From: John Fastabend <john.fastabend@gmail.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
linux-kernel@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Roopa Prabhu <roprabhu@cisco.com>,
John Fastabend <john.r.fastabend@intel.com>,
Patrick McHardy <kaber@trash.net>,
netdev@vger.kernel.org
Subject: Re: [PATCH net] macvlan: don't touch promisc without passthrough
Date: Wed, 12 Jun 2013 23:02:01 -0700 [thread overview]
Message-ID: <51B96059.4070104@gmail.com> (raw)
In-Reply-To: <51B87E0D.8040009@cogentembedded.com>
On 06/12/2013 06:56 AM, Sergei Shtylyov wrote:
> Hello.
>
> On 12-06-2013 15:34, Michael S. Tsirkin wrote:
>
>> commit df8ef8f3aaa6692970a436204c4429210addb23a in linux 3.5 added a way
>
> Please also specify that commit's summary line in parens.
>
>> to control NOPROMISC macvlan flag through netlink.
>
>> However, with a non passthrough device we don't set promisc on open or
>> clear it on stop, even if NOPROMISC is off. As a result:
>
>> If userspace clears NOPROMISC on open, then does not clear it on a
>> netlink command, promisc counter is not decremented on stop and there
>> will be no way to clear it once macvlan is detached.
>
>> If userspace does not clear NOPROMISC on open, then sets NOPROMISC on a
>> netlink command, promisc counter will be decremented from 0 and overflow
>> to fffffffff with no way to clear promisc afterwards.
>
>> To fix, simply ignore NOPROMISC flag in a netlink command for
>> non-passthrough devices, same as we do at open/stop.
>
>> While at it - since we touch this code anyway - check
>> dev_set_promiscuity return code and pass it to users (though an error
>> here is unlikely).
>
>> Cc: "David S. Miller" <davem@davemloft.net>
>> CC: Roopa Prabhu <roprabhu@cisco.com>
>> Cc: John Fastabend <john.r.fastabend@intel.com>
>> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>> ---
>
>> Please review, and consider for 3.10 and -stable.
>
Other than those few nits looks good to me thanks!
Reviewed-by: John Fastabend <john.r.fastabend@intel.com>
--
John Fastabend Intel Corporation
prev parent reply other threads:[~2013-06-13 6:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-12 11:34 [PATCH net] macvlan: don't touch promisc without passthrough Michael S. Tsirkin
2013-06-12 13:56 ` Sergei Shtylyov
2013-06-13 6:02 ` John Fastabend [this message]
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=51B96059.4070104@gmail.com \
--to=john.fastabend@gmail.com \
--cc=davem@davemloft.net \
--cc=john.r.fastabend@intel.com \
--cc=kaber@trash.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=roprabhu@cisco.com \
--cc=sergei.shtylyov@cogentembedded.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).