From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 436C5C6FA82 for ; Tue, 27 Sep 2022 14:22:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230464AbiI0OV7 (ORCPT ); Tue, 27 Sep 2022 10:21:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231391AbiI0OVd (ORCPT ); Tue, 27 Sep 2022 10:21:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D3E8186992 for ; Tue, 27 Sep 2022 07:21:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AE2D2619E4 for ; Tue, 27 Sep 2022 14:21:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87A86C433D6; Tue, 27 Sep 2022 14:21:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664288492; bh=4bQnZI8Jw2dtanthhEef1onMSAgdsb+Kei9j5MWAHtc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=p+PosGe7ro1xd4HBGlyZYxT44VDuo3bpfUi4HsQDfgVUQ1OmCyEKcrL8Q0rn4dwbk wh6u3hdo0QLUJDarpy13j3VUTERCXaXU84IEMk3GcnMW7WGph0nIWI+P1+BFisKrp/ HYQ7XTYCrEesUwDcY/B8fAcjYmiCE5DTnX4YVd9SVAYZdF6RbcjZ16h8Kq3ydXh4bC 4besFm7zjO49ZlQZTmi4fOqrUh84q61Xv3F8UmHY+OVG9cETu+pw5a0pAkQQaTuZJu 5UjJRPctrFFsL19YMmpjq2eJxhXZoMcdJ8Xyvz95elVZhvm/b62WFoROAIPFxT/Viq 6O49bDofgCcsA== Date: Tue, 27 Sep 2022 07:21:30 -0700 From: Jakub Kicinski To: Hangbin Liu Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Paolo Abeni , Ido Schimmel , Petr Machata , Florent Fourcot , Nikolay Aleksandrov , Nicolas Dichtel , Guillaume Nault , David Ahern Subject: Re: [PATCHv3 net-next] rtnetlink: Honour NLM_F_ECHO flag in rtnl_{new, set, del}link Message-ID: <20220927072130.6d5204a3@kernel.org> In-Reply-To: <20220927041303.152877-1-liuhangbin@gmail.com> References: <20220927041303.152877-1-liuhangbin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 27 Sep 2022 12:13:03 +0800 Hangbin Liu wrote: > @@ -3382,6 +3401,12 @@ static int rtnl_newlink_create(struct sk_buff *skb, struct ifinfomsg *ifm, > if (err) > goto out_unregister; > } > + > + nskb = rtmsg_ifinfo_build_skb(RTM_NEWLINK, dev, 0, 0, GFP_KERNEL, NULL, > + 0, pid, nlh->nlmsg_seq); > + if (nskb) > + rtnl_notify(nskb, dev_net(dev), pid, RTNLGRP_LINK, nlh, GFP_KERNEL); > + > out: > if (link_net) > put_net(link_net); I'm surprised you're adding new notifications. Does the kernel not already notify about new links? I thought rtnl_newlink_create() -> rtnl_configure_link() -> __dev_notify_flags() sends a notification, already.