diff mbox series

[ovs-dev,42/62] dpif-netdev: delete insert hw offload after dpcls lookup mechanism

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

Commit Message

Tao YunXiang Dec. 28, 2020, 9:25 a.m. UTC
From: Rongyin <rongyin@cmss.chinamobile.com>

Code Source From: Self Code

Description:

     Delete insert hw offload after dpcls lookup mechanism

Jira:  #[Optional]
市场项目编号(名称):[Optional]

NOTE: The reason of delete this mechanism is: If we set megaflow enable
,when we do dpcls insertion, the rule is together with megaflow mask,
and even if EMC lookup miss, but dpcls lookup hit, the offloaded flow is
the same as dpcls already has, but not the new flow.
So it seems as intel FPGA card can't support wildcard match, the only
solution is turn off megaflow.
---
 lib/dpif-netdev.c | 47 -----------------------------------------------
 1 file changed, 47 deletions(-)
diff mbox series

Patch

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index ff226ea..a2cf82b 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -4287,36 +4287,6 @@  dp_netdev_actions_free(struct dp_netdev_actions *actions)
 }
 
 static void
-dp_netdev_append_hw_offload(struct dp_netdev_pmd_thread *pmd,
-                            struct dp_netdev_flow *flow)
-{
-    struct match flow_put_match;
-    struct dp_netdev_actions *flow_put_actions;
-    struct dp_flow_offload_item *offload;
-    int op = DP_NETDEV_FLOW_OFFLOAD_OP_ADD;
-
-    match_wc_init(&flow_put_match,&(flow->flow));
-    /* If this flow has been offloaded, but fail, won't offload again
-     * Otherwise if this flow has been offloaded succeded, it means
-     * although the ufid is the same, but exact flow is different
-     * in this scenario, or hw flow is ageout. we should also try to
-     * offload it to hw
-     */
-    if (megaflow_to_offload_st_find(&flow->ufid) == true) {
-        return ;
-    }
-    flow_put_actions = dp_netdev_flow_get_actions(flow);
-
-    offload = dp_netdev_alloc_flow_offload(pmd, flow, op);
-    offload->match = flow_put_match;
-    offload->actions = xmalloc(flow_put_actions->size);
-    memcpy(offload->actions, flow_put_actions->actions, flow_put_actions->size);
-    offload->actions_len = flow_put_actions->size;
-
-    dp_netdev_append_flow_offload(offload);
-}
-
-static void
 dp_netdev_rxq_set_cycles(struct dp_netdev_rxq *rx,
                          enum rxq_cycles_counter_type type,
                          unsigned long long cycles)
@@ -6635,15 +6605,6 @@  smc_lookup_batch(struct dp_netdev_pmd_thread *pmd,
                 flow->flow.in_port.odp_port == packet->md.in_port.odp_port)) {
                     tcp_flags = miniflow_get_tcp_flags(&keys[i].mf);
 
-                    /* In case of wildcard condition: FPGA and EMC lookup miss but
-                     * smc/dpcls lookup hit, before insert EMC, try to offload
-                     * netdev flows again(correspond to new ufid)
-                     */
-                    if (netdev_is_flow_api_enabled() &&
-                        (flow->flow.dl_type == htons(ETH_TYPE_IP))) {
-                        dp_netdev_append_hw_offload(pmd,flow);
-                    }
-
                     /* SMC hit and emc miss, we insert into EMC */
                     keys[i].len =
                         netdev_flow_key_size(miniflow_n_values(&keys[i].mf));
@@ -6994,14 +6955,6 @@  fast_path_processing(struct dp_netdev_pmd_thread *pmd,
         }
 
         flow = dp_netdev_flow_cast(rules[i]);
-        /* In case of wildcard condition: FPGA and EMC lookup miss but
-         * smc/dpcls lookup hit, before insert EMC, try to offload
-         * netdev flows again(correspond to new mega_ufid)
-         */
-        if (netdev_is_flow_api_enabled() &&
-            (flow->flow.dl_type == htons(ETH_TYPE_IP))) {
-            dp_netdev_append_hw_offload(pmd,flow);
-        }
 
         uint32_t hash =  dp_netdev_flow_hash(&flow->ufid);
         smc_insert(pmd, keys[i], hash);