From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v8 1/5] ethdev: add firmware version get Date: Sun, 15 Jan 2017 21:56:27 +0100 Message-ID: <2137227.KlaXuaYADV@xps13> References: <1484116905-57438-1-git-send-email-qiming.yang@intel.com> <1484202716-41669-1-git-send-email-qiming.yang@intel.com> <1484202716-41669-2-git-send-email-qiming.yang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, ferruh.yigit@intel.com, remy.horton@intel.com To: Qiming Yang Return-path: Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 69C42F971 for ; Sun, 15 Jan 2017 21:56:29 +0100 (CET) Received: by mail-wm0-f50.google.com with SMTP id r144so148041238wme.1 for ; Sun, 15 Jan 2017 12:56:29 -0800 (PST) In-Reply-To: <1484202716-41669-2-git-send-email-qiming.yang@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.