Commit a54df682 authored by Pavel Belous's avatar Pavel Belous Committed by David S. Miller

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: default avatarPavel Belous <pavel.belous@aquantia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 56ce097c
...@@ -134,7 +134,10 @@ static inline unsigned int aq_ring_dx_in_range(unsigned int h, unsigned int i, ...@@ -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)) #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); struct net_device *ndev = aq_nic_get_ndev(self->aq_nic);
int err = 0; int err = 0;
...@@ -240,7 +243,7 @@ int aq_ring_rx_clean(struct aq_ring_s *self, int *work_done, int budget) ...@@ -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); skb_record_rx_queue(skb, self->idx);
netif_receive_skb(skb); napi_gro_receive(napi, skb);
++self->stats.rx.packets; ++self->stats.rx.packets;
self->stats.rx.bytes += skb->len; self->stats.rx.bytes += skb->len;
......
...@@ -148,7 +148,10 @@ int aq_ring_init(struct aq_ring_s *self); ...@@ -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_rx_deinit(struct aq_ring_s *self);
void aq_ring_free(struct aq_ring_s *self); void aq_ring_free(struct aq_ring_s *self);
void aq_ring_tx_clean(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); int aq_ring_rx_fill(struct aq_ring_s *self);
#endif /* AQ_RING_H */ #endif /* AQ_RING_H */
...@@ -78,6 +78,7 @@ __acquires(&self->lock) ...@@ -78,6 +78,7 @@ __acquires(&self->lock)
if (ring[AQ_VEC_RX_ID].sw_head != if (ring[AQ_VEC_RX_ID].sw_head !=
ring[AQ_VEC_RX_ID].hw_head) { ring[AQ_VEC_RX_ID].hw_head) {
err = aq_ring_rx_clean(&ring[AQ_VEC_RX_ID], err = aq_ring_rx_clean(&ring[AQ_VEC_RX_ID],
napi,
&work_done, &work_done,
budget - work_done); budget - work_done);
if (err < 0) if (err < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment