netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] vmxnet3: support higher link speeds from vmxnet3 v9
@ 2024-09-17 22:59 Ronak Doshi
  2024-09-18  7:29 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Ronak Doshi @ 2024-09-17 22:59 UTC (permalink / raw)
  To: netdev
  Cc: Ronak Doshi, Broadcom internal kernel review list,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	open list

Until now, vmxnet3 was default reporting 10Gbps as link speed.
Vmxnet3 v9 adds support for user to configure higher link speeds.
User can configure the link speed via VMs advanced parameters options
in VCenter. This speed is reported in gbps by hypervisor.

This patch adds support for vmxnet3 to report higher link speeds and
converts it to mbps as expected by Linux stack.

Signed-off-by: Ronak Doshi <ronak.doshi@broadcom.com>
Acked-by: Guolin Yang <guolin.yang@broadcom.com>
---
 drivers/net/vmxnet3/vmxnet3_drv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index b70654c7ad34..bb514b72c8b5 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -201,6 +201,8 @@ vmxnet3_check_link(struct vmxnet3_adapter *adapter, bool affectTxQueue)
 
 	adapter->link_speed = ret >> 16;
 	if (ret & 1) { /* Link is up. */
+		if (VMXNET3_VERSION_GE_9(adapter) && adapter->link_speed < 10000)
+			adapter->link_speed = adapter->link_speed * 1000;
 		netdev_info(adapter->netdev, "NIC Link is Up %d Mbps\n",
 			    adapter->link_speed);
 		netif_carrier_on(adapter->netdev);
-- 
2.11.0


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

* Re: [PATCH net-next] vmxnet3: support higher link speeds from vmxnet3 v9
  2024-09-17 22:59 [PATCH net-next] vmxnet3: support higher link speeds from vmxnet3 v9 Ronak Doshi
@ 2024-09-18  7:29 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2024-09-18  7:29 UTC (permalink / raw)
  To: Ronak Doshi
  Cc: netdev, Broadcom internal kernel review list, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, open list

On Tue, Sep 17, 2024 at 03:59:46PM -0700, Ronak Doshi wrote:
> Until now, vmxnet3 was default reporting 10Gbps as link speed.
> Vmxnet3 v9 adds support for user to configure higher link speeds.
> User can configure the link speed via VMs advanced parameters options
> in VCenter. This speed is reported in gbps by hypervisor.
> 
> This patch adds support for vmxnet3 to report higher link speeds and
> converts it to mbps as expected by Linux stack.
> 
> Signed-off-by: Ronak Doshi <ronak.doshi@broadcom.com>
> Acked-by: Guolin Yang <guolin.yang@broadcom.com>
> ---
>  drivers/net/vmxnet3/vmxnet3_drv.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
> index b70654c7ad34..bb514b72c8b5 100644
> --- a/drivers/net/vmxnet3/vmxnet3_drv.c
> +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
> @@ -201,6 +201,8 @@ vmxnet3_check_link(struct vmxnet3_adapter *adapter, bool affectTxQueue)
>  
>  	adapter->link_speed = ret >> 16;
>  	if (ret & 1) { /* Link is up. */

Hi Ronak,

I think it would be nice to add a comment regarding the logic added below,
particularly the inequality.  It took me more than one reading to
understand it in the presence of the patch description. I expected may have
remained a mystery without some accompanying text.

> +		if (VMXNET3_VERSION_GE_9(adapter) && adapter->link_speed < 10000)

Please consider limiting Networking code to 80 columns wide where it
can trivially be achieved, as appears to be the case here.

checkpatch can be run with an option to flag this.

> +			adapter->link_speed = adapter->link_speed * 1000;

>  		netdev_info(adapter->netdev, "NIC Link is Up %d Mbps\n",
>  			    adapter->link_speed);
>  		netif_carrier_on(adapter->netdev);

net-next is currently closed for the v6.12 merge window.
Please repost this patch after it reopens, which will be after
v6.12-rc1 is released, most likely a little under two weeks from now.

-- 
pw-bot: changes-requested

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

end of thread, other threads:[~2024-09-18  7:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-17 22:59 [PATCH net-next] vmxnet3: support higher link speeds from vmxnet3 v9 Ronak Doshi
2024-09-18  7:29 ` Simon Horman

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).