|
33 | 33 | #include <linux/bpf_trace.h>
|
34 | 34 | #include <linux/pm_runtime.h>
|
35 | 35 | #include <linux/etherdevice.h>
|
| 36 | +#include <linux/lockdep.h> |
36 | 37 | #ifdef CONFIG_IGB_DCA
|
37 | 38 | #include <linux/dca.h>
|
38 | 39 | #endif
|
@@ -2914,8 +2915,11 @@ static int igb_xdp(struct net_device *dev, struct netdev_bpf *xdp)
|
2914 | 2915 | }
|
2915 | 2916 | }
|
2916 | 2917 |
|
| 2918 | +/* This function assumes __netif_tx_lock is held by the caller. */ |
2917 | 2919 | static void igb_xdp_ring_update_tail(struct igb_ring *ring)
|
2918 | 2920 | {
|
| 2921 | + lockdep_assert_held(&txring_txq(ring)->_xmit_lock); |
| 2922 | + |
2919 | 2923 | /* Force memory writes to complete before letting h/w know there
|
2920 | 2924 | * are new descriptors to fetch.
|
2921 | 2925 | */
|
@@ -3000,11 +3004,11 @@ static int igb_xdp_xmit(struct net_device *dev, int n,
|
3000 | 3004 | nxmit++;
|
3001 | 3005 | }
|
3002 | 3006 |
|
3003 |
| - __netif_tx_unlock(nq); |
3004 |
| - |
3005 | 3007 | if (unlikely(flags & XDP_XMIT_FLUSH))
|
3006 | 3008 | igb_xdp_ring_update_tail(tx_ring);
|
3007 | 3009 |
|
| 3010 | + __netif_tx_unlock(nq); |
| 3011 | + |
3008 | 3012 | return nxmit;
|
3009 | 3013 | }
|
3010 | 3014 |
|
@@ -8864,12 +8868,14 @@ static void igb_put_rx_buffer(struct igb_ring *rx_ring,
|
8864 | 8868 |
|
8865 | 8869 | static int igb_clean_rx_irq(struct igb_q_vector *q_vector, const int budget)
|
8866 | 8870 | {
|
| 8871 | + unsigned int total_bytes = 0, total_packets = 0; |
8867 | 8872 | struct igb_adapter *adapter = q_vector->adapter;
|
8868 | 8873 | struct igb_ring *rx_ring = q_vector->rx.ring;
|
8869 |
| - struct sk_buff *skb = rx_ring->skb; |
8870 |
| - unsigned int total_bytes = 0, total_packets = 0; |
8871 | 8874 | u16 cleaned_count = igb_desc_unused(rx_ring);
|
| 8875 | + struct sk_buff *skb = rx_ring->skb; |
| 8876 | + int cpu = smp_processor_id(); |
8872 | 8877 | unsigned int xdp_xmit = 0;
|
| 8878 | + struct netdev_queue *nq; |
8873 | 8879 | struct xdp_buff xdp;
|
8874 | 8880 | u32 frame_sz = 0;
|
8875 | 8881 | int rx_buf_pgcnt;
|
@@ -8997,7 +9003,10 @@ static int igb_clean_rx_irq(struct igb_q_vector *q_vector, const int budget)
|
8997 | 9003 | if (xdp_xmit & IGB_XDP_TX) {
|
8998 | 9004 | struct igb_ring *tx_ring = igb_xdp_tx_queue_mapping(adapter);
|
8999 | 9005 |
|
| 9006 | + nq = txring_txq(tx_ring); |
| 9007 | + __netif_tx_lock(nq, cpu); |
9000 | 9008 | igb_xdp_ring_update_tail(tx_ring);
|
| 9009 | + __netif_tx_unlock(nq); |
9001 | 9010 | }
|
9002 | 9011 |
|
9003 | 9012 | u64_stats_update_begin(&rx_ring->rx_syncp);
|
|
0 commit comments