summaryrefslogtreecommitdiff
path: root/net/packet/internal.h
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2020-07-07 18:22:04 +0300
committerJakub Kicinski <kuba@kernel.org>2020-07-16 21:40:39 +0300
commit632ca50f2cbd8809a2fc1934b4b2c9c49bd55e98 (patch)
tree17ed0b6ce864b175f2849f7518b7648853618f3c /net/packet/internal.h
parent999cf8aeb6c9d4019659efe85ce0594808d071a6 (diff)
downloadlinux-632ca50f2cbd8809a2fc1934b4b2c9c49bd55e98.tar.xz
af_packet: TPACKET_V3: replace busy-wait loop
A busy-wait loop is used to implement waiting for bits to be copied from the skb to the kernel buffer before retiring a block. This is a problem on PREEMPT_RT because the copying task could be preempted by the busy-waiting task and thus live lock in the busy-wait loop. Replace the busy-wait logic with an rwlock_t. This provides lockdep coverage and makes the code RT ready. Signed-off-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/packet/internal.h')
-rw-r--r--net/packet/internal.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/packet/internal.h b/net/packet/internal.h
index 907f4cd2a718..fd41ecb7f605 100644
--- a/net/packet/internal.h
+++ b/net/packet/internal.h
@@ -39,7 +39,7 @@ struct tpacket_kbdq_core {
char *nxt_offset;
struct sk_buff *skb;
- atomic_t blk_fill_in_prog;
+ rwlock_t blk_fill_in_prog_lock;
/* Default is set to 8ms */
#define DEFAULT_PRB_RETIRE_TOV (8)