netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@dev.mellanox.co.il>
To: David Miller <davem@davemloft.net>
Cc: Saeed Mahameed <saeedm@mellanox.com>,
	Linux Netdev List <netdev@vger.kernel.org>,
	Gal Pressman <galp@mellanox.com>,
	Or Gerlitz <ogerlitz@mellanox.com>,
	kaber@trash.net
Subject: Re: [PATCH net] net/8021q: Check the correct vlan filter capability
Date: Wed, 24 Feb 2016 22:35:16 +0200	[thread overview]
Message-ID: <CALzJLG8CiRRBqUziAFOXE2RAmEDUMgJK2GM6SF3mz_HueRfdvQ@mail.gmail.com> (raw)
In-Reply-To: <CALzJLG-CR1Ac5biwP5CuFbygqCOWh4-VGQc-XZ=BuZQLRnnRDg@mail.gmail.com>

On Wed, Feb 24, 2016 at 10:27 PM, Saeed Mahameed
<saeedm@dev.mellanox.co.il> wrote:
>>> Netdev features can be changed dynamically to off after vlan_vid_add
>>> was called, thus vlan_vid_del will skip ndo_vlan_rx_kill_vid and will
>>> leave the device driver with un-freed resources.
>>
>> Are you sure the fix isn't to make vlan_vid_add() check ->features instead
>> of ->hw_features.
>
> This is exactly what this fix suggests, "->features" is not consistent
> and can be turned ON/OFF between vlan_add/del which can leave the NIC
> driver in inconsistent state !
>
>>
>> Should we really be trying to add VLAN filters when the user has
>> turned it off?
>
> Well, I think it is debatable, but the current implementation is not
> consistent, especially for adding vlan 0 by default and then the user
> disables the vlan filter, this will cause the stack to never call the
> nic ndo_vlan_rx_kill_vid for the pre added vlan 0 and vise versa call
> kill_vid without add_vid, BUG ?
>
> So i think we have two options, use this patch, and always trust to
> delegate vlan_vid_add/del to the NIC when it's HW supports it, and the
> nic will be smart enough to know what to do with it (in case vlan
> filter is enabled/disabled). Or, for each vlan we can remember if it
> was added to the NIC or not so the stack will know whether to clean it
> up or not.

BTW we choose the first option since the "buggy" function is called
"vlan_hw_filter_capable" which lead us to decide that the function
should be looking for ->hw_features and not ->features.
and i think this way it makes more sense.

  reply	other threads:[~2016-02-24 20:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 16:39 [PATCH net] net/8021q: Check the correct vlan filter capability Saeed Mahameed
2016-02-24 16:48 ` David Miller
2016-02-24 20:27   ` Saeed Mahameed
2016-02-24 20:35     ` Saeed Mahameed [this message]
2016-02-24 21:49       ` David Miller
2016-02-24 21:48     ` David Miller
2016-02-25  3:58       ` John Fastabend

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=CALzJLG8CiRRBqUziAFOXE2RAmEDUMgJK2GM6SF3mz_HueRfdvQ@mail.gmail.com \
    --to=saeedm@dev.mellanox.co.il \
    --cc=davem@davemloft.net \
    --cc=galp@mellanox.com \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=saeedm@mellanox.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).