diff options
author | Tariq Toukan | 2021-02-11 13:35:51 +0200 |
---|---|---|
committer | David S. Miller | 2021-02-11 19:08:06 -0800 |
commit | 4e1beecc3b586e5d05401c0a9e456f96aab0e5a4 (patch) | |
tree | 0bb99894f397d0619ef331dd243a01924a886194 /net | |
parent | 3c5a2fd042d0bfac71a2dfb99515723d318df47b (diff) |
net/sock: Add kernel config SOCK_RX_QUEUE_MAPPING
Use a new config SOCK_RX_QUEUE_MAPPING to compile-in the socket
RX queue field and logic, instead of the XPS config.
This breaks dependency in XPS, and allows selecting it from non-XPS
use cases, as we do in the next patch.
In addition, use the new flag to wrap the logic in sk_rx_queue_get()
and protect access to the sk_rx_queue_mapping field, while keeping
the function exposed unconditionally, just like sk_rx_queue_set()
and sk_rx_queue_clear().
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/Kconfig | 4 | ||||
-rw-r--r-- | net/core/filter.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/net/Kconfig b/net/Kconfig index f4c32d982af6..8cea808ad9e8 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -256,9 +256,13 @@ config RFS_ACCEL select CPU_RMAP default y +config SOCK_RX_QUEUE_MAPPING + bool + config XPS bool depends on SMP + select SOCK_RX_QUEUE_MAPPING default y config HWBM diff --git a/net/core/filter.c b/net/core/filter.c index 74bd401bf483..3b728ab79a61 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -8814,7 +8814,7 @@ u32 bpf_sock_convert_ctx_access(enum bpf_access_type type, target_size)); break; case offsetof(struct bpf_sock, rx_queue_mapping): -#ifdef CONFIG_XPS +#ifdef CONFIG_SOCK_RX_QUEUE_MAPPING *insn++ = BPF_LDX_MEM( BPF_FIELD_SIZEOF(struct sock, sk_rx_queue_mapping), si->dst_reg, si->src_reg, |