From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E2586A00C3; Mon, 15 Aug 2022 01:06:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 447E9427F4; Mon, 15 Aug 2022 01:04:11 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 98ED642C50 for ; Mon, 15 Aug 2022 01:04:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660518248; x=1692054248; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Pk3w/DpmPB3tHVl+Ga8GprcPTEPWkOCjFAGoyjHv80s=; b=CO5Kq2RdAzQvcypwdEWqVhxifAIevKIjyavPp+0FDmQxBeOn5UAun9z2 eYm8JU/D4tmzJME/ECguCpuTjgxPIOQQ2b+PSOhZIVVAx+MaUKBrlQSCQ g3yeK1esJoIBiRf32dyVHvny5vqur01IY3okr/XMMJ/t9pYtuhGhVzA71 ECZg9Im64LIny2Hk5FJIrKYCWFO7xFQv7Hy79a06W0FunG8KMZOnz1FUU 4JjD95QnSWUjHGScr5WFEbHd+c0gqh9tXYn5bg4ksF0H1QgFuQj9CB+vr J4ndRkbZoP7muRcXQz4ZqlhwGJuC5iA9aq8bFqkOmI7OgYnppb5PDQdUx Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10439"; a="289427614" X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="289427614" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 16:04:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="934296744" Received: from dpdk-qzhan15-test02.sh.intel.com ([10.67.115.4]) by fmsmga005.fm.intel.com with ESMTP; 14 Aug 2022 16:04:06 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: dev@dpdk.org, Qi Zhang , dpdk@stable.org, Grzegorz Nitka Subject: [PATCH 36/70] net/ice/base: ice-shared: fix add mac rule Date: Mon, 15 Aug 2022 03:12:32 -0400 Message-Id: <20220815071306.2910599-37-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220815071306.2910599-1-qi.z.zhang@intel.com> References: <20220815071306.2910599-1-qi.z.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Fix ice_add_mac_rule function by not overriding action value with vsi id. It's possible to add MAC based switch filters with action other than FWD_TO_VSI. In current implementation fwd_id member of filter config structure was always overwritten with hw vsi index, regardless of action type. Fix it, by setting hw vsi index only for FWD_TO_VSI action filter and leave it as it is in case of other actions. Fixes: 3ee1b0159ee5 ("net/ice/base: support adding MAC rules on specific port") Cc: dpdk@stable.org Signed-off-by: Grzegorz Nitka Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_switch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 124b4fad1b..edcfa89bcb 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -4858,7 +4858,8 @@ ice_add_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list, if (!ice_is_vsi_valid(hw, vsi_handle)) return ICE_ERR_PARAM; hw_vsi_id = ice_get_hw_vsi_num(hw, vsi_handle); - m_list_itr->fltr_info.fwd_id.hw_vsi_id = hw_vsi_id; + if (m_list_itr->fltr_info.fltr_act == ICE_FWD_TO_VSI) + m_list_itr->fltr_info.fwd_id.hw_vsi_id = hw_vsi_id; /* update the src in case it is VSI num */ if (m_list_itr->fltr_info.src_id != ICE_SRC_ID_VSI) return ICE_ERR_PARAM; -- 2.31.1