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 2D0B0A00BE; Wed, 29 Apr 2020 09:53:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CFBF31D951; Wed, 29 Apr 2020 09:53:24 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 4E26A1D94D for ; Wed, 29 Apr 2020 09:53:22 +0200 (CEST) IronPort-SDR: 9n+gZPteRB9UHT49E7i7I+P5Hffi3sRKAPTGwB/hC9Z8W6JoE0mTF4pM2n4kivkmnYdnSuQLgH CvO8xuMfnKpA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 00:53:21 -0700 IronPort-SDR: PObkLvsSdE4NyRI0Uj/rvALO+tUo+mePQlu+z9d1gD/NmsUSyjas2vgXQHMd8ycANQRd6PHP1m uzbXwPl+qOug== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,330,1583222400"; d="scan'208";a="459096360" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.116.183]) by fmsmga005.fm.intel.com with ESMTP; 29 Apr 2020 00:53:17 -0700 Date: Wed, 29 Apr 2020 15:45:59 +0800 From: Ye Xiaolong To: Qi Zhang Cc: qiming.yang@intel.com, dev@dpdk.org Message-ID: <20200429074559.GG6502@intel.com> References: <20200423130704.37332-1-qi.z.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200423130704.37332-1-qi.z.zhang@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v2] 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" On 04/23, Qi Zhang wrote: >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") Cc: stable@dpdk.org > >Signed-off-by: Qi Zhang >--- >v2: >- fix a bug > > drivers/net/ice/base/ice_switch.c | 11 ++++++++++- > drivers/net/ice/ice_switch_filter.c | 1 + > 2 files changed, 11 insertions(+), 1 deletion(-) > >diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c >index fd2cf101a..0970ffdd0 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, struct ice_fltr_info *fi) > { > fi->lb_en = false; > fi->lan_en = false; >+ >+ if ((fi->flag & ICE_FLTR_RX) && >+ (fi->fltr_act == ICE_FWD_TO_VSI || >+ fi->fltr_act == ICE_FWD_TO_VSI_LIST) && >+ fi->lkup_type == ICE_SW_LKUP_LAST) >+ fi->lan_en = true; >+ > if ((fi->flag & ICE_FLTR_TX) && > (fi->fltr_act == ICE_FWD_TO_VSI || > fi->fltr_act == ICE_FWD_TO_VSI_LIST || >@@ -6453,6 +6460,7 @@ ice_adv_add_update_vsi_list(struct ice_hw *hw, > return status; > > ice_memset(&tmp_fltr, 0, sizeof(tmp_fltr), ICE_NONDMA_MEM); >+ tmp_fltr.flag = m_entry->rule_info.sw_act.flag; > tmp_fltr.fltr_rule_id = cur_fltr->fltr_rule_id; > tmp_fltr.fltr_act = ICE_FWD_TO_VSI_LIST; > tmp_fltr.fwd_id.vsi_list_id = vsi_list_id; >@@ -6615,7 +6623,7 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, > s_rule = (struct ice_aqc_sw_rules_elem *)ice_malloc(hw, rule_buf_sz); > if (!s_rule) > return ICE_ERR_NO_MEMORY; >- act |= ICE_SINGLE_ACT_LB_ENABLE | ICE_SINGLE_ACT_LAN_ENABLE; >+ act |= ICE_SINGLE_ACT_LAN_ENABLE; > switch (rinfo->sw_act.fltr_act) { > case ICE_FWD_TO_VSI: > act |= (rinfo->sw_act.fwd_id.hw_vsi_id << >@@ -6780,6 +6788,7 @@ ice_adv_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle, > return status; > > ice_memset(&tmp_fltr, 0, sizeof(tmp_fltr), ICE_NONDMA_MEM); >+ tmp_fltr.flag = fm_list->rule_info.sw_act.flag; > tmp_fltr.fltr_rule_id = fm_list->rule_info.fltr_rule_id; > fm_list->rule_info.sw_act.fltr_act = ICE_FWD_TO_VSI; > tmp_fltr.fltr_act = ICE_FWD_TO_VSI; >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_action *actions, > } > > rule_info->sw_act.src = rule_info->sw_act.vsi_handle; >+ rule_info->sw_act.flag = ICE_FLTR_RX; > rule_info->rx = 1; > rule_info->priority = 5; > >-- >2.13.6 > Applied to dpdk-next-net-intel with qiming's ack, Thanks.