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 093C5A00C2; Thu, 23 Apr 2020 07:05:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B0CE31C1E6; Thu, 23 Apr 2020 07:05:57 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 898311C1CB for ; Thu, 23 Apr 2020 07:05:55 +0200 (CEST) IronPort-SDR: fkfTf9wNSwUuhLUwn6dtcGRo4ZP2KMOaNpwH3cjqMrJLkNPhnui0ZM1KuekNEewbYpyas9pj74 i0CnbXaRSXYw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2020 22:05:54 -0700 IronPort-SDR: o0zMgPdlftpL1gUqH8C57dTzC5vZ3zkHxm5nmsSCU62MjqggKIOSuvhU8Y+uqF+rn6AnFLtdaC nff8xnfDCdzg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,305,1583222400"; d="scan'208";a="365893991" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 22 Apr 2020 22:05:54 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 22 Apr 2020 22:04:51 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX606.ccr.corp.intel.com (10.109.6.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 23 Apr 2020 13:04:48 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Thu, 23 Apr 2020 13:04:48 +0800 From: "Lu, Nannan" To: "Zhang, Qi Z" , "Yang, Qiming" CC: "Ye, Xiaolong" , "dev@dpdk.org" , "Zhang, Qi Z" Thread-Topic: [dpdk-dev] [PATCH] net/ice/base: fix DCF switch rule Thread-Index: AQHWGRu93X8MA93tKUyXGu5J7qyZA6iGJmjw Date: Thu, 23 Apr 2020 05:04:48 +0000 Message-ID: <265bb282158e4033b72bf927e2add670@intel.com> References: <20200423030640.9008-1-qi.z.zhang@intel.com> In-Reply-To: <20200423030640.9008-1-qi.z.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/ice/base: fix DCF switch rule 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" Tested-by: Lu, Nannan -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qi Zhang Sent: Thursday, April 23, 2020 11:07 AM To: Yang, Qiming Cc: Ye, Xiaolong ; dev@dpdk.org; Zhang, Qi Z Subject: [dpdk-dev] [PATCH] net/ice/base: fix DCF switch rule 1. ln_en bit should not be turned on, since we only support Rx VEB. 2. lan_en bit need to be turn on for a DCF switch rule, otherwise any Tx packet that hit on a rule will be dropped. Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe= ") Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_switch.c | 10 +++++++++- drivers/net/ice/ice_switch_filter.c | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_s= witch.c index fd2cf101a..08999d336 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -1938,6 +1938,13 @@ static void ice_fill_sw_info(struct ice_hw *hw, stru= ct ice_fltr_info *fi) { fi->lb_en =3D false; fi->lan_en =3D false; + + if ((fi->flag & ICE_FLTR_RX) && + (fi->fltr_act =3D=3D ICE_FWD_TO_VSI || + fi->fltr_act =3D=3D ICE_FWD_TO_VSI_LIST) && + fi->lkup_type =3D=3D ICE_SW_LKUP_LAST) + fi->lan_en =3D true; + if ((fi->flag & ICE_FLTR_TX) && (fi->fltr_act =3D=3D ICE_FWD_TO_VSI || fi->fltr_act =3D=3D ICE_FWD_TO_VSI_LIST || @@ -6453,6 +6460,7 @@ ice= _adv_add_update_vsi_list(struct ice_hw *hw, return status; =20 ice_memset(&tmp_fltr, 0, sizeof(tmp_fltr), ICE_NONDMA_MEM); + tmp_fltr.flag =3D m_entry->rule_info.sw_act.flag; tmp_fltr.fltr_rule_id =3D cur_fltr->fltr_rule_id; tmp_fltr.fltr_act =3D ICE_FWD_TO_VSI_LIST; tmp_fltr.fwd_id.vsi_list_id =3D vsi_list_id; @@ -6615,7 +6623,7 @@ ice_a= dd_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, s_rule =3D (struct ice_aqc_sw_rules_elem *)ice_malloc(hw, rule_buf_sz); if (!s_rule) return ICE_ERR_NO_MEMORY; - act |=3D ICE_SINGLE_ACT_LB_ENABLE | ICE_SINGLE_ACT_LAN_ENABLE; + act |=3D ICE_SINGLE_ACT_LAN_ENABLE; switch (rinfo->sw_act.fltr_act) { case ICE_FWD_TO_VSI: act |=3D (rinfo->sw_act.fwd_id.hw_vsi_id << diff --git a/drivers/net/ice= /ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c index 55a5618a7..8b007b7eb 100644 --- a/drivers/net/ice/ice_switch_filter.c +++ b/drivers/net/ice/ice_switch_filter.c @@ -1129,6 +1129,7 @@ ice_switch_parse_dcf_action(const struct rte_flow_act= ion *actions, } =20 rule_info->sw_act.src =3D rule_info->sw_act.vsi_handle; + rule_info->sw_act.flag =3D ICE_FLTR_RX; rule_info->rx =3D 1; rule_info->priority =3D 5; =20 -- 2.13.6