From patchwork Thu Oct 24 16:57:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 2001863 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=VfYuhPDZ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZBvC32pHz1xwy for ; Fri, 25 Oct 2024 03:58:31 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 84740813F5; Thu, 24 Oct 2024 16:58:29 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 2k4kWKJT-Dew; Thu, 24 Oct 2024 16:58:28 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org EE6CD813ED DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1729789108; bh=ji37eBUP6AOL/3De1mGYqKkdbcPdB752V6giI2c0vas=; h=From:To:CC:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VfYuhPDZISdZi4MTi0l5jVYzhZ+S9eg2Er/eUiIGASL8duZn/jO5Qo5KGYCLJmsOt Y1xVvonRXpNu/Kwp5Ykb0+wiAMwrvq9gSdCJun/Lkh+TRNozR5ekRw4NM7aKJx23pg ZvHv2/mToV3a9kAspqAmRKhqvGCqvp+gLAAtMbpsgkrJcabt0Tn58cKW8nzx4XCTQb Qhz22WKde9CqQfoJlKQeCPYWNALz9lCoXWDkE4WoHjN84dZXhFmyLu1hl+iZ5+p3Cj PhZBk12CRQNzMlZl7tfYAKFC6wbUBm0ZIt2a6omyMsLwqXP6z/do7+y8sh7eyRUD48 o+X5fqbfEwvUg== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id EE6CD813ED; Thu, 24 Oct 2024 16:58:27 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id 345834960 for ; Thu, 24 Oct 2024 16:58:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 22522607E4 for ; Thu, 24 Oct 2024 16:58:27 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id fMSvz5xdZ46Y for ; Thu, 24 Oct 2024 16:58:26 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=40.107.102.88; helo=nam04-dm6-obe.outbound.protection.outlook.com; envelope-from=petrm@nvidia.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 3D904606B1 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 3D904606B1 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2088.outbound.protection.outlook.com [40.107.102.88]) by smtp3.osuosl.org (Postfix) with ESMTPS id 3D904606B1 for ; Thu, 24 Oct 2024 16:58:25 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HkCjZ8SBdnElbvZDN9OQyx9DbotM3YkcB7OMABew7cfB7T+xX4W6jjGgdBnkHnN7BazSn/ek/X5KKPsnfaz9MLICgHb3xhp/I5TWuzfDBh4GpK2he4e1036PyTUz73Y5Qe18ptvObtnMcR5aU6CEZDrDI0RSzFRcs+Z7L4HiWhMDedcETYqxcaBZio8d6GKSlrbNM26Rhvn3O7hrONMo8OXOrcPacW6YGOFkrgEJc+RJimbmBkuU5H3Dzz4LJAKM7QSeOqVxAdyt2aJH5Vt0mMGiLXL/ADMV3bPLtiDT2/3ImjJiOFvFueTOX0mKJJ7dOr0OWGWZ12+KIUAc1pl0NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ji37eBUP6AOL/3De1mGYqKkdbcPdB752V6giI2c0vas=; b=oVIlIvP53qsPnbeMO6PSfDAzRRGcbEo5WK1b1Y0c20k0a1wHqD9OmyIDn9EgR6iIEwTG09PUY4rAcUB7lx4xlgvOyfZvzLID1km0IvaIeKxwyHoeg+7FhwWvGbBS6vLsAxq29qEjaAv3O7OE8zcsq0WYGqcc++7ebCIq6Gt0UFnk9TX/bIgqoG6vO8CU9KRnOngqQfu7rv9geKT3nQnN3exVBfOYre5CVASFfdJ/AXXhZWNR1QzpC1M6OA4TdvYw7uVkZHFpFbqrFR96/ql6BD6lmrkWTIqM+M3qslVqCl4j51ohR+zJvSuhe7KQGhha9Ud7gS/hZs5j7Lxdj7e6Zg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) Received: from SJ0PR03CA0332.namprd03.prod.outlook.com (2603:10b6:a03:39c::7) by DS0PR12MB8813.namprd12.prod.outlook.com (2603:10b6:8:14e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29; Thu, 24 Oct 2024 16:58:20 +0000 Received: from SJ1PEPF00002322.namprd03.prod.outlook.com (2603:10b6:a03:39c:cafe::21) by SJ0PR03CA0332.outlook.office365.com (2603:10b6:a03:39c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.20 via Frontend Transport; Thu, 24 Oct 2024 16:58:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SJ1PEPF00002322.mail.protection.outlook.com (10.167.242.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Thu, 24 Oct 2024 16:58:20 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 24 Oct 2024 09:58:06 -0700 Received: from fedora.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 24 Oct 2024 09:57:59 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Ido Schimmel , Petr Machata , "Amit Cohen" , Vladimir Oltean , "Andy Roulin" , , Przemek Kitszel , , , Manish Chopra , , Kuniyuki Iwashima , "Andrew Lunn" Date: Thu, 24 Oct 2024 18:57:36 +0200 Message-ID: <2e53a70cbfa8b04fe396ef13993d107da31c8c4e.1729786087.git.petrm@nvidia.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002322:EE_|DS0PR12MB8813:EE_ X-MS-Office365-Filtering-Correlation-Id: 0615bfb1-adb9-423d-ac20-08dcf44d105f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|1800799024|82310400026|7416014; X-Microsoft-Antispam-Message-Info: GffkoEqZbYqOeq90yFp1ZdO+V3r2uMJlBkTDOUBl+6UhWf3D2xh8oW9daYOhKNcyG331J/+fpkDCoCv3aD5F/sQMXEF8omB3qgbkbTJLxGNv07ZF3jdwjgjbx4+tTuwb7iYobQ2+DvvJQ99w/pMsfrRMrWP6MqRTjoB0UWUcW03xv9a/f0gXZexSOomCG80HLNwPUL8+qD0HXPqu1aEsc0HPxLut/IjIK8F2TEAEJLUEY0CxrABnL6rdciWiNcHFxJ6gs0RwrC1E0jejmrKA/ul76yAzPp+oDdS7yRyB2GooIpeOXEGNJLEssSqu6gpYgRe5T4D2UI42BhtWR/ShHBUnY0q73tGXValOPa4zXFQKB5QVvK2LhdAwJ9/BXVYM1kC/9idHHELuVx2QAFsG58yUlTTNVVrfKJHFujMjpp48Qg7kcEcfSaPfcHVaZijHnPz5+47q830uZ/m4e8jbb0ddTB2HSMoERxF7862pOrPIRMtqFY0fHf6bWgC/EH8XRab/LE5l7f+huPFdzrXkDXzNCWFWHbCCY/mFsovCDLEfQF1ay82tpCeLQxlrTwGRKx+AKg5b2m9SVmTzsm7nfTqZD8uyhy41G7SnIzS0Sb56NYrxTrc+XfNLT0xOkNN6p9XJVFzRw/MVfKrcv0W8wFFUASSNGBS2InAleGChlXGsTHeukcYK9yDuxFLyV1luMkrr96TC8vZoGuVT3qLYHQ5uXoknpCyo+EHOohBR1poo8Rie0sfphO04pKibWlXJgoG6NMQI4L7G3nifABJ6fwlqbj/XELVSV6gb+PtBQqM85wWALrPHdDk8kuZAY5u6DuCroCgM2CnjGyQWQkLRQMSP5wP5pHhnSB5ofevwM9iUNdYnipr3L383eMyVWmxEhZbDD8xNPjvK0oOV3a3kwKJPf4g1P41kiPRSq/ppcUuuR17CKEN+P+5uSyk6p2U826aH7DU3w1wrVa9kiaBXlU8M7gnDiMEuuQKwIaJJMMJCpqR8jj8S+qqFZItgMWeP9eUZISU3n0osbfDS+0b7YmZzmcN6wm5A3b7Oq1NXETZdk/jY8hhetUp8Hk8n4a3TKmSHhHlT7WcMiA/MX0I+55rDLetB6yeixUMG/W/JKhRvGl0F3eHrrF1azcTfg+zlDeBe0jwjnQhb2ZrU8SRLe8y+hpdR0SpJJiMbABzC97iIXL8rKbCh/Q50jxx9zToiyaOwpAz+8UFIKQJ7/rU62WYQdgqPIvgwqwuzXvrkrMHj1xVooOba48NcuCbdtEmRMxvs/QBP6n0bZcaATgoDcJg6uNlr8EZ/nk/B9edKaRoMZsdsOMtOM+iKY8iPaO2w5BcpSRe9PRi6PS/p5RGtiYeLevboTHIkQYqoDYqrPFRcjSbK3HJjFb7UeEd07TzFWrOALgZ2lp+6U1EZqqvB0g== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(376014)(1800799024)(82310400026)(7416014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 16:58:20.2882 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0615bfb1-adb9-423d-ac20-08dcf44d105f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002322.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8813 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ji37eBUP6AOL/3De1mGYqKkdbcPdB752V6giI2c0vas=; b=pk8Zm5Kerbr5e7A1aly870n6qn4PIdlPZFYUqFVKF9ztRjjH+ktOczDE+9CXbYe7b/1RJk+EP4sOmpxWINJ0Xd1bdadVzj5mjJrLDEH4pW+DZc49fu3qz9Ss097tPqzwnwlGffBm1NXTFUtMd/wWs6wFIlgJ0IwDeLsqjiquJVZpQsde+No5CkdURVwgKJyRPPtvYwbQcAB3Ke7s1S5M6fsL/R7HhOoYSc3RdTlDjQZLMJsbNLGTDXA/7XYo9VaJ94BJb0a6c7yR4Qtvqx4TFat49ScJ5b2lxp5LlFZSx/IkS8ZN6pAVVVzIAV8gr90CqcRtsWyEtlstB0yRQMTnkw== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=pk8Zm5Ke Subject: [Intel-wired-lan] [PATCH net-next v2 1/8] net: rtnetlink: Publish rtnl_fdb_notify() X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" In the next patch, responsibility for sending notification is moved from the core to the driver that implement fdb_add (and fdb_del in the patch after that). In this patch, export a helper that the core currently uses for sending FDB notifications for the drivers to use as a fallback if there is nothing specific to report. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen --- Notes: CC: Przemek Kitszel CC: intel-wired-lan@lists.osuosl.org CC: UNGLinuxDriver@microchip.com CC: Manish Chopra CC: GR-Linux-NIC-Dev@marvell.com CC: Kuniyuki Iwashima CC: Andrew Lunn include/linux/rtnetlink.h | 2 ++ net/core/rtnetlink.c | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 8468a4ce8510..2e48b4ca7187 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -192,6 +192,8 @@ extern int ndo_dflt_fdb_add(struct ndmsg *ndm, const unsigned char *addr, u16 vid, u16 flags); +extern void rtnl_fdb_notify(struct net_device *dev, const u8 *addr, u16 vid, + int type, u16 ndm_state); extern int ndo_dflt_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 194a81e5f608..e5c6dd4c5cf5 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -4271,7 +4271,7 @@ void rtmsg_ifinfo_newnet(int type, struct net_device *dev, unsigned int change, static int nlmsg_populate_fdb_fill(struct sk_buff *skb, struct net_device *dev, - u8 *addr, u16 vid, u32 pid, u32 seq, + const u8 *addr, u16 vid, u32 pid, u32 seq, int type, unsigned int flags, int nlflags, u16 ndm_state) { @@ -4313,8 +4313,8 @@ static inline size_t rtnl_fdb_nlmsg_size(const struct net_device *dev) 0; } -static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type, - u16 ndm_state) +void rtnl_fdb_notify(struct net_device *dev, const u8 *addr, u16 vid, int type, + u16 ndm_state) { struct net *net = dev_net(dev); struct sk_buff *skb; @@ -4336,6 +4336,7 @@ static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type, errout: rtnl_set_sk_err(net, RTNLGRP_NEIGH, err); } +EXPORT_SYMBOL_GPL(rtnl_fdb_notify); /* * ndo_dflt_fdb_add - default netdevice operation to add an FDB entry From patchwork Thu Oct 24 16:57:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 2001864 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=IrcXKXFU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZBvP4kQlz1xwy for ; Fri, 25 Oct 2024 03:58:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0D31A608D0; Thu, 24 Oct 2024 16:58:40 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id gNWPb7srpHtN; Thu, 24 Oct 2024 16:58:39 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0001F607E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1729789119; bh=B6o8GVt3j2bzQyzwjo+CDrFwovQ0czdOAGsQR+DF4ko=; h=From:To:CC:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IrcXKXFUWoYA0G6ofllWwaG9D8SBpKka0oEmPP37Dx+hlCMqmejCtl6Jq4iW/voOU cPo96fGWyUKHH90aeZS1Iw2AKtP5+MFqdKTJTpcoBt5P4jJCt4iAV01aXL271xZ9wE FpPhaqm9Z3urB2MSJA7Mqr8B4Kr0jwrDdpgiU7HtKSkyJbV8NeF2EVVCdC8lDECYtT IylJIzLk53Wd/mOt2KYcDW3bZ5YQpfO8/WCEzHU361z6FkpdOmKfVj72z1sts7jiW+ qZgYU3Kywzi/LeTFuejkC/bgTj+XyjSwYKahPE5s0MalAgjyTJbjfkuMuSnw6pEXBy AFcgtWa/eqx0g== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 0001F607E4; Thu, 24 Oct 2024 16:58:38 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists1.osuosl.org (Postfix) with ESMTP id 424FC972 for ; Thu, 24 Oct 2024 16:58:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 23A624067C for ; Thu, 24 Oct 2024 16:58:37 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id NCNCj5tz080t for ; Thu, 24 Oct 2024 16:58:36 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=40.107.93.75; helo=nam10-dm6-obe.outbound.protection.outlook.com; envelope-from=petrm@nvidia.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org C5624401F4 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C5624401F4 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2075.outbound.protection.outlook.com [40.107.93.75]) by smtp4.osuosl.org (Postfix) with ESMTPS id C5624401F4 for ; Thu, 24 Oct 2024 16:58:35 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Xi1spLHLkvekhz/0aDODb5owEkh8RavrpUBsFm3T4SlEGs1OD+FRQ6ZYTl/1Ru1YfoAS4cedxDv/d/rvh5tZwSlgE6XkECQZTw3OvALLiS21pQWNOtSzOnMyvoqYhN3SXUUu/icRNe36lqK4/9W1nGPGULYoXrPokdzCB8++8z/8dJGGYm7kEnV5Ahiy5zgHzJguI6Kj5mltZ++BTkDcYWyFep0UXn/Z0WwcezQBNLLGX/rNA5AG0v6pZNdcb3hVQ8FGVXa8+W92kNORewCadXtVoAhDq6Nt6z93wO9G0n7MQJO9tAJWzGmN98Qbl415MquBvr80yJBSBkVFEYktkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=B6o8GVt3j2bzQyzwjo+CDrFwovQ0czdOAGsQR+DF4ko=; b=YSuuy91UsVhlQhpAhI0WftLK4PSFyRg2FHUdu7G5yQYfWf24wRmCTX+k3fck0r526llibsXdZLXPjm4RMB+9BENhv6R5H1D4DzG6vgXtYZrnvp6Z77ou08CfbUO5VhEsF7NBKyMweQoyW6KKcRn8gHqZ4lIKXinNh97M+HCGOA2UzRuvahN8vdwcctBF4UeBS2/eIW2Vu2WY7lGtq5Cv+1NwzSe0rku6179C4d/1+WhKF+IqR/sc6Igotjt6xp9CJUlX7MF2bpVpA3BkUeTkEvdCf0E1hp73kYhC/Q2+1vOs0+jGacF9sKMzswQpvkJJ3Vr/pJdcq+uUCzNW1sNbcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) Received: from BY5PR17CA0044.namprd17.prod.outlook.com (2603:10b6:a03:167::21) by CH3PR12MB9021.namprd12.prod.outlook.com (2603:10b6:610:173::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23; Thu, 24 Oct 2024 16:58:29 +0000 Received: from SJ1PEPF00002315.namprd03.prod.outlook.com (2603:10b6:a03:167:cafe::1a) by BY5PR17CA0044.outlook.office365.com (2603:10b6:a03:167::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Thu, 24 Oct 2024 16:58:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00002315.mail.protection.outlook.com (10.167.242.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Thu, 24 Oct 2024 16:58:29 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 24 Oct 2024 09:58:14 -0700 Received: from fedora.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 24 Oct 2024 09:58:06 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Ido Schimmel , Petr Machata , "Amit Cohen" , Vladimir Oltean , "Andy Roulin" , , Przemek Kitszel , , , Manish Chopra , , Kuniyuki Iwashima , "Andrew Lunn" Date: Thu, 24 Oct 2024 18:57:37 +0200 Message-ID: <5fb245d2d6a0ad78c42bba2a3d30dc1a42f9ea8f.1729786087.git.petrm@nvidia.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002315:EE_|CH3PR12MB9021:EE_ X-MS-Office365-Filtering-Correlation-Id: f2832bd5-6da4-42f0-0a15-08dcf44d15da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|7416014|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: 7sxn4AHgASYCaE+pIV7bVoh32FS6tw9zndUToVucgXz5H4874uYcTBfco/F1gFloYnaTik75VBwTnk4sYXvTLFnutdO7zqSGS0pUDu9vTjQduBwfRXy8CGLgRmS1/XWDrfvkflI8KNJeL6pFp7CY0F6AJyKGHfz4qWPFyFWSrkvGA1pL4YklK2iEocmBV3T7J8P8yYNul9MfMFNKNsmBOaR8vP5+xEkuTCbxiDHb4+m2+0M3szdMaNBZXy7NpzSYPew7PJY9Yv/tSFwNAXvsI6XSTv423glFRPY2jYjdnGdbNjD/huwYpTSJ8aBzOM3GCaw6xMDm1Cd4j/BtA4nsh370TwDSAIzYc3U8x1Qs/0rA0EZytnd6q0bDFIL8QeFKcqJnrJx5XDM6Uh0+0Q3ULjLw+2tTv7SW7PK8tXBgbl36QA9L4rOH3fP90fog0LJjjrjyOhG3hbToJ76oW1CN2BU8s3YQBO75w1FIj5RPIXgidKqPovsu1Iy1/JZFWuZ6dje0NBgyRvePPDEjwtYy9Jn/EjmLui8BU9VY5cwweyWNwvm1SCjlSQfDs/uY4SLXV8fwaYW4KE2JfalaNHUG4n1iizH1QwsUzGyzjWRrkm/bapxtJjxErER65ftKvwx2/UjQ7LsCpskzztDSimu0HKuBIZmAf/10zbWUKYV4SaN3pc0llpm4y1YtkVgJU4V8YQm/uWwfJFgszMMCAmkfTiwg1jViaIDPsl00NUOfIrdzT6NNm7c/87xRjWA/NPkagOMRj6E8rZiubhFYIgbInOBmzF1gDmGVRwf7IBJHLngtLu6CP6a3WwnsFcIXKA9iGbESJtyrr24Y8qjuRKCgIcNGAdabfx21rOnxX1JgS346TVnGAlH/rgqfSY+Xlw+zUbWLiSRPwwMOkzFtXn/j64/FgadWY8tIaduKInPja/yFzOcQ+/VRJ3BJnV16xGw10Q3Nu06/FHe3sMJFxtpfAd8wm3K0B380gBRg3w6a53ARMhVnXfTtzEAoAQg9WMEfvmZZrkVCBmX2h8AqlESI6yfAP1u5c5aePVGRrUmW4clh4kfkgwbQ0LngDqiKj5J0z7zGUu7zGtH6NVxOT2YSLMwiCofIye73ELbX3LrGWbPi4sjHJT8NZrhwCRiU+0FtI/tNqF4BwLMdL4j4WHiAf2ni7OHHXsPi3OFfAz/3JzWrS0HPjTw45x/acmGKbaZ7GuaGffyNv/ILZJ984/V2JDdqbDdO2mCPBc3pCIJHXrTiDazWpWXE6WwrrOfExu3WwrMowLNhGE4S1NDsekUP6Jan/Qw1y+DfqN2ig/mWYm9A9W8CzrBxpofr3atwFRLTjOjc7ggbGH+nWXD7o777LrfwtBnvaA5heHyRt/TyIzZN+t85npKpKODpiv2vwZw+Yo2j9fpAPtfibuYLR6vl6g== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(7416014)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 16:58:29.5725 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f2832bd5-6da4-42f0-0a15-08dcf44d15da X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002315.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9021 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B6o8GVt3j2bzQyzwjo+CDrFwovQ0czdOAGsQR+DF4ko=; b=DnVSCP9495U27NgFvAxkJjZtSpBKJHrZoYFrtwhYyg83iwh42c03v1lRbaksyIl4rXNgtrBuw9EiNiQ9EGzxi7q6xCXUut7MhZvelIVrfQROyz2V7iwg74guRFq1Bft1UTksL7rdThkgNZND5C6xZQzhl9ThvAfVTkz8vZb2ddESJ+uE5/iT8fIqU8KZ/E9UxzCB6Kf9pz5UTfzwgWm3jEt4mmXYPf/5Omim0jlvB4Q2xiYCeUq2xpUnzv4MRCFebS7YznH8udHtatzEPeC65g2VcIBq1DEVMdwSUAA01JwF/mOoYo1vP7plc5dZnsHRx8c8m1LT5k1PloiJLTYvCQ== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=DnVSCP94 Subject: [Intel-wired-lan] [PATCH net-next v2 2/8] ndo_fdb_add: Shift responsibility for notifying to drivers X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Currently when FDB entries are added to or deleted from a VXLAN netdevice, the VXLAN driver emits one notification, including the VXLAN-specific attributes. The core however always sends a notification as well, a generic one. Thus two notifications are unnecessarily sent for these operations. A similar situation comes up with bridge driver, which also emits notifications on its own: # ip link add name vx type vxlan id 1000 dstport 4789 # bridge monitor fdb & [1] 1981693 # bridge fdb add de:ad:be:ef:13:37 dev vx self dst 192.0.2.1 de:ad:be:ef:13:37 dev vx dst 192.0.2.1 self permanent de:ad:be:ef:13:37 dev vx self permanent In order to prevent this duplicity, shift the responsibility to send the notification always to the drivers. Only where the default FDB add / del operations are used does the core emit notifications. If fdb_add and fdb_del are overridden, the driver should do that instead. Drivers can use rtnl_fdb_notify(), exported in the previous patch, to get the default notification behavior back. This function is made to notify on success, which means several drivers do not need to change at all. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen --- Notes: v2: - Fix qlcnic build --- CC: Przemek Kitszel CC: intel-wired-lan@lists.osuosl.org CC: UNGLinuxDriver@microchip.com CC: Manish Chopra CC: GR-Linux-NIC-Dev@marvell.com CC: Kuniyuki Iwashima CC: Andrew Lunn drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +++ drivers/net/ethernet/intel/ice/ice_main.c | 3 +++ drivers/net/ethernet/mscc/ocelot_net.c | 8 +++++++- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 7 ++++++- drivers/net/macvlan.c | 3 +++ include/linux/netdevice.h | 3 +++ net/core/rtnetlink.c | 8 ++++---- 7 files changed, 29 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 25295ae370b2..6a1ac0f4f8a6 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -13126,6 +13126,9 @@ static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], if (err == -EEXIST && !(flags & NLM_F_EXCL)) err = 0; + if (!err) + rtnl_fdb_notify(dev, addr, vid, RTM_NEWNEIGH, ndm->ndm_state); + return err; } diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index a6f586f9bfd1..a3398814a1cb 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -6154,6 +6154,9 @@ ice_fdb_add(struct ndmsg *ndm, struct nlattr __always_unused *tb[], if (err == -EEXIST && !(flags & NLM_F_EXCL)) err = 0; + if (!err) + rtnl_fdb_notify(dev, addr, vid, RTM_NEWNEIGH, ndm->ndm_state); + return err; } diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c index 7c9540a71725..cf972444e254 100644 --- a/drivers/net/ethernet/mscc/ocelot_net.c +++ b/drivers/net/ethernet/mscc/ocelot_net.c @@ -737,8 +737,14 @@ static int ocelot_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], struct ocelot_port *ocelot_port = &priv->port; struct ocelot *ocelot = ocelot_port->ocelot; int port = priv->port.index; + int err; - return ocelot_fdb_add(ocelot, port, addr, vid, ocelot_port->bridge); + err = ocelot_fdb_add(ocelot, port, addr, vid, ocelot_port->bridge); + + if (!err) + rtnl_fdb_notify(dev, addr, vid, RTM_NEWNEIGH, ndm->ndm_state); + + return err; } static int ocelot_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index b3588a1ebc25..584c85c10292 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c @@ -409,7 +409,7 @@ static int qlcnic_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], } if (ether_addr_equal(addr, adapter->mac_addr)) - return err; + goto out; if (is_unicast_ether_addr(addr)) { if (netdev_uc_count(netdev) < adapter->ahw->max_uc_count) @@ -422,6 +422,11 @@ static int qlcnic_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], err = -EINVAL; } +out: + if (!err) + rtnl_fdb_notify(netdev, addr, vid, RTM_NEWNEIGH, + ndm->ndm_state); + return err; } diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index cf18e66de142..b1e828581ec4 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -1044,6 +1044,9 @@ static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], else if (is_multicast_ether_addr(addr)) err = dev_mc_add_excl(dev, addr); + if (!err) + rtnl_fdb_notify(dev, addr, vid, RTM_NEWNEIGH, ndm->ndm_state); + return err; } diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 8feaca12655e..9f7de8d0414a 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1247,6 +1247,9 @@ struct netdev_net_notifier { * const unsigned char *addr, u16 vid, u16 flags, * struct netlink_ext_ack *extack); * Adds an FDB entry to dev for addr. + * Callee is responsible for sending appropriate notification. The helper + * rtnl_fdb_notify() can be invoked to send a generic notification in case + * the driver does not need to customize the notification. * int (*ndo_fdb_del)(struct ndmsg *ndm, struct nlattr *tb[], * struct net_device *dev, * const unsigned char *addr, u16 vid) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index e5c6dd4c5cf5..a9f56a50fa57 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -4376,6 +4376,9 @@ int ndo_dflt_fdb_add(struct ndmsg *ndm, if (err == -EEXIST && !(flags & NLM_F_EXCL)) err = 0; + if (!err) + rtnl_fdb_notify(dev, addr, vid, RTM_NEWNEIGH, ndm->ndm_state); + return err; } EXPORT_SYMBOL(ndo_dflt_fdb_add); @@ -4473,11 +4476,8 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh, err = ndo_dflt_fdb_add(ndm, tb, dev, addr, vid, nlh->nlmsg_flags); - if (!err) { - rtnl_fdb_notify(dev, addr, vid, RTM_NEWNEIGH, - ndm->ndm_state); + if (!err) ndm->ndm_flags &= ~NTF_SELF; - } } out: return err; From patchwork Thu Oct 24 16:57:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 2001866 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=5fe7kIOD; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZBvR5ckKz1xwy for ; Fri, 25 Oct 2024 03:58:43 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 37DD4813E9; Thu, 24 Oct 2024 16:58:42 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id D0XzQvBuXYLY; Thu, 24 Oct 2024 16:58:41 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 607F6813EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1729789121; bh=JBIFWuxjeftBm326+w2qINTjyCljOxo9XLDD0TN4p30=; h=From:To:CC:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=5fe7kIODWqDUmBpdsIQp6UJVSs+ev3iyOJalBgYWdD8Xv3Du7WdGKm2g6a0UfRqZw mgkzJ4pCRStdn7lDdmchKcqhTddfO5V3cAfwZ99aa63r7SolaDzBzzaK4Y2VLKedxF 4j7hPy55Xwd7q2H46u03bxXNuY7LlsdF7fEs2n5MNvm9aVcqglFjipJhuUKTvP4T7y /bEJgqWnn/dF2blGn9gXIIk0nyQ6G1qRwDEG70VStrWw3YK0K40giX1GQ0dHvdviTt BKOCE5SMGYiCNoKhTp3HwD5Uqk9Bba0YJivFwW42/a2J9caBSW+EodcNF9SgZmN+vz R6rhQAwwVaqZA== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 607F6813EA; Thu, 24 Oct 2024 16:58:41 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists1.osuosl.org (Postfix) with ESMTP id DAFE14960 for ; Thu, 24 Oct 2024 16:58:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id BB5384026F for ; Thu, 24 Oct 2024 16:58:39 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id KwvG7mkluYlN for ; Thu, 24 Oct 2024 16:58:38 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=40.107.94.89; helo=nam10-mw2-obe.outbound.protection.outlook.com; envelope-from=petrm@nvidia.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 7B07640025 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 7B07640025 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2089.outbound.protection.outlook.com [40.107.94.89]) by smtp2.osuosl.org (Postfix) with ESMTPS id 7B07640025 for ; Thu, 24 Oct 2024 16:58:38 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aTN5DWJSC1np3DgItAhngRIbRTCKcFPKnfQmZlyfdKYfAoDwOMaQXQ/V9AODOuXPl8ydMkPEXKsz3oypOmQZOnxqBFV6E3hSzO8Re5hW0qaCjQv7x9oNg+IseHUKGOjn3ufBuVMPi1dcab5sTtt8F/E7OXkNHXi2ZUIrTIyOvUoosmjv77dZIVX7S9nzk6JNqL7VjP1DXKR94uL01ynUgf5xg48G2xv+VyCZaWiXzHvGwo/r3R57jYXDwrNAoSepXEfr0rCWn4S4DZwS4D3mM2AQGb0nbyWG76IDGMFU9YC1A9ewEDQTEHP0E7WHIa0k2i77MN1cZe+6ULkHoP8T4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JBIFWuxjeftBm326+w2qINTjyCljOxo9XLDD0TN4p30=; b=ZybIpOfWzeTqRJidb1Gm1dReCPEi/WyxYU3E0/NFAlvZG173rbZ8ljIRC77fULeNNtEnVvjC85SsVX/8/kO8Yfa2U6fxHbMrXh67rX6God2kRbM0Cvt1QegpvAe6M67jJIA3ALAwUF/XsKGZ6JiSdaVMaFZrEZqFmhliUJG+Km3QSyzZEPGw7NHb9XgMOwndMRafz2VnhyfJp9ZiXAJOOTQZUEjOMoaXqd1X3aIDBuDBWsidvFHogdg9ZV1qdTiAbEjs66vhpR7gb3deL4yVQ6LHskBpaLvnYuJARQN0NtJH2QiVFeKw0wa/QK3pIU0Apl7F2EVFFT5T7uVJ7fGKHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) Received: from MW4PR04CA0142.namprd04.prod.outlook.com (2603:10b6:303:84::27) by CH3PR12MB8909.namprd12.prod.outlook.com (2603:10b6:610:179::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.20; Thu, 24 Oct 2024 16:58:34 +0000 Received: from SJ1PEPF00002310.namprd03.prod.outlook.com (2603:10b6:303:84:cafe::27) by MW4PR04CA0142.outlook.office365.com (2603:10b6:303:84::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.20 via Frontend Transport; Thu, 24 Oct 2024 16:58:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00002310.mail.protection.outlook.com (10.167.242.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Thu, 24 Oct 2024 16:58:34 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 24 Oct 2024 09:58:21 -0700 Received: from fedora.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 24 Oct 2024 09:58:14 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Ido Schimmel , Petr Machata , "Amit Cohen" , Vladimir Oltean , "Andy Roulin" , , Przemek Kitszel , , , Manish Chopra , , Kuniyuki Iwashima , "Andrew Lunn" Date: Thu, 24 Oct 2024 18:57:38 +0200 Message-ID: <8a28bbbe632e48613887aa7371cdc93ada36b0e5.1729786087.git.petrm@nvidia.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002310:EE_|CH3PR12MB8909:EE_ X-MS-Office365-Filtering-Correlation-Id: e3e3a6fe-87c5-42a2-fb97-08dcf44d18da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|7416014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: GRNeehSFTE6xm+hcZSmtIjwLKfg47+WbAyTD87yb7V1vNCoaEfNurHXAi8mzTc8g4oblZS58n+CZDmI0cGTnXoBQcTwOS+rXvssmjIsGZsoCt1bs2R0S1yovXjWx6rGO+snsIqrYyr9qapbzDcqLWxljzxZ6f1Q8yFnKVnLUXeD5Bc1JfTl9MWQ0zNdsbWvj6Q/KqGsb10/Xzxh4moD1AljnrSJFGPYt3DT3ZS3MD7RmwEH0S8The+1LC+Vu3b7UY18nyOiZGhZh7KBnNkg4McNzsXS9wLgIm6wbV9ZzLGkI+f6pjvCC2EvfbwK6C5bQGc9g6RyDuw8+YJAOrWUJCnQcYiGc0FM4RhufyMRcyv0YE9LsbBOfLwi7trVGTZea19NquJEzyjppFeEo7fP21Z2GsopEKhGa9i1a5/JIiiWNfE2N7JWvuZsQSzgvT0eqyOeqc9qMj63EIjJdIIcKNSC8Fpa6iDJrlwmMaq0btnqG4y0GZqRHjao7kCShZMRG17yALQJK1wmD4XXJLYks+aQYe8kJOAsr6ks/Dl+/yP2EZhEwbu+MzSlQTOPriUaIroK+NPW03banVXe3PYOwKMWSu+/mdWeaUH7UzcTzs+bcnlhAmHZ+PomjVB/8KQfWlfCsGAOytOFfsv+BxTviXjA9Mr7QUNeE7OGF0dCQFzOxSiJxfjXRICZYAt2UO6tSDdS+BRsDJUqO8T59CWtqvagMgYKEuuybxmuCXz71rOexu25c/HwaEP27cMVTZGu0I1gXn7mguB3lXCQ0RILUBR/uhZhG4SQCux+JHlSrOdqBaz/YoDundPqFZ43OJJPLx2wZO8Vrg2blwRh2uAb8Q/WkMtCbxrZH+BmKckfuab9zzjRrMT68ZQDuVCFkWlA75oN0QWkzfakKFgkBqqwEGnYkJOjHL6LHB5b1hLs+HptbemOrTX3lJbtMIhQ/1J+2YHV5jiPxwNM3B2fZ9Nxc6RmklqiT1kvj4oOsMOXmFAj7dSACdMP6Jba+xI2cDn6hbvVwLykN8XCvi70k8DfSS7T9BVNDcxphyNTwzJbs2ktbFtQbeJB+q4xfiLod1W6prpdIokuljdQisBLaPzj1NhgONLUekG8qR2QcEHpUU75xYXzmxqD8mUw5RcD67Hc3bdcf5Fo1ZE81agpc7ZAzKa1uo46/fTf5i1w8OGyGS9zFdzfcgCpURdm8nhczpVm428hDuxanULie25gEJ618OW6DWnfmCObKenm1xyeLal2Xys3l85qYbBxoq0Zz6laD93iBRoSh/fkXb1dnNVW12HodXpdAEa+aUR3Q/rYksDv1l1ckriJ8LDB+NdQFu8k4v7L1HBIkQiF2l9KAddrU/xSc9KLXSxuNsLgEPHahzPnqkDvxadZAXiFklJf7hSDHh/GmlJc/DSzYvjhnhrswDw== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(7416014)(36860700013)(1800799024)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 16:58:34.5962 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3e3a6fe-87c5-42a2-fb97-08dcf44d18da X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002310.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8909 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JBIFWuxjeftBm326+w2qINTjyCljOxo9XLDD0TN4p30=; b=idy3jsZDmRUe/0ez3acjesz6SC7Cm60+UFgbfmx267CM+4o+lO5GZdthawt0/ALDJqGFuVrpeCPKS5Snp+t2wyhrQuTNTD69WLnu6OoHbvkqzoyKmyVaed8wWZNasp8/5LqWNPCdvn6j4AEaOvGEamcR+feKOMtb5iTnmzLOEA6y+K2srOsDaUeWYKHT/wgfVAyJQNDzZGUkAOO1YuRyJ6Hr1pHewyERbvXRQmLmM5fbRTJtuJ64Vscl/6raI53OwMxyHXiP8jZ3ZAoYZgET48KnNSGsC90EYCJ0nWH0SSKGFQSW3OfqXzH4SCS25Y8jdDFzy/tn2lxSklz3jjJ0Pw== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=idy3jsZD Subject: [Intel-wired-lan] [PATCH net-next v2 3/8] ndo_fdb_del: Shift responsibility for notifying to drivers X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" As described in the previous patch, the drivers that provide their own fdb_add and fdb_del callbacks should from now on be responsible for sending the notification themselves. In this patch, implement the fdb_del leg of the change. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen --- Notes: v2: - Fix qlcnic build --- CC: Przemek Kitszel CC: intel-wired-lan@lists.osuosl.org CC: UNGLinuxDriver@microchip.com CC: Manish Chopra CC: GR-Linux-NIC-Dev@marvell.com CC: Kuniyuki Iwashima CC: Andrew Lunn drivers/net/ethernet/intel/ice/ice_main.c | 3 +++ drivers/net/ethernet/mscc/ocelot_net.c | 8 +++++++- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 5 +++++ drivers/net/macvlan.c | 3 +++ include/linux/netdevice.h | 2 ++ net/core/rtnetlink.c | 9 ++++----- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index a3398814a1cb..65f9dcf4745b 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -6188,6 +6188,9 @@ ice_fdb_del(struct ndmsg *ndm, __always_unused struct nlattr *tb[], else err = -EINVAL; + if (!err) + rtnl_fdb_notify(dev, addr, vid, RTM_DELNEIGH, ndm->ndm_state); + return err; } diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c index cf972444e254..12958d985fd7 100644 --- a/drivers/net/ethernet/mscc/ocelot_net.c +++ b/drivers/net/ethernet/mscc/ocelot_net.c @@ -756,8 +756,14 @@ static int ocelot_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], struct ocelot_port *ocelot_port = &priv->port; struct ocelot *ocelot = ocelot_port->ocelot; int port = priv->port.index; + int err; - return ocelot_fdb_del(ocelot, port, addr, vid, ocelot_port->bridge); + err = ocelot_fdb_del(ocelot, port, addr, vid, ocelot_port->bridge); + + if (!err) + rtnl_fdb_notify(dev, addr, vid, RTM_DELNEIGH, ndm->ndm_state); + + return err; } static int ocelot_port_fdb_do_dump(const unsigned char *addr, u16 vid, diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 584c85c10292..88308c30f88e 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c @@ -388,6 +388,11 @@ static int qlcnic_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], err = -EINVAL; } } + + if (!err) + rtnl_fdb_notify(netdev, addr, vid, RTM_DELNEIGH, + ndm->ndm_state); + return err; } diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index b1e828581ec4..2c61b7b83875 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -1069,6 +1069,9 @@ static int macvlan_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], else if (is_multicast_ether_addr(addr)) err = dev_mc_del(dev, addr); + if (!err) + rtnl_fdb_notify(dev, addr, vid, RTM_DELNEIGH, ndm->ndm_state); + return err; } diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9f7de8d0414a..9e1ffb21de18 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1254,6 +1254,8 @@ struct netdev_net_notifier { * struct net_device *dev, * const unsigned char *addr, u16 vid) * Deletes the FDB entry from dev corresponding to addr. + * Callee is responsible for sending appropriate notification, as with + * ndo_fdb_add(). * int (*ndo_fdb_del_bulk)(struct nlmsghdr *nlh, struct net_device *dev, * struct netlink_ext_ack *extack); * int (*ndo_fdb_dump)(struct sk_buff *skb, struct netlink_callback *cb, diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index a9f56a50fa57..4788bfc58aa2 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -4506,6 +4506,9 @@ int ndo_dflt_fdb_del(struct ndmsg *ndm, else if (is_multicast_ether_addr(addr)) err = dev_mc_del(dev, addr); + if (!err) + rtnl_fdb_notify(dev, addr, vid, RTM_DELNEIGH, ndm->ndm_state); + return err; } EXPORT_SYMBOL(ndo_dflt_fdb_del); @@ -4604,12 +4607,8 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh, err = ops->ndo_fdb_del_bulk(nlh, dev, extack); } - if (!err) { - if (!del_bulk) - rtnl_fdb_notify(dev, addr, vid, RTM_DELNEIGH, - ndm->ndm_state); + if (!err) ndm->ndm_flags &= ~NTF_SELF; - } } out: return err;