[6/8] vmxnet3: set reta size

Message ID 20220503042257.15626-7-pagupta@vmware.com (mailing list archive)
State Changes Requested, archived
Delegated to: Andrew Rybchenko
Headers
Series vmxnet3 version V5 and V6 |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Pankaj Gupta May 3, 2022, 4:22 a.m. UTC
  Currently the driver assumes that the size of the reta table is
four times the number of rx queues at multiple places. However,
it sets it to four times the maximum number of queues (4 * 32 = 128)
when it first initializes the device. Change the other uses to use
the stored value, not the assumed default.

Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
  

Comments

Andrew Rybchenko May 4, 2022, 3:05 p.m. UTC | #1
Consider:

net/vmxnet3: advertise RETA size in device info

On 5/3/22 07:22, Pankaj Gupta wrote:
> Currently the driver assumes that the size of the reta table is

reta -> RETA (see devtools/words-case.txt)

> four times the number of rx queues at multiple places. However,

rx -> Rx

> it sets it to four times the maximum number of queues (4 * 32 = 128)
> when it first initializes the device. Change the other uses to use
> the stored value, not the assumed default.
> 
> Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
> ---
>   drivers/net/vmxnet3/vmxnet3_ethdev.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> index f65b3d3113..9955f121f6 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> @@ -1483,7 +1483,12 @@ vmxnet3_dev_info_get(struct rte_eth_dev *dev,
>   	dev_info->rx_queue_offload_capa = 0;
>   	dev_info->tx_offload_capa = VMXNET3_TX_OFFLOAD_CAP;
>   	dev_info->tx_queue_offload_capa = 0;
> -
> +	if (hw->rss_conf) {

Compare with NULL explicitly as DPDK coding style says.

> +		dev_info->reta_size = hw->rss_conf->indTableSize;
> +	} else {
> +		/* RSS not configured */
> +		dev_info->reta_size = 0;
> +	}
>   	return 0;
>   }
>
  

Patch

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index f65b3d3113..9955f121f6 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -1483,7 +1483,12 @@  vmxnet3_dev_info_get(struct rte_eth_dev *dev,
 	dev_info->rx_queue_offload_capa = 0;
 	dev_info->tx_offload_capa = VMXNET3_TX_OFFLOAD_CAP;
 	dev_info->tx_queue_offload_capa = 0;
-
+	if (hw->rss_conf) {
+		dev_info->reta_size = hw->rss_conf->indTableSize;
+	} else {
+		/* RSS not configured */
+		dev_info->reta_size = 0;
+	}
 	return 0;
 }