From 48d8675c9cff887f96e960183e7b408829870b46 Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Fri, 9 Jun 2017 19:36:04 +0100 Subject: [PATCH] ethdev: ensure same name size for device and ethdev 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 9f2765d514..0c8f6c8022 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 88120a1cf7..b11cbfca3c 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 14465402f5..d1076c8210 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 -- 2.20.1