From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E004042DF2; Fri, 7 Jul 2023 07:16:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B4331406B5; Fri, 7 Jul 2023 07:16:21 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 5314040685 for ; Fri, 7 Jul 2023 07:16:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688706980; x=1720242980; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Uqbul4lBj6Zu8qpvgOW0m9XzGw04eMNCgX2GN4I3cck=; b=Lo6HGfWsZOnZDcdiOtYzZQZlsWf2vrmgvIMzgPRxi4RYxdg/bDT0qd0b 5qOnOHw8E8m0vwTFJeqe4qV9zm1ESzPuG9AD/hRbmmrz1Kv6u8KnLyKpK hB+1roMuxICwafcO8j1ynD7Ce2RCmbY1gzY0CK4xbL8pAomZpQ0+xNM7W uSiEkyUsBTErwIwDuhcF4/iJjkpQ02rL8W56NdcVP0scpjXUFl1fiVqFx o9Ui3pJMgfWNhy6Dg43HTbA8D4+gphw9QQLUPGRjrG27yG7UoBmxPx8JF /hRXGAM6CG7Y3oUZcgg9AWeH0mljnRjal9RZ9BuA8RrEDyRlx3b8YO3kD A==; X-IronPort-AV: E=McAfee;i="6600,9927,10763"; a="353648778" X-IronPort-AV: E=Sophos;i="6.01,187,1684825200"; d="scan'208";a="353648778" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2023 22:16:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10763"; a="719832041" X-IronPort-AV: E=Sophos;i="6.01,187,1684825200"; d="scan'208";a="719832041" Received: from npg-dpdk-virtual-marvin.sh.intel.com ([10.67.119.3]) by orsmga002.jf.intel.com with ESMTP; 06 Jul 2023 22:16:18 -0700 From: Marvin Liu To: thomas@monjalon.net, dev@dpdk.org Cc: Marvin Liu Subject: [PATCH] eal: allow both allow and block options coexistence Date: Fri, 7 Jul 2023 13:07:01 +0800 Message-Id: <20230707050701.21433-1-yong.liu@intel.com> X-Mailer: git-send-email 2.24.0.rc1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- .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 Yogev Chaimovich Yongjie Gu Yongji Xie -Yong Liu +Marvin Liu Yongping Zhang Yongseok Koh Yong Wang 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