From: Neil Horman <nhorman@tuxdriver.com>
To: "Nicolás Pernas Maradei" <nicolas.pernas.maradei@emutex.com>
Cc: dev@dpdk.org, "Nicolás Pernas Maradei" <nico@emutex.com>
Subject: Re: [dpdk-dev] [PATCH] eal: allow virtual devices to be white/black listed
Date: Mon, 17 Nov 2014 09:10:50 -0500 [thread overview]
Message-ID: <20141117141050.GD17886@hmsreliant.think-freely.org> (raw)
In-Reply-To: <1416173215-27533-1-git-send-email-nicolas.pernas.maradei@emutex.com>
On Sun, Nov 16, 2014 at 09:26:55PM +0000, Nicolás Pernas Maradei wrote:
> From: Nicolás Pernas Maradei <nico@emutex.com>
>
> Virtual and physical devices are now treated the same in terms of
> white/black listing. Virtual devices can be defined using --vdev as
> before and also whitelisted (using -w vdev_name) or blacklisted (using -b
> vdev_name). This allows the user to have only a virtual device (port) in
> use.
>
> Signed-off-by: Nicolás Pernas Maradei <nico@emutex.com>
> ---
> app/test-pmd/cmdline.c | 5 +-
> app/test/commands.c | 4 +-
> app/test/test_devargs.c | 69 +++++-----
> app/test/test_pci.c | 3 +-
> lib/librte_eal/bsdapp/eal/eal.c | 8 +-
> lib/librte_eal/bsdapp/eal/eal_pci.c | 2 +-
> lib/librte_eal/common/eal_common_dev.c | 24 ++--
> lib/librte_eal/common/eal_common_devargs.c | 196 ++++++++++++++++++++--------
> lib/librte_eal/common/eal_common_options.c | 11 +-
> lib/librte_eal/common/eal_common_pci.c | 11 +-
> lib/librte_eal/common/include/rte_devargs.h | 124 +++++++++++++-----
> lib/librte_eal/linuxapp/eal/eal.c | 8 +-
> lib/librte_eal/linuxapp/eal/eal_pci.c | 2 +-
> 13 files changed, 319 insertions(+), 148 deletions(-)
>
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index 4c3fc76..f6ba4fe 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -6844,6 +6844,8 @@ static void cmd_dump_parsed(void *parsed_result,
> rte_mempool_list_dump(stdout);
> else if (!strcmp(res->dump, "dump_devargs"))
> rte_eal_devargs_dump(stdout);
> + else if (!strcmp(res->dump, "dump_vdevargs"))
> + rte_eal_vdevargs_dump(stdout);
> }
>
> cmdline_parse_token_string_t cmd_dump_dump =
> @@ -6854,7 +6856,8 @@ cmdline_parse_token_string_t cmd_dump_dump =
> "dump_struct_sizes#"
> "dump_ring#"
> "dump_mempool#"
> - "dump_devargs");
> + "dump_devargs#"
> + "dump_vdevargs");
>
> cmdline_parse_inst_t cmd_dump = {
> .f = cmd_dump_parsed, /* function to call */
> diff --git a/app/test/commands.c b/app/test/commands.c
> index 92a17ed..6799d63 100644
> --- a/app/test/commands.c
> +++ b/app/test/commands.c
> @@ -161,13 +161,15 @@ static void cmd_dump_parsed(void *parsed_result,
> rte_mempool_list_dump(stdout);
> else if (!strcmp(res->dump, "dump_devargs"))
> rte_eal_devargs_dump(stdout);
> + else if (!strcmp(res->dump, "dump_vdevargs"))
> + rte_eal_vdevargs_dump(stdout);
> }
>
> cmdline_parse_token_string_t cmd_dump_dump =
> TOKEN_STRING_INITIALIZER(struct cmd_dump_result, dump,
> "dump_physmem#dump_memzone#dump_log_history#"
> "dump_struct_sizes#dump_ring#dump_mempool#"
> - "dump_devargs");
> + "dump_devargs#dump_vdevargs");
>
> cmdline_parse_inst_t cmd_dump = {
> .f = cmd_dump_parsed, /* function to call */
> diff --git a/app/test/test_devargs.c b/app/test/test_devargs.c
> index f0acf8e..8fb93df 100644
> --- a/app/test/test_devargs.c
> +++ b/app/test/test_devargs.c
> @@ -52,52 +52,60 @@ static void free_devargs_list(void)
> }
> }
>
> +/* clear vdevargs list that was modified by the test */
> +static void free_vdevargs_list(void)
> +{
> + struct rte_vdevargs *vdevargs;
> +
> + while (!TAILQ_EMPTY(&vdevargs_list)) {
> + vdevargs = TAILQ_FIRST(&vdevargs_list);
> + TAILQ_REMOVE(&vdevargs_list, vdevargs, next);
> + free(vdevargs);
> + }
> +}
> +
> static int
> test_devargs(void)
> {
> struct rte_devargs_list save_devargs_list;
> + struct rte_vdevargs_list save_vdevargs_list;
> struct rte_devargs *devargs;
> + struct rte_vdevargs *vdevargs;
>
> /* save the real devargs_list, it is restored at the end of the test */
> save_devargs_list = devargs_list;
> + save_vdevargs_list = vdevargs_list;
> TAILQ_INIT(&devargs_list);
> + TAILQ_INIT(&vdevargs_list);
>
> /* test valid cases */
> - if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "08:00.1") < 0)
> - goto fail;
> - if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, "0000:5:00.0") < 0)
> - goto fail;
> - if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, "04:00.0,arg=val") < 0)
> - goto fail;
> - if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, "0000:01:00.1") < 0)
> + if (rte_eal_devargs_add(RTE_DEV_WHITELISTED, "08:00.1") < 0)
> goto fail;
> - if (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) != 2)
> + if (rte_eal_devargs_add(RTE_DEV_WHITELISTED, "0000:5:00.0") < 0)
> goto fail;
> - if (rte_eal_devargs_type_count(RTE_DEVTYPE_BLACKLISTED_PCI) != 2)
> + if (rte_eal_devargs_add(RTE_DEV_BLACKLISTED, "04:00.0") < 0)
> goto fail;
> - if (rte_eal_devargs_type_count(RTE_DEVTYPE_VIRTUAL) != 0)
> + if (rte_eal_devargs_add(RTE_DEV_BLACKLISTED, "0000:01:00.1") < 0)
> goto fail;
What are the above pci bus/device/function tuples?
Neil
next prev parent reply other threads:[~2014-11-17 14:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-16 21:26 Nicolás Pernas Maradei
2014-11-17 14:10 ` Neil Horman [this message]
2014-11-17 14:58 ` Nicolas Pernas Maradei
[not found] ` <546A0BA2.3040306@emutex.com>
2014-11-17 16:00 ` Neil Horman
2014-11-17 16:40 ` Nicolas Pernas Maradei
2014-11-17 16:52 ` Bruce Richardson
2014-11-17 21:17 ` Neil Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141117141050.GD17886@hmsreliant.think-freely.org \
--to=nhorman@tuxdriver.com \
--cc=dev@dpdk.org \
--cc=nico@emutex.com \
--cc=nicolas.pernas.maradei@emutex.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).