lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1288086894.3169.53.camel@edumazet-laptop>
Date:	Tue, 26 Oct 2010 11:54:54 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Amit Kumar Salecha <amit.salecha@...gic.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org,
	ameen.rahman@...gic.com, anirban.chakraborty@...gic.com
Subject: Re: [PATCH] qlcnic: dma address align check

Le mardi 26 octobre 2010 à 02:38 -0700, Amit Kumar Salecha a écrit :
> Device requires tx_hw_cosnumer to be 64 byte aligned.
> Tx desc size is 64 byte, alloc tx_hw_consumer with tx desc.
> 
> Signed-off-by: Amit Kumar Salecha <amit.salecha@...gic.com>
> ---
>  drivers/net/qlcnic/qlcnic_ctx.c |   35 +++++++++++++++--------------------
>  1 files changed, 15 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/net/qlcnic/qlcnic_ctx.c b/drivers/net/qlcnic/qlcnic_ctx.c
> index 1cdc05d..21c9c28 100644
> --- a/drivers/net/qlcnic/qlcnic_ctx.c
> +++ b/drivers/net/qlcnic/qlcnic_ctx.c
> @@ -418,18 +418,9 @@ int qlcnic_alloc_hw_resources(struct qlcnic_adapter *adapter)
>  	recv_ctx = &adapter->recv_ctx;
>  	tx_ring = adapter->tx_ring;
>  
> -	tx_ring->hw_consumer = (__le32 *)pci_alloc_consistent(pdev, sizeof(u32),
> -						&tx_ring->hw_cons_phys_addr);
> -	if (tx_ring->hw_consumer == NULL) {
> -		dev_err(&pdev->dev, "failed to allocate tx consumer\n");
> -		return -ENOMEM;
> -	}
> -	*(tx_ring->hw_consumer) = 0;
> -
>  	/* cmd desc ring */
> -	addr = pci_alloc_consistent(pdev, TX_DESC_RINGSIZE(tx_ring),
> -			&tx_ring->phys_addr);
> -
> +	addr = pci_alloc_consistent(pdev, TX_DESC_RINGSIZE(tx_ring) +
> +			sizeof(u32), &tx_ring->phys_addr);

Wont this use twice memory than before, due to power-of-two
allocations ?

Allocating 65536 + 4 bytes gives you 131072 bytes.


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