From patchwork Fri Jun 9 18:36:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 25238 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 0FC6F388F; Fri, 9 Jun 2017 20:36:14 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A51AA3790 for ; Fri, 9 Jun 2017 20:36:11 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jun 2017 11:36:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.39,319,1493708400"; d="scan'208"; a="1180496565" Received: from silpixa00372839.ir.intel.com (HELO silpixa00372839.ger.corp.intel.com) ([10.237.222.154]) by fmsmga002.fm.intel.com with ESMTP; 09 Jun 2017 11:36:08 -0700 From: Ferruh Yigit To: Thomas Monjalon Cc: dev@dpdk.org, Ferruh Yigit Date: Fri, 9 Jun 2017 19:36:04 +0100 Message-Id: <20170609183606.34596-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170526161141.4746-1-ferruh.yigit@intel.com> References: <20170526161141.4746-1-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH v2 1/3] ethdev: ensure same name size for device and ethdev X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" rte_device->name copied into eth_dev->name, right now size is same for both but the requirement is not clear. This patch highlights the relation without changing actual sizes. Signed-off-by: Ferruh Yigit --- lib/librte_eal/common/include/rte_dev.h | 2 ++ lib/librte_eal/common/include/rte_devargs.h | 2 +- lib/librte_ether/rte_ethdev.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index de20c06..fdd5b11 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -132,6 +132,8 @@ struct rte_driver { const char *alias; /**< Driver alias. */ }; +#define RTE_DEV_NAME_MAX_LEN (32) + /** * A structure describing a generic device. */ diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h index 88120a1..b11cbfc 100644 --- a/lib/librte_eal/common/include/rte_devargs.h +++ b/lib/librte_eal/common/include/rte_devargs.h @@ -86,7 +86,7 @@ struct rte_devargs { /** Used if type is RTE_DEVTYPE_VIRTUAL. */ struct { /** Driver name. */ - char drv_name[32]; + char drv_name[RTE_DEV_NAME_MAX_LEN]; } virt; }; /** Arguments string as given by user or "" for no argument. */ diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index d1297a5..e8ac546 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1624,7 +1624,7 @@ struct rte_eth_dev_sriov { }; #define RTE_ETH_DEV_SRIOV(dev) ((dev)->data->sriov) -#define RTE_ETH_NAME_MAX_LEN (32) +#define RTE_ETH_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN /** * @internal