All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>, dev@dpdk.org
Cc: bernard.iremonger@intel.com
Subject: Re: [PATCH] ethdev: remove useless parameter in callback process
Date: Thu, 21 Dec 2017 19:08:12 -0800	[thread overview]
Message-ID: <53c8669c-79b9-2f6d-4008-7679aa2cf377@intel.com> (raw)
In-Reply-To: <20171128220951.15317-1-thomas@monjalon.net>

On 11/28/2017 2:09 PM, Thomas Monjalon wrote:
> The pointer to the user parameter of the callback registration is
> automatically pass to the callback function.
> There is no point to allow changing this user parameter by a caller.
> That's why this parameter is always set to NULL by PMDs and set only
> in ethdev layer before calling the callback function.

It can be helpful to mention a little from history:

user cb_arg overwrite introduced by [1], to enable driver pass a pointer to user
callback function and carry some information back from app to driver.

Later to prevent usage of cb_arg as both input and output, an explicit output
(ret_param) added [2] to _rte_eth_dev_callback_process() but previous cb_arg
overwriting kept without any user.

[1]: c1ceaf3ad056 ("ethdev: add an argument to internal callback function")

[2]: d6af1a13d7a1 ("ethdev: add return values to callback process API")

> 
> The NULL parameter in the internal callback processing function
> is now removed. It makes clear that the callback parameter is user
> managed and opaque from a DPDK point of view.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

  reply	other threads:[~2017-12-22  3:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 22:09 [PATCH] ethdev: remove useless parameter in callback process Thomas Monjalon
2017-12-22  3:08 ` Ferruh Yigit [this message]
2017-12-28 21:54   ` Thomas Monjalon
2017-12-28 21:56     ` Thomas Monjalon
2017-12-28 22:10   ` [PATCH v2] " Thomas Monjalon
2017-12-29 13:29     ` 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=53c8669c-79b9-2f6d-4008-7679aa2cf377@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.