Skip to content

Commit 4fb37e7

Browse files
committed
Merge branch 'sock-rx-qmap'
Tariq Toukan says: ==================== Compile-flag for sock RX queue mapping Socket's RX queue mapping logic is useful also for non-XPS use cases. This series breaks the dependency between the two, introducing a new kernel config flag SOCK_RX_QUEUE_MAPPING. Here we select this new kernel flag from TLS_DEVICE, as well as XPS. ==================== Acked-by: Jakub Kicinski <[email protected]>
2 parents 3c5a2fd + 2af3e35 commit 4fb37e7

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

drivers/net/ethernet/mellanox/mlx5/core/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ config MLX5_FPGA_TLS
166166
depends on TLS=y || MLX5_CORE=m
167167
depends on MLX5_CORE_EN
168168
depends on MLX5_FPGA
169-
depends on XPS
170169
select MLX5_EN_TLS
171170
default n
172171
help
@@ -181,7 +180,6 @@ config MLX5_TLS
181180
depends on TLS_DEVICE
182181
depends on TLS=y || MLX5_CORE=m
183182
depends on MLX5_CORE_EN
184-
depends on XPS
185183
select MLX5_ACCEL
186184
select MLX5_EN_TLS
187185
default n

include/net/sock.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ struct sock_common {
226226
struct hlist_nulls_node skc_nulls_node;
227227
};
228228
unsigned short skc_tx_queue_mapping;
229-
#ifdef CONFIG_XPS
229+
#ifdef CONFIG_SOCK_RX_QUEUE_MAPPING
230230
unsigned short skc_rx_queue_mapping;
231231
#endif
232232
union {
@@ -356,7 +356,7 @@ struct sock {
356356
#define sk_nulls_node __sk_common.skc_nulls_node
357357
#define sk_refcnt __sk_common.skc_refcnt
358358
#define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping
359-
#ifdef CONFIG_XPS
359+
#ifdef CONFIG_SOCK_RX_QUEUE_MAPPING
360360
#define sk_rx_queue_mapping __sk_common.skc_rx_queue_mapping
361361
#endif
362362

@@ -1838,7 +1838,7 @@ static inline int sk_tx_queue_get(const struct sock *sk)
18381838

18391839
static inline void sk_rx_queue_set(struct sock *sk, const struct sk_buff *skb)
18401840
{
1841-
#ifdef CONFIG_XPS
1841+
#ifdef CONFIG_SOCK_RX_QUEUE_MAPPING
18421842
if (skb_rx_queue_recorded(skb)) {
18431843
u16 rx_queue = skb_get_rx_queue(skb);
18441844

@@ -1852,20 +1852,20 @@ static inline void sk_rx_queue_set(struct sock *sk, const struct sk_buff *skb)
18521852

18531853
static inline void sk_rx_queue_clear(struct sock *sk)
18541854
{
1855-
#ifdef CONFIG_XPS
1855+
#ifdef CONFIG_SOCK_RX_QUEUE_MAPPING
18561856
sk->sk_rx_queue_mapping = NO_QUEUE_MAPPING;
18571857
#endif
18581858
}
18591859

1860-
#ifdef CONFIG_XPS
18611860
static inline int sk_rx_queue_get(const struct sock *sk)
18621861
{
1862+
#ifdef CONFIG_SOCK_RX_QUEUE_MAPPING
18631863
if (sk && sk->sk_rx_queue_mapping != NO_QUEUE_MAPPING)
18641864
return sk->sk_rx_queue_mapping;
1865+
#endif
18651866

18661867
return -1;
18671868
}
1868-
#endif
18691869

18701870
static inline void sk_set_socket(struct sock *sk, struct socket *sock)
18711871
{

net/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,13 @@ config RFS_ACCEL
256256
select CPU_RMAP
257257
default y
258258

259+
config SOCK_RX_QUEUE_MAPPING
260+
bool
261+
259262
config XPS
260263
bool
261264
depends on SMP
265+
select SOCK_RX_QUEUE_MAPPING
262266
default y
263267

264268
config HWBM

net/core/filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8814,7 +8814,7 @@ u32 bpf_sock_convert_ctx_access(enum bpf_access_type type,
88148814
target_size));
88158815
break;
88168816
case offsetof(struct bpf_sock, rx_queue_mapping):
8817-
#ifdef CONFIG_XPS
8817+
#ifdef CONFIG_SOCK_RX_QUEUE_MAPPING
88188818
*insn++ = BPF_LDX_MEM(
88198819
BPF_FIELD_SIZEOF(struct sock, sk_rx_queue_mapping),
88208820
si->dst_reg, si->src_reg,

net/tls/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ config TLS_DEVICE
2121
bool "Transport Layer Security HW offload"
2222
depends on TLS
2323
select SOCK_VALIDATE_XMIT
24+
select SOCK_RX_QUEUE_MAPPING
2425
default n
2526
help
2627
Enable kernel support for HW offload of the TLS protocol.

0 commit comments

Comments
 (0)