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 0B0FEA0577; Tue, 7 Apr 2020 02:21:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8F1222BE9; Tue, 7 Apr 2020 02:21:38 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id AE8AD2B96; Tue, 7 Apr 2020 02:21:36 +0200 (CEST) IronPort-SDR: wxMZZH5gVUugfuWBPx8QoVxzLKJbeMQ2caFXQTagLmoi1CgdQ2TdSfzYb57qw6mze8Cg8vIC19 OTyitjABhdaQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2020 17:21:35 -0700 IronPort-SDR: MVR9Ls/087OAYwaV0Au/OViGRP/ketFLUIrb/+fftC98CUipiYiYpVgvMZ1X25YOQFPvpbVas2 zw1ZuyLl4lJw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,352,1580803200"; d="scan'208";a="451026799" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by fmsmga005.fm.intel.com with ESMTP; 06 Apr 2020 17:21:34 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: xiaolong.ye@intel.com, dev@dpdk.org, Qi Zhang , stable@dpdk.org Date: Tue, 7 Apr 2020 08:25:23 +0800 Message-Id: <20200407002523.37881-1-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-dev] [PATCH] net/ice/base: remove unnecessary code 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" Update a switch rule' action from "to VSI" to "to VSI List" should only happen when the same rule has been programmed with a different fwd destination. This is already handled by below code block: m_entry = ice_find_adv_rule_entry(...) if (m_entry) { ... ice_adv_add_update_vsi_list(...) } The following ice_update_pkt_fwd_rule is unnecessary and should be removed due to: 1) If a switch rule's action is still to VSI, which means, it is the first time be issued, we don't need to update it "to VSI List." 2) Actually the implementation does not match the comment, it still update the rule with "to VSI" action. Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe") Cc: stable@dpdk.org Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_switch.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index b5aa5abd9..07f8efd65 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -6695,24 +6695,8 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, sw->recp_list[rid].adv_rule = true; rule_head = &sw->recp_list[rid].filt_rules; - if (rinfo->sw_act.fltr_act == ICE_FWD_TO_VSI) { - struct ice_fltr_info tmp_fltr; - - ice_memset(&tmp_fltr, 0, sizeof(tmp_fltr), ICE_NONDMA_MEM); - tmp_fltr.fltr_rule_id = - LE16_TO_CPU(s_rule->pdata.lkup_tx_rx.index); - tmp_fltr.fltr_act = ICE_FWD_TO_VSI; - tmp_fltr.fwd_id.hw_vsi_id = - ice_get_hw_vsi_num(hw, vsi_handle); - tmp_fltr.vsi_handle = vsi_handle; - /* Update the previous switch rule of "forward to VSI" to - * "fwd to VSI list" - */ - status = ice_update_pkt_fwd_rule(hw, &tmp_fltr); - if (status) - goto err_ice_add_adv_rule; + if (rinfo->sw_act.fltr_act == ICE_FWD_TO_VSI) adv_fltr->vsi_count = 1; - } /* Add rule entry to book keeping list */ LIST_ADD(&adv_fltr->list_entry, rule_head); -- 2.13.6