From patchwork Mon Dec 28 09:25:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: taoyunxiang X-Patchwork-Id: 1420986 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D4Qcr0CsJz9sWC for ; Tue, 29 Dec 2020 05:12:28 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 43C4886992; Mon, 28 Dec 2020 18:12:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q5JpqDaDG8xz; Mon, 28 Dec 2020 18:12:24 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id F3CCA868C5; Mon, 28 Dec 2020 18:11:55 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9E0B3C1F92; Mon, 28 Dec 2020 18:11:55 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 80194C0891 for ; Mon, 28 Dec 2020 09:26:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7A2BD81B5E for ; Mon, 28 Dec 2020 09:26:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QnDOCEy9WwuF for ; Mon, 28 Dec 2020 09:26:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from cmccmta2.chinamobile.com (cmccmta2.chinamobile.com [221.176.66.80]) by hemlock.osuosl.org (Postfix) with ESMTP id 5BCFE84FB8 for ; Mon, 28 Dec 2020 09:26:33 +0000 (UTC) Received: from spf.mail.chinamobile.com (unknown[172.16.121.3]) by rmmx-syy-dmz-app08-12008 (RichMail) with SMTP id 2ee85fe9a4a2f65-c0804; Mon, 28 Dec 2020 17:25:54 +0800 (CST) X-RM-TRANSID: 2ee85fe9a4a2f65-c0804 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from yun.localdomain (unknown[112.25.154.146]) by rmsmtp-syy-appsvr02-12002 (RichMail) with SMTP id 2ee25fe9a48a90b-7b8c7; Mon, 28 Dec 2020 17:25:54 +0800 (CST) X-RM-TRANSID: 2ee25fe9a48a90b-7b8c7 From: Tao YunXiang To: ovs-dev@openvswitch.org Date: Mon, 28 Dec 2020 01:25:00 -0800 Message-Id: <20201228092520.11807-43-taoyunxiang@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201228092520.11807-1-taoyunxiang@cmss.chinamobile.com> References: <8> <20201228092520.11807-1-taoyunxiang@cmss.chinamobile.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 28 Dec 2020 18:10:34 +0000 Cc: Rongyin Subject: [ovs-dev] [PATCH 42/62] dpif-netdev: delete insert hw offload after dpcls lookup mechanism X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Rongyin 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 --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);