Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp156373rwe; Wed, 24 Aug 2022 19:40:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR5XE19DIhjhyCyuYpHYau3QyP+qJ4Js01JYZy3sn6w90eU74ALMToT3oF3uzPCrG9NKeOW6 X-Received: by 2002:a17:907:e8c:b0:73d:8146:9aa1 with SMTP id ho12-20020a1709070e8c00b0073d81469aa1mr1027039ejc.253.1661395232749; Wed, 24 Aug 2022 19:40:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661395232; cv=none; d=google.com; s=arc-20160816; b=qVfyhNIWwYZd2SAumbImim972M8wORRbZmHTqywxpU6/ACjgY7RcoVSXBc6IaD+rAQ lKH6J8jwYr2oFuIeoMLdJgH97+J+pis7qTTxnJlT8r1UwprQc7a2V9OIJzhZPuHdJu16 RC4Ri37JJkaS0O9D+uJfIad5i+McN8T0lO2z/YfwuoubtcddMub0WbflBfRG1OJA36n3 H0OGk58LUfsJJanGjj4rmWp2KGYCAVRXEDq/n38VJcYYtDrsnqtVJ6hdaXYP5+IrGqLr GmdTERqft+F3Kpe1bmxDIy31PbljXgU0W83P+uC5dmtILuhNOOllocjzO6o4LBS2PKT4 0XzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=3jF59bnxqmLklAHzEtiDUVdu2dFyXPidcFRU+bKjDi8=; b=zpsKOvzRm/gTi/8uIbNemnwB/y3sbBf5/S3misszp4cTmc9YtiN+2MJlIGtmxWtxLP pRyiTuTrJUrfgWRaeaNaNZvhpqQWqLrD3DjTYdXE4Vc1S3TiPFDG/ehyM2DbUbOrSeJV dJneQ9r+brcIDzaHvk8grgTDXY0v5OI59pG2vjFHQCFGcfUxufPOUp1xufh8gH0TuHRH o61E9ZtapIC2DOuCS4YlwPT5dKpR0wk6hUad10K5uGZB7hs115cxNtNPr6l1T7cJILY0 u+ZxlHEjIk96QRs4OhvgSJN8k2qbXZhC/IHPoXXFUVMOBkKQnGn7KO2SokeqZnTwkJdK 88hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HeLCcdTu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b12-20020a056402084c00b0043df391fcbesi6202637edz.583.2022.08.24.19.40.06; Wed, 24 Aug 2022 19:40:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HeLCcdTu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233514AbiHYC3N (ORCPT + 99 others); Wed, 24 Aug 2022 22:29:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233228AbiHYC3H (ORCPT ); Wed, 24 Aug 2022 22:29:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F511923CC for ; Wed, 24 Aug 2022 19:29:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661394545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3jF59bnxqmLklAHzEtiDUVdu2dFyXPidcFRU+bKjDi8=; b=HeLCcdTu0I+oaFDwO2H7n2LdRv3ty4q75kgm/lxBSoDD0UQsE+HvGWlhV2RMXyjwwh4wG+ /GRqEC7vuImxSd+TJTVkXkqbFUs92m1D71JUfHqSpFdF0Ws93Ud+x+G0la6OiLEnsGBOuP Pn+YpEAJoBw9MHGqz2gjwX7WbqHXlUQ= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-675-ZVpSUUuUOf2vHK4fgeEllA-1; Wed, 24 Aug 2022 22:29:02 -0400 X-MC-Unique: ZVpSUUuUOf2vHK4fgeEllA-1 Received: by mail-qk1-f200.google.com with SMTP id bl16-20020a05620a1a9000b006bc3aa1908dso6508065qkb.15 for ; Wed, 24 Aug 2022 19:29:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=3jF59bnxqmLklAHzEtiDUVdu2dFyXPidcFRU+bKjDi8=; b=OaJRxgHo9M1sKX1vZRoPCgWUiOag4DBD9nmzaDO8F5jnhvisb3ReRoHI2i0w2Gp6in /LPE9onJdj/3+e37Q2CYGy9qkp3xz3aj3ltA8odLwRLyDs/14+pE9ElGPzmn7J+9oryQ qksUjC344xlacZG6okDyDQW281pQvOfcU47TcciJTyJptG9dR17PAmC5f/fc45FZXx4c uQsEgwx7SqMUZai24suTK6UUXSeDGdpBHcztIdkkEz5xcjp9++UQi076JcMLPKYeES01 9jSYqkWIPqHcodSzEl72qclh/mpKTlvUndwpRFXxvOuOlUYFA+ey3yXbNqPk8Ck4moKl JdAw== X-Gm-Message-State: ACgBeo3k5omyQ0iVBuC1PekGNmvCm5iggJqw1KCV3yVeqG6NmGshaMvP 7RYDlWVOhuH8Rmm2Nv/TsuXAxLboJKXJ93I5fK16F7UMoZ4LG2+PXM+30dggc6MBhv+HggoSie/ /cSuIw5JqFieSQA/oLFfKoXWh X-Received: by 2002:a05:620a:15d8:b0:6ba:c5e3:871c with SMTP id o24-20020a05620a15d800b006bac5e3871cmr1623892qkm.572.1661394540655; Wed, 24 Aug 2022 19:29:00 -0700 (PDT) X-Received: by 2002:a05:620a:15d8:b0:6ba:c5e3:871c with SMTP id o24-20020a05620a15d800b006bac5e3871cmr1623874qkm.572.1661394540422; Wed, 24 Aug 2022 19:29:00 -0700 (PDT) Received: from [192.168.98.18] ([107.12.98.143]) by smtp.gmail.com with ESMTPSA id j12-20020a05620a288c00b006b61b2cb1d2sm16492780qkp.46.2022.08.24.19.28.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Aug 2022 19:28:59 -0700 (PDT) Message-ID: <320c2a05-e99a-88b4-2f67-11210ae37903@redhat.com> Date: Wed, 24 Aug 2022 22:28:58 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH net-next v2] bonding: Remove unnecessary check Content-Language: en-US To: Sun Shouxin Cc: vfalico@gmail.com, andy@greyhouse.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, huyd12@chinatelecom.cn, Jay Vosburgh References: <20220824111712.5999-1-sunshouxin@chinatelecom.cn> From: Jonathan Toppins In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/24/22 14:07, Jay Vosburgh wrote: > On 8/24/22, Sun Shouxin wrote: >> This code is intended to support bond alb interface added to >> Linux bridge by modifying MAC, however, it doesn't work for >> one bond alb interface with vlan added to bridge. >> Since commit d5410ac7b0ba("net:bonding:support balance-alb >> interface with vlan to bridge"), new logic is adapted to handle >> bond alb with or without vlan id, and then the code is deprecated. > > I think this could still be clearer; the actual changes relate to the stack of > interfaces (e.g., eth0 -> bond0 -> vlan123 -> bridge0), not what VLAN tags > incoming traffic contains. > > The code being removed here is specifically for the case of > eth0 -> bond0 -> bridge0, without an intermediate VLAN interface > in the stack (because, if memory serves, netif_is_bridge_port doesn't > transfer through to the bond if there's a VLAN interface in between). > > Also, this code is for incoming traffic, assigning the bond's MAC to > traffic arriving on interfaces other than the active interface (which bears > the bond's MAC in alb mode; the other interfaces have different MACs). > Commit d5410ac7b0ba affects the balance assignments for outgoing ARP > traffic. I'm not sure that d5410 is an exact replacement for the code this > patch removes. I would be more comfortable with a change like this if it can be demonstrated that an example test case functions as expected before and after the change. Could a selftests test be written with veths to demonstrate this code is indeed redundant? -Jon > >> >> Suggested-by: Hu Yadi >> Signed-off-by: Sun Shouxin >> --- >> drivers/net/bonding/bond_main.c | 13 ------------- >> 1 file changed, 13 deletions(-) >> >> diff --git a/drivers/net/bonding/bond_main.c >> b/drivers/net/bonding/bond_main.c >> index 50e60843020c..6b0f0ce9b9a1 100644 >> --- a/drivers/net/bonding/bond_main.c >> +++ b/drivers/net/bonding/bond_main.c >> @@ -1578,19 +1578,6 @@ static rx_handler_result_t bond_handle_frame(struct >> sk_buff **pskb) >> >> skb->dev = bond->dev; >> >> - if (BOND_MODE(bond) == BOND_MODE_ALB && >> - netif_is_bridge_port(bond->dev) && >> - skb->pkt_type == PACKET_HOST) { >> - >> - if (unlikely(skb_cow_head(skb, >> - skb->data - skb_mac_header(skb)))) { >> - kfree_skb(skb); >> - return RX_HANDLER_CONSUMED; >> - } >> - bond_hw_addr_copy(eth_hdr(skb)->h_dest, bond->dev->dev_addr, >> - bond->dev->addr_len); >> - } >> - >> return ret; >> } >> >> -- >> 2.27.0 >> >> >