From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id E7FE110D8B for ; Thu, 22 Dec 2016 16:31:09 +0100 (CET) Received: by mail-wm0-f48.google.com with SMTP id g23so53349463wme.1 for ; Thu, 22 Dec 2016 07:31:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=i3v0QOLRkJxd7D4POaPCPSLZgyML0vpx1UlNiN4s0Sw=; b=E8lcHoIFpiZYwTKG+FRZSIVJyPXk1fV9x309B54G7mxAm/8lojkhnvmSPWEYSaienu DJ7MzvycD2JhjY2AJmHjEbg2e3iaoAOIlOl5jtBXkp+jPfxkGAh4F1BIxJHBMfpfxlrc 1gI1blVGUgAfiNhYHyGl2B1ZeAx4zYcsMY7RthEH5IYXVxCuhtYD68qazmRky2C8CKJ3 iAqq62cl+OHjNq6v2GD7Crvx56vSOFeGR25wRxbznxgACH0Pm7wNv7iRipJTqazf6AJn TPDwYHG8r/0BRTHiLv1Pzgx/D+uwsPK3bsCgV+OAvc9D5yw6h2jlC/RpWrlREyI4v0x7 rS5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=i3v0QOLRkJxd7D4POaPCPSLZgyML0vpx1UlNiN4s0Sw=; b=eBeAWMZCoFz+RGKOrw6ltFDVKZ+xuODK2aVObfomeqnwjh6qAqytXz+aRqykvidUbF zDvRrvgHdW7BcLh1Yyk7MN4welKqOLjNAcURFp1YirYeLTa1KFLWyLeNsVaINg//z6Wq hI9MHTGMY5gB6IM9wojNf8mvKmz3d2hwAmtui/iIFH1hnNUBBVGlg5uI6defA/xJFuBe CU5PS0neS5KX8qvsHBx14zFWjC7VxQ5aXPmoOk+qHmV1CyuzWr/3PX8Lx7M8HmqvnzPq Vti4hhJMCSgXwPD9PQQErKfp1ChIvzYMvS57qRXRzw+cGe+XfxG1jDvoYUWewX365az8 IFXQ== X-Gm-Message-State: AIkVDXIhIfNXB3GuDO3HgUAjPLj3vX86QPloYdAomwbWXg9qp8RCu6qqDd4QnXaFVG9IYE3s X-Received: by 10.28.143.68 with SMTP id r65mr10245448wmd.95.1482420669551; Thu, 22 Dec 2016 07:31:09 -0800 (PST) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id f76sm32719263wmd.15.2016.12.22.07.31.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Dec 2016 07:31:08 -0800 (PST) From: Thomas Monjalon To: Ferruh Yigit Cc: Qiming Yang , dev@dpdk.org, Remy Horton Date: Thu, 22 Dec 2016 16:31:08 +0100 Message-ID: <4171707.MgFeI6QLbH@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <095d7632-fbb7-a72b-8a48-163ed2b32cb4@intel.com> References: <1479375779-46629-2-git-send-email-qiming.yang@intel.com> <6590239.9s5rXc1lKr@xps13> <095d7632-fbb7-a72b-8a48-163ed2b32cb4@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2 0/5] example/ethtool: add bus info and fw version get X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2016 15:31:10 -0000 2016-12-22 15:05, Ferruh Yigit: > On 12/22/2016 2:47 PM, Thomas Monjalon wrote: > > 2016-12-22 14:36, Ferruh Yigit: > >> On 12/22/2016 11:07 AM, Thomas Monjalon wrote: > >>> I think it is OK to add a new dev_ops and a new API function for firmware > >>> query. Generally speaking, it is a good thing to avoid putting all > >>> informations in the same structure (e.g. rte_eth_dev_info). > >> > >> OK. > >> > >>> However, there > >>> is a balance to find. Could we plan to add more info to this new query? > >>> Instead of > >>> rte_eth_dev_fwver_get(uint8_t port_id, char *fw_version, int fw_length) > > [...] > >>> could it fill a struct? > >>> rte_eth_dev_fw_info_get(uint8_t port_id, struct rte_eth_dev_fw_info *fw_info) > >> > >> I believe this is better. But the problem we are having with this usage > >> is: ABI breakage. > >> > >> Since this struct will be a public structure, in the future if we want > >> to add a new field to the struct, it will break the ABI, and just this > >> change will cause a new version for whole ethdev library! > >> > >> When all required fields received via arguments, one by one, instead of > >> struct, at least ABI versioning can be done on the API when new field > >> added, and can be possible to escape from ABI breakage. But this will be > >> ugly when number of arguments increased. > >> > >> Or any other opinion on how to define API to reduce ABI breakage? > > > > You're right. > > But I don't think we should have a function per data. Just because it would > > be ugly :) > > I am no suggesting function per data, instead something like: > > rte_eth_dev_fw_info_get(uint8_t port_id, uint32_t maj, uint32_t min); > > And in the future if we need etrack_id too, we can have both in > versioned manner: > > rte_eth_dev_fw_info_get(uint8_t port_id, uint32_t maj, uint32_t min); > > rte_eth_dev_fw_info_get(uint8_t port_id, uint32_t maj, uint32_t min, > uint32_t etrack_id); Oh I see. So it can be versioned with compat macros. > So my concern was if the number of the arguments becomes too many by time. It looks to be a good proposal. We should not have a dozen of arguments.