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 645CFA2EEB for ; Sun, 6 Oct 2019 05:12:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2A9161D177; Sun, 6 Oct 2019 05:11:35 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 436CF1D161 for ; Sun, 6 Oct 2019 05:11:30 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Oct 2019 20:11:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,261,1566889200"; d="scan'208";a="183095237" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by orsmga007.jf.intel.com with ESMTP; 05 Oct 2019 20:11:28 -0700 From: Qi Zhang To: wenzhuo.lu@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, xiaolong.ye@intel.com, Qi Zhang , Paul M Stillwell Jr Date: Sun, 6 Oct 2019 11:14:04 +0800 Message-Id: <20191006031408.8633-9-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20191006031408.8633-1-qi.z.zhang@intel.com> References: <20190902035551.16852-1-qi.z.zhang@intel.com> <20191006031408.8633-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH v2 08/12] net/ice/base: fix unexpected switch rule overwrite 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" A switch rule with "drop" action will be overwritten by a rule with same pattern match but with a "to queue" action. While in an inversed flow creation sequence, the "to queue" can't be overwritten by the "drop" rule. The inconsistent behavior is not expected, the patch fix the issue by preventing rule overwrite in both cases. Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe") Signed-off-by: Qi Zhang Signed-off-by: Paul M Stillwell Jr Acked-by: Qiming Yang --- drivers/net/ice/base/ice_switch.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 334f1b5e0..2c02021b1 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -5977,13 +5977,10 @@ ice_adv_add_update_vsi_list(struct ice_hw *hw, u16 vsi_list_id = 0; if (cur_fltr->sw_act.fltr_act == ICE_FWD_TO_Q || - cur_fltr->sw_act.fltr_act == ICE_FWD_TO_QGRP) + cur_fltr->sw_act.fltr_act == ICE_FWD_TO_QGRP || + cur_fltr->sw_act.fltr_act == ICE_DROP_PACKET) return ICE_ERR_NOT_IMPL; - if (cur_fltr->sw_act.fltr_act == ICE_DROP_PACKET && - new_fltr->sw_act.fltr_act == ICE_DROP_PACKET) - return ICE_ERR_ALREADY_EXISTS; - if ((new_fltr->sw_act.fltr_act == ICE_FWD_TO_Q || new_fltr->sw_act.fltr_act == ICE_FWD_TO_QGRP) && (cur_fltr->sw_act.fltr_act == ICE_FWD_TO_VSI || -- 2.13.6