From patchwork Sun Jul 22 08:17:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 947461 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=cumulusnetworks.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cumulusnetworks.com header.i=@cumulusnetworks.com header.b="OO38EtNK"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41YHYx2mkTz9s3q for ; Sun, 22 Jul 2018 18:18:13 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728058AbeGVJOD (ORCPT ); Sun, 22 Jul 2018 05:14:03 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:37810 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727865AbeGVJOC (ORCPT ); Sun, 22 Jul 2018 05:14:02 -0400 Received: by mail-wm0-f68.google.com with SMTP id n11-v6so2405329wmc.2 for ; Sun, 22 Jul 2018 01:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=from:to:cc:subject:date:message-id; bh=lD12QYthV87/xYuRRORC+dTQMvjpSM3HdoBQZztD9PY=; b=OO38EtNKuOxYdDwIkhtSwxqNziJFM7yVYGXDxovH7EgOC3aSsgYHmtFDiY4saALpWr 25uo3naGXVA95Z1JKCOnCj2ggOit0FXayG2kK13fEFlJq9wHxS+5JvtLoPxCx7skgotA WYOzEj89XUqkxmXSmSz+kfH2027bf22vuWF5s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=lD12QYthV87/xYuRRORC+dTQMvjpSM3HdoBQZztD9PY=; b=Ke8+Ja5GQT8dwLeFxGakSqGVFUVV/WeTSHCUhJ4KCK2bGfHYTsU6671fMI9KAQtCFu 6m3ffpeuL6Qeqga7aGDZxHJVCzpvulVL6PXSZELqYRmRMM5IemJxbCVldu5FgzI51jVg dG+1AqEjHVjEElXDNYtMV7fnGShRpi+HRrgUiqM6FKbqm/coeEG6i1t/DGGFFLld8xRV utQ+qbD03D8ZkWMXBSVFi72YABYPV0eFKFu+aLiGMBasyUvEnzCYoZ5vqMzkQVwKUyQq ovijOO6PVV4dczGitzsnhFefk+/RNmROXoQ6GZVTXbIBdsCKIdJfDMQ4lQoZdtuabLk/ +SnQ== X-Gm-Message-State: AOUpUlFqSHadSCK/xPIY0xZKmGp+cciLkmSun2qdaPokVjqtF5YCwQhR aO7Si/l82xVdnp814OBPbxaGxOctbwU= X-Google-Smtp-Source: AAOMgperoHcUy6z5Xs7RKFigofJKu3eu7cR6wgUqG10+pqWDqOXZfGhcvShPzkfdak2kKrgXjXRzvw== X-Received: by 2002:a1c:a813:: with SMTP id r19-v6mr4809756wme.100.1532247489503; Sun, 22 Jul 2018 01:18:09 -0700 (PDT) Received: from localhost.localdomain (95-42-17-99.ip.btc-net.bg. [95.42.17.99]) by smtp.gmail.com with ESMTPSA id i15-v6sm635697wrw.75.2018.07.22.01.18.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Jul 2018 01:18:08 -0700 (PDT) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@cumulusnetworks.com, davem@davemloft.net, anuradhak@cumulusnetworks.com, wkok@cumulusnetworks.com, stephen@networkplumber.org, bridge@lists.linux-foundation.org, Nikolay Aleksandrov Subject: [PATCH net-next v2 0/2] net: bridge: add support for backup port Date: Sun, 22 Jul 2018 11:17:43 +0300 Message-Id: <20180722081745.23272-1-nikolay@cumulusnetworks.com> X-Mailer: git-send-email 2.11.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, This set introduces a new bridge port option that allows any port to have any other port (in the same bridge of course) as its backup and traffic will be forwarded to the backup port when the primary goes down. This is mainly used in MLAG and EVPN setups where we have peerlink path which is a backup of many (or even all) ports and is a participating bridge port itself. There's more detailed information in patch 02. Patch 01 just prepares the port sysfs code for options that take raw value. The main issues that this set solves are scalability and fallback latency. We have used similar code for over 6 months now to bring the fallback latency of the backup peerlink down and avoid fdb notification storms. Also due to the nature of master devices such setup is currently not possible, and last but not least having tens of thousands of fdbs require thousands of calls to switch. I've also CCed our MLAG experts that have been using similar option. v2: In patch 01 use kstrdup/kfree to avoid casting the const buf. In order to avoid using GFP_ATOMIC or always allocating I kept the spinlock inside each branch. Thanks, Nik Nikolay Aleksandrov (2): net: bridge: add support for raw sysfs port options net: bridge: add support for backup port include/uapi/linux/if_link.h | 1 + net/bridge/br_forward.c | 16 +++++++- net/bridge/br_if.c | 53 ++++++++++++++++++++++++++ net/bridge/br_netlink.c | 30 ++++++++++++++- net/bridge/br_private.h | 3 ++ net/bridge/br_sysfs_if.c | 89 +++++++++++++++++++++++++++++++++++++------- 6 files changed, 176 insertions(+), 16 deletions(-)