DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [dpdk-dev] [FDIO] dpdk: add devargs support
  2019-12-13 23:35 [dpdk-dev] [FDIO] dpdk: add devargs support chenmin.sun
@ 2019-12-13 14:50 ` Ananyev, Konstantin
  2019-12-13 14:52   ` Sun, Chenmin
  0 siblings, 1 reply; 3+ messages in thread
From: Ananyev, Konstantin @ 2019-12-13 14:50 UTC (permalink / raw)
  To: Sun, Chenmin, dev



> From: Chenmin Sun <chenmin.sun@intel.com>
> 
> Type: feature
> 
> This patch adds the devargs support for dpdk device
> The devargs are used as hardware-specific init args for dpdk devices
> please refer to the nic guides under
> $(DPDK_DIR)/doc/guides/nics/$(NIC_DRIVER).rst
> 
> Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
> Change-Id: Id380d04720090bb66afe5ce09d664e5e248b8eb9


Isn't it patch for vpp?
If so wrong mailing list 😊

> ---
>  src/plugins/dpdk/device/dpdk.h   |  2 ++
>  src/plugins/dpdk/device/format.c |  3 +++
>  src/plugins/dpdk/device/init.c   | 36 +++++++++++++++++++++-----------
>  src/vpp/conf/startup.conf        |  5 +++++
>  4 files changed, 34 insertions(+), 12 deletions(-)
> 
> diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h
> index d58d2daa7..ab28ac06a 100644
> --- a/src/plugins/dpdk/device/dpdk.h
> +++ b/src/plugins/dpdk/device/dpdk.h
> @@ -336,6 +336,8 @@ typedef struct
>    u32 hqos_enabled;
>    dpdk_device_config_hqos_t hqos;
>    u8 tso;
> +  u8 *devargs;
> +
>  #define DPDK_DEVICE_TSO_DEFAULT 0
>  #define DPDK_DEVICE_TSO_OFF 1
>  #define DPDK_DEVICE_TSO_ON  2
> diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c
> index 292c083fc..20493eb77 100644
> --- a/src/plugins/dpdk/device/format.c
> +++ b/src/plugins/dpdk/device/format.c
> @@ -564,6 +564,9 @@ format_dpdk_device (u8 * s, va_list * args)
>  	      format_white_space, indent + 2, format_dpdk_link_status, xd);
>    s = format (s, "%Uflags: %U\n",
>  	      format_white_space, indent + 2, format_dpdk_device_flags, xd);
> +  if (di.device->devargs && di.device->devargs->args)
> +    s = format (s, "%UDevargs: %s\n",
> +		format_white_space, indent + 2, di.device->devargs->args);
>    s = format (s, "%Urx: queues %d (max %d), desc %d "
>  	      "(min %d max %d align %d)\n",
>  	      format_white_space, indent + 2, xd->rx_q_used, di.max_rx_queues,
> diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
> index 5a6262c30..d0125e939 100644
> --- a/src/plugins/dpdk/device/init.c
> +++ b/src/plugins/dpdk/device/init.c
> @@ -1118,6 +1118,8 @@ dpdk_device_config (dpdk_config_main_t * conf, vlib_pci_addr_t pci_addr,
>  	{
>  	  devconf->tso = DPDK_DEVICE_TSO_OFF;
>  	}
> +      else if (unformat (input, "devargs %s", &devconf->devargs))
> +	;
>        else
>  	{
>  	  error = clib_error_return (0, "unknown input `%U'",
> @@ -1428,21 +1430,31 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
>  	/* copy tso config from default device */
>  	_(tso)
> 
> +	/* copy tso config from default device */
> +	_(devargs)
> +
>      /* add DPDK EAL whitelist/blacklist entry */
>      if (num_whitelisted > 0 && devconf->is_blacklisted == 0)
> -      {
> -	tmp = format (0, "-w%c", 0);
> -	vec_add1 (conf->eal_init_args, tmp);
> -	tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
> -	vec_add1 (conf->eal_init_args, tmp);
> -      }
> +    {
> +	  tmp = format (0, "-w%c", 0);
> +	  vec_add1 (conf->eal_init_args, tmp);
> +	  if (devconf->devargs)
> +	  {
> +	    tmp = format (0, "%U,%s", format_vlib_pci_addr, &devconf->pci_addr, devconf->devargs, 0);
> +	  }
> +	  else
> +	  {
> +	    tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
> +	  }
> +	  vec_add1 (conf->eal_init_args, tmp);
> +    }
>      else if (num_whitelisted == 0 && devconf->is_blacklisted != 0)
> -      {
> -	tmp = format (0, "-b%c", 0);
> -	vec_add1 (conf->eal_init_args, tmp);
> -	tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
> -	vec_add1 (conf->eal_init_args, tmp);
> -      }
> +    {
> +	  tmp = format (0, "-b%c", 0);
> +	  vec_add1 (conf->eal_init_args, tmp);
> +	  tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
> +	  vec_add1 (conf->eal_init_args, tmp);
> +    }
>    }));
>    /* *INDENT-ON* */
> 
> diff --git a/src/vpp/conf/startup.conf b/src/vpp/conf/startup.conf
> index 3d83a1336..b0d0c8664 100644
> --- a/src/vpp/conf/startup.conf
> +++ b/src/vpp/conf/startup.conf
> @@ -105,6 +105,11 @@ cpu {
>  		## Default is off
>  		## To enable TSO, 'enable-tcp-udp-checksum' must be set
>  		# tso on
> +
> +		## Devargs
> +                ## device specific init args
> +                ## Default is NULL
> +		# devargs safe-mode-support=1,pipeline-mode-support=1
>  	# }
> 
>  	## Whitelist specific interface by specifying PCI address
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [FDIO] dpdk: add devargs support
  2019-12-13 14:50 ` Ananyev, Konstantin
@ 2019-12-13 14:52   ` Sun, Chenmin
  0 siblings, 0 replies; 3+ messages in thread
From: Sun, Chenmin @ 2019-12-13 14:52 UTC (permalink / raw)
  To: Ananyev, Konstantin, dev

Ohhhh I'm sorry...

Best Regards,
Sun, Chenmin

-----Original Message-----
From: Ananyev, Konstantin 
Sent: Friday, December 13, 2019 10:51 PM
To: Sun, Chenmin <chenmin.sun@intel.com>; dev@dpdk.org
Subject: RE: [dpdk-dev] [FDIO] dpdk: add devargs support



> From: Chenmin Sun <chenmin.sun@intel.com>
> 
> Type: feature
> 
> This patch adds the devargs support for dpdk device The devargs are 
> used as hardware-specific init args for dpdk devices please refer to 
> the nic guides under $(DPDK_DIR)/doc/guides/nics/$(NIC_DRIVER).rst
> 
> Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
> Change-Id: Id380d04720090bb66afe5ce09d664e5e248b8eb9


Isn't it patch for vpp?
If so wrong mailing list 😊

> ---
>  src/plugins/dpdk/device/dpdk.h   |  2 ++
>  src/plugins/dpdk/device/format.c |  3 +++
>  src/plugins/dpdk/device/init.c   | 36 +++++++++++++++++++++-----------
>  src/vpp/conf/startup.conf        |  5 +++++
>  4 files changed, 34 insertions(+), 12 deletions(-)
> 
> diff --git a/src/plugins/dpdk/device/dpdk.h 
> b/src/plugins/dpdk/device/dpdk.h index d58d2daa7..ab28ac06a 100644
> --- a/src/plugins/dpdk/device/dpdk.h
> +++ b/src/plugins/dpdk/device/dpdk.h
> @@ -336,6 +336,8 @@ typedef struct
>    u32 hqos_enabled;
>    dpdk_device_config_hqos_t hqos;
>    u8 tso;
> +  u8 *devargs;
> +
>  #define DPDK_DEVICE_TSO_DEFAULT 0
>  #define DPDK_DEVICE_TSO_OFF 1
>  #define DPDK_DEVICE_TSO_ON  2
> diff --git a/src/plugins/dpdk/device/format.c 
> b/src/plugins/dpdk/device/format.c
> index 292c083fc..20493eb77 100644
> --- a/src/plugins/dpdk/device/format.c
> +++ b/src/plugins/dpdk/device/format.c
> @@ -564,6 +564,9 @@ format_dpdk_device (u8 * s, va_list * args)
>        format_white_space, indent + 2, format_dpdk_link_status, xd);
>    s = format (s, "%Uflags: %U\n",
>        format_white_space, indent + 2, format_dpdk_device_flags, xd);
> +  if (di.device->devargs && di.device->devargs->args)
> +    s = format (s, "%UDevargs: %s\n", format_white_space, indent + 2, 
> +di.device->devargs->args);
>    s = format (s, "%Urx: queues %d (max %d), desc %d "
>        "(min %d max %d align %d)\n",
>        format_white_space, indent + 2, xd->rx_q_used, 
> di.max_rx_queues, diff --git a/src/plugins/dpdk/device/init.c 
> b/src/plugins/dpdk/device/init.c index 5a6262c30..d0125e939 100644
> --- a/src/plugins/dpdk/device/init.c
> +++ b/src/plugins/dpdk/device/init.c
> @@ -1118,6 +1118,8 @@ dpdk_device_config (dpdk_config_main_t * conf, 
> vlib_pci_addr_t pci_addr,  {
>    devconf->tso = DPDK_DEVICE_TSO_OFF;  }
> +      else if (unformat (input, "devargs %s", &devconf->devargs)) ;
>        else
>  {
>    error = clib_error_return (0, "unknown input `%U'", @@ -1428,21 
> +1430,31 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
>  /* copy tso config from default device */
>  _(tso)
> 
> +/* copy tso config from default device */
> +_(devargs)
> +
>      /* add DPDK EAL whitelist/blacklist entry */
>      if (num_whitelisted > 0 && devconf->is_blacklisted == 0)
> -      {
> -tmp = format (0, "-w%c", 0);
> -vec_add1 (conf->eal_init_args, tmp);
> -tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 
> 0);
> -vec_add1 (conf->eal_init_args, tmp);
> -      }
> +    {
> +  tmp = format (0, "-w%c", 0);
> +  vec_add1 (conf->eal_init_args, tmp);  if (devconf->devargs)  {
> +    tmp = format (0, "%U,%s", format_vlib_pci_addr, 
> + &devconf->pci_addr, devconf->devargs, 0);  }  else  {
> +    tmp = format (0, "%U%c", format_vlib_pci_addr, 
> + &devconf->pci_addr, 0);  }
> +  vec_add1 (conf->eal_init_args, tmp);
> +    }
>      else if (num_whitelisted == 0 && devconf->is_blacklisted != 0)
> -      {
> -tmp = format (0, "-b%c", 0);
> -vec_add1 (conf->eal_init_args, tmp);
> -tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 
> 0);
> -vec_add1 (conf->eal_init_args, tmp);
> -      }
> +    {
> +  tmp = format (0, "-b%c", 0);
> +  vec_add1 (conf->eal_init_args, tmp);  tmp = format (0, "%U%c", 
> + format_vlib_pci_addr, &devconf->pci_addr, 0);
> +  vec_add1 (conf->eal_init_args, tmp);
> +    }
>    }));
>    /* *INDENT-ON* */
> 
> diff --git a/src/vpp/conf/startup.conf b/src/vpp/conf/startup.conf 
> index 3d83a1336..b0d0c8664 100644
> --- a/src/vpp/conf/startup.conf
> +++ b/src/vpp/conf/startup.conf
> @@ -105,6 +105,11 @@ cpu {
>  ## Default is off
>  ## To enable TSO, 'enable-tcp-udp-checksum' must be set  # tso on
> +
> +## Devargs
> +                ## device specific init args
> +                ## Default is NULL
> +# devargs safe-mode-support=1,pipeline-mode-support=1
>  # }
> 
>  ## Whitelist specific interface by specifying PCI address
> --
> 2.17.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [FDIO] dpdk: add devargs support
@ 2019-12-13 23:35 chenmin.sun
  2019-12-13 14:50 ` Ananyev, Konstantin
  0 siblings, 1 reply; 3+ messages in thread
From: chenmin.sun @ 2019-12-13 23:35 UTC (permalink / raw)
  To: dev

From: Chenmin Sun <chenmin.sun@intel.com>

Type: feature

This patch adds the devargs support for dpdk device
The devargs are used as hardware-specific init args for dpdk devices
please refer to the nic guides under
$(DPDK_DIR)/doc/guides/nics/$(NIC_DRIVER).rst

Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
Change-Id: Id380d04720090bb66afe5ce09d664e5e248b8eb9
---
 src/plugins/dpdk/device/dpdk.h   |  2 ++
 src/plugins/dpdk/device/format.c |  3 +++
 src/plugins/dpdk/device/init.c   | 36 +++++++++++++++++++++-----------
 src/vpp/conf/startup.conf        |  5 +++++
 4 files changed, 34 insertions(+), 12 deletions(-)

diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h
index d58d2daa7..ab28ac06a 100644
--- a/src/plugins/dpdk/device/dpdk.h
+++ b/src/plugins/dpdk/device/dpdk.h
@@ -336,6 +336,8 @@ typedef struct
   u32 hqos_enabled;
   dpdk_device_config_hqos_t hqos;
   u8 tso;
+  u8 *devargs;
+
 #define DPDK_DEVICE_TSO_DEFAULT 0
 #define DPDK_DEVICE_TSO_OFF 1
 #define DPDK_DEVICE_TSO_ON  2
diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c
index 292c083fc..20493eb77 100644
--- a/src/plugins/dpdk/device/format.c
+++ b/src/plugins/dpdk/device/format.c
@@ -564,6 +564,9 @@ format_dpdk_device (u8 * s, va_list * args)
 	      format_white_space, indent + 2, format_dpdk_link_status, xd);
   s = format (s, "%Uflags: %U\n",
 	      format_white_space, indent + 2, format_dpdk_device_flags, xd);
+  if (di.device->devargs && di.device->devargs->args)
+    s = format (s, "%UDevargs: %s\n",
+		format_white_space, indent + 2, di.device->devargs->args);
   s = format (s, "%Urx: queues %d (max %d), desc %d "
 	      "(min %d max %d align %d)\n",
 	      format_white_space, indent + 2, xd->rx_q_used, di.max_rx_queues,
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 5a6262c30..d0125e939 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -1118,6 +1118,8 @@ dpdk_device_config (dpdk_config_main_t * conf, vlib_pci_addr_t pci_addr,
 	{
 	  devconf->tso = DPDK_DEVICE_TSO_OFF;
 	}
+      else if (unformat (input, "devargs %s", &devconf->devargs))
+	;
       else
 	{
 	  error = clib_error_return (0, "unknown input `%U'",
@@ -1428,21 +1430,31 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
 	/* copy tso config from default device */
 	_(tso)
 
+	/* copy tso config from default device */
+	_(devargs)
+
     /* add DPDK EAL whitelist/blacklist entry */
     if (num_whitelisted > 0 && devconf->is_blacklisted == 0)
-      {
-	tmp = format (0, "-w%c", 0);
-	vec_add1 (conf->eal_init_args, tmp);
-	tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
-	vec_add1 (conf->eal_init_args, tmp);
-      }
+    {
+	  tmp = format (0, "-w%c", 0);
+	  vec_add1 (conf->eal_init_args, tmp);
+	  if (devconf->devargs)
+	  {
+	    tmp = format (0, "%U,%s", format_vlib_pci_addr, &devconf->pci_addr, devconf->devargs, 0);
+	  }
+	  else
+	  {
+	    tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
+	  }
+	  vec_add1 (conf->eal_init_args, tmp);
+    }
     else if (num_whitelisted == 0 && devconf->is_blacklisted != 0)
-      {
-	tmp = format (0, "-b%c", 0);
-	vec_add1 (conf->eal_init_args, tmp);
-	tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
-	vec_add1 (conf->eal_init_args, tmp);
-      }
+    {
+	  tmp = format (0, "-b%c", 0);
+	  vec_add1 (conf->eal_init_args, tmp);
+	  tmp = format (0, "%U%c", format_vlib_pci_addr, &devconf->pci_addr, 0);
+	  vec_add1 (conf->eal_init_args, tmp);
+    }
   }));
   /* *INDENT-ON* */
 
diff --git a/src/vpp/conf/startup.conf b/src/vpp/conf/startup.conf
index 3d83a1336..b0d0c8664 100644
--- a/src/vpp/conf/startup.conf
+++ b/src/vpp/conf/startup.conf
@@ -105,6 +105,11 @@ cpu {
 		## Default is off
 		## To enable TSO, 'enable-tcp-udp-checksum' must be set
 		# tso on
+
+		## Devargs
+                ## device specific init args
+                ## Default is NULL
+		# devargs safe-mode-support=1,pipeline-mode-support=1
 	# }
 
 	## Whitelist specific interface by specifying PCI address
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-13 14:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-13 23:35 [dpdk-dev] [FDIO] dpdk: add devargs support chenmin.sun
2019-12-13 14:50 ` Ananyev, Konstantin
2019-12-13 14:52   ` Sun, Chenmin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).