Commit 5b252f0c authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller

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: default avatarBen Hutchings <bhutchings@solarflare.com>
Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0519d83d
...@@ -348,13 +348,14 @@ enum ...@@ -348,13 +348,14 @@ enum
NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */ NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */
}; };
enum { enum gro_result {
GRO_MERGED, GRO_MERGED,
GRO_MERGED_FREE, GRO_MERGED_FREE,
GRO_HELD, GRO_HELD,
GRO_NORMAL, GRO_NORMAL,
GRO_DROP, GRO_DROP,
}; };
typedef enum gro_result gro_result_t;
extern void __napi_schedule(struct napi_struct *n); extern void __napi_schedule(struct napi_struct *n);
...@@ -1480,16 +1481,17 @@ extern int netif_rx_ni(struct sk_buff *skb); ...@@ -1480,16 +1481,17 @@ extern int netif_rx_ni(struct sk_buff *skb);
#define HAVE_NETIF_RECEIVE_SKB 1 #define HAVE_NETIF_RECEIVE_SKB 1
extern int netif_receive_skb(struct sk_buff *skb); extern int netif_receive_skb(struct sk_buff *skb);
extern void napi_gro_flush(struct napi_struct *napi); extern void napi_gro_flush(struct napi_struct *napi);
extern int dev_gro_receive(struct napi_struct *napi, extern gro_result_t dev_gro_receive(struct napi_struct *napi,
struct sk_buff *skb); struct sk_buff *skb);
extern int napi_skb_finish(int ret, struct sk_buff *skb); extern int napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
extern int napi_gro_receive(struct napi_struct *napi, extern int napi_gro_receive(struct napi_struct *napi,
struct sk_buff *skb); struct sk_buff *skb);
extern void napi_reuse_skb(struct napi_struct *napi, extern void napi_reuse_skb(struct napi_struct *napi,
struct sk_buff *skb); struct sk_buff *skb);
extern struct sk_buff * napi_get_frags(struct napi_struct *napi); extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
extern int napi_frags_finish(struct napi_struct *napi, extern int napi_frags_finish(struct napi_struct *napi,
struct sk_buff *skb, int ret); struct sk_buff *skb,
gro_result_t ret);
extern struct sk_buff * napi_frags_skb(struct napi_struct *napi); extern struct sk_buff * napi_frags_skb(struct napi_struct *napi);
extern int napi_gro_frags(struct napi_struct *napi); extern int napi_gro_frags(struct napi_struct *napi);
......
...@@ -74,8 +74,9 @@ u16 vlan_dev_vlan_id(const struct net_device *dev) ...@@ -74,8 +74,9 @@ u16 vlan_dev_vlan_id(const struct net_device *dev)
} }
EXPORT_SYMBOL(vlan_dev_vlan_id); EXPORT_SYMBOL(vlan_dev_vlan_id);
static int vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp, static gro_result_t
unsigned int vlan_tci, struct sk_buff *skb) vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,
unsigned int vlan_tci, struct sk_buff *skb)
{ {
struct sk_buff *p; struct sk_buff *p;
......
...@@ -2476,7 +2476,7 @@ void napi_gro_flush(struct napi_struct *napi) ...@@ -2476,7 +2476,7 @@ void napi_gro_flush(struct napi_struct *napi)
} }
EXPORT_SYMBOL(napi_gro_flush); EXPORT_SYMBOL(napi_gro_flush);
int dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb) enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
{ {
struct sk_buff **pp = NULL; struct sk_buff **pp = NULL;
struct packet_type *ptype; struct packet_type *ptype;
...@@ -2484,7 +2484,7 @@ int dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb) ...@@ -2484,7 +2484,7 @@ int dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
struct list_head *head = &ptype_base[ntohs(type) & PTYPE_HASH_MASK]; struct list_head *head = &ptype_base[ntohs(type) & PTYPE_HASH_MASK];
int same_flow; int same_flow;
int mac_len; int mac_len;
int ret; enum gro_result ret;
if (!(skb->dev->features & NETIF_F_GRO)) if (!(skb->dev->features & NETIF_F_GRO))
goto normal; goto normal;
...@@ -2568,7 +2568,8 @@ int dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb) ...@@ -2568,7 +2568,8 @@ int dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
} }
EXPORT_SYMBOL(dev_gro_receive); EXPORT_SYMBOL(dev_gro_receive);
static int __napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb) static gro_result_t
__napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
{ {
struct sk_buff *p; struct sk_buff *p;
...@@ -2585,7 +2586,7 @@ static int __napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb) ...@@ -2585,7 +2586,7 @@ static int __napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
return dev_gro_receive(napi, skb); return dev_gro_receive(napi, skb);
} }
int napi_skb_finish(int ret, struct sk_buff *skb) int napi_skb_finish(gro_result_t ret, struct sk_buff *skb)
{ {
int err = NET_RX_SUCCESS; int err = NET_RX_SUCCESS;
...@@ -2600,6 +2601,10 @@ int napi_skb_finish(int ret, struct sk_buff *skb) ...@@ -2600,6 +2601,10 @@ int napi_skb_finish(int ret, struct sk_buff *skb)
case GRO_MERGED_FREE: case GRO_MERGED_FREE:
kfree_skb(skb); kfree_skb(skb);
break; break;
case GRO_HELD:
case GRO_MERGED:
break;
} }
return err; return err;
...@@ -2652,7 +2657,8 @@ struct sk_buff *napi_get_frags(struct napi_struct *napi) ...@@ -2652,7 +2657,8 @@ struct sk_buff *napi_get_frags(struct napi_struct *napi)
} }
EXPORT_SYMBOL(napi_get_frags); EXPORT_SYMBOL(napi_get_frags);
int napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb, int ret) int napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb,
gro_result_t ret)
{ {
int err = NET_RX_SUCCESS; int err = NET_RX_SUCCESS;
...@@ -2674,6 +2680,9 @@ int napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb, int ret) ...@@ -2674,6 +2680,9 @@ int napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb, int ret)
case GRO_MERGED_FREE: case GRO_MERGED_FREE:
napi_reuse_skb(napi, skb); napi_reuse_skb(napi, skb);
break; break;
case GRO_MERGED:
break;
} }
return err; return err;
......
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