public inbox for intel-wired-lan@osuosl.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net] iavf: iavf_virtchnl_completion: drop duplicate ether_addr_equal() test
@ 2026-04-21  9:59 Corinna Vinschen
  2026-04-21 10:20 ` Loktionov, Aleksandr
  0 siblings, 1 reply; 7+ messages in thread
From: Corinna Vinschen @ 2026-04-21  9:59 UTC (permalink / raw)
  To: intel-wired-lan, netdev; +Cc: Corinna Vinschen, Jose Ignacio Tornos Martinez

This is just a simple cleanup fix.  Commit 35a2443d0910f ("iavf: Add
waiting for response from PF in set mac") introduced a duplicate
ether_addr_equal() check, so the current code tests the new MAC twice
against the former MAC.

Remove the outer ether_addr_equal() test, remnant of commit c5c922b3e09b
("iavf: fix MAC address setting for VFs when filter is rejected")

Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
Fixes: 35a2443d0910f ("iavf: Add waiting for response from PF in set mac")
---
 drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index a52c100dcbc5..9b8e7e4376c2 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -2579,13 +2579,11 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
 	case VIRTCHNL_OP_ADD_ETH_ADDR:
 		if (!v_retval)
 			iavf_mac_add_ok(adapter);
-		if (!ether_addr_equal(netdev->dev_addr, adapter->hw.mac.addr))
-			if (!ether_addr_equal(netdev->dev_addr,
-					      adapter->hw.mac.addr)) {
-				netif_addr_lock_bh(netdev);
-				eth_hw_addr_set(netdev, adapter->hw.mac.addr);
-				netif_addr_unlock_bh(netdev);
-			}
+		if (!ether_addr_equal(netdev->dev_addr, adapter->hw.mac.addr)) {
+			netif_addr_lock_bh(netdev);
+			eth_hw_addr_set(netdev, adapter->hw.mac.addr);
+			netif_addr_unlock_bh(netdev);
+		}
 		wake_up(&adapter->vc_waitqueue);
 		break;
 	case VIRTCHNL_OP_GET_STATS: {
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Intel-wired-lan] [PATCH net] iavf: iavf_virtchnl_completion: drop duplicate ether_addr_equal() test
  2026-04-21  9:59 [Intel-wired-lan] [PATCH net] iavf: iavf_virtchnl_completion: drop duplicate ether_addr_equal() test Corinna Vinschen
@ 2026-04-21 10:20 ` Loktionov, Aleksandr
  2026-04-21 11:12   ` Corinna Vinschen
  0 siblings, 1 reply; 7+ messages in thread
From: Loktionov, Aleksandr @ 2026-04-21 10:20 UTC (permalink / raw)
  To: Vinschen, Corinna, intel-wired-lan@osuosl.org,
	netdev@vger.kernel.org
  Cc: Vinschen, Corinna, Jose Ignacio Tornos Martinez



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Corinna Vinschen
> Sent: Tuesday, April 21, 2026 12:00 PM
> To: intel-wired-lan@osuosl.org; netdev@vger.kernel.org
> Cc: Vinschen, Corinna <vinschen@redhat.com>; Jose Ignacio Tornos
> Martinez <jtornosm@redhat.com>
> Subject: [Intel-wired-lan] [PATCH net] iavf: iavf_virtchnl_completion:
> drop duplicate ether_addr_equal() test
> 
> This is just a simple cleanup fix.  Commit 35a2443d0910f ("iavf: Add
> waiting for response from PF in set mac") introduced a duplicate
> ether_addr_equal() check, so the current code tests the new MAC twice
> against the former MAC.
> 
> Remove the outer ether_addr_equal() test, remnant of commit
> c5c922b3e09b
> ("iavf: fix MAC address setting for VFs when filter is rejected")
> 
> Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
> Fixes: 35a2443d0910f ("iavf: Add waiting for response from PF in set
> mac")

I think Cc: stable@vger.kernel.org should be added.
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>

> ---
>  drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> index a52c100dcbc5..9b8e7e4376c2 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
> @@ -2579,13 +2579,11 @@ void iavf_virtchnl_completion(struct
> iavf_adapter *adapter,
>  	case VIRTCHNL_OP_ADD_ETH_ADDR:
>  		if (!v_retval)
>  			iavf_mac_add_ok(adapter);
> -		if (!ether_addr_equal(netdev->dev_addr, adapter-
> >hw.mac.addr))
> -			if (!ether_addr_equal(netdev->dev_addr,
> -					      adapter->hw.mac.addr)) {
> -				netif_addr_lock_bh(netdev);
> -				eth_hw_addr_set(netdev, adapter-
> >hw.mac.addr);
> -				netif_addr_unlock_bh(netdev);
> -			}
> +		if (!ether_addr_equal(netdev->dev_addr, adapter-
> >hw.mac.addr)) {
> +			netif_addr_lock_bh(netdev);
> +			eth_hw_addr_set(netdev, adapter->hw.mac.addr);
> +			netif_addr_unlock_bh(netdev);
> +		}
>  		wake_up(&adapter->vc_waitqueue);
>  		break;
>  	case VIRTCHNL_OP_GET_STATS: {
> --
> 2.53.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Intel-wired-lan] [PATCH net] iavf: iavf_virtchnl_completion: drop duplicate ether_addr_equal() test
  2026-04-21 10:20 ` Loktionov, Aleksandr
