aquantia: Switch to use napi_gro_receive
authorPavel Belous <pavel.belous@aquantia.com>
Thu, 3 Aug 2017 15:15:32 +0000 (18:15 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 5 Aug 2017 03:57:13 +0000 (20:57 -0700)
Add support for GRO (generic receive offload) for aQuantia Atlantic driver.
This results in a perfomance improvement when GRO is enabled.

Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/aq_ring.c
drivers/net/ethernet/aquantia/atlantic/aq_ring.h
drivers/net/ethernet/aquantia/atlantic/aq_vec.c

index 9a0817938eca38526e4c746680efe2845e9b1e51..4b445750b93e15733ff63b67945f88d7a2ca84df 100644 (file)
@@ -134,7 +134,10 @@ static inline unsigned int aq_ring_dx_in_range(unsigned int h, unsigned int i,
 }
 
 #define AQ_SKB_ALIGN SKB_DATA_ALIGN(sizeof(struct skb_shared_info))
-int aq_ring_rx_clean(struct aq_ring_s *self, int *work_done, int budget)
+int aq_ring_rx_clean(struct aq_ring_s *self,
+                    struct napi_struct *napi,
+                    int *work_done,
+                    int budget)
 {
        struct net_device *ndev = aq_nic_get_ndev(self->aq_nic);
        int err = 0;
@@ -240,7 +243,7 @@ int aq_ring_rx_clean(struct aq_ring_s *self, int *work_done, int budget)
 
                skb_record_rx_queue(skb, self->idx);
 
-               netif_receive_skb(skb);
+               napi_gro_receive(napi, skb);
 
                ++self->stats.rx.packets;
                self->stats.rx.bytes += skb->len;
index eecd6d1c4d731a4e648e6811a5615498ee3a8965..782176c5f4f800f090353ee3184a98918dd1d0a3 100644 (file)
@@ -148,7 +148,10 @@ int aq_ring_init(struct aq_ring_s *self);
 void aq_ring_rx_deinit(struct aq_ring_s *self);
 void aq_ring_free(struct aq_ring_s *self);
 void aq_ring_tx_clean(struct aq_ring_s *self);
-int aq_ring_rx_clean(struct aq_ring_s *self, int *work_done, int budget);
+int aq_ring_rx_clean(struct aq_ring_s *self,
+                    struct napi_struct *napi,
+                    int *work_done,
+                    int budget);
 int aq_ring_rx_fill(struct aq_ring_s *self);
 
 #endif /* AQ_RING_H */
index ad5b4d4dac7f6c7a5626ce5b86b9ca6d1a37f012..ec390c5eed35efb54d838a94f466833cdd3806eb 100644 (file)
@@ -78,6 +78,7 @@ __acquires(&self->lock)
                        if (ring[AQ_VEC_RX_ID].sw_head !=
                                ring[AQ_VEC_RX_ID].hw_head) {
                                err = aq_ring_rx_clean(&ring[AQ_VEC_RX_ID],
+                                                      napi,
                                                       &work_done,
                                                       budget - work_done);
                                if (err < 0)