From patchwork Mon Dec 28 09:24:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: taoyunxiang X-Patchwork-Id: 1420951 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 4D4Qb611LZz9sWC for ; Tue, 29 Dec 2020 05:10:57 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 50609870BA; Mon, 28 Dec 2020 18:10:56 +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 PN0hZmH83aHq; Mon, 28 Dec 2020 18:10:52 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id C5EAE870F0; Mon, 28 Dec 2020 18:10:51 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 992B3C1DA4; Mon, 28 Dec 2020 18:10:51 +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 5DE40C1D9C for ; Mon, 28 Dec 2020 09:26:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4376C86CA1 for ; Mon, 28 Dec 2020 09:26:06 +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 rnh+4z9t5ggL for ; Mon, 28 Dec 2020 09:26:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from cmccmta3.chinamobile.com (cmccmta3.chinamobile.com [221.176.66.81]) by whitealder.osuosl.org (Postfix) with ESMTP id A70A786C73 for ; Mon, 28 Dec 2020 09:26:03 +0000 (UTC) Received: from spf.mail.chinamobile.com (unknown[172.16.121.3]) by rmmx-syy-dmz-app10-12010 (RichMail) with SMTP id 2eea5fe9a49f9e4-c33e4; Mon, 28 Dec 2020 17:25:52 +0800 (CST) X-RM-TRANSID: 2eea5fe9a49f9e4-c33e4 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-7b8bb; Mon, 28 Dec 2020 17:25:51 +0800 (CST) X-RM-TRANSID: 2ee25fe9a48a90b-7b8bb From: Tao YunXiang To: ovs-dev@openvswitch.org Date: Mon, 28 Dec 2020 01:24:56 -0800 Message-Id: <20201228092520.11807-39-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: Rongyin Subject: [ovs-dev] [PATCH 38/62] netdev-offload: delete work around code 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: Flow delete work around code Jira: #[Optional] 市场项目编号(名称):[Optional] --- lib/netdev-offload-dpdk.c | 14 ++------------ lib/netdev-offload-provider.h | 5 ----- lib/netdev-offload.c | 14 ++++---------- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c index 21a4058..4867053 100644 --- a/lib/netdev-offload-dpdk.c +++ b/lib/netdev-offload-dpdk.c @@ -608,14 +608,6 @@ netdev_offload_dpdk_flow_create(struct netdev *netdev, VLOG_DBG("TIMO DBG: in netdev_offload_dpdk_flow_create %s",netdev->name); flow = netdev_dpdk_rte_flow_create(netdev, attr, items, actions, error); - /* work around: for dump_flow even if rte_flow create fail */ - if (!VLOG_DROP_DBG(&rl)) { - ds_init(&s); - dump_flow(&s, attr, items, actions); - VLOG_DBG_RL(&rl, "TIMO:%s: rte_flow 0x%"PRIxPTR" printed:\n%s", - netdev_get_name(netdev), (intptr_t) flow, ds_cstr(&s)); - ds_destroy(&s); - } if (flow) { if (!VLOG_DROP_DBG(&rl)) { ds_init(&s); @@ -1207,10 +1199,8 @@ add_output_action(struct netdev *netdev, VLOG_DBG_RL(&rl, "Cannot find netdev for odp port %"PRIu32, port); return -1; } - /* work around: to enable vhost type port tans rte_flow if (!netdev_flow_api_equals(netdev, outdev) || - add_port_id_action(actions, outdev)) { */ - if (add_port_id_action(actions, outdev)) { + add_port_id_action(actions, outdev)) { VLOG_DBG_RL(&rl, "%s: Output to port \'%s\' cannot be offloaded.", netdev_get_name(netdev), netdev_get_name(outdev)); ret = -1; @@ -1890,7 +1880,7 @@ netdev_offload_dpdk_destroy_flow(struct netdev *netdev, return ret; } -int +static int netdev_offload_dpdk_flow_put(struct netdev *netdev, struct match *match, struct nlattr *actions, size_t actions_len, const ovs_u128 *ufid, struct offload_info *info, diff --git a/lib/netdev-offload-provider.h b/lib/netdev-offload-provider.h index 0c1a370..5a809c0 100644 --- a/lib/netdev-offload-provider.h +++ b/lib/netdev-offload-provider.h @@ -28,11 +28,6 @@ extern "C" { #endif -extern int -netdev_offload_dpdk_flow_put(struct netdev *netdev, struct match *match, - struct nlattr *actions, size_t actions_len, - const ovs_u128 *ufid, struct offload_info *info, - struct dpif_flow_stats *stats); struct netdev_flow_api { char *type; /* Flush all offloaded flows from a netdev. diff --git a/lib/netdev-offload.c b/lib/netdev-offload.c index a32b3fc..e054bb0 100644 --- a/lib/netdev-offload.c +++ b/lib/netdev-offload.c @@ -246,17 +246,11 @@ netdev_flow_put(struct netdev *netdev, struct match *match, { const struct netdev_flow_api *flow_api = ovsrcu_get(const struct netdev_flow_api *, &netdev->flow_api); - const char *netdev_type = netdev->netdev_class->type; - if (!strcmp(netdev_type, "dpdkvhostuserclient")) { - return netdev_offload_dpdk_flow_put(netdev, match, actions, act_len, ufid, - info, stats); - } else { - return (flow_api && flow_api->flow_put) - ? flow_api->flow_put(netdev, match, actions, act_len, ufid, - info, stats) - : EOPNOTSUPP; - } + return (flow_api && flow_api->flow_put) + ? flow_api->flow_put(netdev, match, actions, act_len, ufid, + info, stats) + : EOPNOTSUPP; } int