Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135220
b: refs/heads/master
c: d1c76af
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Mar 16, 2009
1 parent cfda5c6 commit 5192ffc
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: afece1c6587010cc81d1a43045c855774e8234a3
refs/heads/master: d1c76af9e2434fac3add561e26c61b06503de986
8 changes: 8 additions & 0 deletions trunk/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,14 @@ enum
NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */
};

enum {
GRO_MERGED,
GRO_MERGED_FREE,
GRO_HELD,
GRO_NORMAL,
GRO_DROP,
};

extern void __napi_schedule(struct napi_struct *n);

static inline int napi_disable_pending(struct napi_struct *n)
Expand Down
11 changes: 11 additions & 0 deletions trunk/include/linux/netpoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ static inline int netpoll_rx(struct sk_buff *skb)
return ret;
}

static inline int netpoll_rx_on(struct sk_buff *skb)
{
struct netpoll_info *npinfo = skb->dev->npinfo;

return npinfo && (npinfo->rx_np || npinfo->rx_flags);
}

static inline int netpoll_receive_skb(struct sk_buff *skb)
{
if (!list_empty(&skb->dev->napi_list))
Expand Down Expand Up @@ -99,6 +106,10 @@ static inline int netpoll_rx(struct sk_buff *skb)
{
return 0;
}
static inline int netpoll_rx_on(struct sk_buff *skb)
{
return 0;
}
static inline int netpoll_receive_skb(struct sk_buff *skb)
{
return 0;
Expand Down
11 changes: 4 additions & 7 deletions trunk/net/8021q/vlan_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ static int vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,
{
struct sk_buff *p;

if (netpoll_rx_on(skb))
return GRO_NORMAL;

if (skb_bond_should_drop(skb))
goto drop;

Expand All @@ -98,17 +101,14 @@ static int vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,
return dev_gro_receive(napi, skb);

drop:
return 2;
return GRO_DROP;
}

int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
unsigned int vlan_tci, struct sk_buff *skb)
{
skb_gro_reset_offset(skb);

if (netpoll_receive_skb(skb))
return NET_RX_DROP;

return napi_skb_finish(vlan_gro_common(napi, grp, vlan_tci, skb), skb);
}
EXPORT_SYMBOL(vlan_gro_receive);
Expand All @@ -121,9 +121,6 @@ int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
if (!skb)
return NET_RX_DROP;

if (netpoll_receive_skb(skb))
return NET_RX_DROP;

return napi_frags_finish(napi, skb,
vlan_gro_common(napi, grp, vlan_tci, skb));
}
Expand Down
17 changes: 3 additions & 14 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,6 @@
/* This should be increased if a protocol with a bigger head is added. */
#define GRO_MAX_HEAD (MAX_HEADER + 128)

enum {
GRO_MERGED,
GRO_MERGED_FREE,
GRO_HELD,
GRO_NORMAL,
GRO_DROP,
};

/*
* The list of packet types we will receive (as opposed to discard)
* and the routines to invoke.
Expand Down Expand Up @@ -2474,6 +2466,9 @@ static int __napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
{
struct sk_buff *p;

if (netpoll_rx_on(skb))
return GRO_NORMAL;

for (p = napi->gro_list; p; p = p->next) {
NAPI_GRO_CB(p)->same_flow = !compare_ether_header(
skb_mac_header(p), skb_gro_mac_header(skb));
Expand All @@ -2487,9 +2482,6 @@ int napi_skb_finish(int ret, struct sk_buff *skb)
{
int err = NET_RX_SUCCESS;

if (netpoll_receive_skb(skb))
return NET_RX_DROP;

switch (ret) {
case GRO_NORMAL:
return netif_receive_skb(skb);
Expand Down Expand Up @@ -2587,9 +2579,6 @@ int napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb, int ret)
{
int err = NET_RX_SUCCESS;

if (netpoll_receive_skb(skb))
return NET_RX_DROP;

switch (ret) {
case GRO_NORMAL:
case GRO_HELD:
Expand Down

0 comments on commit 5192ffc

Please sign in to comment.