Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2024816ybl; Thu, 29 Aug 2019 02:27:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqySUji5by3/v6aXbNyZL00xm3D25pgMipk6I36cVZ9uuFb4ZUAeOq6Ybx2BEecRs5ooy9dn X-Received: by 2002:aa7:9713:: with SMTP id a19mr10100783pfg.64.1567070830675; Thu, 29 Aug 2019 02:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567070830; cv=none; d=google.com; s=arc-20160816; b=VjpXGtPwBR13zSOlN/YrlH2MAUGL4Dm/qM8pim0WcIRC20CkaufFtp8f6LStph5e5Y TnnKNyYDfeu7Am2u85dJriuky8Hl91JcU9Fh53Ae0UcZIOxE6Dm83mqHuKkcMO3/SDZb vfhmcFWpzhNIzl5Xb1qMNVZ+kgfgUcyr7EO82+oCQuXpO627De9I7xZ7EtPFbB0poTUN nf5do798OjduYWjrKTrjdPXTvDmfQgDK7lQnp2+HCeS49hjc9/h4RH6pldpBx72OdXl9 n/KwNNYbU0vGPOlhMC05ZlcfJKIr1gS9nkZRn9+E/qg2DudUjl76wPBSXn6G+VuqXkZV jlTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:ironport-sdr; bh=WicJTQbUFjOEHye6GzBrM9ootF/lyeHmKkROuBsikZk=; b=f2hskevEv/ytgZc8TBbgtrVBlCsRo99mSPcAZHYM4uj+LbljVK+w72aCLCw7efzJru 6PZFbZfRLApB9FQFbReCgCI0gq1XdrtsRNRifxaES+vsWy6tftfvjoyo+pq/4OQNzg0H lgTow+YXtcjLUseJJHe7p+7+Ws/4sXpSeHy6FCIxjbZTOHsKaPy8+2YfLHzEV1P03PU9 KydFa+DPLtIE4IUnQAe7hxXjsCfZQbK1PpZHQxTfvDSa3r5YEHpn/Mp41G3qH83gHKBi Ivk/Uwd6PpphY8mIYar19gKrlpVPFHulKrmVdXMKL2ZrF4/HXBw0MLIhHVEEQQSiO/6y TsnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y3si1462682pgy.230.2019.08.29.02.26.55; Thu, 29 Aug 2019 02:27:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727889AbfH2JYS (ORCPT + 99 others); Thu, 29 Aug 2019 05:24:18 -0400 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:14951 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbfH2JYS (ORCPT ); Thu, 29 Aug 2019 05:24:18 -0400 Received-SPF: Pass (esa5.microchip.iphmx.com: domain of Horatiu.Vultur@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa5.microchip.iphmx.com; envelope-from="Horatiu.Vultur@microchip.com"; x-sender="Horatiu.Vultur@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com a:mx1.microchip.iphmx.com a:mx2.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa5.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa5.microchip.iphmx.com; envelope-from="Horatiu.Vultur@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa5.microchip.iphmx.com; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=Horatiu.Vultur@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: mXFrx/vA6Ko1qlodqX8ZLmLuJVy2PyCGVgDX+f24Usps4NRsbkG3rrCbqrc4bg5pisGzJOFUJc wB8aQXizz/eblA9b5TjaQlQDd39nwIpisjD1B1mWyPRv70LiW7SZiKRF+B1X4tip6lJ1qFkCGF 8Re7wfxRrh74KxnExC9piYf/qa67VoUAbrcRWST2PjFEyKAC1EvpWJSRULWQIq16RVUSbkCK8W 9WWle63b+iLKG0Zf+gl7+azfzYgbphYv+sOBDU11DoCL+32zOPzHO/tIzWf3g6JHwQlkzRue/d gW4= X-IronPort-AV: E=Sophos;i="5.64,442,1559545200"; d="scan'208";a="45437238" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 29 Aug 2019 02:24:18 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 29 Aug 2019 02:24:13 -0700 Received: from soft-dev3.microsemi.net (10.10.85.251) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Thu, 29 Aug 2019 02:24:11 -0700 From: Horatiu Vultur To: , , , , , , , , , CC: Horatiu Vultur Subject: [PATCH v3 0/2] net: core: Notify on changes to dev->promiscuity Date: Thu, 29 Aug 2019 11:22:27 +0200 Message-ID: <1567070549-29255-1-git-send-email-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the SWITCHDEV_ATTR_ID_PORT_PROMISCUITY switchdev notification type, used to indicate whenever the dev promiscuity counter is changed. HW that has bridge capabilities are not required to set their ports in promisc mode when they are added to the bridge. But it is required to enable promisc mode if a user space application requires it. Therefore if the driver listens for events SWITCHDEV_ATTR_ID_PORT_PROMISCUITY and NETDEV_CHANGEUPPER it is possible to deduce when to add/remove ports in promisc mode. v2->v3: - stop using feature NETIF_F_HW_BR_CAP - renmae subject from 'Add NETIF_F_BW_BR_CAP feature' because this feature is not used anymore. v1->v2: - rename feature to NETIF_F_HW_BR_CAP - add better description in the commit message and in the code - remove the check that all network drivers have same netdev_ops and just check for the feature NETIF_F_HW_BR_CAP when setting the network port in promisc mode. Horatiu Vultur (2): net: core: Notify on changes to dev->promiscuity. net: mscc: Implement promisc mode. drivers/net/ethernet/mscc/ocelot.c | 47 ++++++++++++++++++++++++++++++++++++++ include/net/switchdev.h | 1 + net/core/dev.c | 9 ++++++++ 3 files changed, 57 insertions(+) -- 2.7.4