]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net/mlx4_en: Obsolete call to generic write_desc in XDP xmit flow
authorTariq Toukan <tariqt@mellanox.com>
Wed, 11 Oct 2017 10:17:26 +0000 (13:17 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Oct 2017 03:21:23 +0000 (20:21 -0700)
Function mlx4_en_tx_write_desc() is not optimized to use of XDP xmit.
Use the relevant parts inline instead.

Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_tx.c

index f16774c9c347b135ea8baca2811bf9a79b25c852..ac7254e3f9095e6e1543788fc42dc7423a0b4032 100644 (file)
@@ -1090,7 +1090,9 @@ netdev_tx_t mlx4_en_xmit_frame(struct mlx4_en_rx_ring *rx_ring,
                               struct mlx4_en_priv *priv, unsigned int length,
                               int tx_ind, bool *doorbell_pending)
 {
-       union mlx4_wqe_qpn_vlan qpn_vlan = {};
+       union mlx4_wqe_qpn_vlan qpn_vlan = {
+               .fence_size = MLX4_EN_XDP_TX_REAL_SZ,
+       };
        struct mlx4_en_tx_desc *tx_desc;
        struct mlx4_en_tx_info *tx_info;
        struct mlx4_wqe_data_seg *data;
@@ -1140,7 +1142,6 @@ netdev_tx_t mlx4_en_xmit_frame(struct mlx4_en_rx_ring *rx_ring,
        data->byte_count = cpu_to_be32(length);
 
        /* tx completion can avoid cache line miss for common cases */
-       tx_desc->ctrl.srcrb_flags = priv->ctrl_flags;
 
        op_own = cpu_to_be32(MLX4_OPCODE_SEND) |
                ((ring->prod & ring->size) ?
@@ -1151,10 +1152,16 @@ netdev_tx_t mlx4_en_xmit_frame(struct mlx4_en_rx_ring *rx_ring,
 
        ring->prod += MLX4_EN_XDP_TX_NRTXBB;
 
-       qpn_vlan.fence_size = MLX4_EN_XDP_TX_REAL_SZ;
+       tx_desc->ctrl.qpn_vlan = qpn_vlan;
+       tx_desc->ctrl.srcrb_flags = priv->ctrl_flags;
+
+       /* Ensure new descriptor hits memory
+        * before setting ownership of this descriptor to HW
+        */
+       dma_wmb();
+       tx_desc->ctrl.owner_opcode = op_own;
+       ring->xmit_more++;
 
-       mlx4_en_tx_write_desc(ring, tx_desc, qpn_vlan, TXBB_SIZE, 0,
-                             op_own, false, false);
        *doorbell_pending = true;
 
        return NETDEV_TX_OK;