All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/vmxnet3: fix queue size changes
@ 2017-03-13 22:41 Charles (Chas) Williams
  2017-03-14 16:11 ` Jan Blunck
  2017-03-15 12:35 ` Charles (Chas) Williams
  0 siblings, 2 replies; 13+ messages in thread
From: Charles (Chas) Williams @ 2017-03-13 22:41 UTC (permalink / raw)
  To: dev; +Cc: yongwang, Charles (Chas) Williams

If the user reconfigures the queues size, then the previosly allocated
memzone may potentially be too small.  Instead, always free the old
memzone and allocate a new one.

Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver implementation")

Signed-off-by: Chas Williams <ciwillia@brocade.com>
---
 drivers/net/vmxnet3/vmxnet3_rxtx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 6649c3f..104e040 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -893,8 +893,8 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 
 /*
  * Create memzone for device rings. malloc can't be used as the physical address is
- * needed. If the memzone is already created, then this function returns a ptr
- * to the old one.
+ * needed. If the memzone already exists, we free it since it may have been created
+ * with a different size.
  */
 static const struct rte_memzone *
 ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name,
@@ -909,7 +909,7 @@ ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name,
 
 	mz = rte_memzone_lookup(z_name);
 	if (mz)
-		return mz;
+		rte_memzone_free(mz);
 
 	return rte_memzone_reserve_aligned(z_name, ring_size,
 					   socket_id, 0, VMXNET3_RING_BA_ALIGN);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-03-16 11:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-13 22:41 [PATCH] net/vmxnet3: fix queue size changes Charles (Chas) Williams
2017-03-14 16:11 ` Jan Blunck
2017-03-14 16:38   ` Charles (Chas) Williams
2017-03-15  8:18     ` Jan Blunck
2017-03-15  9:45       ` Charles (Chas) Williams
2017-03-15 10:05         ` Jan Blunck
2017-03-15 10:06           ` Charles (Chas) Williams
2017-03-15 12:34           ` Charles (Chas) Williams
2017-03-15 12:35 ` Charles (Chas) Williams
2017-03-15 17:57   ` Yong Wang
2017-03-15 18:30     ` Shrikrishna Khare
2017-03-15 18:19   ` Jan Blunck
2017-03-16 11:38     ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.