From patchwork Mon Dec 28 09:24:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: taoyunxiang X-Patchwork-Id: 1420972 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.133; helo=hemlock.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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D4Qc90gfDz9sWC for ; Tue, 29 Dec 2020 05:11:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 91C87870C0; Mon, 28 Dec 2020 18:11:51 +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 5bcqqtf9rDrZ; Mon, 28 Dec 2020 18:11:48 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id F1A168721F; Mon, 28 Dec 2020 18:11:25 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A1BFBC1E62; Mon, 28 Dec 2020 18:11:25 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id BF0F1C0891 for ; Mon, 28 Dec 2020 09:26:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id AE80B86C4C for ; Mon, 28 Dec 2020 09:26:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zXFzwmKDMrDF for ; Mon, 28 Dec 2020 09:26:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from cmccmta1.chinamobile.com (cmccmta1.chinamobile.com [221.176.66.79]) by whitealder.osuosl.org (Postfix) with ESMTP id 86AE786C8F for ; Mon, 28 Dec 2020 09:26:15 +0000 (UTC) Received: from spf.mail.chinamobile.com (unknown[172.16.121.3]) by rmmx-syy-dmz-app02-12002 (RichMail) with SMTP id 2ee25fe9a497d66-bebef; Mon, 28 Dec 2020 17:25:44 +0800 (CST) X-RM-TRANSID: 2ee25fe9a497d66-bebef 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-7b88f; Mon, 28 Dec 2020 17:25:44 +0800 (CST) X-RM-TRANSID: 2ee25fe9a48a90b-7b88f From: Tao YunXiang To: ovs-dev@openvswitch.org Date: Mon, 28 Dec 2020 01:24:46 -0800 Message-Id: <20201228092520.11807-29-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 28/62] netdev-offload-dpdk: delete mask effect in parse_flow_match 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 mask effect in parse_flow_match Jira: #[Optional] 市场项目编号(名称):[Optional] --- lib/netdev-offload-dpdk.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c index bb0b91d..11b04b5 100644 --- a/lib/netdev-offload-dpdk.c +++ b/lib/netdev-offload-dpdk.c @@ -762,8 +762,7 @@ parse_flow_match(struct flow_patterns *patterns, } /* Eth */ - if (!eth_addr_is_zero(match->wc.masks.dl_src) || - !eth_addr_is_zero(match->wc.masks.dl_dst)) { + if (match->flow.packet_type == htonl(PT_ETH)) { struct rte_flow_item_eth *spec, *mask; spec = xzalloc(sizeof *spec); @@ -845,26 +844,24 @@ parse_flow_match(struct flow_patterns *patterns, consumed_masks->nw_src = 0; consumed_masks->nw_dst = 0; - /* Save proto for L4 protocol setup. */ + /* Save proto for L4 protocol setup.Not consider mask proto = spec->hdr.next_proto_id & mask->hdr.next_proto_id; + */ + proto = spec->hdr.next_proto_id ; next_proto_mask = &mask->hdr.next_proto_id; + } else { + /* if eth_type is not IP ,just transit eth rte_flow */ + add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_END, NULL, NULL); + return 0; } if (proto != IPPROTO_ICMP && proto != IPPROTO_UDP && - proto != IPPROTO_SCTP && proto != IPPROTO_TCP && - (match->wc.masks.tp_src || - match->wc.masks.tp_dst || - match->wc.masks.tcp_flags)) { + proto != IPPROTO_SCTP && proto != IPPROTO_TCP ){ VLOG_DBG("L4 Protocol (%u) not supported", proto); return -1; } - if ((match->wc.masks.tp_src && match->wc.masks.tp_src != OVS_BE16_MAX) || - (match->wc.masks.tp_dst && match->wc.masks.tp_dst != OVS_BE16_MAX)) { - return -1; - } - if (proto == IPPROTO_TCP) { struct rte_flow_item_tcp *spec, *mask;