From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E0CF3A0562; Thu, 2 Apr 2020 08:58:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C91602B8B; Thu, 2 Apr 2020 08:57:59 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C5705FFA; Thu, 2 Apr 2020 08:57:57 +0200 (CEST) IronPort-SDR: RvJ9o65nohT9tOP+G05pipR/vqy/cq331BvWqa3PPjTqo2DXDWcq/qmS9DZ9l5ClEUUrPgDB2E 6ps90hwXdpZA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2020 23:57:56 -0700 IronPort-SDR: mImkiC8SL5A+rlW0jOkwgp5/YBES5Ld801rrye8YYV1AujHCXhZVGwM9A1jP4Q6M6YWn3bbQQH heAK5IFvYISQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,334,1580803200"; d="scan'208";a="449510184" Received: from unknown (HELO npg-dpdk-cvl-simeisu-118d193.sh.intel.com) ([10.67.110.183]) by fmsmga005.fm.intel.com with ESMTP; 01 Apr 2020 23:57:54 -0700 From: Simei Su To: qi.z.zhang@intel.com, xiaolong.ye@intel.com Cc: dev@dpdk.org, yahui.cao@intel.com, simei.su@intel.com, stable@dpdk.org Date: Thu, 2 Apr 2020 14:55:57 +0800 Message-Id: <1585810557-21150-1-git-send-email-simei.su@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/ice: support mark only action for FDIR 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" This patch fixes issue that doesn't support mark only case. Mark only action is equal to mark + passthru action. Fixes: f5cafa961fae ("net/ice: add flow director create and destroy") Cc: stable@dpdk.org Signed-off-by: Simei Su --- drivers/net/ice/ice_fdir_filter.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c index a082a13..8acdb1a 100644 --- a/drivers/net/ice/ice_fdir_filter.c +++ b/drivers/net/ice/ice_fdir_filter.c @@ -1469,6 +1469,10 @@ uint32_t counter_num = 0; int ret; + /* set default action to PASSTHRU mode, in the case of MARK only. */ + filter->input.dest_ctl = + ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER; + for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) { switch (actions->type) { case RTE_FLOW_ACTION_TYPE_VOID: @@ -1533,7 +1537,7 @@ } } - if (dest_num == 0 || dest_num >= 2) { + if (dest_num >= 2) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, actions, "Unsupported action combination"); @@ -1554,6 +1558,13 @@ return -rte_errno; } + if (dest_num + mark_num == 0) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, actions, + "Emtpy action"); + return -rte_errno; + } + return 0; } -- 1.8.3.1