Commit 366c1099 authored by Greg Rose's avatar Greg Rose Committed by David S. Miller

ixgbevf: Add flag to indicate when rx is in net poll

napi_gro_receive shouldn't be called from netpoll context.  Doing
so was causing kernel panics when jumbo frames larger than 2K were set.
Add a flag to check if the Rx ring processing is occurring from interrupt
context or from netpoll context and call netif_rx() if in the polling
context.
Signed-off-by: default avatarGreg Rose <gregory.v.rose@intel.com>
Tested-by: default avatarSibai Li <sibai.li@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a5f9337b
...@@ -229,6 +229,7 @@ struct ixgbevf_adapter { ...@@ -229,6 +229,7 @@ struct ixgbevf_adapter {
*/ */
u32 flags; u32 flags;
#define IXGBE_FLAG_IN_WATCHDOG_TASK (u32)(1) #define IXGBE_FLAG_IN_WATCHDOG_TASK (u32)(1)
#define IXGBE_FLAG_IN_NETPOLL (u32)(1 << 1)
/* OS defined structs */ /* OS defined structs */
struct net_device *netdev; struct net_device *netdev;
......
...@@ -288,7 +288,10 @@ static void ixgbevf_receive_skb(struct ixgbevf_q_vector *q_vector, ...@@ -288,7 +288,10 @@ static void ixgbevf_receive_skb(struct ixgbevf_q_vector *q_vector,
if (is_vlan && test_bit(tag & VLAN_VID_MASK, adapter->active_vlans)) if (is_vlan && test_bit(tag & VLAN_VID_MASK, adapter->active_vlans))
__vlan_hwaccel_put_tag(skb, tag); __vlan_hwaccel_put_tag(skb, tag);
if (!(adapter->flags & IXGBE_FLAG_IN_NETPOLL))
napi_gro_receive(&q_vector->napi, skb); napi_gro_receive(&q_vector->napi, skb);
else
netif_rx(skb);
} }
/** /**
...@@ -550,9 +553,11 @@ static int ixgbevf_poll(struct napi_struct *napi, int budget) ...@@ -550,9 +553,11 @@ static int ixgbevf_poll(struct napi_struct *napi, int budget)
else else
per_ring_budget = budget; per_ring_budget = budget;
adapter->flags |= IXGBE_FLAG_IN_NETPOLL;
ixgbevf_for_each_ring(ring, q_vector->rx) ixgbevf_for_each_ring(ring, q_vector->rx)
clean_complete &= ixgbevf_clean_rx_irq(q_vector, ring, clean_complete &= ixgbevf_clean_rx_irq(q_vector, ring,
per_ring_budget); per_ring_budget);
adapter->flags &= ~IXGBE_FLAG_IN_NETPOLL;
/* If all work not completed, return budget and keep polling */ /* If all work not completed, return budget and keep polling */
if (!clean_complete) if (!clean_complete)
......
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