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 53B47A00C4; Thu, 4 Jun 2020 20:40:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 37E621D5DA; Thu, 4 Jun 2020 20:40:48 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id EEAE51C19E for ; Wed, 3 Jun 2020 04:47:51 +0200 (CEST) IronPort-SDR: YXWPoFtNjdDf/2jaaMCNdLmhxDeFUg6Aa/HcVsplPIMEde3QozLTFPrIEe3UeuR8xD0c3SHxjc KVPnyurDyFTw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2020 19:47:50 -0700 IronPort-SDR: 48KYCJ8XpT3JzqAXHw/CgWz162/+4K4JU7v6rBevnJCS8kvnczS8RkBvIgBaR30qT980SFqha2 thYTle5UbYsg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,466,1583222400"; d="scan'208";a="377955388" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga001.fm.intel.com with ESMTP; 02 Jun 2020 19:47:50 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 2 Jun 2020 19:47:50 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 2 Jun 2020 19:47:49 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.53) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 2 Jun 2020 19:47:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JRyGWFefI3gcc5ErfoOOe/oTQd3HgTyL2ca69hBTUejQl6mW2njJ7lAzuHwZheV3ICqhJdJA+aOEqMBiW/Jh6Sn9zdprwJcPOoX3xQl2WjNeQwVBeDbeWL05+8lSeZKej/X4rZwBv3AYvLhn0ne9HNQRXMEXPE+5tJwZBzT+rXqNGAWc+OTs2775KtBNhzusDta/7ygU3Zj/pYCr2Flm53aCP+K9ZB+YwqbiQVjL8rOqM/lxFRZX5QfB9iR3RqPNkVTUi5eJYbcV5nj5iClBgrbLXQSyUlmTQJ5IB128/+GfSa3s40ZAIhpwnfaFVafCv+rHIqDDEwGBSvk9LGZCag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vq9ZJqYmr2aQXIYXT97I4mSE7USxdHgv0t0XQbUIZhU=; b=DSEgkOYJZwcq2QUxMVKj/VyjxKAbaeaWOxBz4hZL9uR5e5DcqC63KfzighZica+xlOiUzgJZd1e9pPgJbVU6BWhM9wS6cueKW4PjSRFdowN67Gv5qHqRqfKDutszSgAGx8u8vXsJfSdAyzB02b+zmkJIgRxJef003dV9pxwhOYjxVyFzeovtftxSHRNysyU/wM7BhRsJIjBEmd0lWehV2ytisIrU01JWL/P1lS02IcsgJlRF+Uuc+CY1Vua9S8OwJ1OcvPpuW+wzydYoKH1wZgLydyO0hi4a8tgFuS2AalCpH2L3jGRaEDEyNCl8M/fHVleek4CweXSo4Xks+AGqrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vq9ZJqYmr2aQXIYXT97I4mSE7USxdHgv0t0XQbUIZhU=; b=Tifu8n6EfmnJDaNcCuBqhqTFmxNjq9qdHw7rXmZXmLPEJFWH6WAQLENv5CdZZu+CXzbW6C4Sd7LgQiXHaV/BoYyhcd/yBzlxWNXSLBmMv1h0AjumiMhMuGmWEiiE7M5rF/3Y0c8AOVqNZwuSIoJ2CGUjfuRwke4vNgqL6sEoFdw= Received: from SN6PR11MB2847.namprd11.prod.outlook.com (2603:10b6:805:55::31) by SN6PR11MB2862.namprd11.prod.outlook.com (2603:10b6:805:5b::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.21; Wed, 3 Jun 2020 02:47:47 +0000 Received: from SN6PR11MB2847.namprd11.prod.outlook.com ([fe80::d89d:a96a:98c8:5acb]) by SN6PR11MB2847.namprd11.prod.outlook.com ([fe80::d89d:a96a:98c8:5acb%3]) with mapi id 15.20.3045.022; Wed, 3 Jun 2020 02:47:47 +0000 From: "Patil, Kiran" To: "Zhang, Qi Z" , "Yang, Qiming" CC: "dev@dpdk.org" , "Ye, Xiaolong" , "Stillwell Jr, Paul M" Thread-Topic: [PATCH 31/52] net/ice/base: reset flags when all rules are deleted Thread-Index: AQHWOU/uJGte48uYEEi8rQuzOqQ1RajGMApA Date: Wed, 3 Jun 2020 02:47:46 +0000 Message-ID: References: <20200603024016.30636-1-qi.z.zhang@intel.com> <20200603024016.30636-32-qi.z.zhang@intel.com> In-Reply-To: <20200603024016.30636-32-qi.z.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [134.134.136.222] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f1aa16fe-5022-4184-5e38-08d807687f98 x-ms-traffictypediagnostic: SN6PR11MB2862: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1051; x-forefront-prvs: 04238CD941 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vExsudCwmHQWUk4x7W0E+4cku+rg1ilvhsiW/lOQ8+70fSfd0/CtgYsmfJiQuPb77cVBIeKC5/DcpU/ksp/vgqgCUhrVzlhEpnHOWJbXCGA+Ws2mPKRSgdKd6QKoKdGuCsKaDRHz/kBVylJVqgmAmzZ4OCgxKfRNWEhgHX9GG6xI+q1jdEhS1kvJI/I8nV3Y6gGxZUWfUXzH3amPFjuEC8u4YvsFyY8p+vcRlCq9Vm9npMjNjEblGiurXto2cEQBFVzScG6w2qNNoXr2YgEIHUfkKRMKwq/g/Xp4RQE8dx4b+TigiIMwUe93EEbdiIyk x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2847.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(366004)(136003)(376002)(39860400002)(346002)(396003)(33656002)(9686003)(83380400001)(55016002)(52536014)(6636002)(8936002)(86362001)(478600001)(4326008)(107886003)(26005)(110136005)(2906002)(66556008)(53546011)(66946007)(66476007)(186003)(64756008)(6506007)(7696005)(316002)(8676002)(5660300002)(71200400001)(66446008)(54906003)(76116006); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: dowEp8Dsd/rsdjB47JRvC5vN8YFtD/klFbhsRTde7Y9T9e+w8ZnSJqsHb8tyNtP57eb/OZtmkBalm439sOxjM/EJt6XhCWk02n3mhnGc9VJGT31CXgjRVYlW88uxOuH7nyoEQBHWtnZKXggzm+CeeV1i62sVXegyDbzyunJwgL6vfIsgPh4VuWjtOs5dFw+Mzm7YsUdfShkwZZY8THmUIAHH9wybc8r11RpRb66g6Pql5HDwjJMyBYKwbs3X2/NESybIReGTXFnT11AId6yEu1feFgJ4aHO5Mxdtfz2BN7nXF9o2daKU/0zjGT/9QehCvZfgjVXqHmrTpSFLfm48/ZT/Lzl6KHdpqQuL7l0+qM4XJ4dVHW2Pe5bY9ipf0hQPVtvW7KEY0zOcGZABnp+sAS2QVTUN6YWYQ5w221E42Y0qLn7+HYOXFvyTEy3fVp5yATVA72TnJRJOitaZlMsAQqdWCXwD0FBs92soAkSsAJU9T8IccXv8mV9HzflV7fPI Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f1aa16fe-5022-4184-5e38-08d807687f98 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2020 02:47:46.9881 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rBOmMQC0hZtEK5oVkwBS9MIrQoTk8Dh3rg3ekefXtUfp5LUhyPmlhcQMQ8DMnyJBZU2EegWc/bg9QjiF23GYMQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2862 X-OriginatorOrg: intel.com X-Mailman-Approved-At: Thu, 04 Jun 2020 20:40:47 +0200 Subject: Re: [dpdk-dev] [PATCH 31/52] net/ice/base: reset flags when all rules are deleted 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" ACK -----Original Message----- From: Zhang, Qi Z =20 Sent: Tuesday, June 2, 2020 7:40 PM To: Yang, Qiming Cc: dev@dpdk.org; Ye, Xiaolong ; Zhang, Qi Z ; Patil, Kiran ; Stillwell Jr, Paul M= Subject: [PATCH 31/52] net/ice/base: reset flags when all rules are deleted To avoid having stale information about "adv_rule" per recipe, when all rul= es associated to a given recipe are deleted, reset the "adv_rule" flag otherwise it causes problem later on when decisions about filter rules= being present or not are made based on "adv_rule" flag. Removed setting "adv_rule =3D 1" when recipe is created. It is set correctl= y when advanced switch rule is added referring to the recipe which was crea= ted as a result of adding advanced switch rule. Signed-off-by: Kiran Patil Signed-off-by: Paul M. Stillwell Jr Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_switch.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_s= witch.c index 94268d560..f379a5f5d 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -4122,6 +4122,9 @@ void ice_rem_all_sw_rules_info(struct ice_hw *hw) ice_rem_sw_rule_info(hw, rule_head); else ice_rem_adv_rule_info(hw, rule_head); + if (sw->recp_list[i].adv_rule && + LIST_EMPTY(&sw->recp_list[i].filt_rules)) + sw->recp_list[i].adv_rule =3D false; } } =20 @@ -6130,7 +6133,6 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_re= cipe *rm, recp->n_grp_count =3D rm->n_grp_count; recp->tun_type =3D rm->tun_type; recp->recp_created =3D true; - recp->adv_rule =3D 1; } rm->root_buf =3D buf; ice_free(hw, tmp); @@ -7611,11 +7613,15 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_= lkup_elem *lkups, rule_buf_sz, 1, ice_aqc_opc_remove_sw_rules, NULL); if (status =3D=3D ICE_SUCCESS || status =3D=3D ICE_ERR_DOES_NOT_EXIST) { + struct ice_switch_info *sw =3D hw->switch_info; + ice_acquire_lock(rule_lock); LIST_DEL(&list_elem->list_entry); ice_free(hw, list_elem->lkups); ice_free(hw, list_elem); ice_release_lock(rule_lock); + if (LIST_EMPTY(&sw->recp_list[rid].filt_rules)) + sw->recp_list[rid].adv_rule =3D false; } ice_free(hw, s_rule); } -- 2.13.6