Skip to content

Commit a54df68

Browse files
Pavel Belousdavem330
authored andcommitted
aquantia: Switch to use napi_gro_receive
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>
1 parent 56ce097 commit a54df68

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

drivers/net/ethernet/aquantia/atlantic/aq_ring.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ static inline unsigned int aq_ring_dx_in_range(unsigned int h, unsigned int i,
134134
}
135135

136136
#define AQ_SKB_ALIGN SKB_DATA_ALIGN(sizeof(struct skb_shared_info))
137-
int aq_ring_rx_clean(struct aq_ring_s *self, int *work_done, int budget)
137+
int aq_ring_rx_clean(struct aq_ring_s *self,
138+
struct napi_struct *napi,
139+
int *work_done,
140+
int budget)
138141
{
139142
struct net_device *ndev = aq_nic_get_ndev(self->aq_nic);
140143
int err = 0;
@@ -240,7 +243,7 @@ int aq_ring_rx_clean(struct aq_ring_s *self, int *work_done, int budget)
240243

241244
skb_record_rx_queue(skb, self->idx);
242245

243-
netif_receive_skb(skb);
246+
napi_gro_receive(napi, skb);
244247

245248
++self->stats.rx.packets;
246249
self->stats.rx.bytes += skb->len;

drivers/net/ethernet/aquantia/atlantic/aq_ring.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ int aq_ring_init(struct aq_ring_s *self);
148148
void aq_ring_rx_deinit(struct aq_ring_s *self);
149149
void aq_ring_free(struct aq_ring_s *self);
150150
void aq_ring_tx_clean(struct aq_ring_s *self);
151-
int aq_ring_rx_clean(struct aq_ring_s *self, int *work_done, int budget);
151+
int aq_ring_rx_clean(struct aq_ring_s *self,
152+
struct napi_struct *napi,
153+
int *work_done,
154+
int budget);
152155
int aq_ring_rx_fill(struct aq_ring_s *self);
153156

154157
#endif /* AQ_RING_H */

drivers/net/ethernet/aquantia/atlantic/aq_vec.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ __acquires(&self->lock)
7878
if (ring[AQ_VEC_RX_ID].sw_head !=
7979
ring[AQ_VEC_RX_ID].hw_head) {
8080
err = aq_ring_rx_clean(&ring[AQ_VEC_RX_ID],
81+
napi,
8182
&work_done,
8283
budget - work_done);
8384
if (err < 0)

0 commit comments

Comments
 (0)