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 B71F8A0562; Mon, 30 Mar 2020 12:26:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0BB041C065; Mon, 30 Mar 2020 12:26:21 +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 35A662BEA for ; Mon, 30 Mar 2020 12:26:16 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.61]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id A308960054 for ; Mon, 30 Mar 2020 10:26:15 +0000 (UTC) Received: from us4-mdac16-24.ut7.mdlocal (unknown [10.7.65.250]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id A1D198009E for ; Mon, 30 Mar 2020 10:26:15 +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 30A0280055 for ; Mon, 30 Mar 2020 10:26:15 +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 D57CAB40057 for ; Mon, 30 Mar 2020 10:26:14 +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 02UAQB57030732; 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 CF33E1627D7; Mon, 30 Mar 2020 11:26:11 +0100 (BST) From: Andrew Rybchenko To: CC: Igor Romanov Date: Mon, 30 Mar 2020 11:25:41 +0100 Message-ID: <1585563945-9537-3-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.471400-8.000000-10 X-TMASE-MatchedRID: sEnO3h6fbGrISYXJXW/tDI6MisxJraxHeouvej40T4gd0WOKRkwsh6kR YsmYERbErdoLblq9S5ruFC9g00HQc642liFPoJXkGBtNDqobyCdnAst8At+c3QjNGogFaQEsFsd Ea+rJZgTlk5HQqNZHiWa39PjWf0NNHxPMjOKY7A9uHY1mnovlhEp0ODI8GjvXKrauXd3MZDUmNd GTv36m3txi0+jeLcC8pS96VFzeMj+0Q79BkEeIZn6f6ii8oC6Nj6cQxp/P8SZE6cUGoFLA4Utfv UWucVB/1fB+QhnuUJ8QRuntbv102jigZBQJvBjlD6DuZ3COjrnoW0NkKZgEnVjylogJTbSOQwym txuJ6y0= X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10-2.471400-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1020-25322.003 X-MDID: 1585563975-OIOt_cYkE1Dn Subject: [dpdk-dev] [PATCH 2/6] net/sfc/base: refactor filters mark 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 mark 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 | 34 +++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/drivers/net/sfc/base/ef10_filter.c b/drivers/net/sfc/base/ef10_filter.c index 74d06ecf57..5033ff75ac 100644 --- a/drivers/net/sfc/base/ef10_filter.c +++ b/drivers/net/sfc/base/ef10_filter.c @@ -1782,6 +1782,27 @@ ef10_filter_remove_all_existing_filters( table->eft_encap_filter_count = 0; } +static void +ef10_filter_mark_old_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_set_entry_auto_old(table, + table->eft_unicst_filter_indexes[i]); + } + for (i = 0; i < table->eft_mulcst_filter_count; i++) { + ef10_filter_set_entry_auto_old(table, + table->eft_mulcst_filter_indexes[i]); + } + for (i = 0; i < table->eft_encap_filter_count; i++) { + ef10_filter_set_entry_auto_old(table, + table->eft_encap_filter_indexes[i]); + } +} + /* * Reconfigure all filters. * If all_unicst and/or all mulcst filters cannot be applied then @@ -1824,18 +1845,7 @@ ef10_filter_reconfigure( filter_flags = 0; /* Mark old filters which may need to be removed */ - for (i = 0; i < table->eft_unicst_filter_count; i++) { - ef10_filter_set_entry_auto_old(table, - table->eft_unicst_filter_indexes[i]); - } - for (i = 0; i < table->eft_mulcst_filter_count; i++) { - ef10_filter_set_entry_auto_old(table, - table->eft_mulcst_filter_indexes[i]); - } - for (i = 0; i < table->eft_encap_filter_count; i++) { - ef10_filter_set_entry_auto_old(table, - table->eft_encap_filter_indexes[i]); - } + ef10_filter_mark_old_filters(enp); /* * Insert or renew unicast filters. -- 2.17.1