From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E693C43387 for ; Wed, 16 Jan 2019 02:02:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2B3D20873 for ; Wed, 16 Jan 2019 02:02:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728164AbfAPCCA (ORCPT ); Tue, 15 Jan 2019 21:02:00 -0500 Received: from drutsystem.com ([84.10.39.251]:52255 "EHLO drutsystem.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728071AbfAPCCA (ORCPT ); Tue, 15 Jan 2019 21:02:00 -0500 Received: from [10.227.137.2] (89-78-107-182.dynamic.chello.pl [89.78.107.182]) by drutsystem.com (Postfix) with ESMTPA id F29C763F74A; Wed, 16 Jan 2019 03:01:53 +0100 (CET) Subject: Re: [PATCH net 1/1] bonding: fix PACKET_ORIGDEV regression on bonding masters To: =?UTF-8?Q?Maciej_=c5=bbenczykowski?= , David Miller Cc: Linux NetDev , Jay Vosburgh , vincent@bernat.ch, Mahesh Bandewar , Chonggang Li References: <20190107162946.13072-1-soltys@ziu.info> <20190107162946.13072-2-soltys@ziu.info> <20190113.150355.1753998293477839740.davem@davemloft.net> From: Michal Soltys Message-ID: Date: Wed, 16 Jan 2019 03:01:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-MailScanner-ID: F29C763F74A.A0FE9 X-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details X-MailScanner-From: soltys@ziu.info Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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; > } > > would fix both problems? > I'll test this change in bridging scenarios in coming days. And thanks for the explanation of what was the issue in your case.