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 CD85CA0562; Mon, 30 Mar 2020 12:27:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CE33D1C0B8; Mon, 30 Mar 2020 12:26:26 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id F3B6C1C031 for ; Mon, 30 Mar 2020 12:26:17 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.62]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 6892E6006F for ; Mon, 30 Mar 2020 10:26:17 +0000 (UTC) Received: from us4-mdac16-11.ut7.mdlocal (unknown [10.7.65.208]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 650DE8009B for ; Mon, 30 Mar 2020 10:26:17 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.7.66.37]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id E229A280050 for ; Mon, 30 Mar 2020 10:26:16 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 94D1AB40057 for ; Mon, 30 Mar 2020 10:26:16 +0000 (UTC) Received: from ukex01.SolarFlarecom.com (10.17.10.4) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 30 Mar 2020 11:26:11 +0100 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 30 Mar 2020 11:26:11 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 02UAQBNe030727; Mon, 30 Mar 2020 11:26:11 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id C2F6E16139D; Mon, 30 Mar 2020 11:26:11 +0100 (BST) From: Andrew Rybchenko To: CC: Igor Romanov Date: Mon, 30 Mar 2020 11:25:40 +0100 Message-ID: <1585563945-9537-2-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1585563945-9537-1-git-send-email-arybchenko@solarflare.com> References: <1585563945-9537-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1020-25322.003 X-TM-AS-Result: No-2.878600-8.000000-10 X-TMASE-MatchedRID: jpL0RKAWQXxhNdhmbyNY5Y6MisxJraxHeouvej40T4gd0WOKRkwsh6kR YsmYERbErdoLblq9S5ra/g/NGTW3Mo8iv1am7RhcttAWxuM5sl69GztfiloZvCS30GKAkBxWYlY WejBrHK448AlHZUML32jyDf2yYP7u931rzwI1kxCeAiCmPx4NwJuJ+Pb8n/VxSnQ4MjwaO9cqtq 5d3cxkNfdgfYxnyqoAE7btNKuBhuDiYedk3lfznx+2v6jOXtiNUfqbxqxnurcFN2qEvxPGF0/hB 8VBOZdUZiQN9dVhg3Ymj+X9f9XlrjH1izdgpyB8OKBkFAm8GOUPoO5ncI6OuehbQ2QpmASdbcuA 3Id6O6JDDKa3G4nrLQ== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--2.878600-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1020-25322.003 X-MDID: 1585563977-vW7_J-Urnfg6 Subject: [dpdk-dev] [PATCH 1/6] net/sfc/base: refactor filters cleanup in reconfigure 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" From: Igor Romanov Refactor the filters cleanup stage of the reconfigure function to make it clearer and allow for more convenient further changes. Signed-off-by: Igor Romanov Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/base/ef10_filter.c | 44 ++++++++++++++++++------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/drivers/net/sfc/base/ef10_filter.c b/drivers/net/sfc/base/ef10_filter.c index 12802a3d13..74d06ecf57 100644 --- a/drivers/net/sfc/base/ef10_filter.c +++ b/drivers/net/sfc/base/ef10_filter.c @@ -1756,6 +1756,31 @@ ef10_filter_get_workarounds( } +static void +ef10_filter_remove_all_existing_filters( + __in efx_nic_t *enp) +{ + ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; + unsigned int i; + + for (i = 0; i < table->eft_unicst_filter_count; i++) { + ef10_filter_delete_auto(enp, + table->eft_unicst_filter_indexes[i]); + } + table->eft_unicst_filter_count = 0; + + for (i = 0; i < table->eft_mulcst_filter_count; i++) { + ef10_filter_delete_auto(enp, + table->eft_mulcst_filter_indexes[i]); + } + table->eft_mulcst_filter_count = 0; + + for (i = 0; i < table->eft_encap_filter_count; i++) { + ef10_filter_delete_auto(enp, + table->eft_encap_filter_indexes[i]); + } + table->eft_encap_filter_count = 0; +} /* * Reconfigure all filters. @@ -1789,24 +1814,7 @@ ef10_filter_reconfigure( * filters must be removed (ignore errors in case the MC * has rebooted, which removes hardware filters). */ - for (i = 0; i < table->eft_unicst_filter_count; i++) { - ef10_filter_delete_auto(enp, - table->eft_unicst_filter_indexes[i]); - } - table->eft_unicst_filter_count = 0; - - for (i = 0; i < table->eft_mulcst_filter_count; i++) { - ef10_filter_delete_auto(enp, - table->eft_mulcst_filter_indexes[i]); - } - table->eft_mulcst_filter_count = 0; - - for (i = 0; i < table->eft_encap_filter_count; i++) { - ef10_filter_delete_auto(enp, - table->eft_encap_filter_indexes[i]); - } - table->eft_encap_filter_count = 0; - + ef10_filter_remove_all_existing_filters(enp); return (0); } -- 2.17.1