Files
android_kernel_xiaomi_sm8450/include/linux
Björn Töpel 36ccdf8582 net, xsk: Avoid taking multiple skbuff references
Commit 642e450b6b ("xsk: Do not discard packet when NETDEV_TX_BUSY")
addressed the problem that packets were discarded from the Tx AF_XDP
ring, when the driver returned NETDEV_TX_BUSY. Part of the fix was
bumping the skbuff reference count, so that the buffer would not be
freed by dev_direct_xmit(). A reference count larger than one means
that the skbuff is "shared", which is not the case.

If the "shared" skbuff is sent to the generic XDP receive path,
netif_receive_generic_xdp(), and pskb_expand_head() is entered the
BUG_ON(skb_shared(skb)) will trigger.

This patch adds a variant to dev_direct_xmit(), __dev_direct_xmit(),
where a user can select the skbuff free policy. This allows AF_XDP to
avoid bumping the reference count, but still keep the NETDEV_TX_BUSY
behavior.

Fixes: 642e450b6b ("xsk: Do not discard packet when NETDEV_TX_BUSY")
Reported-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20201123175600.146255-1-bjorn.topel@gmail.com
2020-11-24 22:39:56 +01:00
..
2020-06-25 22:25:13 -07:00
2020-10-28 13:18:56 +01:00
2020-07-21 08:24:52 -05:00
2020-07-08 10:48:35 -07:00
2020-10-02 14:59:25 -07:00
2020-09-21 15:00:40 -07:00
2020-10-02 15:00:49 -07:00
2020-10-16 17:21:51 +02:00
2020-07-27 14:29:23 -04:00
2020-08-12 20:42:08 +02:00
2020-10-27 16:22:43 +01:00
2020-09-30 22:44:26 +02:00
2020-07-24 17:12:41 -07:00
2020-08-04 21:02:38 -04:00
2020-09-16 08:54:53 -05:00
2020-08-26 12:41:56 +02:00
2020-10-13 18:38:32 -07:00
2020-09-04 09:25:20 -07:00
2020-09-23 18:02:49 -07:00
2020-09-04 12:46:07 +01:00
2020-08-27 16:06:47 -04:00
2020-10-07 14:28:39 -04:00
2020-07-01 10:49:02 +02:00
2020-09-24 19:49:36 -07:00
2020-07-23 17:34:18 +10:00
2020-08-31 12:52:33 -07:00
2020-10-28 11:41:15 -06:00
2020-10-18 09:27:10 -07:00
2020-08-18 17:06:15 +02:00
2020-07-16 23:19:51 +02:00
2020-11-06 10:05:18 -08:00
2020-08-07 11:33:24 -07:00
2020-09-26 22:55:05 -04:00
2020-07-04 09:35:36 -05:00
2020-09-10 14:03:31 -07:00
2020-07-07 11:58:59 -05:00
2020-08-01 11:28:17 +02:00
2020-10-18 09:27:10 -07:00
2020-10-05 13:21:49 +02:00