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 35377A00C2; Thu, 23 Apr 2020 04:58:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A41BD1D441; Thu, 23 Apr 2020 04:58:10 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id E37721D40D for ; Thu, 23 Apr 2020 04:58:09 +0200 (CEST) IronPort-SDR: FJ2U4ogciC7L4G91QLRqMopkJUZQ7MhYUFnoz1pJWUqeZ+Q79iYO+FEQmhL7G2utRQohZ31DCq XxP5qGMxtIpw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Apr 2020 19:58:08 -0700 IronPort-SDR: VKlZ4celkxYrgvPn8IeWXKTr9ikcAqwDMf78y9+Q5h8IKOPQoP2n6yQ5oeS5yOOexPpa7xWbLJ HQQtodWZz72w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,305,1583222400"; d="scan'208";a="365873721" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by fmsmga001.fm.intel.com with ESMTP; 22 Apr 2020 19:58:07 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: xiaolong.ye@intel.com, dev@dpdk.org, Qi Zhang Date: Thu, 23 Apr 2020 11:01:59 +0800 Message-Id: <20200423030159.8655-1-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-dev] [PATCH] net/ice/base: fix DCF switch rule on Tx path 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" 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 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index fd2cf101a..2d595cb8e 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 || @@ -6615,7 +6622,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 << -- 2.13.6