Subject: Re: [PATCH net-next v3 RESEND] octeon_ep: add ndo ops for VFs in PF driver

From: Jakub Kicinski <[email-masked]>
Date: Tue, 3 Dec 2024 18:33:18 -0800

On Mon, 2 Dec 2024 10:32:18 -0800 Shinas Rasheed wrote:
> These APIs are needed to support applications that use netlink to get VF
> information from a PF driver.

> +	ivi->vf = vf;
> +	ether_addr_copy(ivi->mac, oct->vf_info[vf].mac_addr);
> +	ivi->spoofchk = true;
> +	ivi->linkstate = IFLA_VF_LINK_STATE_ENABLE;
> +	ivi->trusted = oct->vf_info[vf].trusted;
> +	ivi->max_tx_rate = 10000;

I still feel like this is using the rate limiting API to report fixed
link speed, which is tangential to rate limiting..

Unless the user can set the max_tx_rate why would they want to know
what the limit is at? Ideally reporting rate limit would be done
in a patch set which supports setting it.

> +	ivi->min_tx_rate = 0;

No need to set this to 0, AFAIR core initializes to 0.
>  /**
> @@ -1560,9 +1601,12 @@ static void octep_remove(struct pci_dev *pdev)
>  static int octep_sriov_enable(struct octep_device *oct, int num_vfs)
>  {
>  	struct pci_dev *pdev = oct->pdev;
> -	int err;
> +	int i, err;
>  
>  	CFG_GET_ACTIVE_VFS(oct->conf) = num_vfs;
> +	for (i = 0; i < num_vfs; i++)
> +		oct->vf_info[i].trusted = false;

I don't see it ever getting set to true, why track it if it's always
false?

>  	err = pci_enable_sriov(pdev, num_vfs);
>  	if (err) {
>  		dev_warn(&pdev->dev, "Failed to enable SRIOV err=%d\n", err);