]> www.infradead.org Git - users/willy/xarray.git/commitdiff
openvswitch: fix alignment issues
authorMark Gray <mark.d.gray@redhat.com>
Fri, 23 Jul 2021 14:24:13 +0000 (10:24 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Jul 2021 10:48:42 +0000 (11:48 +0100)
Signed-off-by: Mark Gray <mark.d.gray@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/openvswitch.h
net/openvswitch/actions.c
net/openvswitch/datapath.c

index 0e436a3755f1d3b1001665a19e0fb7a54eb95540..150bcff49b1c1794cfee0a7ab94cdf3c6fd12ade 100644 (file)
@@ -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
 };
index f79679746c628dfcc845a692e0255b17352c679b..076774034bb960b16c04609cd120fd5118829538 100644 (file)
@@ -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;
index 7a4edafdc68508a3f3d8459fb4c8e3a85c8333bc..e6f0ae5618dd2be1ea06294138c2aee6b0016f67 100644 (file)
@@ -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;
                }