All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Jesse Gross <jesse@kernel.org>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v3 8/8] geneve: break dependency to network drivers
Date: Thu, 7 Jan 2016 01:39:44 +0100	[thread overview]
Message-ID: <568DB3D0.1040109@stressinduktion.org> (raw)
In-Reply-To: <CAEh+42h79Sxc4JwzH_zMm+MZ-CmQWGdX1Qiz7epJmj2nCiAAVQ@mail.gmail.com>

Hi Jesse,

On 07.01.2016 01:18, Jesse Gross wrote:
> On Wed, Jan 6, 2016 at 3:39 PM, Hannes Frederic Sowa
> <hannes@stressinduktion.org> wrote:
>> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
>> ---
>>   drivers/net/geneve.c | 30 +++++++++++++++++++++++++++---
>>   include/net/geneve.h |  7 +++----
>>   2 files changed, 30 insertions(+), 7 deletions(-)
>
> Thanks a lot for going through all the drivers! You found more things
> than I thought. I noticed just a couple new things with this version
> but overall I think it is a good direction.
>
>> diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
>> index 24b077a32c1c9c..5b8d728b1204be 100644
>> --- a/drivers/net/geneve.c
>> +++ b/drivers/net/geneve.c
>> @@ -1110,7 +1110,7 @@ static struct device_type geneve_type = {
>>    * supply the listening GENEVE udp ports. Callers are expected
>>    * to implement the ndo_add_geneve_port.
>>    */
>> -void geneve_get_rx_port(struct net_device *dev)
>> +static void geneve_notify_refresh_netdev(struct net_device *dev)
>>   {
>>          struct net *net = dev_net(dev);
>>          struct geneve_net *gn = net_generic(net, geneve_net_id);
>
> Both this function and the corresponding one in VXLAN assume that the
> add port NDO is implemented and blindly dereference the pointer. Now
> that all protocols get refreshed at the same time, we should check
> first. There's also a comment above the function that says this, which
> we can remove now.

Absolutely, will fix this in the next version. With the separate 
offloading types this wouldn't be possible. Thanks for seeing this!

I actually had this in a follow-up patch because I want to call this on 
NETDEV_REGISTER, too, so we don't need to add the geneve/vxlan functions 
to the drivers in ndo_start anymore.

> I also think we can update the comments in netdevice.h for the
> VXLAN/Geneve add/remove NDOs to say that they are protected by RTNL.

Will do. Thanks!

>> diff --git a/include/net/geneve.h b/include/net/geneve.h
>> index e6c23dc765f7ec..7d52077b72faa3 100644
>> --- a/include/net/geneve.h
>> +++ b/include/net/geneve.h
>> -#if IS_ENABLED(CONFIG_GENEVE)
>> -void geneve_get_rx_port(struct net_device *netdev);
>> -#else
>>   static inline void geneve_get_rx_port(struct net_device *netdev)
>>   {
>> +       call_netdevice_notifiers(NETDEV_REFRESH_OFFLOADS, netdev);
>>   }
>> -#endif
>
> I think we should merge vxlan_get_rx_port() and geneve_get_rx_port()
> into a single generic function. For drivers that support both, they
> now have two calls to get notified for all offloaded ports. This
> actually can cause problems related to duplicates, similar to what you
> feared before.

Agreed. I add comments to the offloading functions in netdevice.h so 
they need to be implemented in a idempotent way and review the drivers 
how they deal with it.

Thanks for the review,
Hannes

  reply	other threads:[~2016-01-07  0:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06 23:39 [PATCH net-next v3 0/8] net: break dependency of drivers on geneve and vxlan Hannes Frederic Sowa
2016-01-06 23:39 ` [PATCH net-next v3 1/8] qlcnic: protect qlcnic_82xx_io_slot_reset with rtnl lock Hannes Frederic Sowa
2016-01-06 23:39 ` [PATCH net-next v3 2/8] mlx4: add rtnl lock protection in mlx4_en_restart Hannes Frederic Sowa
2016-01-06 23:39 ` [PATCH net-next v3 3/8] ixgbe: add rtnl locking in service task around vxlan_get_rx_port Hannes Frederic Sowa
2016-01-06 23:39 ` [PATCH net-next v3 4/8] benet: add rtnl lock protection around be_open in be_resume Hannes Frederic Sowa
2016-01-06 23:39 ` [PATCH net-next v3 5/8] fm10k: add rtnl lock protection in fm10k_io_resume Hannes Frederic Sowa
2016-01-06 23:39 ` [PATCH net-next v3 6/8] netdev: add netdevice notifier type to trigger a reprogramming of offloads Hannes Frederic Sowa
2016-01-06 23:39 ` [PATCH net-next v3 7/8] vxlan: break dependency to network drivers Hannes Frederic Sowa
2016-01-06 23:39 ` [PATCH net-next v3 8/8] geneve: " Hannes Frederic Sowa
2016-01-07  0:18   ` Jesse Gross
2016-01-07  0:39     ` Hannes Frederic Sowa [this message]
2016-01-08 20:47     ` Hannes Frederic Sowa
2016-01-08 21:12       ` Jesse Gross
2016-01-08 21:18         ` Hannes Frederic Sowa
2016-01-09  0:38           ` Jesse Gross

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=568DB3D0.1040109@stressinduktion.org \
    --to=hannes@stressinduktion.org \
    --cc=jesse@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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.