diff mbox series

[iwl-net,06/10] ice: keep adding MAC filters after one that already exists

Message ID 20261002130752.2597259-7-poros@redhat.com
State Under Review
Delegated to: Anthony Nguyen
Headers show
Series ice: port missing i40e fixes | expand

Commit Message

Petr Oros Oct. 2, 2026, 1:07 p.m. UTC
ice_add_mac() returns as soon as one entry of the list fails, including
-EEXIST for a filter that is already programmed for the VSI. The rest of
the list is never added. ice_vsi_sync_fltr() treats -EEXIST as success,
so the skipped addresses are considered synced and their traffic is
dropped until they are removed and added again.

In a test that adds 50 multicast addresses to a port in a burst with
the port MAC address in the middle of it, 19 of them were left without
a filter.

Continue with the next entry on -EEXIST and report it once the whole
list has been processed. Other errors still stop the loop.

There is no i40e counterpart of this fix, i40e keeps its MAC filters in
a hash with a state per filter and syncs them differently. It was found
while building a reproducer for the MAC filter overflow handling that
i40e fixed in commit e58872398684 ("i40e: fix disabling overflow
promiscuous mode") and commit 7363115efb04 ("i40e: do not force filter
failure in overflow promiscuous").

Commit bbb968e8b34c ("ice: Fix issues updating VSI MAC filters") dealt
with the same problem for the VF MAC filter requests, which are now
added one by one with -EEXIST tolerated, but left ice_add_mac() and the
PF filter sync as they were.

Fixes: 89f3e4a5b762 ("ice: Do not bail out when filter already exists")
Assisted-by: LLM
Signed-off-by: Petr Oros <poros@redhat.com>
---
 drivers/net/ethernet/intel/ice/ice_switch.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ivan Vecera Oct. 3, 2026, 9:55 a.m. UTC | #1
On October 2, 2026 3:07:48 PM GMT+02:00, Petr Oros <poros@redhat.com> wrote:
>ice_add_mac() returns as soon as one entry of the list fails, including
>-EEXIST for a filter that is already programmed for the VSI. The rest of
>the list is never added. ice_vsi_sync_fltr() treats -EEXIST as success,
>so the skipped addresses are considered synced and their traffic is
>dropped until they are removed and added again.
>
>In a test that adds 50 multicast addresses to a port in a burst with
>the port MAC address in the middle of it, 19 of them were left without
>a filter.
>
>Continue with the next entry on -EEXIST and report it once the whole
>list has been processed. Other errors still stop the loop.
>
>There is no i40e counterpart of this fix, i40e keeps its MAC filters in
>a hash with a state per filter and syncs them differently. It was found
>while building a reproducer for the MAC filter overflow handling that
>i40e fixed in commit e58872398684 ("i40e: fix disabling overflow
>promiscuous mode") and commit 7363115efb04 ("i40e: do not force filter
>failure in overflow promiscuous").
>
>Commit bbb968e8b34c ("ice: Fix issues updating VSI MAC filters") dealt
>with the same problem for the VF MAC filter requests, which are now
>added one by one with -EEXIST tolerated, but left ice_add_mac() and the
>PF filter sync as they were.
>
>Fixes: 89f3e4a5b762 ("ice: Do not bail out when filter already exists")
>Assisted-by: LLM
>Signed-off-by: Petr Oros <poros@redhat.com>
>---
> drivers/net/ethernet/intel/ice/ice_switch.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
>index 2ee5cb6ffdab1f..239d4d9633baa6 100644
>--- a/drivers/net/ethernet/intel/ice/ice_switch.c
>+++ b/drivers/net/ethernet/intel/ice/ice_switch.c
>@@ -3659,7 +3659,9 @@ int ice_add_mac(struct ice_hw *hw, struct list_head *m_list)
> 
> 		m_list_itr->status = ice_add_rule_internal(hw, ICE_SW_LKUP_MAC,
> 							   m_list_itr);
>-		if (m_list_itr->status)
>+		if (m_list_itr->status == -EEXIST)
>+			status = -EEXIST;
>+		else if (m_list_itr->status)
> 			return m_list_itr->status;
> 	}
> 

Reviewed-by: Ivan Vecera <ivecera@redhat.com>
Loktionov, Aleksandr Oct. 5, 2026, 10:26 a.m. UTC | #2
> -----Original Message-----
> From: Petr Oros <poros@redhat.com>
> Sent: Friday, October 2, 2026 3:08 PM
> To: netdev@vger.kernel.org
> Cc: Oros, Petr <poros@redhat.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Andrew Lunn <andrew+netdev@lunn.ch>;
> David S. Miller <davem@davemloft.net>; Eric Dumazet
> <edumazet@kernel.org>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Lobakin, Aleksander
> <aleksander.lobakin@intel.com>; Alexei Starovoitov <ast@kernel.org>;
> Daniel Borkmann <daniel@iogearbox.net>; Jesper Dangaard Brouer
> <hawk@kernel.org>; John Fastabend <john.fastabend@gmail.com>;
> Stanislav Fomichev <sdf@fomichev.me>; Henry Tieman
> <henry.w.tieman@intel.com>; Anirudh Venkataramanan
> <anirudh.venkataramanan@intel.com>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>; Jesse Brandeburg
> <jbrandeb@kernel.org>; Preethi Banala <preethi.banala@intel.com>;
> Kiran Patil <kiran.patil@intel.com>; Dan Nowlin
> <dan.nowlin@intel.com>; Stephen Hemminger
> <stephen@networkplumber.org>; intel-wired-lan@lists.osuosl.org; linux-
> kernel@vger.kernel.org; bpf@vger.kernel.org
> Subject: [PATCH iwl-net 06/10] ice: keep adding MAC filters after one
> that already exists
> 
> ice_add_mac() returns as soon as one entry of the list fails,
> including -EEXIST for a filter that is already programmed for the VSI.
> The rest of the list is never added. ice_vsi_sync_fltr() treats -
> EEXIST as success, so the skipped addresses are considered synced and
> their traffic is dropped until they are removed and added again.
> 
> In a test that adds 50 multicast addresses to a port in a burst with
> the port MAC address in the middle of it, 19 of them were left without
> a filter.
> 
> Continue with the next entry on -EEXIST and report it once the whole
> list has been processed. Other errors still stop the loop.
> 
> There is no i40e counterpart of this fix, i40e keeps its MAC filters
> in a hash with a state per filter and syncs them differently. It was
> found while building a reproducer for the MAC filter overflow handling
> that i40e fixed in commit e58872398684 ("i40e: fix disabling overflow
> promiscuous mode") and commit 7363115efb04 ("i40e: do not force filter
> failure in overflow promiscuous").
> 
> Commit bbb968e8b34c ("ice: Fix issues updating VSI MAC filters") dealt
> with the same problem for the VF MAC filter requests, which are now
> added one by one with -EEXIST tolerated, but left ice_add_mac() and
> the PF filter sync as they were.
> 
> Fixes: 89f3e4a5b762 ("ice: Do not bail out when filter already
> exists")
> Assisted-by: LLM
> Signed-off-by: Petr Oros <poros@redhat.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_switch.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c
> b/drivers/net/ethernet/intel/ice/ice_switch.c
> index 2ee5cb6ffdab1f..239d4d9633baa6 100644
> --- a/drivers/net/ethernet/intel/ice/ice_switch.c
> +++ b/drivers/net/ethernet/intel/ice/ice_switch.c
> @@ -3659,7 +3659,9 @@ int ice_add_mac(struct ice_hw *hw, struct
> list_head *m_list)
> 
>  		m_list_itr->status = ice_add_rule_internal(hw,
> ICE_SW_LKUP_MAC,
>  							   m_list_itr);
> -		if (m_list_itr->status)
> +		if (m_list_itr->status == -EEXIST)
> +			status = -EEXIST;
> +		else if (m_list_itr->status)
>  			return m_list_itr->status;
>  	}
> 
> --
> 2.55.0

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
index 2ee5cb6ffdab1f..239d4d9633baa6 100644
--- a/drivers/net/ethernet/intel/ice/ice_switch.c
+++ b/drivers/net/ethernet/intel/ice/ice_switch.c
@@ -3659,7 +3659,9 @@  int ice_add_mac(struct ice_hw *hw, struct list_head *m_list)
 
 		m_list_itr->status = ice_add_rule_internal(hw, ICE_SW_LKUP_MAC,
 							   m_list_itr);
-		if (m_list_itr->status)
+		if (m_list_itr->status == -EEXIST)
+			status = -EEXIST;
+		else if (m_list_itr->status)
 			return m_list_itr->status;
 	}