From: Anurag Mandal <anurag.mandal@intel.com>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, anatoly.burakov@intel.com,
Anurag Mandal <anurag.mandal@intel.com>
Subject: [PATCH v5] net/ice: add option to enable source prune
Date: Thu, 6 Nov 2025 16:33:34 +0000 [thread overview]
Message-ID: <20251106163334.95660-1-anurag.mandal@intel.com> (raw)
In-Reply-To: <20251101104627.64906-1-anurag.mandal@intel.com>
Source prune is disabled by default to support
VRRP advertisement packets in a vsi of ice PF.
There is no way to enable source prune itself.
This patch introduces devarg "source-prune" to
allow user to enable source prune.
Enable Source Prune to automatically drop incoming
packets when their source MAC address matches one
of the MAC addresses assigned to that same NIC port.
Tested the following with VRRP advertisement packets
in a vsi of ice PF:
1. Source prune default mode with no devarg option.
2. Enable source prune with devarg "source-prune=1".
3. Disable source prune with devarg "source-prune=0".
Signed-off-by: Anurag Mandal <anurag.mandal@intel.com>
---
V5:Addressed Bruce Richardson's minor feedbacks
- changed devarg name to "source-prune"
- removed "Fixes" from commit msg
- removed explicit source prune enabling 'if' block
- changed devargs member name to "source_prune"
- changed macro name to "ICE_SOURCE_PRUNE_ARG"
V4: Addressed Bruce Richardson's feedback
- changed from private API to devarg option.
V3: Addressed Coding Style Warning
V2: Addressed Coding Style Warnings
doc/guides/nics/ice.rst | 11 +++++++++++
drivers/net/intel/ice/ice_ethdev.c | 21 +++++++++++++++++++--
drivers/net/intel/ice/ice_ethdev.h | 1 +
3 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst
index 7e9ba23102..d050140e84 100644
--- a/doc/guides/nics/ice.rst
+++ b/doc/guides/nics/ice.rst
@@ -183,6 +183,17 @@ Runtime Configuration
If the value provided is greater than the number of levels provided by the HW,
SW will use the hardware maximum value.
+- ``Source Prune Enable`` (default ``0``)
+
+ Enable Source Prune to automatically drop incoming packets when
+ their source MAC address matches one of the MAC addresses assigned
+ to that same NIC port.
+
+ Source Prune can be enabled by setting the devargs parameter ``source-prune``,
+ for example::
+
+ -a 80:00.0,source-prune=1
+
- ``Protocol extraction for per queue``
Configure the RX queues to do protocol extraction into mbuf for protocol
diff --git a/drivers/net/intel/ice/ice_ethdev.c b/drivers/net/intel/ice/ice_ethdev.c
index 4669eba7c7..65d4ae5407 100644
--- a/drivers/net/intel/ice/ice_ethdev.c
+++ b/drivers/net/intel/ice/ice_ethdev.c
@@ -41,6 +41,7 @@
#define ICE_DDP_FILENAME_ARG "ddp_pkg_file"
#define ICE_DDP_LOAD_SCHED_ARG "ddp_load_sched_topo"
#define ICE_TM_LEVELS_ARG "tm_sched_levels"
+#define ICE_SOURCE_PRUNE_ARG "source-prune"
#define ICE_LINK_STATE_ON_CLOSE "link_state_on_close"
#define ICE_CYCLECOUNTER_MASK 0xffffffffffffffffULL
@@ -58,6 +59,7 @@ static const char * const ice_valid_args[] = {
ICE_DDP_FILENAME_ARG,
ICE_DDP_LOAD_SCHED_ARG,
ICE_TM_LEVELS_ARG,
+ ICE_SOURCE_PRUNE_ARG,
ICE_LINK_STATE_ON_CLOSE,
NULL
};
@@ -1716,6 +1718,7 @@ ice_setup_vsi(struct ice_pf *pf, enum ice_vsi_type type)
uint16_t max_txqs[ICE_MAX_TRAFFIC_CLASS] = { 0 };
uint8_t tc_bitmap = 0x1;
uint16_t cfg;
+ struct ice_adapter *ad = (struct ice_adapter *)hw->back;
/* hw->num_lports = 1 in NIC mode */
vsi = rte_zmalloc(NULL, sizeof(struct ice_vsi), 0);
@@ -1753,8 +1756,16 @@ ice_setup_vsi(struct ice_pf *pf, enum ice_vsi_type type)
* by ice_init_hw
*/
vsi_ctx.info.sw_id = hw->port_info->sw_id;
- vsi_ctx.info.sw_flags = ICE_AQ_VSI_SW_FLAG_LOCAL_LB;
- vsi_ctx.info.sw_flags |= ICE_AQ_VSI_SW_FLAG_SRC_PRUNE;
+ /* Source Prune */
+ if (ad->devargs.source_prune != 1) {
+ /* Disable source prune to support VRRP
+ * when source-prune devarg is not set
+ */
+ vsi_ctx.info.sw_flags =
+ ICE_AQ_VSI_SW_FLAG_LOCAL_LB;
+ vsi_ctx.info.sw_flags |=
+ ICE_AQ_VSI_SW_FLAG_SRC_PRUNE;
+ }
cfg = ICE_AQ_VSI_PROP_SW_VALID;
vsi_ctx.info.valid_sections |= rte_cpu_to_le_16(cfg);
vsi_ctx.info.sw_flags2 = ICE_AQ_VSI_SW_FLAG_LAN_ENA;
@@ -2449,6 +2460,11 @@ static int ice_parse_devargs(struct rte_eth_dev *dev)
if (ret)
goto bail;
+ ret = rte_kvargs_process(kvlist, ICE_SOURCE_PRUNE_ARG,
+ &parse_bool, &ad->devargs.source_prune);
+ if (ret)
+ goto bail;
+
ret = rte_kvargs_process(kvlist, ICE_LINK_STATE_ON_CLOSE,
&parse_link_state_on_close, &ad->devargs.link_state_on_close);
@@ -7659,6 +7675,7 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ice,
ICE_DDP_FILENAME_ARG "=</path/to/file>"
ICE_DDP_LOAD_SCHED_ARG "=<0|1>"
ICE_TM_LEVELS_ARG "=<N>"
+ ICE_SOURCE_PRUNE_ARG "=<0|1>"
ICE_RX_LOW_LATENCY_ARG "=<0|1>"
ICE_LINK_STATE_ON_CLOSE "=<down|up|initial>");
diff --git a/drivers/net/intel/ice/ice_ethdev.h b/drivers/net/intel/ice/ice_ethdev.h
index 6478d6dfbd..5decb05d5f 100644
--- a/drivers/net/intel/ice/ice_ethdev.h
+++ b/drivers/net/intel/ice/ice_ethdev.h
@@ -614,6 +614,7 @@ struct ice_devargs {
uint8_t pps_out_ena;
uint8_t ddp_load_sched;
uint8_t tm_exposed_levels;
+ uint8_t source_prune;
int link_state_on_close;
int xtr_field_offs;
uint8_t xtr_flag_offs[PROTO_XTR_MAX];
--
2.34.1
next prev parent reply other threads:[~2025-11-06 16:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-01 10:46 [PATCH] net/ice: add source prune configuration API Anurag Mandal
2025-11-01 18:29 ` [PATCH v2] " Anurag Mandal
2025-11-02 1:19 ` [PATCH v3] " Anurag Mandal
2025-11-05 9:13 ` Bruce Richardson
2025-11-05 18:30 ` [PATCH v4] net/ice: add option to enable source prune Anurag Mandal
2025-11-06 14:22 ` Bruce Richardson
2025-11-06 16:33 ` Anurag Mandal [this message]
2025-11-06 17:29 ` [PATCH v5] " Bruce Richardson
2025-11-06 17:56 ` 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=20251106163334.95660-1-anurag.mandal@intel.com \
--to=anurag.mandal@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@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;
as well as URLs for NNTP newsgroup(s).