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 7E27CA0520; Mon, 20 Jan 2020 04:24:20 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D781E2BF1; Mon, 20 Jan 2020 04:24:18 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 890101DBA; Mon, 20 Jan 2020 04:24:17 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jan 2020 19:24:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,340,1574150400"; d="scan'208";a="374209819" Received: from npg-dpdk-beilei-3.sh.intel.com ([10.67.110.206]) by orsmga004.jf.intel.com with ESMTP; 19 Jan 2020 19:24:15 -0800 From: Beilei Xing To: dev@dpdk.org, qi.z.zhang@intel.com, yahui.cao@intel.com Cc: stable@dpdk.org Date: Mon, 20 Jan 2020 20:18:54 +0800 Message-Id: <1579522734-16566-1-git-send-email-beilei.xing@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] net/ice: fix FDIR flag issue 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" If there's no mark action when creating a FDIR rule, there shouldn't be FDIR flags in mbuf. Fixes: f5cafa961fae ("net/ice: add flow director create and destroy") Fixes: bd984f155f49 ("net/ice/base: support FDIR") Cc: stable@dpdk.org Signed-off-by: Beilei Xing --- drivers/net/ice/base/ice_fdir.c | 2 +- drivers/net/ice/base/ice_fdir.h | 1 + drivers/net/ice/base/ice_lan_tx_rx.h | 1 + drivers/net/ice/ice_fdir_filter.c | 4 ++++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_fdir.c b/drivers/net/ice/base/ice_fdir.c index 87fa0af..20d64f8 100644 --- a/drivers/net/ice/base/ice_fdir.c +++ b/drivers/net/ice/base/ice_fdir.c @@ -418,7 +418,7 @@ ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input, fdir_fltr_ctx.swap = ICE_FXD_FLTR_QW1_SWAP_NOT_SET; fdir_fltr_ctx.comp_q = ICE_FXD_FLTR_QW0_COMP_Q_ZERO; fdir_fltr_ctx.comp_report = ICE_FXD_FLTR_QW0_COMP_REPORT_SW; - fdir_fltr_ctx.fdid_prio = 3; + fdir_fltr_ctx.fdid_prio = input->fdid_prio; fdir_fltr_ctx.desc_prof = 1; fdir_fltr_ctx.desc_prof_prio = 3; ice_set_fd_desc_val(&fdir_fltr_ctx, fdesc); diff --git a/drivers/net/ice/base/ice_fdir.h b/drivers/net/ice/base/ice_fdir.h index db1f835..c811f76 100644 --- a/drivers/net/ice/base/ice_fdir.h +++ b/drivers/net/ice/base/ice_fdir.h @@ -202,6 +202,7 @@ struct ice_fdir_fltr { u8 cnt_ena; u8 fltr_status; u16 cnt_index; + u8 fdid_prio; u32 fltr_id; }; diff --git a/drivers/net/ice/base/ice_lan_tx_rx.h b/drivers/net/ice/base/ice_lan_tx_rx.h index a97c63c..d6f66cf 100644 --- a/drivers/net/ice/base/ice_lan_tx_rx.h +++ b/drivers/net/ice/base/ice_lan_tx_rx.h @@ -162,6 +162,7 @@ struct ice_fltr_desc { #define ICE_FXD_FLTR_QW1_FDID_PRI_S 25 #define ICE_FXD_FLTR_QW1_FDID_PRI_M (0x7ULL << ICE_FXD_FLTR_QW1_FDID_PRI_S) +#define ICE_FXD_FLTR_QW1_FDID_PRI_ZERO 0x0ULL #define ICE_FXD_FLTR_QW1_FDID_PRI_ONE 0x1ULL #define ICE_FXD_FLTR_QW1_FDID_MDID_S 28 diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c index fa87074..8359a8c 100644 --- a/drivers/net/ice/ice_fdir_filter.c +++ b/drivers/net/ice/ice_fdir_filter.c @@ -1534,6 +1534,10 @@ ice_fdir_parse_action(struct ice_adapter *ad, RTE_FLOW_ERROR_TYPE_ACTION, actions, "Too many mark actions"); return -rte_errno; + } else if (mark_num == 0) { + filter->input.fdid_prio = ICE_FXD_FLTR_QW1_FDID_PRI_ZERO; + } else { + filter->input.fdid_prio = ICE_FXD_FLTR_QW1_FDID_PRI_ONE; } if (counter_num >= 2) { -- 2.7.4