* [Intel-wired-lan] [PATCH net v4] igbvf: Regard vf reset nack as success
@ 2022-12-01 10:20 Akihiko Odaki
2022-12-04 11:20 ` Leon Romanovsky
0 siblings, 1 reply; 3+ messages in thread
From: Akihiko Odaki @ 2022-12-01 10:20 UTC (permalink / raw)
Cc: Paul Menzel, Leon Romanovsky, netdev, linux-kernel,
Yuri Benditovich, Eric Dumazet, intel-wired-lan, Yan Vugenfirer,
Jakub Kicinski, Paolo Abeni, David S . Miller
vf reset nack actually represents the reset operation itself is
performed but no address is assigned. Therefore, e1000_reset_hw_vf
should fill the "perm_addr" with the zero address and return success on
such an occasion. This prevents its callers in netdev.c from saying PF
still resetting, and instead allows them to correctly report that no
address is assigned.
Fixes: 6ddbc4cf1f4d ("igb: Indicate failure on vf reset for empty mac address")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
V3 -> V4: Removed blank lines between cases
V2 -> V3: Added Fixes: tag
drivers/net/ethernet/intel/igbvf/vf.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/igbvf/vf.c b/drivers/net/ethernet/intel/igbvf/vf.c
index b8ba3f94c363..a47a2e3e548c 100644
--- a/drivers/net/ethernet/intel/igbvf/vf.c
+++ b/drivers/net/ethernet/intel/igbvf/vf.c
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2009 - 2018 Intel Corporation. */
+#include <linux/etherdevice.h>
+
#include "vf.h"
static s32 e1000_check_for_link_vf(struct e1000_hw *hw);
@@ -131,11 +133,16 @@ static s32 e1000_reset_hw_vf(struct e1000_hw *hw)
/* set our "perm_addr" based on info provided by PF */
ret_val = mbx->ops.read_posted(hw, msgbuf, 3);
if (!ret_val) {
- if (msgbuf[0] == (E1000_VF_RESET |
- E1000_VT_MSGTYPE_ACK))
+ switch (msgbuf[0]) {
+ case E1000_VF_RESET | E1000_VT_MSGTYPE_ACK:
memcpy(hw->mac.perm_addr, addr, ETH_ALEN);
- else
+ break;
+ case E1000_VF_RESET | E1000_VT_MSGTYPE_NACK:
+ eth_zero_addr(hw->mac.perm_addr);
+ break;
+ default:
ret_val = -E1000_ERR_MAC_INIT;
+ }
}
}
--
2.38.1
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Intel-wired-lan] [PATCH net v4] igbvf: Regard vf reset nack as success
2022-12-01 10:20 [Intel-wired-lan] [PATCH net v4] igbvf: Regard vf reset nack as success Akihiko Odaki
@ 2022-12-04 11:20 ` Leon Romanovsky
2023-03-08 14:42 ` Szlosek, Marek
0 siblings, 1 reply; 3+ messages in thread
From: Leon Romanovsky @ 2022-12-04 11:20 UTC (permalink / raw)
To: Akihiko Odaki
Cc: Paul Menzel, netdev, linux-kernel, Yuri Benditovich, Eric Dumazet,
intel-wired-lan, Yan Vugenfirer, Jakub Kicinski, Paolo Abeni,
David S . Miller
On Thu, Dec 01, 2022 at 07:20:03PM +0900, Akihiko Odaki wrote:
> vf reset nack actually represents the reset operation itself is
> performed but no address is assigned. Therefore, e1000_reset_hw_vf
> should fill the "perm_addr" with the zero address and return success on
> such an occasion. This prevents its callers in netdev.c from saying PF
> still resetting, and instead allows them to correctly report that no
> address is assigned.
>
> Fixes: 6ddbc4cf1f4d ("igb: Indicate failure on vf reset for empty mac address")
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
> V3 -> V4: Removed blank lines between cases
> V2 -> V3: Added Fixes: tag
>
> drivers/net/ethernet/intel/igbvf/vf.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Intel-wired-lan] [PATCH net v4] igbvf: Regard vf reset nack as success
2022-12-04 11:20 ` Leon Romanovsky
@ 2023-03-08 14:42 ` Szlosek, Marek
0 siblings, 0 replies; 3+ messages in thread
From: Szlosek, Marek @ 2023-03-08 14:42 UTC (permalink / raw)
To: intel-wired-lan@lists.osuosl.org
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Leon Romanovsky
> Sent: niedziela, 4 grudnia 2022 12:21
> To: Akihiko Odaki <akihiko.odaki@daynix.com>
> Cc: Paul Menzel <pmenzel@molgen.mpg.de>; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; Yuri Benditovich <yuri.benditovich@daynix.com>;
> Eric Dumazet <edumazet@google.com>; intel-wired-lan@lists.osuosl.org;
> Yan Vugenfirer <yan@daynix.com>; Jakub Kicinski <kuba@kernel.org>; Paolo
> Abeni <pabeni@redhat.com>; David S . Miller <davem@davemloft.net>
> Subject: Re: [Intel-wired-lan] [PATCH net v4] igbvf: Regard vf reset nack as
> success
>
Tested-by: Marek Szlosek <marek.szlosek@intel.com>
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-08 14:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-01 10:20 [Intel-wired-lan] [PATCH net v4] igbvf: Regard vf reset nack as success Akihiko Odaki
2022-12-04 11:20 ` Leon Romanovsky
2023-03-08 14:42 ` Szlosek, Marek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox