Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1232178pxp; Thu, 17 Mar 2022 05:48:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHfGRlvAqWind/6I630F93Aeu/qOE/I/CvK9Zfoa3Yd6065bjMowEk8ZbEjt4VWRdu/0ut X-Received: by 2002:a05:6402:528e:b0:407:80ff:6eed with SMTP id en14-20020a056402528e00b0040780ff6eedmr4205328edb.165.1647521311713; Thu, 17 Mar 2022 05:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647521311; cv=none; d=google.com; s=arc-20160816; b=woH+gJWgZrvbBGRhb/t9oVso+8RzevnVNZXTlp2sQ9rOoC/riCT7GOvTIvzt5v80v6 W6qogs3JdaBp0QfChu6vQh0AM1pjZSomAA1jkc+cfngdT+HB3Gcy9a5tS4W6qo55YwgP R8/YPm0LfrMNv/BdQgM+8u98SC0S6tRKFsmdznEvollQzhwYYIGsw1W9hwcYo/5j3rAe U1NQDxD1JFkubPWxdyApmAOmPuGjzJt9aDXi22bo9lhk4poN5flkn01ENAL0hLfwPIkF kRiTZez6As/BJypM1k3wJ0GkX2FmvtpkbMsRlbTewC/P2W4jQYLPM2DsXDMRyPaafulg 7b3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=IAni6CZ3rMr9AtNTUfmAVEBymHaVw/hvggCMmkUx9/o=; b=PUTk31eO1tds0MaoJp7NqHykRnccrwHNH2xopth3nTvVk2yadtT0lwKgcJp5mjKC/E PTO7gT1JYdhM/JGMBdVjp75u7zBQU8mZ9OXysQ2TDl9Im8RMDiOdc/ZgDAuJAVF9/RB+ JVehzf6CMeDBAy75dNpDFF7h+eVOI+a4AIr6OTKN3ZtQ/dyyPXNL649vYFHdcl0XHXTm 4QeDeoNjdObWPbX/oN2kdXBMRGd+48omaNWPrChnMxKm0W3U6Zb8nm62XqpEQd0HdMup gvWnqU3nwLdyhzwaO+ZlzjFiEylArCcHolGbpCBPOuY8scOvKZAZiZelTvsK0gntjxh+ KlWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Mb0vVZpl; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g6-20020a170906198600b006d07e3a4564si3083706ejd.169.2022.03.17.05.48.06; Thu, 17 Mar 2022 05:48:31 -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=@gmail.com header.s=20210112 header.b=Mb0vVZpl; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232059AbiCQJkg (ORCPT + 99 others); Thu, 17 Mar 2022 05:40:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230149AbiCQJkf (ORCPT ); Thu, 17 Mar 2022 05:40:35 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAF7D185447; Thu, 17 Mar 2022 02:39:16 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id u7so6401359ljk.13; Thu, 17 Mar 2022 02:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version:organization :content-transfer-encoding; bh=IAni6CZ3rMr9AtNTUfmAVEBymHaVw/hvggCMmkUx9/o=; b=Mb0vVZplMfFqQljm0vS4KbqDPo346w3lbKqjCZZmv816h8VP9QGTpJ7UBew3uB/4PM Hh6SAqiF4HSyR7s3C3cZ/Ykd7l+4Kpfj3ERrMuELhABalzRQtZ+ccHLbLTrgjvchnqgw ftcAbs3BBrIvJPli6osV4wKOTTH6o0lFhm0x3JwLV49vPM3EzP6SMQjV9QvLN8eASWbl irD5YC7ApxtpjJx0JXTgKFt5FTDuAJsVWS3zp+F9k0Rznfwscex4M3OTTTkWlOZg7A+Z Cgj8fsscSrERR7eMSOGezU5wigTHeU285EGVS7/yZRf42kvYw9GG16ZKklcbFHJcnybW P20g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :organization:content-transfer-encoding; bh=IAni6CZ3rMr9AtNTUfmAVEBymHaVw/hvggCMmkUx9/o=; b=TJXL/nLNoPTpTgDUejBPaSnv5gC0Ejd2zDyp+wZN2w2Gtz2Ke99DT2EnBGaUVKfKs5 zaJMMQZ64bRzLMwaYXx6NgxPay+3MxhVCGHwba13dJ10QCf33tKaZR9xC6a88q3TQ2bB l8gkJAcl3fb/dIROyG+qdj0OcVyAAn2mqt+Y9X4soLIXbn5zqMcceGBR0unXNNqAi+AW tfIV01l9mYxFvh/Nq2Q+DH9kV0c2Upt0hbBW7z0iqdwqqr24HyJXPxigvvuc0k/zzc8i IsIMwHE1XMVZSbsAfItil+R/QHysKGFfb+G2wUvcVm5/6h0CptjnNNtmWGG/769CDcnU qDyQ== X-Gm-Message-State: AOAM533eNDGyhkNaEtW+BYtBSoAuxMTeOa2suRJuHTtqWuBU5Ee3yfRy XuoDVJ5pwAT1nEBeD4Pn7yc= X-Received: by 2002:a2e:804d:0:b0:246:1aba:af59 with SMTP id p13-20020a2e804d000000b002461abaaf59mr2258039ljg.508.1647509955084; Thu, 17 Mar 2022 02:39:15 -0700 (PDT) Received: from wse-c0127.beijerelectronics.com ([208.127.141.29]) by smtp.gmail.com with ESMTPSA id w13-20020a2e998d000000b002496199495csm113479lji.55.2022.03.17.02.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 02:39:14 -0700 (PDT) From: Hans Schultz X-Google-Original-From: Hans Schultz To: davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, Hans Schultz , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Shuah Khan , Daniel Borkmann , Ido Schimmel , linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org, linux-kselftest@vger.kernel.org Subject: [PATCH v2 net-next 0/4] Extend locked port feature with FDB locked flag (MAC-Auth/MAB) Date: Thu, 17 Mar 2022 10:38:58 +0100 Message-Id: <20220317093902.1305816-1-schultz.hans+netdev@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Organization: Westermo Network Technologies AB Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 This patch set extends the locked port feature for devices that are behind a locked port, but do not have the ability to authorize themselves as a supplicant using IEEE 802.1X. Such devices can be printers, meters or anything related to fixed installations. Instead of 802.1X authorization, devices can get access based on their MAC addresses being whitelisted. For an authorization daemon to detect that a device is trying to get access through a locked port, the bridge will add the MAC address of the device to the FDB with a locked flag to it. Thus the authorization daemon can catch the FDB add event and check if the MAC address is in the whitelist and if so replace the FDB entry without the locked flag enabled, and thus open the port for the device. This feature is known as MAC-Auth or MAC Authentication Bypass (MAB) in Cisco terminology, where the full MAB concept involves additional Cisco infrastructure for authorization. There is no real authentication process, as the MAC address of the device is the only input the authorization daemon, in the general case, has to base the decision if to unlock the port or not. With this patch set, an implementation of the offloaded case is supplied for the mv88e6xxx driver. When a packet ingresses on a locked port, an ATU miss violation event will occur. When handling such ATU miss violation interrupts, the MAC address of the device is added to the FDB with a zero destination port vector (DPV) and the MAC address is communicated through the switchdev layer to the bridge, so that a FDB entry with the locked flag enabled can be added. Hans Schultz (4): net: bridge: add fdb flag to extent locked port feature net: switchdev: add support for offloading of fdb locked flag net: dsa: mv88e6xxx: mac-auth/MAB implementation selftests: forwarding: add test of MAC-Auth Bypass to locked port tests drivers/net/dsa/mv88e6xxx/Makefile | 1 + drivers/net/dsa/mv88e6xxx/chip.c | 10 +-- drivers/net/dsa/mv88e6xxx/chip.h | 5 ++ drivers/net/dsa/mv88e6xxx/global1.h | 1 + drivers/net/dsa/mv88e6xxx/global1_atu.c | 29 ++++++- .../net/dsa/mv88e6xxx/mv88e6xxx_switchdev.c | 75 +++++++++++++++++++ .../net/dsa/mv88e6xxx/mv88e6xxx_switchdev.h | 20 +++++ drivers/net/dsa/mv88e6xxx/port.c | 17 ++++- drivers/net/dsa/mv88e6xxx/port.h | 1 + include/net/switchdev.h | 3 +- include/uapi/linux/neighbour.h | 1 + net/bridge/br.c | 3 +- net/bridge/br_fdb.c | 13 +++- net/bridge/br_input.c | 10 ++- net/bridge/br_private.h | 5 +- .../net/forwarding/bridge_locked_port.sh | 29 ++++++- 16 files changed, 206 insertions(+), 17 deletions(-) create mode 100644 drivers/net/dsa/mv88e6xxx/mv88e6xxx_switchdev.c create mode 100644 drivers/net/dsa/mv88e6xxx/mv88e6xxx_switchdev.h -- 2.30.2