From 3c8b3efc061a745d888869dc3462ac4f7dd582d9 Mon Sep 17 00:00:00 2001 From: Shrikrishna Khare Date: Thu, 16 Jun 2016 10:51:55 -0700 Subject: vmxnet3: allow variable length transmit data ring buffer vmxnet3 driver supports transmit data ring viz. a set of fixed size buffers used by the driver to copy packet headers. Small packets that fit these buffers are copied into these buffers entirely. Currently this buffer size of fixed at 128 bytes. This patch extends transmit data ring implementation to allow variable length transmit data ring buffers. The length of the buffer is read from the emulation during initialization. Signed-off-by: Sriram Rangarajan Signed-off-by: Shrikrishna Khare Signed-off-by: David S. Miller --- drivers/net/vmxnet3/vmxnet3_ethtool.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/net/vmxnet3/vmxnet3_ethtool.c') diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c index 163e99c91023..3b70cfef9748 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethtool.c +++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c @@ -396,8 +396,7 @@ vmxnet3_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *p) buf[j++] = VMXNET3_GET_ADDR_LO(tq->data_ring.basePA); buf[j++] = VMXNET3_GET_ADDR_HI(tq->data_ring.basePA); buf[j++] = tq->data_ring.size; - /* transmit data ring buffer size */ - buf[j++] = VMXNET3_HDR_COPY_SIZE; + buf[j++] = tq->txdata_desc_size; buf[j++] = VMXNET3_GET_ADDR_LO(tq->comp_ring.basePA); buf[j++] = VMXNET3_GET_ADDR_HI(tq->comp_ring.basePA); @@ -591,7 +590,8 @@ vmxnet3_set_ringparam(struct net_device *netdev, vmxnet3_rq_destroy_all(adapter); err = vmxnet3_create_queues(adapter, new_tx_ring_size, - new_rx_ring_size, new_rx_ring2_size); + new_rx_ring_size, new_rx_ring2_size, + adapter->txdata_desc_size); if (err) { /* failed, most likely because of OOM, try default @@ -604,7 +604,8 @@ vmxnet3_set_ringparam(struct net_device *netdev, err = vmxnet3_create_queues(adapter, new_tx_ring_size, new_rx_ring_size, - new_rx_ring2_size); + new_rx_ring2_size, + adapter->txdata_desc_size); if (err) { netdev_err(netdev, "failed to create queues " "with default sizes. Closing it\n"); -- cgit v1.2.1