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)
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))
{
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;
{
struct sk_buff *p;
+ if (netpoll_rx_on(skb))
+ return GRO_NORMAL;
+
if (skb_bond_should_drop(skb))
goto drop;
return dev_gro_receive(napi, skb);
drop:
- return 2;
+ return GRO_DROP;
}
int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
{
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);
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));
}
/* 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.
{
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));
{
int err = NET_RX_SUCCESS;
- if (netpoll_receive_skb(skb))
- return NET_RX_DROP;
-
switch (ret) {
case GRO_NORMAL:
return netif_receive_skb(skb);
{
int err = NET_RX_SUCCESS;
- if (netpoll_receive_skb(skb))
- return NET_RX_DROP;
-
switch (ret) {
case GRO_NORMAL:
case GRO_HELD: