From patchwork Fri Jan 5 00:06:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aahil Awatramani X-Patchwork-Id: 185172 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5939221dyb; Thu, 4 Jan 2024 16:07:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFIvxRugIA0imJoZxM/L2A1MiJKOPnQIjKMRk5APoRGs6sAvkUgYSi4QG0dCLrVvO+2mCcV X-Received: by 2002:ad4:5aad:0:b0:67f:dc29:f9d0 with SMTP id u13-20020ad45aad000000b0067fdc29f9d0mr1583948qvg.114.1704413248089; Thu, 04 Jan 2024 16:07:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704413248; cv=none; d=google.com; s=arc-20160816; b=mQrqbvyPKo2ar8LeKAf3L25YuG0L4Yulpp6pveCtGcZli+I3QEORQkksMT/MzWOWrH q/KrXu8qLWooVHwOPKIUsqmy0Zg1gytVefEGhfgGXb65U/e/MOTJsgj1i0W06FzFfJui gkbVM0iMq27oouYoNzoDy5P0/J+jUyOCrXLzCn7C2dZObXgjAAmm7ubWupBuHOZimImZ tYzWjRX1jm2aMhddWUX4OuxjloTn27oKiY2HoyEixn9/x3uneTiaecjUPupEIOstJHAP hy6yFloo+zvJqLlF/f8v+a+6INeWYBueTm5kXMEhMrVirjho+cPXXNBB6KiuNOgfuDJN hUzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=ZCm4qbqYLKL0X2tawwVQnjcJ74n/29xH0+vMdcngW8c=; fh=GyVGW8U1MvtbEyh/ldAgs7Rk0zl8uwbRC+ltCCnLM7k=; b=Rf6QnxCgdZNOwBMSmPP2ZEDOxwkcfmtbt9YIqSzLI60HqXn+vMaq+yYj72VPiPNeYP jVoNnMKaWbpqfInJBsUsPxNhnjfLDPNMl3qkfOAHpguk2T0B9cOSdUxAGjWHB75x483q KU/Glk3lHHzwWdLR7wguXGCKktHn28RcrnVxgp32Pmhz742Dz+8KZbvTF+wHZN4EYhEU /gWlHcNECbM924NQGg4atmUSGpqC/qwX1i036v+0jhUPYXkUsHAk8zqEltuGKD7nrhow OnpHxjjZm7d5d5W5/hUeIF4fVIfoU95diRgZiwe+3kXJIK1Q+gYSAG7THJ0VHtodQdqi XDKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=mNUcjAqj; spf=pass (google.com: domain of linux-kernel+bounces-17347-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17347-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bi29-20020a05620a319d00b0078308612decsi365649qkb.127.2024.01.04.16.07.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 16:07:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17347-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=mNUcjAqj; spf=pass (google.com: domain of linux-kernel+bounces-17347-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17347-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DC7361C22017 for ; Fri, 5 Jan 2024 00:07:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1263C28F2; Fri, 5 Jan 2024 00:07:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="mNUcjAqj" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 376891FCA for ; Fri, 5 Jan 2024 00:07:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aahila.bounces.google.com Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-5c65e666609so952533a12.1 for ; Thu, 04 Jan 2024 16:07:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704413222; x=1705018022; darn=vger.kernel.org; h=to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=ZCm4qbqYLKL0X2tawwVQnjcJ74n/29xH0+vMdcngW8c=; b=mNUcjAqjjvGF5xpDOMseDVfN7pidAvcDn8p7kxy/x5Bdu8hGrAxDFUyALF3G9VVPt9 7A9UOgTMNICN4XfcSibsZJFqevzeUebtcwSQ54z76f8/QKtXF2mOdUx63kXLWtH5jzMj G9jnxMyzXf5LzCBZJqoSpSqXjboQAZS8JqOq1E8dShtX2JiCwUhEK83omsumSpSquATp oTWHipD7KjgO1ox5zJ7Nu1SY0K4iQ37eQjuXVjutPMc4WpsAHED/BNMkfb+OvfIr9vxN t5picz7zohze/dJNHm+bs3Q0ebLtvvc0On42MA5jbOQEEzHtug7dYGni8aclLLSaZLl0 mpbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704413222; x=1705018022; h=to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ZCm4qbqYLKL0X2tawwVQnjcJ74n/29xH0+vMdcngW8c=; b=jsaOutFVka3yQnJDNMYSN9Rmqsg4CwZb2IZLijhD495BZuFZ86Tl7O110vACBT82IN jzycmyTX2l/dwB5AzOzX3/h2pCaejbNddUf5jN0Yy2AvhQR+Ry/xxZ5T0CDY7UY33p8U WrUATot48LD/7T3L0VKKF8vNiC6TVC3uGLjDXarUbC6/CYYQ2xFiw5DbecNlc3l4MKcx BfMZixKcqkUTjFIkAUYoERVndYtmu2Fgi2Pj1gnPdWTYfiqWoDzzTm++S/uc+aHdoUau lG5Wj2TkDkhUROz0enVe9fYzub8TG0iYuelhjFMI8nzupS4VXspznobtHeZbCx/M9KdL FhYg== X-Gm-Message-State: AOJu0YxryDxTXEfsAgbi8TCV6ZUzo3C43rceqf0C/QiBNXiIbnstrT6F 9dgdE8UW1wuips/rWpr7wAddnDbtJrO9v7KQUQ== X-Received: from aahila.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2f3]) (user=aahila job=sendgmr) by 2002:a05:6a02:491:b0:5ce:474:352b with SMTP id bw17-20020a056a02049100b005ce0474352bmr7789pgb.5.1704413222131; Thu, 04 Jan 2024 16:07:02 -0800 (PST) Date: Fri, 5 Jan 2024 00:06:31 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog Message-ID: <20240105000632.2484182-1-aahila@google.com> Subject: [PATCH 1/2 net-next v2] bonding: Extending LACP MUX State Machine to include a Collecting State. From: Aahil Awatramani To: Aahil Awatramani , David Dillow , Mahesh Bandewar , Jay Vosburgh , Andy Gospodarek , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Martin KaFai Lau , Herbert Xu , Daniel Borkmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785857305613733901 X-GMAIL-MSGID: 1787206826171305096 Introduces two new states, AD_MUX_COLLECTING and AD_MUX_DISTRIBUTING in the LACP MUX state machine for separated handling of an initial Collecting state before the Collecting and Distributing state. This enables a port to be in a state where it can receive incoming packets while not still distributing. This is useful for reducing packet loss when a port begins distributing before its partner is able to collect. Additionally this also brings the 802.3ad bonding driver's implementation closer to the LACP specification which already predefined this behaviour, that is currently the implementation only supports coupled control. Added new functions such as bond_set_slave_tx_disabled_flags and bond_set_slave_rx_enabled_flags to precisely manage the port's collecting and distributing states. Previously, there was no dedicated method to disable TX while keeping RX enabled, which this patch addresses. Note that the regular flow process in the kernel's bonding driver remains unaffected by this patch. The extension requires explicit opt-in by the user (in order to ensure no disruptions for existing setups) via netlink support using the new bonding parameter coupled_control. The default value for coupled_control is set to 1 so as to preserve existing behaviour. Signed-off-by: Aahil Awatramani --- Documentation/networking/bonding.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/networking/bonding.rst b/Documentation/networking/bonding.rst index f7a73421eb76..cb3e6013605d 100644 --- a/Documentation/networking/bonding.rst +++ b/Documentation/networking/bonding.rst @@ -444,6 +444,14 @@ arp_missed_max The default value is 2, and the allowable range is 1 - 255. +coupled_control + + Specifies whether the LACP state machine's MUX in the 802.3ad mode + should have separate Collecting and Distributing states. + + The default value is 1. This setting does not separate the Collecting + and Distributing states, maintaining the bond in coupled control. + downdelay Specifies the time, in milliseconds, to wait before disabling