From patchwork Mon Sep 18 13:03:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 131573 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E955B425D1; Mon, 18 Sep 2023 15:04:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16B7740A8B; Mon, 18 Sep 2023 15:04:10 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 0676640A6E for ; Mon, 18 Sep 2023 15:04:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695042248; x=1726578248; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/LgBJRJsTvjFbK/Eeym9+ozhJFSN56v/DJZLnFfiznQ=; b=LMr4kj85BaaygFf4XXt2iOsoMZYNb6tjrls5nOj451QwSpvCHc5lm2QA xTFQ/FnyjWy0w7DUh7yHM559TV7GEc6pMXB0kytdydOlfWrPwSMGSvCcT e/eaX3/spAP0oCTB8zJJaCtIPF3J1W1bXxHAisCxjyjsm0Tqhec/quTbX ijVMjuBi/5caARM2cGOIdSQ9VGlqLkP+kBwugBaUJtx5Vpfu8nm02j3+v p7CzugW74GJuMp/sBWCcXaARSAOiCnTsGSCRB7E3WOaORSEY1dHp0CBxE CoDLXfNmEIfMoT6kF9Mi5JMslCUCb5WuX1Uy/K+wdC8Z1Y0yirSTL1dlD g==; X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="369969403" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="369969403" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 06:04:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="739130642" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="739130642" Received: from silpixa00401385.ir.intel.com ([10.237.214.14]) by orsmga007.jf.intel.com with ESMTP; 18 Sep 2023 06:04:06 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Olivier Matz , Bruce Richardson Subject: [RFC PATCH v2 4/5] buildtools/dpdk-cmdline-gen: add IP address support Date: Mon, 18 Sep 2023 14:03:51 +0100 Message-Id: <20230918130352.379478-5-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230918130352.379478-1-bruce.richardson@intel.com> References: <20230802170052.955323-1-bruce.richardson@intel.com> <20230918130352.379478-1-bruce.richardson@intel.com> MIME-Version: 1.0 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 Add support for apps to have IP addresses as command parameters Signed-off-by: Bruce Richardson --- buildtools/dpdk-cmdline-gen.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/buildtools/dpdk-cmdline-gen.py b/buildtools/dpdk-cmdline-gen.py index 1ddd8b6bbb..c1f8a6f1da 100755 --- a/buildtools/dpdk-cmdline-gen.py +++ b/buildtools/dpdk-cmdline-gen.py @@ -49,6 +49,10 @@ def process_command(tokens, cfile): result_struct.append(f"\t{t_type.lower()}_t {t_name};") initializers.append(f"static cmdline_parse_token_num_t cmd_{name}_{t_name}_tok =\n" + f"\tTOKEN_NUM_INITIALIZER(struct cmd_{name}_result, {t_name}, RTE_{t_type});") + elif t_type in ['IP', 'IP_ADDR', 'IPADDR']: + result_struct.append(f"\tcmdline_ipaddr_t {t_name};") + initializers.append(f"cmdline_parse_token_ipaddr_t cmd_{name}_{t_name}_tok =\n" + + f"\tTOKEN_IPV4_INITIALIZER(struct cmd_{name}_result, {t_name});") else: print(f"Error: unknown token-type {t}", file=sys.stderr) sys.exit(1) @@ -96,6 +100,7 @@ def process_commands(infile, hfile, cfile, ctxname): print("#include ") print("#include ") print("#include ") + print("#include ") print("") for line in infile.readlines():