BUG: Wrong dma queue handling in ixp4 driver

2 messages, 1 author, 2016-07-19 · open the first message on its own page

BUG: Wrong dma queue handling in ixp4 driver

From: "Lino Sanfilippo" <LinoSanfilippo@gmx.de>
Date: 2016-07-19 11:06:06

Hi,

maybe I miss something, but the ixp4 ethernet driver seems to handle dma pools 
in a wrong way: In init_queues() it creates a dma pool for descriptors and then
 only allocates a single descriptor from this pool. The author seems to assume the whole
table has been allocated already, since after that the complete pool size is zeroed:

<snip> 
static int init_queues(struct port *port)
{
	int i;

	if (!ports_open) {
		dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev,
					   POOL_ALLOC_SIZE, 32, 0);
		if (!dma_pool)
			return -ENOMEM;
	}

	if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
					      &port->desc_tab_phys)))
		return -ENOMEM;
	memset(port->desc_tab, 0, POOL_ALLOC_SIZE);
<snap>

Regards,
Lino

Aw: BUG: Wrong dma queue handling in ixp4 driver

From: "Lino Sanfilippo" <LinoSanfilippo@gmx.de>
Date: 2016-07-19 11:31:55

Hi,

maybe I miss something, but the ixp4 ethernet driver seems to handle dma pools 
in a wrong way: In init_queues() it creates a dma pool for descriptors and then
 only allocates a single descriptor from this pool. The author seems to assume the whole
table has been allocated already, since after that the complete pool size is zeroed:
Sorry, I indeed missed something. The allocation is correct. A pool is not required, though,
since only one chunk is allocated.

Lino
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help