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 CF115A00C3; Mon, 15 Aug 2022 01:25:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E361442C80; Mon, 15 Aug 2022 01:23:18 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 83ADC42BC0; Mon, 15 Aug 2022 01:23:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660519396; x=1692055396; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iV7UV4Vr/CwFSMZsJk/dJSbnkhc5E4RM5q931Q9yTZ8=; b=YueqwwyvJy5W4bmcDYtJYgP+t22fDEzjv4FUvWuBUElXJeeXbParmy4/ 25IPDCQedqaOoXKrIN+/vKcYQALPX9ZHsE3jROUKBGCFmbZDjk3YJ6nIa qzXgrHZlCTbzStlWHy5D1zibIxMUVoMY/xF3Mdd1KEo85t3yLtrPUowvL 91LkBxtRhRb2rDCDC9+Xx9y4t7o4xRRem9K/jWZOQO3q+6g4sbc+6EPdH R7hfUOK4MzJiqYzvYy/pM7paPoj9mJKJICcf+l7hiI8Pxkmq8dfmAYxjR g6+QeoaTubhR4V4n2f4E44w8N2BGgb07cB2X9jTbg9t1UQJxrYTszbtYw g==; X-IronPort-AV: E=McAfee;i="6400,9594,10439"; a="291857978" X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="291857978" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 16:23:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="635283192" Received: from dpdk-qzhan15-test02.sh.intel.com ([10.67.115.4]) by orsmga008.jf.intel.com with ESMTP; 14 Aug 2022 16:23:14 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: dev@dpdk.org, Qi Zhang , stable@dpdk.org, Grzegorz Nitka Subject: [PATCH v2 36/70] net/ice/base: fix add mac rule Date: Mon, 15 Aug 2022 03:31:32 -0400 Message-Id: <20220815073206.2917968-37-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220815073206.2917968-1-qi.z.zhang@intel.com> References: <20220815071306.2910599-1-qi.z.zhang@intel.com> <20220815073206.2917968-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: stable@dpdk.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