From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw0-f179.google.com (mail-yw0-f179.google.com [209.85.161.179]) by dpdk.org (Postfix) with ESMTP id B4FB437B0 for ; Sun, 12 Jun 2016 16:51:07 +0200 (CEST) Received: by mail-yw0-f179.google.com with SMTP id z186so88296000ywd.2 for ; Sun, 12 Jun 2016 07:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=i8UDAnEU5bEyWgzxupy2dxLwlRAPCL0+vXbiAFu6+50=; b=airF3ny9OHsqTW21TJJSzZlJAGRmeaZy33o4oiFXj+JcKTgVtu0T9DXmEzenr+gs3H cKFqyCwD0E470qnDTnwoND9ggA73r68t6J/qCaN3xm7w99OmG4CuWcRlou31uW5bEgMv bBVkpIHmIWrhxe/CYppmQmWSCUCUjKy6oTtYXPhRMVlq7IsSPla1CNq8I2/D7XcCvQPp M8WBA2n2ig7RLe7604qZshozWrZHpksuI06rfCOGUZAKCK/3VUXveUs/Uq7xyXf8UYig e8VThewElM3mmX9mRsZvuoq9Re4z7D3z1tc4S0JaEgMC8Wwcf++DEVFeaNyHyMtIi6OJ vbPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=i8UDAnEU5bEyWgzxupy2dxLwlRAPCL0+vXbiAFu6+50=; b=dYEXX3Gr6t43JuU4Kdr/PCNB10RZPxMZToYWO7zQdO9ZB1KfYHVIhOaF6+UBkjHbWh 7B76nW174bIguSm2ePWRtJZD81xQH53iotJhDNaNUgJUXUxDi+LO/r+XXHl2B+TEi8Rp 4utxCL1mRgx4WnmQjmguyNp2HTVWzSQ8BBj235JkJ7UGuCbbaY59NSpnhaSTd+XDSeAX dd0JfET6Vxg93voWbZsYPlySjbbdU5DUygS6AKx6PdyZNWC5tia34e9emsV8VQ8mWxgw CXfXT5fAceXrMubxswzB8SdW/gUoLXh31pFvwFegsi+HVgfYeI8fqhK09xInr4yj8zV+ 35yQ== X-Gm-Message-State: ALyK8tKqEgLF89V29vd3hX7fHsoB9ek1Q9klzdleTfBZ5TnSbh7ThDp8oDsaJdYXj/30jfUuIKX1UDo8zvOf+w== MIME-Version: 1.0 X-Received: by 10.129.156.131 with SMTP id t125mr5536466ywg.224.1465743067225; Sun, 12 Jun 2016 07:51:07 -0700 (PDT) Received: by 10.37.16.133 with HTTP; Sun, 12 Jun 2016 07:51:07 -0700 (PDT) In-Reply-To: <12994980.C5dFrG15Qg@xps13> References: <1464767771-19159-1-git-send-email-zr@semihalf.com> <12994980.C5dFrG15Qg@xps13> Date: Sun, 12 Jun 2016 16:51:07 +0200 Message-ID: From: Zyta Szpak To: Thomas Monjalon Cc: Remy Horton , dev@dpdk.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v3 1/2] ethdev: add callback to get register size in bytes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2016 14:51:08 -0000 Hi, please see inline 2016-06-08 10:53 GMT+02:00 Thomas Monjalon : > Hi Zyta, > > 2016-06-01 09:56, zr@semihalf.com: > > rte_eth_dev_get_reg_length and rte_eth_dev_get_reg callbacks > > do not provide register size to the app in any way. It is > > needed to allocate proper number of bytes before retrieving > > registers content with rte_eth_dev_get_reg. > > Yes, register size is needed. > And I think it makes sense to register it in the struct rte_dev_reg_info. > We already have a length field, so we could just add a width field. > That was my first thought to add reg_size to reg_info struct but get_reg_length doesn' take reg_info as parameter so it would require modification of this callback as well. This would interfere with the author's vision. I think that adding a new one is clear and readable. > > > @@ -1455,6 +1458,8 @@ struct eth_dev_ops { > > > > eth_get_reg_length_t get_reg_length; > > /**< Get # of registers */ > > + eth_get_reg_width_t get_reg_width; > > + /**< Get # of bytes in register */ > > eth_get_reg_t get_reg; > > /**< Get registers */ > > I am not sure it is a good practice to add a new function for each > parameter of a request. > I would prefer having only one function rte_eth_dev_get_regs() > which returns length and width if data is NULL. > The first call is a parameter request before buffer allocation, > and the second call fills the buffer. > > We can deprecate the old API and introduce this new one. > > Opinions? > In my opinion as it is now it works fine. Gathering all parameters in one callback might be a good idea if the maintainer also agrees to that because as I mentioned, it interferes. Any other opinions?\ Best regards, Zyta Szpak