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

Daniele Di Proietto ddiproietto at vmware.com
Thu Aug 7 01:07:05 UTC 2014



On 8/6/14, 3:30 PM, "Pravin Shelar" <pshelar at nicira.com> wrote:

>On Wed, Jul 30, 2014 at 8:51 AM, Daniele Di Proietto
><ddiproietto at vmware.com> wrote:
>> DPDK rings must have a power-of-two size.
>>
>> Signed-off-by: Daniele Di Proietto <ddiproietto at vmware.com>
>> ---
>>  lib/netdev-dpdk.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
>> index b45e367..a779833 100644
>> --- a/lib/netdev-dpdk.c
>> +++ b/lib/netdev-dpdk.c
>> @@ -125,6 +125,8 @@ static const struct rte_eth_txconf tx_conf = {
>>
>>  enum { MAX_RX_QUEUE_LEN = 192 };
>>  enum { MAX_TX_QUEUE_LEN = 384 };
>Is there any benefit of keeping separate RX and TX QUEUE size ?

This patch just fixes a bug related to DPDK rings.

The TX queue is bigger because in a single PMD thread iteration multiple
NICs _could_ receive a whole batch of packets that has to be sent to the
same output NIC. Having a bigger TX queue size reduces the calls to
dpdk_queue_flush__().

I¹m not sure in practice how much this would affect performance, but I do
not see any harm in keeping them separate.

Anyway, if you think we should merge them, I trust your judgement!

Daniele 

>
>
>> +enum { DPDK_RING_SIZE = 256 };
>> +BUILD_ASSERT_DECL(IS_POW2(DPDK_RING_SIZE));
>>  enum { DRAIN_TSC = 200000ULL };
>>
>>  static int rte_eal_init_ret = ENODEV;
>> @@ -1236,7 +1238,7 @@ dpdk_ring_create(const char dev_name[], unsigned
>>int port_no,
>>          return -err;
>>      }
>>
>> -    ivshmem->cring_tx = rte_ring_create(ring_name, MAX_RX_QUEUE_LEN,
>>SOCKET0, 0);
>> +    ivshmem->cring_tx = rte_ring_create(ring_name, DPDK_RING_SIZE,
>>SOCKET0, 0);
>>      if (ivshmem->cring_tx == NULL) {
>>          rte_free(ivshmem);
>>          return ENOMEM;
>> @@ -1247,7 +1249,7 @@ dpdk_ring_create(const char dev_name[], unsigned
>>int port_no,
>>          return -err;
>>      }
>>
>> -    ivshmem->cring_rx = rte_ring_create(ring_name, MAX_RX_QUEUE_LEN,
>>SOCKET0, 0);
>> +    ivshmem->cring_rx = rte_ring_create(ring_name, DPDK_RING_SIZE,
>>SOCKET0, 0);
>>      if (ivshmem->cring_rx == NULL) {
>>          rte_free(ivshmem);
>>          return ENOMEM;
>> --
>> 2.0.1
>>
>> _______________________________________________
>> dev mailing list
>> dev at openvswitch.org
>> 
>>https://urldefense.proofpoint.com/v1/url?u=http://openvswitch.org/mailman
>>/listinfo/dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=MV9BdLjtFIdhBDBaw5z%2
>>BU6SSA2gAfY4L%2F1HCy3VjlKU%3D%0A&m=JbCK3%2FN5NZ%2F3z8V4149DjoC21IV84G5i8E
>>hF0%2FuTQuE%3D%0A&s=5c089867eee0c6cdafca280a0e54f877cf5a900cfa8c73cad7d56
>>d9f20e8ee93




More information about the dev mailing list