net: use listified RX for handling GRO_NORMAL skbs
When GRO decides not to coalesce a packet, in napi_frags_finish(), instead of passing it to the stack immediately, place it on a list in the napi struct. Then, at flush time (napi_complete_done(), napi_poll(), or napi_busy_loop()), call netif_receive_skb_list_internal() on the list. We'd like to do that in napi_gro_flush(), but it's not called if !napi->gro_bitmask, so we have to do it in the callers instead. (There are a handful of drivers that call napi_gro_flush() themselves, but it's not clear why, or whether this will affect them.) Because a full 64 packets is an inefficiently large batch, also consume the list whenever it exceeds gro_normal_batch, a new net/core sysctl that defaults to 8. Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
6727013694
commit
323ebb61e3
@@ -332,6 +332,8 @@ struct napi_struct {
|
||||
struct net_device *dev;
|
||||
struct gro_list gro_hash[GRO_HASH_BUCKETS];
|
||||
struct sk_buff *skb;
|
||||
struct list_head rx_list; /* Pending GRO_NORMAL skbs */
|
||||
int rx_count; /* length of rx_list */
|
||||
struct hrtimer timer;
|
||||
struct list_head dev_list;
|
||||
struct hlist_node napi_hash_node;
|
||||
@@ -4239,6 +4241,7 @@ extern int dev_weight_rx_bias;
|
||||
extern int dev_weight_tx_bias;
|
||||
extern int dev_rx_weight;
|
||||
extern int dev_tx_weight;
|
||||
extern int gro_normal_batch;
|
||||
|
||||
bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev);
|
||||
struct net_device *netdev_upper_get_next_dev_rcu(struct net_device *dev,
|
||||
|
Reference in New Issue
Block a user