From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Cc: Igor Romanov <igor.romanov@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH 1/6] net/sfc/base: refactor filters cleanup in reconfigure
Date: Mon, 30 Mar 2020 11:25:40 +0100 [thread overview]
Message-ID: <1585563945-9537-2-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1585563945-9537-1-git-send-email-arybchenko@solarflare.com>
From: Igor Romanov <igor.romanov@oktetlabs.ru>
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 <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
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
next prev parent reply other threads:[~2020-03-30 10:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-30 10:25 [dpdk-dev] [PATCH 0/6] net/sfc: improve Rx mode handling on VF Andrew Rybchenko
2020-03-30 10:25 ` Andrew Rybchenko [this message]
2020-03-30 10:25 ` [dpdk-dev] [PATCH 2/6] net/sfc/base: refactor filters mark in reconfigure Andrew Rybchenko
2020-03-30 10:25 ` [dpdk-dev] [PATCH 3/6] net/sfc/base: refactor unicast filters reconfiguration Andrew Rybchenko
2020-03-30 10:25 ` [dpdk-dev] [PATCH 4/6] net/sfc/base: refactor mcast " Andrew Rybchenko
2020-03-30 10:25 ` [dpdk-dev] [PATCH 5/6] net/sfc/base: add API to get currently operating filters Andrew Rybchenko
2020-03-30 10:25 ` [dpdk-dev] [PATCH 6/6] net/sfc: check actual all multicast unknown unicast filters Andrew Rybchenko
2020-04-02 9:37 ` [dpdk-dev] [PATCH 0/6] net/sfc: improve Rx mode handling on VF Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1585563945-9537-2-git-send-email-arybchenko@solarflare.com \
--to=arybchenko@solarflare.com \
--cc=dev@dpdk.org \
--cc=igor.romanov@oktetlabs.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).