openvswitch: per-cpu upcall patchwork issues
Subsystems (3)
cover openvswitch: per-cpu upcall patchwork issues
Some issues were raised by patchwork at:
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/#24285159
Mark Gray (3):
openvswitch: update kdoc OVS_DP_ATTR_PER_CPU_PIDS
openvswitch: fix alignment issues
openvswitch: fix sparse warning incorrect type
include/uapi/linux/openvswitch.h | 6 +++--- net/openvswitch/actions.c | 6 ++++-- net/openvswitch/datapath.c | 18 +++++++++++------- 3 files changed, 18 insertions(+), 12 deletions(-)
Signature · 1 line
2.27.0
PATCH 1/3 openvswitch: update kdoc OVS_DP_ATTR_PER_CPU_PIDS
--- include/uapi/linux/openvswitch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/openvswitch.h +1 -1
@@ -70,7 +70,7 @@ enum ovs_datapath_cmd {* set on the datapath port (for OVS_ACTION_ATTR_MISS). Only valid on * %OVS_DP_CMD_NEW requests. A value of zero indicates that upcalls should * not be sent. -* OVS_DP_ATTR_PER_CPU_PIDS: Per-cpu array of PIDs for upcalls when +* @OVS_DP_ATTR_PER_CPU_PIDS: Per-cpu array of PIDs for upcalls when * OVS_DP_F_DISPATCH_UPCALL_PER_CPU feature is set. * @OVS_DP_ATTR_STATS: Statistics about packets that have passed through the * datapath. Always present in notifications.
Signature · 1 line
2.27.0
PATCH 2/3 openvswitch: fix alignment issues
In reply to Mark Gray--- include/uapi/linux/openvswitch.h | 4 ++-- net/openvswitch/actions.c | 6 ++++-- net/openvswitch/datapath.c | 16 ++++++++++------ 3 files changed, 16 insertions(+), 10 deletions(-)
include/uapi/linux/openvswitch.h +2 -2
@@ -89,8 +89,8 @@ enum ovs_datapath_attr {OVS_DP_ATTR_USER_FEATURES ,/* OVS_DP_F_* */ OVS_DP_ATTR_PAD ,OVS_DP_ATTR_MASKS_CACHE_SIZE , -OVS_DP_ATTR_PER_CPU_PIDS ,/* Netlink PIDS to receive upcalls in per-cpu -* dispatch mode +OVS_DP_ATTR_PER_CPU_PIDS ,/* Netlink PIDS to receive upcalls in +* per-cpu dispatch mode */ __OVS_DP_ATTR_MAX };
net/openvswitch/actions.c +4 -2
@@ -924,9 +924,11 @@ static int output_userspace(struct datapath *dp, struct sk_buff *skb,break ;case OVS_USERSPACE_ATTR_PID : -if (dp->user_features &OVS_DP_F_DISPATCH_UPCALL_PER_CPU ) +if (dp->user_features & +OVS_DP_F_DISPATCH_UPCALL_PER_CPU ) upcall.portid = -ovs_dp_get_upcall_portid (dp,smp_processor_id ()); +ovs_dp_get_upcall_portid (dp, +smp_processor_id ());else upcall.portid =nla_get_u32 (a);break ;
net/openvswitch/datapath.c +10 -6
@@ -244,7 +244,8 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key) upcall.cmd =OVS_PACKET_CMD_MISS ;if (dp->user_features &OVS_DP_F_DISPATCH_UPCALL_PER_CPU ) - upcall.portid =ovs_dp_get_upcall_portid (dp,smp_processor_id ()); + upcall.portid = +ovs_dp_get_upcall_portid (dp,smp_processor_id ());else upcall.portid =ovs_vport_find_upcall_portid (p, skb);
@@ -1636,13 +1637,16 @@ u32 ovs_dp_get_upcall_portid(const struct datapath *dp, uint32_t cpu_id)if (dp_nlsk_pids) {if (cpu_id < dp_nlsk_pids->n_pids) {return dp_nlsk_pids->pids[cpu_id]; - }else if (dp_nlsk_pids->n_pids >0 && cpu_id >= dp_nlsk_pids->n_pids) { -/* If the number of netlink PIDs is mismatched with the number of -* CPUs as seen by the kernel, log this and send the upcall to an -* arbitrary socket (0) in order to not drop packets + }else if (dp_nlsk_pids->n_pids >0 && + cpu_id >= dp_nlsk_pids->n_pids) { +/* If the number of netlink PIDs is mismatched with +* the number of CPUs as seen by the kernel, log this +* and send the upcall to an arbitrary socket (0) in +* order to not drop packets */ pr_info_ratelimited ("cpu_id mismatch with handler threads" ); -return dp_nlsk_pids->pids[cpu_id % dp_nlsk_pids->n_pids]; +return dp_nlsk_pids->pids[cpu_id % + dp_nlsk_pids->n_pids]; }else {return 0 ; }
Signature · 1 line
2.27.0
PATCH 3/3 openvswitch: fix sparse warning incorrect type
In reply to Mark Grayfix incorrect type in argument 1 (different address spaces)
../net/openvswitch/datapath.c:169:17: warning: incorrect type in argument 1 (different address spaces)../net/openvswitch/datapath.c:169:17: expected void const *../net/openvswitch/datapath.c:169:17: got struct dp_nlsk_pids [noderef] __rcu *upcall_portids
Found at: https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/#24285159
--- net/openvswitch/datapath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/openvswitch/datapath.c +1 -1
@@ -168,7 +168,7 @@ static void destroy_dp_rcu(struct rcu_head *rcu)free_percpu (dp->stats_percpu);kfree (dp->ports);ovs_meters_exit (dp); -kfree (dp->upcall_portids); +kfree (rcu_dereference_raw (dp->upcall_portids));kfree (dp); }
Signature · 1 line
2.27.0
This series was applied to netdev/net-next.git (refs/heads/master):
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
Quoted 9 lines · On Fri, 23 Jul 2021 10:24:11 -0400 you wrote:
Some issues were raised by patchwork at:
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/#24285159Mark Gray (3):
openvswitch: update kdocOVS_DP_ATTR_PER_CPU_PIDS
openvswitch: fix alignment issues
openvswitch: fix sparse warning incorrect type[...]
Here is the summary with links:
- [net-next,1/3] openvswitch: update kdoc OVS_DP_ATTR_PER_CPU_PIDS
https://git.kernel.org/netdev/net-next/c/e4252cb66637 - [net-next,2/3] openvswitch: fix alignment issues https://git.kernel.org/netdev/net-next/c/784dcfa56e04 - [net-next,3/3] openvswitch: fix sparse warning incorrect type https://git.kernel.org/netdev/net-next/c/076999e46027
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html