Skip to content

Commit

Permalink
eal: allow both allow and block options coexistence
Browse files Browse the repository at this point in the history
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>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
MarvinLiu123 authored and ovsrobot committed Jul 7, 2023
1 parent 5d41169 commit 2cfeab8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,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>
Expand Down
14 changes: 0 additions & 14 deletions lib/eal/common/eal_common_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2cfeab8

Please sign in to comment.