public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail•com>
To: Jiri Pirko <jiri@resnulli•us>
Cc: netdev@vger•kernel.org, davem@davemloft•net,
	vivien.didelot@savoirfairelinux•com, andrew@lunn•ch,
	marcelo.leitner@gmail•com
Subject: Re: [PATCH net-next v2 1/4] net: switchdev: Prepare for deferred functions modifying objects
Date: Tue, 10 Jan 2017 09:57:18 -0800	[thread overview]
Message-ID: <afdaab40-1975-bb6c-eeca-dafe42d42528@gmail.com> (raw)
In-Reply-To: <20170110100901.GB1827@nanopsycho>

On 01/10/2017 02:09 AM, Jiri Pirko wrote:
> Mon, Jan 09, 2017 at 09:45:20PM CET, f.fainelli@gmail•com wrote:
>> In preparation for adding support for deferred dump operations, allow
>> specifying a deferred function whose signature allows read/write
>> objects.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail•com>
>> ---
>> net/switchdev/switchdev.c | 21 ++++++++++++++++-----
>> 1 file changed, 16 insertions(+), 5 deletions(-)
>>
>> diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
>> index 017801f9dbaa..3d70ad02c617 100644
>> --- a/net/switchdev/switchdev.c
>> +++ b/net/switchdev/switchdev.c
>> @@ -100,11 +100,14 @@ static DEFINE_SPINLOCK(deferred_lock);
>>
>> typedef void switchdev_deferred_func_t(struct net_device *dev,
>> 				       const void *data);
>> +typedef void switchdev_deferred_func_rw_t(struct net_device *dev,
>> +					  void *data);
>>
>> struct switchdev_deferred_item {
>> 	struct list_head list;
>> 	struct net_device *dev;
>> 	switchdev_deferred_func_t *func;
>> +	switchdev_deferred_func_rw_t *func_rw;
> 
> I'm missing why you need to have 2 funcs here. Why you just can't re-use
> func?

I wanted to let the existing callers be passed down a const void *data,
and not update them with void *data, since there is value in keeping
that annotated. This may be considered overkill, I don't know.
-- 
Florian

  reply	other threads:[~2017-01-10 17:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09 20:45 [PATCH net-next v2 0/4] net: switchdev: Avoid sleep in atomic with DSA Florian Fainelli
2017-01-09 20:45 ` [PATCH net-next v2 1/4] net: switchdev: Prepare for deferred functions modifying objects Florian Fainelli
2017-01-10 10:09   ` Jiri Pirko
2017-01-10 17:57     ` Florian Fainelli [this message]
2017-01-09 20:45 ` [PATCH net-next v2 2/4] net: switchdev: Add object dump deferred operation Florian Fainelli
2017-01-09 20:45 ` [PATCH net-next v2 3/4] net: switchdev: Add switchdev_port_bridge_getlink_deferred Florian Fainelli
2017-01-09 20:45 ` [PATCH net-next v2 4/4] net: dsa: Utilize switchdev_port_bridge_getlink_deferred() Florian Fainelli

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=afdaab40-1975-bb6c-eeca-dafe42d42528@gmail.com \
    --to=f.fainelli@gmail$(echo .)com \
    --cc=andrew@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=jiri@resnulli$(echo .)us \
    --cc=marcelo.leitner@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=vivien.didelot@savoirfairelinux$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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