From: Marvin Liu <yong.liu@intel.com>
To: thomas@monjalon.net, dev@dpdk.org
Cc: Marvin Liu <yong.liu@intel.com>
Subject: [PATCH] eal: allow both allow and block options coexistence
Date: Fri, 7 Jul 2023 13:07:01 +0800 [thread overview]
Message-ID: <20230707050701.21433-1-yong.liu@intel.com> (raw)
Currently, all buses use the same eal allow and block options. Need to
allow both allow and block options for different buses to coexist.
It wouldn't be a problem for pci bus if both allow and block options
were present. When the first option occurs, the scan mode for pci bus is
set.
For example:
--allow 0000:05:00.0 --block wq0.0
only pci device 0000:05:00.0 will be scanned
all devices except wq0.0 on dsa bus will be scanned
--allow 0000:05:00.0 --block 0000:05:00.1
block option will be ignored
--block 0000:05:00.1 --allow 0000:05:00.0
allow option will be ignored
Signed-off-by: Marvin Liu <yong.liu@intel.com>
---
.mailmap | 2 +-
lib/eal/common/eal_common_options.c | 14 --------------
2 files changed, 1 insertion(+), 15 deletions(-)
diff --git a/.mailmap b/.mailmap
index 0443e461a9..d256696485 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1548,7 +1548,7 @@ Yogesh Jangra <yogesh.jangra@intel.com>
Yogev Chaimovich <yogev@cgstowernetworks.com>
Yongjie Gu <yongjiex.gu@intel.com>
Yongji Xie <xieyongji@baidu.com>
-Yong Liu <yong.liu@intel.com>
+Marvin Liu <yong.liu@intel.com>
Yongping Zhang <yongping.zhang@broadcom.com>
Yongseok Koh <yskoh@mellanox.com>
Yong Wang <wang.yong19@zte.com.cn> <yongwang@vmware.com>
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index 0305933698..0d8f9c5a38 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -1623,24 +1623,15 @@ int
eal_parse_common_option(int opt, const char *optarg,
struct internal_config *conf)
{
- static int b_used;
- static int a_used;
-
switch (opt) {
case 'b':
- if (a_used)
- goto ba_conflict;
if (eal_option_device_add(RTE_DEVTYPE_BLOCKED, optarg) < 0)
return -1;
- b_used = 1;
break;
case 'a':
- if (b_used)
- goto ba_conflict;
if (eal_option_device_add(RTE_DEVTYPE_ALLOWED, optarg) < 0)
return -1;
- a_used = 1;
break;
/* coremask */
case 'c': {
@@ -1929,11 +1920,6 @@ eal_parse_common_option(int opt, const char *optarg,
}
return 0;
-
-ba_conflict:
- RTE_LOG(ERR, EAL,
- "Options allow (-a) and block (-b) can't be used at the same time\n");
- return -1;
}
static void
--
2.24.0.rc1
next reply other threads:[~2023-07-07 5:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-07 5:07 Marvin Liu [this message]
2023-07-07 7:12 ` Thomas Monjalon
-- strict thread matches above, loose matches on Subject: below --
2023-05-19 2:29 Marvin Liu
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=20230707050701.21433-1-yong.liu@intel.com \
--to=yong.liu@intel.com \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
/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).