From patchwork Thu Feb 28 07:03:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hyong Youb Kim (hyonkim)" X-Patchwork-Id: 50604 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C6F3F4C9F; Thu, 28 Feb 2019 08:05:08 +0100 (CET) Received: from rcdn-iport-7.cisco.com (rcdn-iport-7.cisco.com [173.37.86.78]) by dpdk.org (Postfix) with ESMTP id 2CE304C74 for ; Thu, 28 Feb 2019 08:05:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2394; q=dns/txt; s=iport; t=1551337507; x=1552547107; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=dJxA7mHEa28LA2OoO/18M9iWskXi4f4sjC127MAo8e0=; b=e9IddGKhrjspDF58trS3wZR8VjJC9n33+mwYg0E4cuFHp/ICSOVJZWrc jD74qDGLDRb/HAXnRafrXLbPmQr4yb67LVkUOPCTldH9fFt9gqZzVUobh bD2RRogBVhvhxMQi2jXRdLZypXEHYCzuUh95tLH+O3pOx3TeQxS2TiM2+ U=; X-IronPort-AV: E=Sophos;i="5.58,422,1544486400"; d="scan'208";a="522692944" Received: from alln-core-3.cisco.com ([173.36.13.136]) by rcdn-iport-7.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2019 07:05:06 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-3.cisco.com (8.15.2/8.15.2) with ESMTP id x1S756XR019889; Thu, 28 Feb 2019 07:05:06 GMT Received: by cisco.com (Postfix, from userid 508933) id F0ABB20F2001; Wed, 27 Feb 2019 23:05:05 -0800 (PST) From: Hyong Youb Kim To: Ferruh Yigit Cc: dev@dpdk.org, John Daley , Hyong Youb Kim Date: Wed, 27 Feb 2019 23:03:09 -0800 Message-Id: <20190228070317.17002-8-hyonkim@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20190228070317.17002-1-hyonkim@cisco.com> References: <20190228070317.17002-1-hyonkim@cisco.com> X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: alln-core-3.cisco.com Subject: [dpdk-dev] [PATCH 07/15] net/enic: enable limited PASSTHRU flow action X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Some apps like VPP use PASSTHRU+MARK flow rules to offload packet matching to the NIC. Just like MARK+RSS used by OVS-DPDK and others, PASSTHRU+MARK is used to "mark and then receive normally". Recent VIC adapters support such flow rules, so enable PASSTHRU for this limited use case. Signed-off-by: Hyong Youb Kim --- drivers/net/enic/enic_flow.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c index 0f6b6b930..c6ed9e1b9 100644 --- a/drivers/net/enic/enic_flow.c +++ b/drivers/net/enic/enic_flow.c @@ -283,6 +283,7 @@ static const enum rte_flow_action_type enic_supported_actions_v2_id[] = { RTE_FLOW_ACTION_TYPE_MARK, RTE_FLOW_ACTION_TYPE_FLAG, RTE_FLOW_ACTION_TYPE_RSS, + RTE_FLOW_ACTION_TYPE_PASSTHRU, RTE_FLOW_ACTION_TYPE_END, }; @@ -292,6 +293,7 @@ static const enum rte_flow_action_type enic_supported_actions_v2_drop[] = { RTE_FLOW_ACTION_TYPE_FLAG, RTE_FLOW_ACTION_TYPE_DROP, RTE_FLOW_ACTION_TYPE_RSS, + RTE_FLOW_ACTION_TYPE_PASSTHRU, RTE_FLOW_ACTION_TYPE_END, }; @@ -302,6 +304,7 @@ static const enum rte_flow_action_type enic_supported_actions_v2_count[] = { RTE_FLOW_ACTION_TYPE_DROP, RTE_FLOW_ACTION_TYPE_COUNT, RTE_FLOW_ACTION_TYPE_RSS, + RTE_FLOW_ACTION_TYPE_PASSTHRU, RTE_FLOW_ACTION_TYPE_END, }; @@ -1072,6 +1075,7 @@ enic_copy_action_v2(struct enic *enic, { enum { FATE = 1, MARK = 2, }; uint32_t overlap = 0; + bool passthru = false; FLOW_TRACE(); @@ -1164,6 +1168,19 @@ enic_copy_action_v2(struct enic *enic, overlap |= FATE; break; } + case RTE_FLOW_ACTION_TYPE_PASSTHRU: { + /* + * Like RSS above, PASSTHRU + MARK may be used to + * "mark and then receive normally". MARK usually comes + * after PASSTHRU, so remember we have seen passthru + * and check for mark later. + */ + if (overlap & FATE) + return ENOTSUP; + overlap |= FATE; + passthru = true; + break; + } case RTE_FLOW_ACTION_TYPE_VOID: continue; default: @@ -1171,6 +1188,9 @@ enic_copy_action_v2(struct enic *enic, break; } } + /* Only PASSTHRU + MARK is allowed */ + if (passthru && !(overlap & MARK)) + return ENOTSUP; if (!(overlap & FATE)) return ENOTSUP; enic_action->type = FILTER_ACTION_V2;