[dpdk-dev] [PATCH v8 1/5] ethdev: add firmware version get

Thomas Monjalon thomas.monjalon at 6wind.com
Sun Jan 15 21:56:27 CET 2017


2017-01-12 14:31, Qiming Yang:
> + * @param fw_size
> + *   The size of the array pointed by fw_version, which should be
> + *   large enough to store firmware version of the device.
> + * @return
> + *   - (0) if successful.
> + *   - (-ENOTSUP) if operation is not supported.
> + *   - (-ENODEV) if *port_id* invalid.
> + *   - (-EINVAL) if *fw_size* is not enough to store firmware version.
> + */
> +int rte_eth_dev_fw_version_get(uint8_t port_id,
> +                              char *fw_version, size_t fw_size);
> +

How to know the required size?
You should return the size of the non truncated string as snprintf does.
Note: Andrew Rybchenko already commented on it and you didn't reply.


More information about the dev mailing list