aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-10-29 03:17:09 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-30 00:33:55 -0400
commit5b252f0c2f98df21fadf0f6cf189b87a0b938228 (patch)
treed3003625d8c5fd6d54466f81cffab1b5459bb98f
parent0519d83d83ed485b5a1f9222ff69d7d6c9bb8a01 (diff)
gro: Name the GRO result enumeration type
This clarifies which return and parameter types are GRO result codes and not RX result codes. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/netdevice.h10
-rw-r--r--net/8021q/vlan_core.c5
-rw-r--r--net/core/dev.c19
3 files changed, 23 insertions, 11 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ffc3106cc037..6e777efe149e 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -348,13 +348,14 @@ enum
348 NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */ 348 NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */
349}; 349};
350 350
351enum { 351enum gro_result {
352 GRO_MERGED, 352 GRO_MERGED,
353 GRO_MERGED_FREE, 353 GRO_MERGED_FREE,
354 GRO_HELD, 354 GRO_HELD,
355 GRO_NORMAL, 355 GRO_NORMAL,
356 GRO_DROP, 356 GRO_DROP,
357}; 357};
358typedef enum gro_result gro_result_t;
358 359
359extern void __napi_schedule(struct napi_struct *n); 360extern void __napi_schedule(struct napi_struct *n);
360 361
@@ -1480,16 +1481,17 @@ extern int netif_rx_ni(struct sk_buff *skb);
1480#define HAVE_NETIF_RECEIVE_SKB 1 1481#define HAVE_NETIF_RECEIVE_SKB 1
1481extern int netif_receive_skb(struct sk_buff *skb); 1482extern int netif_receive_skb(struct sk_buff *skb);
1482extern void napi_gro_flush(struct napi_struct *napi); 1483extern void napi_gro_flush(struct napi_struct *napi);
1483extern int dev_gro_receive(struct napi_struct *napi, 1484extern gro_result_t dev_gro_receive(struct napi_struct *napi,
1484 struct sk_buff *skb); 1485 struct sk_buff *skb);
1485extern int napi_skb_finish(int ret, struct sk_buff *skb); 1486extern int napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
1486extern int napi_gro_receive(struct napi_struct *napi, 1487extern int napi_gro_receive(struct napi_struct *napi,
1487 struct sk_buff *skb); 1488 struct sk_buff *skb);
1488extern void napi_reuse_skb(struct napi_struct *napi, 1489extern void napi_reuse_skb(struct napi_struct *napi,
1489 struct sk_buff *skb); 1490 struct sk_buff *skb);
1490extern struct sk_buff * napi_get_frags(struct napi_struct *napi); 1491extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
1491extern int napi_frags_finish(struct napi_struct *napi, 1492extern int napi_frags_finish(struct napi_struct *napi,
1492 struct sk_buff *skb, int ret); 1493 struct sk_buff *skb,
1494 gro_result_t ret);
1493extern struct sk_buff * napi_frags_skb(struct napi_struct *napi); 1495extern struct sk_buff * napi_frags_skb(struct napi_struct *napi);
1494extern int napi_gro_frags(struct napi_struct *napi); 1496extern int napi_gro_frags(struct napi_struct *napi);
1495 1497
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index 7f7de1a04de6..47a80d65c3b7 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -74,8 +74,9 @@ u16 vlan_dev_vlan_id(const struct net_device *dev)
74} 74}
75EXPORT_SYMBOL(vlan_dev_vlan_id); 75EXPORT_SYMBOL(vlan_dev_vlan_id);
76 76
77static int vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp, 77static gro_result_t
78 unsigned int vlan_tci, struct sk_buff *skb) 78vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,
79 unsigned int vlan_tci, struct sk_buff *skb)
79{ 80{
80 struct sk_buff *p; 81 struct sk_buff *p;
81 82
diff --git a/net/core/dev.c b/net/core/dev.c
index 68a1bb68b5a8..1dc13744684c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2476,7 +2476,7 @@ void napi_gro_flush(struct napi_struct *napi)
2476} 2476}
2477EXPORT_SYMBOL(napi_gro_flush); 2477EXPORT_SYMBOL(napi_gro_flush);
2478 2478
2479int dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb) 2479enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
2480{ 2480{
2481 struct sk_buff **pp = NULL; 2481 struct sk_buff **pp = NULL;
2482 struct packet_type *ptype; 2482 struct packet_type *ptype;
@@ -2484,7 +2484,7 @@ int dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
2484 struct list_head *head = &ptype_base[ntohs(type) & PTYPE_HASH_MASK]; 2484 struct list_head *head = &ptype_base[ntohs(type) & PTYPE_HASH_MASK];
2485 int same_flow; 2485 int same_flow;
2486 int mac_len; 2486 int mac_len;
2487 int ret; 2487 enum gro_result ret;
2488 2488
2489 if (!(skb->dev->features & NETIF_F_GRO)) 2489 if (!(skb->dev->features & NETIF_F_GRO))
2490 goto normal; 2490 goto normal;
@@ -2568,7 +2568,8 @@ normal:
2568} 2568}
2569EXPORT_SYMBOL(dev_gro_receive); 2569EXPORT_SYMBOL(dev_gro_receive);
2570 2570
2571static int __napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb) 2571static gro_result_t
2572__napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
2572{ 2573{
2573 struct sk_buff *p; 2574 struct sk_buff *p;
2574 2575
@@ -2585,7 +2586,7 @@ static int __napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
2585 return dev_gro_receive(napi, skb); 2586 return dev_gro_receive(napi, skb);
2586} 2587}
2587 2588
2588int napi_skb_finish(int ret, struct sk_buff *skb) 2589int napi_skb_finish(gro_result_t ret, struct sk_buff *skb)
2589{ 2590{
2590 int err = NET_RX_SUCCESS; 2591 int err = NET_RX_SUCCESS;
2591 2592
@@ -2600,6 +2601,10 @@ int napi_skb_finish(int ret, struct sk_buff *skb)
2600 case GRO_MERGED_FREE: 2601 case GRO_MERGED_FREE:
2601 kfree_skb(skb); 2602 kfree_skb(skb);
2602 break; 2603 break;
2604
2605 case GRO_HELD:
2606 case GRO_MERGED:
2607 break;
2603 } 2608 }
2604 2609
2605 return err; 2610 return err;
@@ -2652,7 +2657,8 @@ struct sk_buff *napi_get_frags(struct napi_struct *napi)
2652} 2657}
2653EXPORT_SYMBOL(napi_get_frags); 2658EXPORT_SYMBOL(napi_get_frags);
2654 2659
2655int napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb, int ret) 2660int napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb,
2661 gro_result_t ret)
2656{ 2662{
2657 int err = NET_RX_SUCCESS; 2663 int err = NET_RX_SUCCESS;
2658 2664
@@ -2674,6 +2680,9 @@ int napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb, int ret)
2674 case GRO_MERGED_FREE: 2680 case GRO_MERGED_FREE:
2675 napi_reuse_skb(napi, skb); 2681 napi_reuse_skb(napi, skb);
2676 break; 2682 break;
2683
2684 case GRO_MERGED:
2685 break;
2677 } 2686 }
2678 2687
2679 return err; 2688 return err;