aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2019-04-01 10:42:13 -0400
committerDavid S. Miller <davem@davemloft.net>2019-04-01 21:35:02 -0400
commit97cdcf37b57e3f204be3000b9eab9686f38b4356 (patch)
tree1a387912cfc2d1c24828d2390b7036697326ccba /net/core/dev.c
parent74dcb4c1a52c7c6666319a149ad4adb001f1d00b (diff)
net: place xmit recursion in softnet data
This fills a hole in softnet data, so no change in structure size. Also prepares for xmit_more placement in the same spot; skb->xmit_more will be removed in followup patch. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 9823b7713f79..d5b1315218d3 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3566,9 +3566,6 @@ static void skb_update_prio(struct sk_buff *skb)
3566#define skb_update_prio(skb) 3566#define skb_update_prio(skb)
3567#endif 3567#endif
3568 3568
3569DEFINE_PER_CPU(int, xmit_recursion);
3570EXPORT_SYMBOL(xmit_recursion);
3571
3572/** 3569/**
3573 * dev_loopback_xmit - loop back @skb 3570 * dev_loopback_xmit - loop back @skb
3574 * @net: network namespace this loopback is happening in 3571 * @net: network namespace this loopback is happening in
@@ -3857,8 +3854,7 @@ static int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev)
3857 int cpu = smp_processor_id(); /* ok because BHs are off */ 3854 int cpu = smp_processor_id(); /* ok because BHs are off */
3858 3855
3859 if (txq->xmit_lock_owner != cpu) { 3856 if (txq->xmit_lock_owner != cpu) {
3860 if (unlikely(__this_cpu_read(xmit_recursion) > 3857 if (dev_xmit_recursion())
3861 XMIT_RECURSION_LIMIT))
3862 goto recursion_alert; 3858 goto recursion_alert;
3863 3859
3864 skb = validate_xmit_skb(skb, dev, &again); 3860 skb = validate_xmit_skb(skb, dev, &again);
@@ -3868,9 +3864,9 @@ static int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev)
3868 HARD_TX_LOCK(dev, txq, cpu); 3864 HARD_TX_LOCK(dev, txq, cpu);
3869 3865
3870 if (!netif_xmit_stopped(txq)) { 3866 if (!netif_xmit_stopped(txq)) {
3871 __this_cpu_inc(xmit_recursion); 3867 dev_xmit_recursion_inc();
3872 skb = dev_hard_start_xmit(skb, dev, txq, &rc); 3868 skb = dev_hard_start_xmit(skb, dev, txq, &rc);
3873 __this_cpu_dec(xmit_recursion); 3869 dev_xmit_recursion_dec();
3874 if (dev_xmit_complete(rc)) { 3870 if (dev_xmit_complete(rc)) {
3875 HARD_TX_UNLOCK(dev, txq); 3871 HARD_TX_UNLOCK(dev, txq);
3876 goto out; 3872 goto out;