From patchwork Mon Dec 28 09:24:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: taoyunxiang X-Patchwork-Id: 1420958 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.138; helo=whitealder.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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D4QbT3l4fz9sVv for ; Tue, 29 Dec 2020 05:11:17 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2E9708713A; Mon, 28 Dec 2020 18:11:14 +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 4sZPWipnO8MC; Mon, 28 Dec 2020 18:11:08 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 792A586D63; Mon, 28 Dec 2020 18:10:41 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4F5ECC1DA2; Mon, 28 Dec 2020 18:10:41 +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 CDC06C0891 for ; Mon, 28 Dec 2020 09:26:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C622A86C46 for ; Mon, 28 Dec 2020 09:26:02 +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 1W0HtZidCoAP for ; Mon, 28 Dec 2020 09:26:01 +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 B43C786C71 for ; Mon, 28 Dec 2020 09:25:59 +0000 (UTC) Received: from spf.mail.chinamobile.com (unknown[172.16.121.3]) by rmmx-syy-dmz-app02-12002 (RichMail) with SMTP id 2ee25fe9a494d58-bebe1; Mon, 28 Dec 2020 17:25:40 +0800 (CST) X-RM-TRANSID: 2ee25fe9a494d58-bebe1 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-7b871; Mon, 28 Dec 2020 17:25:40 +0800 (CST) X-RM-TRANSID: 2ee25fe9a48a90b-7b871 From: Tao YunXiang To: ovs-dev@openvswitch.org Date: Mon, 28 Dec 2020 01:24:36 -0800 Message-Id: <20201228092520.11807-19-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:33 +0000 Cc: Liuchang Subject: [ovs-dev] [PATCH 18/62] netdev-offload-dpdk.c: add flag to exclude multicast scenario 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: Liuchang Code Source From: Self Code Description: Now we can only offload unicast flow,so we should seperate these pkts before offloading Jira: #[Optional] 市场项目编号(名称):[Optional] --- lib/netdev-offload-dpdk.c | 12 +++++++++++- lib/netdev-offload.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c index 7d34870..970eada 100644 --- a/lib/netdev-offload-dpdk.c +++ b/lib/netdev-offload-dpdk.c @@ -1201,9 +1201,13 @@ parse_clone_actions(struct netdev *netdev, continue; } } else if (clone_type == OVS_ACTION_ATTR_OUTPUT) { - if (add_output_action(netdev, actions, ca,info)) { + if (add_output_action(netdev, actions, ca, info)) { + return -1; + } else if (info->valid_ucast) { + VLOG_DBG_RL(&rl, "Unsupported multicast output action"); return -1; } + info->valid_ucast = true; } else if (clone_type == OVS_ACTION_ATTR_PUSH_VLAN) { const struct ovs_action_push_vlan *vlan = nl_attr_get(ca); struct rte_flow_action_of_push_vlan *vlan_tci; @@ -1235,14 +1239,20 @@ parse_flow_actions(struct netdev *netdev, struct nlattr *nla; size_t left; uint8_t i = 0; + add_count_action(actions); NL_ATTR_FOR_EACH_UNSAFE (nla, left, nl_actions, nl_actions_len) { + VLOG_DBG("TIMO:action type %0d:%d",i++,nl_attr_type(nla)); if (nl_attr_type(nla) == OVS_ACTION_ATTR_OUTPUT) { if (add_output_action(netdev, actions, nla, info)) { return -1; + } else if (info->valid_ucast) { + VLOG_DBG_RL(&rl, "Unsupported multicast output action"); + return -1; } + info->valid_ucast = true; } else if (nl_attr_type(nla) == OVS_ACTION_ATTR_DROP) { add_flow_action(actions, RTE_FLOW_ACTION_TYPE_DROP, NULL); } else if (nl_attr_type(nla) == OVS_ACTION_ATTR_SET || diff --git a/lib/netdev-offload.h b/lib/netdev-offload.h index 67504dd..cadbde1 100644 --- a/lib/netdev-offload.h +++ b/lib/netdev-offload.h @@ -76,6 +76,7 @@ struct offload_info { bool tc_modify_flow_deleted; /* Indicate the tc modify flow put success * to delete the original flow. */ + bool valid_ucast; /* flag to judge multicast && broadcast */ }; int netdev_flow_flush(struct netdev *);