[ovs-dev] [PATCH] netdev-dpdk: Use different constant for ring size

Ben Pfaff blp at nicira.com
Wed Jul 30 15:29:29 UTC 2014


On Tue, Jul 29, 2014 at 04:21:32PM -0700, Daniele Di Proietto wrote:
> DPDK rings must have a power-of-two size.
> 
> Signed-off-by: Daniele Di Proietto <ddiproietto at vmware.com>
> ---
>  lib/netdev-dpdk.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index b45e367..c1b644a 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -125,6 +125,7 @@ static const struct rte_eth_txconf tx_conf = {
>  
>  enum { MAX_RX_QUEUE_LEN = 192 };
>  enum { MAX_TX_QUEUE_LEN = 384 };
> +enum { DPDK_RING_SIZE = 256 }; /* Must be a power of 2 */

We usually add something like
BUILD_ASSERT_DECL(IS_POW2(DPDK_RING_SIZE)); to make that even clearer.



More information about the dev mailing list