From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, andrew.gospodarek@broadcom.com,
pavan.chebbi@broadcom.com
Subject: [PATCH net-next 09/13] bnxt_en: Retain user configured filters when closing
Date: Mon, 5 Feb 2024 14:31:58 -0800 [thread overview]
Message-ID: <20240205223202.25341-10-michael.chan@broadcom.com> (raw)
In-Reply-To: <20240205223202.25341-1-michael.chan@broadcom.com>
[-- Attachment #1: Type: text/plain, Size: 1983 bytes --]
From: Pavan Chebbi <pavan.chebbi@broadcom.com>
Driver should not free user created filters from its memory
when closing since we are going to reconfigure them when
we open again. If the "all" parameter is false, do not free
user configured filters in bnxt_free_ntp_fltrs() and
bnxt_free_l2_filters().
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index b5bd88f33028..41e1c6d2c127 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -4883,7 +4883,8 @@ static void bnxt_free_ntp_fltrs(struct bnxt *bp, bool all)
head = &bp->ntp_fltr_hash_tbl[i];
hlist_for_each_entry_safe(fltr, tmp, head, base.hash) {
bnxt_del_l2_filter(bp, fltr->l2_fltr);
- if (!all && (fltr->base.flags & BNXT_ACT_FUNC_DST))
+ if (!all && ((fltr->base.flags & BNXT_ACT_FUNC_DST) ||
+ !list_empty(&fltr->base.list)))
continue;
bnxt_del_fltr(bp, &fltr->base);
}
@@ -4926,7 +4927,8 @@ static void bnxt_free_l2_filters(struct bnxt *bp, bool all)
head = &bp->l2_fltr_hash_tbl[i];
hlist_for_each_entry_safe(fltr, tmp, head, base.hash) {
- if (!all && (fltr->base.flags & BNXT_ACT_FUNC_DST))
+ if (!all && ((fltr->base.flags & BNXT_ACT_FUNC_DST) ||
+ !list_empty(&fltr->base.list)))
continue;
bnxt_del_fltr(bp, &fltr->base);
}
@@ -5851,7 +5853,8 @@ static void bnxt_hwrm_clear_vnic_filter(struct bnxt *bp)
struct bnxt_l2_filter *fltr = vnic->l2_filters[j];
bnxt_hwrm_l2_filter_free(bp, fltr);
- bnxt_del_l2_filter(bp, fltr);
+ if (list_empty(&fltr->base.list))
+ bnxt_del_l2_filter(bp, fltr);
}
vnic->uc_filter_count = 0;
}
--
2.30.1
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
next prev parent reply other threads:[~2024-02-05 22:32 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-05 22:31 [PATCH net-next 00/13] bnxt_en: Ntuple and RSS updates Michael Chan
2024-02-05 22:31 ` [PATCH net-next 01/13] bnxt_en: Use firmware provided maximum filter counts Michael Chan
2024-02-06 6:55 ` Michal Swiatkowski
2024-02-05 22:31 ` [PATCH net-next 02/13] bnxt_en: Add ethtool -N support for ether filters Michael Chan
2024-02-06 7:04 ` Michal Swiatkowski
2024-02-06 8:10 ` Michael Chan
2024-02-06 13:45 ` Michal Swiatkowski
2024-02-05 22:31 ` [PATCH net-next 03/13] bnxt_en: Support ethtool -n to display " Michael Chan
2024-02-06 7:15 ` Michal Swiatkowski
2024-02-05 22:31 ` [PATCH net-next 04/13] bnxt_en: implement fully specified 5-tuple masks Michael Chan
2024-02-06 7:47 ` Michal Swiatkowski
2024-02-05 22:31 ` [PATCH net-next 05/13] bnxt_en: Enhance ethtool ntuple support for ip flows besides TCP/UDP Michael Chan
2024-02-05 22:31 ` [PATCH net-next 06/13] bnxt_en: Add drop action support for ntuple Michael Chan
2024-02-05 22:31 ` [PATCH net-next 07/13] bnxt_en: Add separate function to delete the filter structure Michael Chan
2024-02-05 22:31 ` [PATCH net-next 08/13] bnxt_en: Save user configured filters in a lookup list Michael Chan
2024-02-05 22:31 ` Michael Chan [this message]
2024-02-05 22:31 ` [PATCH net-next 10/13] bnxt_en: Restore all the user created L2 and ntuple filters Michael Chan
2024-02-05 22:32 ` [PATCH net-next 11/13] bnxt_en: Add support for user configured RSS key Michael Chan
2024-02-05 22:32 ` [PATCH net-next 12/13] bnxt_en: Invalidate user filters when needed Michael Chan
2024-02-05 22:32 ` [PATCH net-next 13/13] bnxt_en: Add RSS support for IPSEC headers Michael Chan
2024-02-09 20:50 ` [PATCH net-next 00/13] bnxt_en: Ntuple and RSS updates patchwork-bot+netdevbpf
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=20240205223202.25341-10-michael.chan@broadcom.com \
--to=michael.chan@broadcom.com \
--cc=andrew.gospodarek@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
/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).