@ 2026-04-21 11:12   ` Corinna Vinschen
  2026-04-23 18:55     ` Simon Horman
  0 siblings, 1 reply; 7+ messages in thread
From: Corinna Vinschen @ 2026-04-21 11:12 UTC (permalink / raw)
  To: intel-wired-lan, netdev
  Cc: Corinna Vinschen, stable, Jose Ignacio Tornos Martinez

This is just a simple cleanup fix.  Commit 35a2443d0910f ("iavf: Add
waiting for response from PF in set mac") introduced a duplicate
ether_addr_equal() check, so the current code tests the new MAC twice
against the former MAC.

Remove the outer ether_addr_equal() test, remnant of commit c5c922b3e09b
("iavf: fix MAC address setting for VFs when filter is rejected")

Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
Fixes: 35a2443d0910f ("iavf: Add waiting for response from PF in set mac")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
Added CC: stable@vger.kernel.org

 drivers/net/ethernet/intel/iavf/iavf_virtchnl.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
index a52c100dcbc5..9b8e7e4376c2 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
@@ -2579,13 +2579,11 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
 	case VIRTCHNL_OP_ADD_ETH_ADDR:
 		if (!v_retval)
 			iavf_mac_add_ok(adapter);
-		if (!ether_addr_equal(netdev->dev_addr, adapter->hw.mac.addr))
-			if (!ether_addr_equal(netdev->dev_addr,
-					      adapter->hw.mac.addr)) {
-				netif_addr_lock_bh(netdev);
-				eth_hw_addr_set(netdev, adapter->hw.mac.addr);
-				netif_addr_unlock_bh(netdev);
-			}
+		if (!ether_addr_equal(netdev->dev_addr, adapter->hw.mac.addr)) {
+			netif_addr_lock_bh(netdev);
+			eth_hw_addr_set(netdev, adapter->hw.mac.addr);
+			netif_addr_unlock_bh(netdev);
+		}
 		wake_up(&adapter->vc_waitqueue);
 		break;
 	case VIRTCHNL_OP_GET_STATS: {
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Intel-wired-lan] [PATCH net] iavf: iavf_virtchnl_completion: drop duplicate ether_addr_equal() test
  2026-04-21 11:12   ` Corinna Vinschen
@ 2026-04-23 18:55     ` Simon Horman
  2026-04-24  8:32       ` Corinna Vinschen
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Horman @ 2026-04-23 18:55 UTC (permalink / raw)
  To: Corinna Vinschen
  Cc: intel-wired-lan, stable, Jose Ignacio Tornos Martinez, netdev

On Tue, Apr 21, 2026 at 01:12:36PM +0200, Corinna Vinschen wrote:
> This is just a simple cleanup fix.  Commit 35a2443d0910f ("iavf: Add
> waiting for response from PF in set mac") introduced a duplicate
> ether_addr_equal() check, so the current code tests the new MAC twice
> against the former MAC.
> 
> Remove the outer ether_addr_equal() test, remnant of commit c5c922b3e09b
> ("iavf: fix MAC address setting for VFs when filter is rejected")
> 
> Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
> Fixes: 35a2443d0910f ("iavf: Add waiting for response from PF in set mac")
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> ---
> Added CC: stable@vger.kernel.org

Hi,

This feels more like a cleanup for net-next (without a Fixes tag)
than a fix for net. I'm missing where the bug is here.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Intel-wired-lan] [PATCH net] iavf: iavf_virtchnl_completion: drop duplicate ether_addr_equal() test
  2026-04-23 18:55     ` Simon Horman
@ 2026-04-24  8:32       ` Corinna Vinschen
  2026-04-25  0:37         ` Jacob Keller
  0 siblings, 1 reply; 7+ messages in thread
From: Corinna Vinschen @ 2026-04-24  8:32 UTC (permalink / raw)
  To: Simon Horman
  Cc: intel-wired-lan, stable, Jose Ignacio Tornos Martinez, netdev,
	Corinna Vinschen

On Apr 23 19:55, Simon Horman wrote:
> On Tue, Apr 21, 2026 at 01:12:36PM +0200, Corinna Vinschen wrote:
> > This is just a simple cleanup fix.  Commit 35a2443d0910f ("iavf: Add
> > waiting for response from PF in set mac") introduced a duplicate
> > ether_addr_equal() check, so the current code tests the new MAC twice
> > against the former MAC.
> > 
> > Remove the outer ether_addr_equal() test, remnant of commit c5c922b3e09b
> > ("iavf: fix MAC address setting for VFs when filter is rejected")
> > 
> > Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
> > Fixes: 35a2443d0910f ("iavf: Add waiting for response from PF in set mac")
> > Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> > ---
> > Added CC: stable@vger.kernel.org
> 
> Hi,
> 
> This feels more like a cleanup for net-next (without a Fixes tag)
> than a fix for net. I'm missing where the bug is here.

Yeah, it's not a bug, the "Fixes" tag was just supposed to point out the
patch introducing the duplicate test.

Shall I create a v3 or is it ok as is and just goes to net-next instead
of net?


Thanks,
Corinna


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Intel-wired-lan] [PATCH net] iavf: iavf_virtchnl_completion: drop duplicate ether_addr_equal() test
  2026-04-24  8:32       ` Corinna Vinschen
@ 2026-04-25  0:37         ` Jacob Keller
  2026-04-27 15:58           ` Corinna Vinschen
  0 siblings, 1 reply; 7+ messages in thread
From: Jacob Keller @ 2026-04-25  0:37 UTC (permalink / raw)
  To: Simon Horman, intel-wired-lan, stable,
	Jose Ignacio Tornos Martinez, netdev

On 4/24/2026 1:32 AM, Corinna Vinschen wrote:
> On Apr 23 19:55, Simon Horman wrote:
>> On Tue, Apr 21, 2026 at 01:12:36PM +0200, Corinna Vinschen wrote:
>>> This is just a simple cleanup fix.  Commit 35a2443d0910f ("iavf: Add
>>> waiting for response from PF in set mac") introduced a duplicate
>>> ether_addr_equal() check, so the current code tests the new MAC twice
>>> against the former MAC.
>>>
>>> Remove the outer ether_addr_equal() test, remnant of commit c5c922b3e09b
>>> ("iavf: fix MAC address setting for VFs when filter is rejected")
>>>
>>> Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
>>> Fixes: 35a2443d0910f ("iavf: Add waiting for response from PF in set mac")
>>> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
>>> ---
>>> Added CC: stable@vger.kernel.org
>>
>> Hi,
>>
>> This feels more like a cleanup for net-next (without a Fixes tag)
>> than a fix for net. I'm missing where the bug is here.
> 
> Yeah, it's not a bug, the "Fixes" tag was just supposed to point out the
> patch introducing the duplicate test.
> 
> Shall I create a v3 or is it ok as is and just goes to net-next instead
> of net?
> 
> 
> Thanks,
> Corinna
> 

I can make a note for later and either myself or Tony can forward it
net-next as part of an Intel Wired LAN update when the merge window
re-opens and any testing has completed. (Not that there is much needing
to be tested in this patches case)

Thanks,
Jake

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Intel-wired-lan] [PATCH net] iavf: iavf_virtchnl_completion: drop duplicate ether_addr_equal() test
  2026-04-25  0:37         ` Jacob Keller
@ 2026-04-27 15:58           ` Corinna Vinschen
  0 siblings, 0 replies; 7+ messages in thread
From: Corinna Vinschen @ 2026-04-27 15:58 UTC (permalink / raw)
  To: Jacob Keller
  Cc: Simon Horman, intel-wired-lan, stable,
	Jose Ignacio Tornos Martinez, netdev, Corinna Vinschen

On Apr 24 17:37, Jacob Keller wrote:
> On 4/24/2026 1:32 AM, Corinna Vinschen wrote:
> > On Apr 23 19:55, Simon Horman wrote:
> >> On Tue, Apr 21, 2026 at 01:12:36PM +0200, Corinna Vinschen wrote:
> >>> This is just a simple cleanup fix.  Commit 35a2443d0910f ("iavf: Add
> >>> waiting for response from PF in set mac") introduced a duplicate
> >>> ether_addr_equal() check, so the current code tests the new MAC twice
> >>> against the former MAC.
> >>>
> >>> Remove the outer ether_addr_equal() test, remnant of commit c5c922b3e09b
> >>> ("iavf: fix MAC address setting for VFs when filter is rejected")
> >>>
> >>> Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
> >>> Fixes: 35a2443d0910f ("iavf: Add waiting for response from PF in set mac")
> >>> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> >>> ---
> >>> Added CC: stable@vger.kernel.org
> >>
> >> Hi,
> >>
> >> This feels more like a cleanup for net-next (without a Fixes tag)
> >> than a fix for net. I'm missing where the bug is here.
> > 
> > Yeah, it's not a bug, the "Fixes" tag was just supposed to point out the
> > patch introducing the duplicate test.
> > 
> > Shall I create a v3 or is it ok as is and just goes to net-next instead
> > of net?
> > 
> > 
> > Thanks,
> > Corinna
> > 
> 
> I can make a note for later and either myself or Tony can forward it
> net-next as part of an Intel Wired LAN update when the merge window
> re-opens and any testing has completed. (Not that there is much needing
> to be tested in this patches case)

That's nice, thank you!


Corinna


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-04-27 15:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-21  9:59 [Intel-wired-lan] [PATCH net] iavf: iavf_virtchnl_completion: drop duplicate ether_addr_equal() test Corinna Vinschen
2026-04-21 10:20 ` Loktionov, Aleksandr
2026-04-21 11:12   ` Corinna Vinschen
2026-04-23 18:55     ` Simon Horman
2026-04-24  8:32       ` Corinna Vinschen
2026-04-25  0:37         ` Jacob Keller
2026-04-27 15:58           ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox