[ovs-dev] [PATCH] netdev-dpdk: Increase limit for dpdk ring names

Karthick, A.R. kramanar at ciena.com
Thu Aug 6 17:57:32 UTC 2015


Hi,
 I know this is a low hanging fruit.
 But still wanted to know if this can be merged.
Regards,
-Karthi

On Tue, Jul 28, 2015 at 11:33 AM, A.R. Karthick <ar.karthick at cyaninc.com>
wrote:

> Hi,
>  Currently, the ovs netdev-dpdk ring type dpdkr, restricts dpdk ring name
> size to 10 bytes (includes the _rx/tx suffix).
>
>  This only gives us space to accommodate 10 rings as truncation happens
> with dpdkr10_rx/tx.
>
>  The enclosed patch below ensures that we respect the ring name size
> constraints imposed by the rte dpdk ring apis by allowing for a greater
> size instead of using a hard-coded ring name size in ovs netdev-dpdk layer.
>
> Regards,
> -Karthick
>
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 5ae805e..00229c2 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -92,7 +92,7 @@ BUILD_ASSERT_DECL((MAX_NB_MBUF /
> ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF))
>
>  #define NIC_PORT_RX_Q_SIZE 2048  /* Size of Physical NIC RX Queue, Max
> (n+32<=4096)*/
>  #define NIC_PORT_TX_Q_SIZE 2048  /* Size of Physical NIC TX Queue, Max
> (n+32<=4096)*/
> -
> +#define RING_NAME_MAX (RTE_MEMZONE_NAMESIZE - sizeof(RTE_RING_MZ_PREFIX))
>  static char *cuse_dev_name = NULL;    /* Character device cuse_dev_name.
> */
>  static char *vhost_sock_dir = NULL;   /* Location of vhost-user sockets */
>
> @@ -1797,7 +1797,7 @@ dpdk_ring_create(const char dev_name[], unsigned int
> port_no,
>                   unsigned int *eth_port_id)
>  {
>      struct dpdk_ring *ivshmem;
> -    char ring_name[10];
> +    char ring_name[RING_NAME_MAX];
>      int err;
>
>      ivshmem = dpdk_rte_mzalloc(sizeof *ivshmem);
> @@ -1806,7 +1806,7 @@ dpdk_ring_create(const char dev_name[], unsigned int
> port_no,
>      }
>
>      /* XXX: Add support for multiquque ring. */
> -    err = snprintf(ring_name, 10, "%s_tx", dev_name);
> +    err = snprintf(ring_name, sizeof(ring_name), "%s_tx", dev_name);
>      if (err < 0) {
>          return -err;
>      }
> @@ -1819,7 +1819,7 @@ dpdk_ring_create(const char dev_name[], unsigned int
> port_no,
>          return ENOMEM;
>      }
>
> -    err = snprintf(ring_name, 10, "%s_rx", dev_name);
> +    err = snprintf(ring_name, sizeof(ring_name), "%s_rx", dev_name);
>      if (err < 0) {
>          return -err;
>      }
>
>
>
>
>
>



More information about the dev mailing list