public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Soltys <soltys@ziu.info>
To: "Maciej Żenczykowski" <zenczykowski@gmail.com>,
	"David Miller" <davem@davemloft.net>
Cc: Linux NetDev <netdev@vger.kernel.org>,
	Jay Vosburgh <jay.vosburgh@canonical.com>,
	vincent@bernat.ch, Mahesh Bandewar <maheshb@google.com>,
	Chonggang Li <chonggangli@google.com>
Subject: Re: [PATCH net 1/1] bonding: fix PACKET_ORIGDEV regression on bonding masters
Date: Fri, 18 Jan 2019 01:27:56 +0100	[thread overview]
Message-ID: <cd229ac2-8d79-1af5-78e3-50a2b0bb2157@ziu.info> (raw)
In-Reply-To: <CAHo-Ooya1gz-a=3bdZNDc3pDcETU+V7MGvdXq+kA0ALADrLn7g@mail.gmail.com>

On 19/01/14 03:01, Maciej Żenczykowski wrote:
> So I don't remember the specifics...
> 
> (note I'm writing this all from memory without looking it up/testing
> it - I may be utterly wrong or dreaming)
> 
> But I seem to recall that the core problem we were trying to solve was
> that a daemon listening
> on an AF_PACKET ethertype 88CC [LLDP] socket not bound to any device
> would not receive LLDP packets
> arriving on inactive bond slaves (either active-backup or lag).
> 
> [inactive = link/carrier up, but not part of active aggregator]
> 
> This made monitoring for miscabling harder (IFIRC the only non kernel
> fix was to get the daemon to create
> a separate AF_PACKET/88CC socket bound to every physical interface in
> the system, or monitor for
> inactive slaves and add extra packet sockets as needed).
> 
> They would get re-parented to the master and then since the slave was
> inactive they would be considered RX_HANDLER_EXACT match only and not
> match the * interface.
> 
> Honestly I wasn't aware of PACKET_ORIGDEV, although I don't think it
> helps in this case - AFAICR the packets never made it to the packet
> socket.
> 
> Perhaps going from:
>    /* don't change skb->dev for link-local packets */
>    if (is_link_local_ether_addr(eth_hdr(skb)->h_dest)) return RX_HANDLER_PASS;
>    if (bond_should_deliver_exact_match(skb, slave, bond)) return
> RX_HANDLER_EXACT;
> 
> to something more like:
>    if (bond_should_deliver_exact_match(skb, slave, bond)) {
>      /* don't change skb->dev for link-local packets on inactive slaves */
>      if (is_link_local_ether_addr(eth_hdr(skb)->h_dest)) return RX_HANDLER_PASS;
>      return RX_HANDLER_EXACT;
>    }

Having checked the code (if I get the flow correctly), one 
thing/question - currently with Mahesh's fixes, not bound LLDP listener 
will receive all packets - both from active and inactive slaves directly 
(as the check for suppression is done after the link-local check).

The version above will do the suppression check first - so all inactive 
slaves - excluding non-multi/non-broad ALB - will pass it and return 
RX_HANDLER_PASS if the packet is link-local. So those will be available 
w/o binding, but active slaves' packets will be available via master 
device (but with working PACKET_ORIGDEV now - so slave device can be 
retrieved easily). This is fine in your scenario I presume ?


  parent reply	other threads:[~2019-01-18  0:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 16:29 [PATCH net 0/1] bonding: fix PACKET_ORIGDEV regression Michal Soltys
2019-01-07 16:29 ` [PATCH net 1/1] bonding: fix PACKET_ORIGDEV regression on bonding masters Michal Soltys
2019-01-07 17:12   ` David Miller
2019-01-08 13:46     ` Vincent Bernat
2019-01-13 23:03   ` David Miller
2019-01-14  2:01     ` Maciej Żenczykowski
2019-01-14  8:00       ` Vincent Bernat
2019-01-15  2:19         ` Mahesh Bandewar (महेश बंडेवार)
2019-01-16  2:58           ` Michal Soltys
2019-01-16  2:01       ` Michal Soltys
2019-01-18  0:27       ` Michal Soltys [this message]
2019-01-18  6:58         ` Maciej Żenczykowski
2019-01-29  1:47           ` Michal Soltys
2019-01-29  9:39             ` Maciej Żenczykowski
2019-02-18 16:55               ` [PATCH v2] bonding: fix PACKET_ORIGDEV regression Michal Soltys
2019-02-19  1:51                 ` David Ahern
2019-02-19  9:14                 ` Maciej Żenczykowski
2019-02-21 21:21                 ` David Miller

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=cd229ac2-8d79-1af5-78e3-50a2b0bb2157@ziu.info \
    --to=soltys@ziu.info \
    --cc=chonggangli@google.com \
    --cc=davem@davemloft.net \
    --cc=jay.vosburgh@canonical.com \
    --cc=maheshb@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=vincent@bernat.ch \
    --cc=zenczykowski@gmail.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