summaryrefslogtreecommitdiffstats
path: root/drivers/net/vmxnet3/vmxnet3_ethtool.c
diff options
context:
space:
mode:
authorRonak Doshi <doshir@vmware.com>2022-06-07 20:23:50 -0700
committerPaolo Abeni <pabeni@redhat.com>2022-06-09 12:42:01 +0200
commitc7112ebd27ea0dbe4eecd5c96cad93757e34e73d (patch)
treee48a2319af395f9417cd378c39d0e9e6927c62c4 /drivers/net/vmxnet3/vmxnet3_ethtool.c
parent2c5a5748105a6bb901579d365c6f93e79f282b69 (diff)
downloadlinux-c7112ebd27ea0dbe4eecd5c96cad93757e34e73d.tar.gz
linux-c7112ebd27ea0dbe4eecd5c96cad93757e34e73d.tar.bz2
linux-c7112ebd27ea0dbe4eecd5c96cad93757e34e73d.zip
vmxnet3: add command to set ring buffer sizes
This patch adds a new command to set ring buffer sizes. This is required to pass the buffer size information to passthrough devices. For performance reasons, with version7 and later, ring1 will contain only mtu size buffers (bound to 3K). Packets > 3K will use both ring1 and ring2. Also, ring sizes are round down to power of 2 and ring2 default size is increased to 512. Signed-off-by: Ronak Doshi <doshir@vmware.com> Acked-by: Guolin Yang <gyang@vmware.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/vmxnet3/vmxnet3_ethtool.c')
-rw-r--r--drivers/net/vmxnet3/vmxnet3_ethtool.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c
index 397b268f7bc5..ce3993282c0f 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
@@ -718,6 +718,13 @@ vmxnet3_set_ringparam(struct net_device *netdev,
new_rx_ring2_size = min_t(u32, new_rx_ring2_size,
VMXNET3_RX_RING2_MAX_SIZE);
+ /* For v7 and later, keep ring size power of 2 for UPT */
+ if (VMXNET3_VERSION_GE_7(adapter)) {
+ new_tx_ring_size = rounddown_pow_of_two(new_tx_ring_size);
+ new_rx_ring_size = rounddown_pow_of_two(new_rx_ring_size);
+ new_rx_ring2_size = rounddown_pow_of_two(new_rx_ring2_size);
+ }
+
/* rx data ring buffer size has to be a multiple of
* VMXNET3_RXDATA_DESC_SIZE_ALIGN
*/