diff mbox series

[ovs-dev,10/62] netdev-offload-dpdk: Fix compile warnings

Message ID 20201228092520.11807-11-taoyunxiang@cmss.chinamobile.com
State Not Applicable
Headers show
Series DPDK Offload API to test | expand

Commit Message

Tao YunXiang Dec. 28, 2020, 9:24 a.m. UTC
From: Liuchang <liuchang@cmss.chinamobile.com>

Code Source From: Self Code
Description:

    Fix compile warnings

Jira:  #[Optional]
市场项目编号(名称):[Optional]
---
 lib/dpif-netdev.c         | 8 ++++----
 lib/netdev-offload-dpdk.c | 7 +++++--
 2 files changed, 9 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 74fd05c..ce6ba27 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -2275,7 +2275,7 @@  static int
 mark_to_flow_disassociate(struct dp_netdev_pmd_thread *pmd,
                           struct dp_netdev_flow *flow)
 {
-    const char *dpif_type_str = dpif_normalize_type(dpif_type(pmd->dp->dpif));
+    const char *dpif_type_str = dpif_normalize_type(pmd->dp->class->type);
     struct cmap_node *mark_node = CONST_CAST(struct cmap_node *,
                                              &flow->mark_node);
     uint32_t mark = flow->mark;
@@ -2402,7 +2402,7 @@  dp_netdev_flow_offload_put(struct dp_flow_offload_item *offload)
     const struct dpif_class *dpif_class = pmd->dp->class;
     struct dp_netdev_flow *flow = offload->flow;
     odp_port_t in_port = flow->flow.in_port.odp_port;
-    const char *dpif_type_str = dpif_normalize_type(dpif_type(pmd->dp->dpif));
+    const char *dpif_type_str = dpif_normalize_type(pmd->dp->class->type);
     bool modification = offload->op == DP_NETDEV_FLOW_OFFLOAD_OP_MOD;
     struct offload_info info;
     struct netdev *port;
@@ -2438,7 +2438,6 @@  dp_netdev_flow_offload_put(struct dp_flow_offload_item *offload)
         }
     }
     info.flow_mark = mark;
-    info.dpif_class = dpif_class;
 
     port = netdev_ports_get(in_port, dpif_type_str);
     if (!port) {
@@ -3045,6 +3044,7 @@  dpif_netdev_get_flow_offload_status(const struct dp_netdev *dp,
     struct netdev *netdev;
     struct match match;
     struct ofpbuf buf;
+    const char *dpif_type_str = dpif_normalize_type(dp->class->type);
 
     int ret = 0;
 
@@ -3052,7 +3052,7 @@  dpif_netdev_get_flow_offload_status(const struct dp_netdev *dp,
         return false;
     }
 
-    netdev = netdev_ports_get(odp_port, dpif_normalize_type(dp->class->type));
+    netdev = netdev_ports_get(netdev_flow->flow.in_port.odp_port, dpif_type_str);
     if (!netdev) {
         return false;
     }
diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index 5cce175..7cb2dc0 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -568,9 +568,12 @@  parse_flow_match(struct flow_patterns *patterns,
 {
     uint8_t *next_proto_mask = NULL;
     uint8_t proto = 0;
+    struct match consumed_match;
     struct flow *consumed_masks;
 
-    consumed_masks = &match->wc.masks;
+    memcpy(&consumed_match, match, sizeof consumed_match);
+
+    consumed_masks = &(consumed_match.wc.masks);
     /* Not attemp to offload in_port/recirc_id ?
     memset(&consumed_masks->in_port, 0, sizeof consumed_masks->in_port);
     consumed_masks->recirc_id = 0;
@@ -884,7 +887,7 @@  add_output_action(struct netdev *netdev,
     int ret = 0;
 
     port = nl_attr_get_odp_port(nla);
-    outdev = netdev_ports_get(port, info->dpif_class);
+    outdev = netdev_ports_get(port, netdev->dpif_type);
     if (outdev == NULL) {
         VLOG_DBG_RL(&rl, "Cannot find netdev for odp port %"PRIu32, port);
         return -1;