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 <ferruh.yigit@intel.com>
This commit is contained in:
Ferruh Yigit 2017-06-09 19:36:04 +01:00 committed by Thomas Monjalon
parent a3a2e2c8f7
commit 48d8675c9c
3 changed files with 4 additions and 2 deletions

View File

@ -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.
*/

View File

@ -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. */

View File

@ -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