DPDK patches and discussions
 help / color / mirror / Atom feed
From: Zyta Szpak <zr@semihalf.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: Remy Horton <remy.horton@intel.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3 1/2] ethdev: add callback to get register size in bytes
Date: Sun, 12 Jun 2016 16:51:07 +0200	[thread overview]
Message-ID: <CA+E8-F0KdYROi7KkXmf_zjR+Y68oZAjqq0GFRKJUt_Uqowe7-w@mail.gmail.com> (raw)
In-Reply-To: <12994980.C5dFrG15Qg@xps13>

Hi,
please see inline

2016-06-08 10:53 GMT+02:00 Thomas Monjalon <thomas.monjalon@6wind.com>:

> 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

  reply	other threads:[~2016-06-12 14:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01  7:56 zr
2016-06-01  7:56 ` [dpdk-dev] [PATCH v3 2/2] examples/ethtool: get reg width to allocate memory zr
2016-06-07  9:52   ` Remy Horton
2016-06-07  9:52 ` [dpdk-dev] [PATCH v3 1/2] ethdev: add callback to get register size in bytes Remy Horton
2016-06-08  8:53 ` Thomas Monjalon
2016-06-12 14:51   ` Zyta Szpak [this message]
2016-06-13 15:51     ` Remy Horton
2016-06-17 10:20       ` Thomas Monjalon
2016-06-21  9:55         ` Zyta Szpak
2016-06-22  8:19           ` Zyta Szpak
2016-06-22  8:26             ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+E8-F0KdYROi7KkXmf_zjR+Y68oZAjqq0GFRKJUt_Uqowe7-w@mail.gmail.com \
    --to=zr@semihalf.com \
    --cc=dev@dpdk.org \
    --cc=remy.horton@intel.com \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).