summaryrefslogtreecommitdiff
path: root/net/openvswitch/datapath.c
diff options
context:
space:
mode:
authorMark Gray <mark.d.gray@redhat.com>2021-07-23 10:24:13 -0400
committerDavid S. Miller <davem@davemloft.net>2021-07-27 11:48:42 +0100
commit784dcfa56e0453bb197601ba0b8196f6f892ebcb (patch)
tree8964e55ef7d1e278d64626f83f45356bb644bf7a /net/openvswitch/datapath.c
parente4252cb66637b846b916cca7c2cdb4ed22ab2fc3 (diff)
openvswitch: fix alignment issues
Signed-off-by: Mark Gray <mark.d.gray@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/datapath.c')
-rw-r--r--net/openvswitch/datapath.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 7a4edafdc685..e6f0ae5618dd 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -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;
}