[dpdk-dev] [PATCH v10 05/11] net/failsafe: add flexible device definition
Ferruh Yigit
ferruh.yigit at intel.com
Mon Jul 17 17:45:59 CEST 2017
On 7/15/2017 6:57 PM, Gaetan Rivet wrote:
> Add the "exec" device type.
> The parameters given to this type of device will be executed in a shell.
> The output of this command is then used as a definition for a device.
>
> That command can be re-interpreted if the related device is not
> plugged-in. It allows for a device definition to react to system
> changes (e.g. changing PCI bus for a given device).
>
> Signed-off-by: Gaetan Rivet <gaetan.rivet at 6wind.com>
> Acked-by: Olga Shern <olgas at mellanox.com>
> ---
> doc/guides/nics/fail_safe.rst | 20 +++++++
> drivers/net/failsafe/failsafe_args.c | 95 +++++++++++++++++++++++++++++++++
> drivers/net/failsafe/failsafe_ether.c | 7 +++
> drivers/net/failsafe/failsafe_private.h | 4 ++
> 4 files changed, 126 insertions(+)
>
> diff --git a/doc/guides/nics/fail_safe.rst b/doc/guides/nics/fail_safe.rst
> index 5ec3031..be73d7e 100644
> --- a/doc/guides/nics/fail_safe.rst
> +++ b/doc/guides/nics/fail_safe.rst
> @@ -87,6 +87,19 @@ Fail-safe command line parameters
> additional sub-device parameters if need be. They will be passed on to the
> sub-device.
>
> +- **exec(<shell command>)** parameter
> +
> + This parameter allows the user to provide a command to the fail-safe PMD to
> + execute and define a sub-device.
> + It is done within a regular shell context.
> + The first line of its output is read by the fail-safe PMD and otherwise
> + interpreted as if passed by the regular **dev** parameter.
> + Any other line is discarded.
> + If the command fail or output an incorrect string, the sub-device is not
> + initialized.
> + All commas within the ``shell command`` are replaced by spaces before
> + executing the command. This helps using scripts to specify devices.
> +
> - **mac** parameter [MAC address]
>
> This parameter allows the user to set a default MAC address to the fail-safe
> @@ -135,6 +148,13 @@ This section shows some example of using **testpmd** with a fail-safe PMD.
> -w 'net_failsafe0,mac=de:ad:be:ef:01:02,dev(84:00.0),dev(net_ring0)'
> -w 81:00.0 -- -i
>
> +#. Start testpmd using a flexible device definition
> +
> + .. code-block:: console
> +
> + $RTE_TARGET/build/app/testpmd -c 0xff -n 4 --no-pci \
> + --vdev='net_failsafe0,exec(echo 84:00.0)' -- -i
Hi Gaetan,
What is the usecase for this feature.
How this is different from --vdev='net_failsafe0,dev(`echo 84:00.0`)' ?
More information about the dev
mailing list