]> git.droids-corp.org - dpdk.git/commitdiff
ethdev: ensure same name size for device and ethdev
authorFerruh Yigit <ferruh.yigit@intel.com>
Fri, 9 Jun 2017 18:36:04 +0000 (19:36 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 5 Jul 2017 22:16:15 +0000 (00:16 +0200)
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>
lib/librte_eal/common/include/rte_dev.h
lib/librte_eal/common/include/rte_devargs.h
lib/librte_ether/rte_ethdev.h

index 9f2765d514caa65545cf3a612c7ef0798a4b9745..0c8f6c8022d9991224ec07f6327ae8a34d91dc6d 100644 (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.
  */
index 88120a1cf773527dff3ab8468dd91c8647a0db6e..b11cbfca3c90c0a3debee420bc33aa1807e9b903 100644 (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. */
index 14465402f5eae024005263ff1a6cc3bce85d4c64..d1076c821065137d8c444558cfeb1dabc9c4bc56 100644 (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