DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Novikov <naa@amicon.ru>
To: <bruce.richardson@intel.com>
Cc: <dev@dpdk.org>, <lvc-project@linuxtesting.org>, <naa@amicon.ru>,
	<rrv@amicon.ru>, <beilei.xing@intel.com>, <stable@dpdk.org>
Subject: [PATCH] net/i40e: fix ethertype filter restore diagnostics
Date: Mon, 14 Sep 2026 13:08:22 +0300	[thread overview]
Message-ID: <20260914100823.55165-1-naa@amicon.ru> (raw)

The control packet filter command only fills its statistics output on
success. The restore path logs the last output even when the command
fails, and reads uninitialized statistics when the filter list is empty.
It also ignores the command status.

Check each restore result and log failures with the affected filter.
Only report statistics after a successful command, when all fields are
valid. Continue restoring the remaining filters after an error, preserving
the existing best-effort restore policy.

Fixes: ddcd4d4dbbe0 ("net/i40e: restore ethertype filter")
Cc: stable@dpdk.org
Cc: beilei.xing@intel.com

Signed-off-by: Artem Novikov <naa@amicon.ru>
---
 drivers/net/intel/i40e/i40e_ethdev.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/drivers/net/intel/i40e/i40e_ethdev.c b/drivers/net/intel/i40e/i40e_ethdev.c
index b6b2d291eee4f13ae59c80c5a281cee6d4be2f48..f135bd13dcfc885e030d17798159ae9b4bfb5f07 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.c
+++ b/drivers/net/intel/i40e/i40e_ethdev.c
@@ -11617,6 +11617,7 @@ i40e_ethertype_filter_restore(struct i40e_pf *pf)
 		*ethertype_list = &pf->ethertype.ethertype_list;
 	struct i40e_ethertype_filter *f;
 	struct i40e_control_filter_stats stats;
+	enum i40e_status_code ret;
 	uint16_t flags;
 
 	TAILQ_FOREACH(f, ethertype_list, rules) {
@@ -11627,18 +11628,26 @@ i40e_ethertype_filter_restore(struct i40e_pf *pf)
 			flags |= I40E_AQC_ADD_CONTROL_PACKET_FLAGS_DROP;
 		flags |= I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TO_QUEUE;
 
-		memset(&stats, 0, sizeof(stats));
-		i40e_aq_add_rem_control_packet_filter(hw,
+		ret = i40e_aq_add_rem_control_packet_filter(hw,
 					    f->input.mac_addr.addr_bytes,
 					    f->input.ether_type,
 					    flags, pf->main_vsi->seid,
 					    f->queue, 1, &stats, NULL);
+		if (ret != I40E_SUCCESS) {
+			PMD_DRV_LOG(ERR,
+				    "Failed to restore ethertype filter, "
+				    "ether_type=0x%04x, queue=%u, vsi_seid=%u, err %d",
+				    f->input.ether_type, f->queue,
+				    pf->main_vsi->seid, ret);
+			continue;
+		}
+
+		PMD_DRV_LOG(INFO, "Ethertype filter:"
+			    " mac_etype_used = %u, etype_used = %u,"
+			    " mac_etype_free = %u, etype_free = %u",
+			    stats.mac_etype_used, stats.etype_used,
+			    stats.mac_etype_free, stats.etype_free);
 	}
-	PMD_DRV_LOG(INFO, "Ethertype filter:"
-		    " mac_etype_used = %u, etype_used = %u,"
-		    " mac_etype_free = %u, etype_free = %u",
-		    stats.mac_etype_used, stats.etype_used,
-		    stats.mac_etype_free, stats.etype_free);
 }
 
 /* Restore tunnel filter */
-- 
2.43.0

             reply	other threads:[~2026-09-14 11:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 10:08 Artem Novikov [this message]
2026-09-16  9:31 ` [PATCH v2] net/i40e: fix ethertype filter restore diagnostics Artem Novikov
2026-10-05 15:42   ` Bruce Richardson

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=20260914100823.55165-1-naa@amicon.ru \
    --to=naa@amicon.ru \
    --cc=beilei.xing@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=rrv@amicon.ru \
    --cc=stable@dpdk.org \
    /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