OSDN Git Service

net/mlx4_en: Replace netdev parameter with priv in XDP xmit function
authorTariq Toukan <tariqt@mellanox.com>
Wed, 11 Oct 2017 10:17:25 +0000 (13:17 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Oct 2017 03:21:23 +0000 (20:21 -0700)
The struct net_device parameter was passed only to extract
struct mlx4_en_priv out of it.
Here we pass the priv parameter directly.

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

index a786695..92aec17 100644 (file)
@@ -778,7 +778,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
                        case XDP_PASS:
                                break;
                        case XDP_TX:
-                               if (likely(!mlx4_en_xmit_frame(ring, frags, dev,
+                               if (likely(!mlx4_en_xmit_frame(ring, frags, priv,
                                                        length, cq_ring,
                                                        &doorbell_pending))) {
                                        frags[0].page = NULL;
index 2cc82dc..f16774c 100644 (file)
@@ -1087,10 +1087,9 @@ tx_drop:
 
 netdev_tx_t mlx4_en_xmit_frame(struct mlx4_en_rx_ring *rx_ring,
                               struct mlx4_en_rx_alloc *frame,
-                              struct net_device *dev, unsigned int length,
+                              struct mlx4_en_priv *priv, unsigned int length,
                               int tx_ind, bool *doorbell_pending)
 {
-       struct mlx4_en_priv *priv = netdev_priv(dev);
        union mlx4_wqe_qpn_vlan qpn_vlan = {};
        struct mlx4_en_tx_desc *tx_desc;
        struct mlx4_en_tx_info *tx_info;
index 245e9ea..8cad9b4 100644 (file)
@@ -693,7 +693,7 @@ u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb,
 netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev);
 netdev_tx_t mlx4_en_xmit_frame(struct mlx4_en_rx_ring *rx_ring,
                               struct mlx4_en_rx_alloc *frame,
-                              struct net_device *dev, unsigned int length,
+                              struct mlx4_en_priv *priv, unsigned int length,
                               int tx_ind, bool *doorbell_pending);
 void mlx4_en_xmit_doorbell(struct mlx4_en_tx_ring *ring);
 bool mlx4_en_rx_recycle(struct mlx4_en_rx_ring *ring,