Commit 4fb37e72 authored by David S. Miller's avatar David S. Miller

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: default avatarJakub Kicinski <kuba@kernel.org>
parents 3c5a2fd0 2af3e35c
...@@ -166,7 +166,6 @@ config MLX5_FPGA_TLS ...@@ -166,7 +166,6 @@ config MLX5_FPGA_TLS
depends on TLS=y || MLX5_CORE=m depends on TLS=y || MLX5_CORE=m
depends on MLX5_CORE_EN depends on MLX5_CORE_EN
depends on MLX5_FPGA depends on MLX5_FPGA
depends on XPS
select MLX5_EN_TLS select MLX5_EN_TLS
default n default n
help help
...@@ -181,7 +180,6 @@ config MLX5_TLS ...@@ -181,7 +180,6 @@ config MLX5_TLS
depends on TLS_DEVICE depends on TLS_DEVICE
depends on TLS=y || MLX5_CORE=m depends on TLS=y || MLX5_CORE=m
depends on MLX5_CORE_EN depends on MLX5_CORE_EN
depends on XPS
select MLX5_ACCEL select MLX5_ACCEL
select MLX5_EN_TLS select MLX5_EN_TLS
default n default n
......
...@@ -226,7 +226,7 @@ struct sock_common { ...@@ -226,7 +226,7 @@ struct sock_common {
struct hlist_nulls_node skc_nulls_node; struct hlist_nulls_node skc_nulls_node;
}; };
unsigned short skc_tx_queue_mapping; unsigned short skc_tx_queue_mapping;
#ifdef CONFIG_XPS #ifdef CONFIG_SOCK_RX_QUEUE_MAPPING
unsigned short skc_rx_queue_mapping; unsigned short skc_rx_queue_mapping;
#endif #endif
union { union {
...@@ -356,7 +356,7 @@ struct sock { ...@@ -356,7 +356,7 @@ struct sock {
#define sk_nulls_node __sk_common.skc_nulls_node #define sk_nulls_node __sk_common.skc_nulls_node
#define sk_refcnt __sk_common.skc_refcnt #define sk_refcnt __sk_common.skc_refcnt
#define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping #define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping
#ifdef CONFIG_XPS #ifdef CONFIG_SOCK_RX_QUEUE_MAPPING
#define sk_rx_queue_mapping __sk_common.skc_rx_queue_mapping #define sk_rx_queue_mapping __sk_common.skc_rx_queue_mapping
#endif #endif
...@@ -1838,7 +1838,7 @@ static inline int sk_tx_queue_get(const struct sock *sk) ...@@ -1838,7 +1838,7 @@ static inline int sk_tx_queue_get(const struct sock *sk)
static inline void sk_rx_queue_set(struct sock *sk, const struct sk_buff *skb) static inline void sk_rx_queue_set(struct sock *sk, const struct sk_buff *skb)
{ {
#ifdef CONFIG_XPS #ifdef CONFIG_SOCK_RX_QUEUE_MAPPING
if (skb_rx_queue_recorded(skb)) { if (skb_rx_queue_recorded(skb)) {
u16 rx_queue = skb_get_rx_queue(skb); u16 rx_queue = skb_get_rx_queue(skb);
...@@ -1852,20 +1852,20 @@ static inline void sk_rx_queue_set(struct sock *sk, const struct sk_buff *skb) ...@@ -1852,20 +1852,20 @@ static inline void sk_rx_queue_set(struct sock *sk, const struct sk_buff *skb)
static inline void sk_rx_queue_clear(struct sock *sk) static inline void sk_rx_queue_clear(struct sock *sk)
{ {
#ifdef CONFIG_XPS #ifdef CONFIG_SOCK_RX_QUEUE_MAPPING
sk->sk_rx_queue_mapping = NO_QUEUE_MAPPING; sk->sk_rx_queue_mapping = NO_QUEUE_MAPPING;
#endif #endif
} }
#ifdef CONFIG_XPS
static inline int sk_rx_queue_get(const struct sock *sk) static inline int sk_rx_queue_get(const struct sock *sk)
{ {
#ifdef CONFIG_SOCK_RX_QUEUE_MAPPING
if (sk && sk->sk_rx_queue_mapping != NO_QUEUE_MAPPING) if (sk && sk->sk_rx_queue_mapping != NO_QUEUE_MAPPING)
return sk->sk_rx_queue_mapping; return sk->sk_rx_queue_mapping;
#endif
return -1; return -1;
} }
#endif
static inline void sk_set_socket(struct sock *sk, struct socket *sock) static inline void sk_set_socket(struct sock *sk, struct socket *sock)
{ {
......
...@@ -256,9 +256,13 @@ config RFS_ACCEL ...@@ -256,9 +256,13 @@ config RFS_ACCEL
select CPU_RMAP select CPU_RMAP
default y default y
config SOCK_RX_QUEUE_MAPPING
bool
config XPS config XPS
bool bool
depends on SMP depends on SMP
select SOCK_RX_QUEUE_MAPPING
default y default y
config HWBM config HWBM
......
...@@ -8814,7 +8814,7 @@ u32 bpf_sock_convert_ctx_access(enum bpf_access_type type, ...@@ -8814,7 +8814,7 @@ u32 bpf_sock_convert_ctx_access(enum bpf_access_type type,
target_size)); target_size));
break; break;
case offsetof(struct bpf_sock, rx_queue_mapping): case offsetof(struct bpf_sock, rx_queue_mapping):
#ifdef CONFIG_XPS #ifdef CONFIG_SOCK_RX_QUEUE_MAPPING
*insn++ = BPF_LDX_MEM( *insn++ = BPF_LDX_MEM(
BPF_FIELD_SIZEOF(struct sock, sk_rx_queue_mapping), BPF_FIELD_SIZEOF(struct sock, sk_rx_queue_mapping),
si->dst_reg, si->src_reg, si->dst_reg, si->src_reg,
......
...@@ -21,6 +21,7 @@ config TLS_DEVICE ...@@ -21,6 +21,7 @@ config TLS_DEVICE
bool "Transport Layer Security HW offload" bool "Transport Layer Security HW offload"
depends on TLS depends on TLS
select SOCK_VALIDATE_XMIT select SOCK_VALIDATE_XMIT
select SOCK_RX_QUEUE_MAPPING
default n default n
help help
Enable kernel support for HW offload of the TLS protocol. Enable kernel support for HW offload of the TLS protocol.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment