From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 6B418A0471 for ; Wed, 19 Jun 2019 18:03:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6C10D1CDF1; Wed, 19 Jun 2019 17:22:51 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 8FC821C553 for ; Wed, 19 Jun 2019 17:21:36 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2019 08:21:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,392,1557212400"; d="scan'208";a="165050594" Received: from lrong-srv-03.sh.intel.com ([10.67.119.177]) by orsmga006.jf.intel.com with ESMTP; 19 Jun 2019 08:21:35 -0700 From: Leyi Rong To: qi.z.zhang@intel.com Cc: dev@dpdk.org, Leyi Rong , Dan Nowlin , Paul M Stillwell Jr Date: Wed, 19 Jun 2019 23:18:41 +0800 Message-Id: <20190619151846.113820-65-leyi.rong@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190619151846.113820-1-leyi.rong@intel.com> References: <20190611155221.2703-1-leyi.rong@intel.com> <20190619151846.113820-1-leyi.rong@intel.com> Subject: [dpdk-dev] [PATCH v3 64/69] net/ice/base: fix for chained recipe switch ID index 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" For chained recipe entry, the field vector index used to match switch ID should always be zero. Add ICE_AQ_SW_ID_LKUP_IDX define to indicate the FV index used to extract the switch ID. Fixes: dca90ed479cf ("net/ice/base: programming a new switch recipe") Signed-off-by: Dan Nowlin Signed-off-by: Paul M Stillwell Jr Signed-off-by: Leyi Rong --- drivers/net/ice/base/ice_adminq_cmd.h | 1 + drivers/net/ice/base/ice_switch.c | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h index 1fdd612a1..8b8ed7a73 100644 --- a/drivers/net/ice/base/ice_adminq_cmd.h +++ b/drivers/net/ice/base/ice_adminq_cmd.h @@ -711,6 +711,7 @@ struct ice_aqc_recipe_content { #define ICE_AQ_RECIPE_ID_S 0 #define ICE_AQ_RECIPE_ID_M (0x3F << ICE_AQ_RECIPE_ID_S) #define ICE_AQ_RECIPE_ID_IS_ROOT BIT(7) +#define ICE_AQ_SW_ID_LKUP_IDX 0 u8 lkup_indx[5]; #define ICE_AQ_RECIPE_LKUP_DATA_S 0 #define ICE_AQ_RECIPE_LKUP_DATA_M (0x3F << ICE_AQ_RECIPE_LKUP_DATA_S) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 7f4edd274..660d491ed 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -4737,8 +4737,8 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm, sizeof(buf[recps].content.lkup_indx), ICE_NONDMA_MEM); - /* All recipes use look-up field index 0 to match switch ID. */ - buf[recps].content.lkup_indx[0] = 0; + /* All recipes use look-up index 0 to match switch ID. */ + buf[recps].content.lkup_indx[0] = ICE_AQ_SW_ID_LKUP_IDX; buf[recps].content.mask[0] = CPU_TO_LE16(ICE_AQ_SW_ID_LKUP_MASK); /* Setup lkup_indx 1..4 to INVALID/ignore and set the mask @@ -4804,7 +4804,7 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm, buf[0].content.act_ctrl_fwd_priority = rm->priority; } else { struct ice_recp_grp_entry *last_chain_entry; - u16 rid, i = 0; + u16 rid, i; /* Allocate the last recipe that will chain the outcomes of the * other recipes together @@ -4829,8 +4829,9 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm, ice_memset(&buf[recps].content.lkup_indx, 0, sizeof(buf[recps].content.lkup_indx), ICE_NONDMA_MEM); - buf[recps].content.lkup_indx[i] = hw->port_info->sw_id; - buf[recps].content.mask[i] = + /* All recipes use look-up index 0 to match switch ID. */ + buf[recps].content.lkup_indx[0] = ICE_AQ_SW_ID_LKUP_IDX; + buf[recps].content.mask[0] = CPU_TO_LE16(ICE_AQ_SW_ID_LKUP_MASK); for (i = 1; i <= ICE_NUM_WORDS_RECIPE; i++) { buf[recps].content.lkup_indx[i] = -- 2.17.1