From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ferruh.yigit@intel.com>
Received: from mga04.intel.com (mga04.intel.com [192.55.52.120])
 by dpdk.org (Postfix) with ESMTP id EEF13376C
 for <dev@dpdk.org>; Mon, 17 Jul 2017 17:46:09 +0200 (CEST)
Received: from orsmga005.jf.intel.com ([10.7.209.41])
 by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 17 Jul 2017 08:46:08 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.40,374,1496127600"; d="scan'208";a="126078662"
Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.249.74.32])
 ([10.249.74.32])
 by orsmga005.jf.intel.com with ESMTP; 17 Jul 2017 08:46:01 -0700
To: Gaetan Rivet <gaetan.rivet@6wind.com>, dev@dpdk.org
References: <cover.1500130634.git.gaetan.rivet@6wind.com>
 <b337b8afcd9b789931907e0f9e96f21d6ade3792.1500130635.git.gaetan.rivet@6wind.com>
From: Ferruh Yigit <ferruh.yigit@intel.com>
Message-ID: <f72b4db1-e207-70c1-80c7-2877e761305f@intel.com>
Date: Mon, 17 Jul 2017 16:45:59 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
 Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <b337b8afcd9b789931907e0f9e96f21d6ade3792.1500130635.git.gaetan.rivet@6wind.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH v10 05/11] net/failsafe: add flexible device
 definition
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 17 Jul 2017 15:46:10 -0000

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@6wind.com>
> Acked-by: Olga Shern <olgas@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`)' ?