diff options
author | Shrikrishna Khare <skhare@vmware.com> | 2016-08-19 20:33:42 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-08-20 08:44:22 +0300 |
commit | ff2e7d5d51469e98196f7933c83b781e96517e7c (patch) | |
tree | cceeb771f5f82338537ab67b0d6808e3b3c135f7 /drivers/net/vmxnet3/vmxnet3_drv.c | |
parent | c10ac75aeed2d8486a73a316ac3a08f85d140894 (diff) | |
download | linux-ff2e7d5d51469e98196f7933c83b781e96517e7c.tar.xz |
vmxnet3: fix tx data ring copy for variable size
'Commit 3c8b3efc061a ("vmxnet3: allow variable length transmit data ring
buffer")' changed the size of the buffers in the tx data ring from a
fixed size of 128 bytes to a variable size.
However, while copying data to the data ring, vmxnet3_copy_hdr continues
to carry the old code that assumes fixed buffer size of 128. This patch
fixes it by adding correct offset based on the actual data ring buffer
size.
Signed-off-by: Guolin Yang <gyang@vmware.com>
Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vmxnet3/vmxnet3_drv.c')
-rw-r--r-- | drivers/net/vmxnet3/vmxnet3_drv.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index c68fe495d3f9..4244b9d4418e 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c @@ -914,7 +914,9 @@ vmxnet3_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq, { struct Vmxnet3_TxDataDesc *tdd; - tdd = tq->data_ring.base + tq->tx_ring.next2fill; + tdd = (struct Vmxnet3_TxDataDesc *)((u8 *)tq->data_ring.base + + tq->tx_ring.next2fill * + tq->txdata_desc_size); memcpy(tdd->data, skb->data, ctx->copy_size); netdev_dbg(adapter->netdev, |