Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1234429iob; Thu, 12 May 2022 14:27:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7oADbD4016kBY1G4szMSOP4kKje8uskuAPtSKSlyaLGXjFKoH8fNY5QTWiqFPmz+d+QCB X-Received: by 2002:a62:1ad4:0:b0:510:c635:e516 with SMTP id a203-20020a621ad4000000b00510c635e516mr1611894pfa.42.1652390865675; Thu, 12 May 2022 14:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652390865; cv=none; d=google.com; s=arc-20160816; b=pyB1xECD482mpk5R4Gsh+hySz9EgAyVYsEH40y43O9SbJqrWgZLGnqmZhw7jqun1n2 CSW9l7QQRuvBuVULbLJYJl4cvKAezryT+FHDz3FRMIyidOVIo/SISyruR7spH8N+LiFa KMElqIXD1aHfqhf81OlgjyqUoP6SIGFBj9tlDWHbTnvy+wCygGY8JiByEDUm+mVHUTdo gEWzfg8G5zloTr63ee/MxWilx7nlCQmSTvkD5ceCxEVACyEK2VgSsjB88S2ybnNHMYyA 89Qa/66fYmlih5GzD4iKF9qkvTFPCmoZQzuN0AAY7niULFJz2n9BtLu6yjsbFjHyapO9 HaHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qI3oXWeBiZQ3s0yJXR/Iw74/6l7ydEbTwN0ORi2PrK0=; b=VSS9mSceXnB0WrtPkoAWvTRlB6A/KPNGnY5rRMCUgDK9ZhLAqMBixeKjOAhpkw7VFt Aj+hQPYgsbeC1yEP/f+KuYbC0pyxOmY02GJ1XPPzGQtdGUL/v4u0qa3SwfYSUEkfRiL8 QqmBKxDtuDtW/aaTNf01ko73Qan8kmtbytK8ts/X4YXOMjQ7K+oGJECTHyAowkaRb0Yh Hwft27D565KzyC3mkqcssi1qNGRCnrJhmSoZVkPfcZhtqru0SESu7MYTZelsZbReLTN6 8UO6sYW5IjlW/QoCBUWUpcRS60AJimRoW2rJzwtbHBTnBTNC43wb12h5BNdN7P0E7aL8 RvqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KzEWi7vj; 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 q197-20020a632ace000000b0039854fb2001si603918pgq.496.2022.05.12.14.27.31; Thu, 12 May 2022 14:27:45 -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=KzEWi7vj; 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 S1344258AbiELJ4i (ORCPT + 99 others); Thu, 12 May 2022 05:56:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352341AbiELJ4S (ORCPT ); Thu, 12 May 2022 05:56:18 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1027D39681; Thu, 12 May 2022 02:56:16 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id l38-20020a05600c1d2600b00395b809dfbaso2391924wms.2; Thu, 12 May 2022 02:56:15 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=qI3oXWeBiZQ3s0yJXR/Iw74/6l7ydEbTwN0ORi2PrK0=; b=KzEWi7vjnxdxQBJlJDO0DiuyF9DtJfntrDKUKeI93BZiV6D+RQWoCdzKw+i4jLb9bm xgwleuEEPQDLntBcJXA5PkBTXaHNvdz04neDI6FGLhdXBFolFF5XBccTM6wfRBLuuKLx W3+NIJueyMz0GwUPAIhs3KAgx7S7YyDZeN2s8/zN0Cj1eArabJzkNhPTvdSf/o7hfFki byBdeWwmXpwEr5yPIT+K2Evj4IHDvvueM9bCMNd/zQpcPbJMuJ62FCRvWoVv0Pq+kQ5J 7PAQAsaHZpZmh5LCSX9hokxYhh+prd50kEOtg+KmDK9EcDAai2iCtxs9CdmLF27mWzNT ZGXw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=qI3oXWeBiZQ3s0yJXR/Iw74/6l7ydEbTwN0ORi2PrK0=; b=Bv7leIMs8ig0npdy6E4juJuThacMpmOx2LulmP2lR7GtMduYpEm1Ha5GmHjL+TvPIj C9XMEp0LK9kr7tkhyhRrtaTxR6LshkuwWJXjtJTqrTiI1saCjMYf0DRJICAEdqRdLmJh POaUtoZMZ8kiq+sxPb4FylvBTLHytdSXKMspb3lKTaHfCXWuU0dowdtt61CaFtyiUikQ y6VFwtYejsT3Yfd0FUEa1vBOiq2vQd9ZQpTHg4rKJmB2RD3UBE56XJe+zGg3443+irAv WtQkPER71MxKogcgwFP/JTJHgROZ2wVrsVHAtq7l/KhF3VGv5SYQvQPBE5kaxxEKaNQX LHqg== X-Gm-Message-State: AOAM533/CjBo/NeE60TYS61C4jQEywVPqZmItC3ie7SB5pl119AD4Eq4 aPwu2ap4ZTxxta3pDFhSAfE= X-Received: by 2002:a05:600c:3b04:b0:394:6150:db8f with SMTP id m4-20020a05600c3b0400b003946150db8fmr9149320wms.183.1652349374575; Thu, 12 May 2022 02:56:14 -0700 (PDT) Received: from alaa-emad ([197.57.250.210]) by smtp.gmail.com with ESMTPSA id d1-20020a05600c34c100b003942a244f3bsm2296610wmq.20.2022.05.12.02.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 02:56:14 -0700 (PDT) From: Alaa Mohamed To: netdev@vger.kernel.org Cc: outreachy@lists.linux.dev, roopa@nvidia.com, jdenham@redhat.com, sbrivio@redhat.com, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, alexandre.belloni@bootlin.com, shshaikh@marvell.com, manishc@marvell.com, razor@blackwall.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com, GR-Linux-NIC-Dev@marvell.com, bridge@lists.linux-foundation.org, eng.alaamohamedsoliman.am@gmail.com Subject: [PATCH net-next v7 1/2] rtnetlink: add extack support in fdb del handlers Date: Thu, 12 May 2022 11:55:53 +0200 Message-Id: <9b124f0393a8ea2db2333235bbd7129ac08b8c34.1652348962.git.eng.alaamohamedsoliman.am@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 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 Add extack support to .ndo_fdb_del in netdevice.h and all related methods. Signed-off-by: Alaa Mohamed --- changes in V3: fix errors reported by checkpatch.pl --- changes in V4: fix errors reported by checkpatch.pl --- changes in V5: resubmit after rebase. --- changes in V6: update the kdoc on ice_fdb_del --- changes in V7: fix alignments in ocelot_port_fdb_del and vxlan_fdb_delete. --- drivers/net/ethernet/intel/ice/ice_main.c | 3 ++- drivers/net/ethernet/mscc/ocelot_net.c | 3 ++- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 3 ++- drivers/net/macvlan.c | 3 ++- drivers/net/vxlan/vxlan_core.c | 3 ++- include/linux/netdevice.h | 2 +- net/bridge/br_fdb.c | 3 ++- net/bridge/br_private.h | 3 ++- net/core/rtnetlink.c | 4 ++-- 9 files changed, 17 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index fde839ef0613..95f6c9610372 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -5674,11 +5674,12 @@ ice_fdb_add(struct ndmsg *ndm, struct nlattr __always_unused *tb[], * @dev: the net device pointer * @addr: the MAC address entry being added * @vid: VLAN ID + * @extack: netlink extended ack */ static int ice_fdb_del(struct ndmsg *ndm, __always_unused struct nlattr *tb[], struct net_device *dev, const unsigned char *addr, - __always_unused u16 vid) + __always_unused u16 vid, struct netlink_ext_ack *extack) { int err; diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c index 247bc105bdd2..32d0a9e0a4b0 100644 --- a/drivers/net/ethernet/mscc/ocelot_net.c +++ b/drivers/net/ethernet/mscc/ocelot_net.c @@ -774,7 +774,8 @@ static int ocelot_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], static int ocelot_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, - const unsigned char *addr, u16 vid) + const unsigned char *addr, u16 vid, + struct netlink_ext_ack *extack) { struct ocelot_port_private *priv = netdev_priv(dev); struct ocelot_port *ocelot_port = &priv->port; diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index d320567b2cca..28476b982bab 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c @@ -368,7 +368,8 @@ static int qlcnic_set_mac(struct net_device *netdev, void *p) static int qlcnic_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *netdev, - const unsigned char *addr, u16 vid) + const unsigned char *addr, u16 vid, + struct netlink_ext_ack *extack) { struct qlcnic_adapter *adapter = netdev_priv(netdev); int err = -EOPNOTSUPP; diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index b00bc8173abe..cb27631c3a4d 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -1021,7 +1021,8 @@ static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], static int macvlan_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, - const unsigned char *addr, u16 vid) + const unsigned char *addr, u16 vid, + struct netlink_ext_ack *extack) { struct macvlan_dev *vlan = netdev_priv(dev); int err = -EINVAL; diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index 8a5e3a6d32d7..c58c48de4cf4 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -1280,7 +1280,8 @@ int __vxlan_fdb_delete(struct vxlan_dev *vxlan, /* Delete entry (via netlink) */ static int vxlan_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, - const unsigned char *addr, u16 vid) + const unsigned char *addr, u16 vid, + struct netlink_ext_ack *extack) { struct vxlan_dev *vxlan = netdev_priv(dev); union vxlan_addr ip; diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7dccbfd1bf56..23731804a4b0 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1513,7 +1513,7 @@ struct net_device_ops { struct nlattr *tb[], struct net_device *dev, const unsigned char *addr, - u16 vid); + u16 vid, struct netlink_ext_ack *extack); int (*ndo_fdb_del_bulk)(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 1a3d583fbc8e..e7f4fccb6adb 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c @@ -1253,7 +1253,8 @@ static int __br_fdb_delete(struct net_bridge *br, /* Remove neighbor entry with RTM_DELNEIGH */ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, - const unsigned char *addr, u16 vid) + const unsigned char *addr, u16 vid, + struct netlink_ext_ack *extack) { struct net_bridge_vlan_group *vg; struct net_bridge_port *p = NULL; diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 6ae882cfae1c..06e5f6faa431 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h @@ -793,7 +793,8 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source, const unsigned char *addr, u16 vid, unsigned long flags); int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], - struct net_device *dev, const unsigned char *addr, u16 vid); + struct net_device *dev, const unsigned char *addr, u16 vid, + struct netlink_ext_ack *extack); int br_fdb_delete_bulk(struct ndmsg *ndm, struct nlattr *tb[], struct net_device *dev, u16 vid, struct netlink_ext_ack *extack); diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 73f2cbc440c9..3130df52b56a 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -4240,7 +4240,7 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh, ops = br_dev->netdev_ops; if (!del_bulk) { if (ops->ndo_fdb_del) - err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid); + err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid, extack); } else { if (ops->ndo_fdb_del_bulk) err = ops->ndo_fdb_del_bulk(ndm, tb, dev, vid, @@ -4258,7 +4258,7 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh, ops = dev->netdev_ops; if (!del_bulk) { if (ops->ndo_fdb_del) - err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid); + err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid, extack); else err = ndo_dflt_fdb_del(ndm, tb, dev, addr, vid); } else { -- 2.36.1