From patchwork Tue Feb 14 21:01:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Brandeburg X-Patchwork-Id: 13140790 X-Patchwork-Delegate: kuba@kernel.org 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 4496EC6379F for ; Tue, 14 Feb 2023 21:01:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232029AbjBNVB1 (ORCPT ); Tue, 14 Feb 2023 16:01:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231996AbjBNVBZ (ORCPT ); Tue, 14 Feb 2023 16:01:25 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F18812823B for ; Tue, 14 Feb 2023 13:01:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676408484; x=1707944484; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GXLHiMIDgAttvwbqRAYYGaig24AOFGRXzHGq4FyP91Y=; b=LKJC82x3D5VDOfwRMgrYtpZG+9RkWP/9xx1t8gy0WjMhELWm9jxi3Lc9 pNPA287rrMVzxgoPVSnzSS98jYL4msb1PCWhf2yqPF0sTMKWJ8qZ02V5W RArruP4Q9JRBvOtaI/6KcYdR625BTT6JAwUf+kEVogLwVTWzmBt5eZggJ fMPTvn0hSmE1sAYAeetjceMaPkjRHEjtvQ8Ajgrbl89GMbJ7VXxBOgfSe KCYFZf781xP2ZL5nLe4CIMb2lJPW/IO+L1t/pFI0FN4ZDB7RQS0q+4poA NL4pkR1gjRSJLKezuyLQgN4V5lI516DP87lIB0yLMcOYnYbQmTg+rV67K g==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="417490084" X-IronPort-AV: E=Sophos;i="5.97,297,1669104000"; d="scan'208";a="417490084" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 13:01:24 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="699677921" X-IronPort-AV: E=Sophos;i="5.97,297,1669104000"; d="scan'208";a="699677921" Received: from jbrandeb-coyote30.jf.intel.com ([10.166.29.19]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 13:01:23 -0800 From: Jesse Brandeburg To: kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com Cc: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, edumazet@google.com, Jesse Brandeburg Subject: [PATCH net-next v1 1/2] net/core: print message for allmulticast Date: Tue, 14 Feb 2023 13:01:16 -0800 Message-Id: <20230214210117.23123-2-jesse.brandeburg@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230214210117.23123-1-jesse.brandeburg@intel.com> References: <20230214210117.23123-1-jesse.brandeburg@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org When the user sets or clears the IFF_ALLMULTI flag in the netdev, there are no log messages printed to the kernel log to indicate anything happened. This is inexplicably different from most other dev->flags changes, and could suprise the user. Typically this occurs from user-space when a user: ip link set eth0 allmulticast However, other devices like bridge set allmulticast as well, and many other flows might trigger entry into allmulticast as well. The new message uses the standard netdev_info print and looks like: [ 413.246110] ixgbe 0000:17:00.0 eth0: entered allmulticast mode [ 415.977184] ixgbe 0000:17:00.0 eth0: left allmulticast mode Signed-off-by: Jesse Brandeburg --- net/core/dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/core/dev.c b/net/core/dev.c index 7307a0c15c9f..ad1e6482e1c1 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -8391,6 +8391,8 @@ static int __dev_set_allmulti(struct net_device *dev, int inc, bool notify) } } if (dev->flags ^ old_flags) { + netdev_info(dev, "%s allmulticast mode\n", + dev->flags & IFF_ALLMULTI ? "entered" : "left"); dev_change_rx_flags(dev, IFF_ALLMULTI); dev_set_rx_mode(dev); if (notify) From patchwork Tue Feb 14 21:01:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Brandeburg X-Patchwork-Id: 13140791 X-Patchwork-Delegate: kuba@kernel.org 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 F01D3C61DA4 for ; Tue, 14 Feb 2023 21:01:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229496AbjBNVB3 (ORCPT ); Tue, 14 Feb 2023 16:01:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232022AbjBNVB0 (ORCPT ); Tue, 14 Feb 2023 16:01:26 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ACA628236 for ; Tue, 14 Feb 2023 13:01:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676408485; x=1707944485; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XdQERGiLHuUWEuH1ilQnd8gcc6aswjrEnR65SaAwOpU=; b=iDMvTZ44RhPlbAQhk1FcMVnyddH9m7mgFR/Cj9XudEGQwTOdNDCIZfmA 7opB3jOvqN74khDezer+PXzdaqRfTJMbIjsqANXxry540VXgklc0KbUc6 PLXXRXn0uaxuMn8uZczTgzasyaHaW0poFU+VcXIWapX4u+ktNnh+4diZ8 TtuCeeOA49n+E9C+aStxfqug/GZ/phqsk4/aM0I0YScqIOOQwd1uYhh3k tSasju13ZlVzDTZsAC99UgqyYyf6rkyHxNVgQrDJRwkW7EVgTP64pMd8f Qxr/HywTzKkkriBxicop3wSP6kJY1Gzv/w8TgnksG0JU0ZPouvQ1eWxwt g==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="417490090" X-IronPort-AV: E=Sophos;i="5.97,297,1669104000"; d="scan'208";a="417490090" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 13:01:24 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="699677923" X-IronPort-AV: E=Sophos;i="5.97,297,1669104000"; d="scan'208";a="699677923" Received: from jbrandeb-coyote30.jf.intel.com ([10.166.29.19]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 13:01:23 -0800 From: Jesse Brandeburg To: kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com Cc: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, edumazet@google.com, Jesse Brandeburg Subject: [PATCH net-next v1 2/2] net/core: refactor promiscuous mode message Date: Tue, 14 Feb 2023 13:01:17 -0800 Message-Id: <20230214210117.23123-3-jesse.brandeburg@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230214210117.23123-1-jesse.brandeburg@intel.com> References: <20230214210117.23123-1-jesse.brandeburg@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The kernel stack can be more consistent by printing the IFF_PROMISC aka promiscuous enable/disable messages with the standard netdev_info message which can include bus and driver info as well as the device. typical command usage from user space looks like: ip link set eth0 promisc But lots of utilities such as bridge, tcpdump, etc put the interface into promiscuous mode. old message: [ 406.034418] device eth0 entered promiscuous mode [ 408.424703] device eth0 left promiscuous mode new message: [ 406.034431] ice 0000:17:00.0 eth0: entered promiscuous mode [ 408.424715] ice 0000:17:00.0 eth0: left promiscuous mode Signed-off-by: Jesse Brandeburg --- I'm unsure about this one because it's changing a long standard kernel message to a slightly different format. I think the new way looks better and has more information. --- net/core/dev.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index ad1e6482e1c1..357081b0113c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -8321,9 +8321,8 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc, bool notify) } } if (dev->flags != old_flags) { - pr_info("device %s %s promiscuous mode\n", - dev->name, - dev->flags & IFF_PROMISC ? "entered" : "left"); + netdev_info(dev, "%s promiscuous mode\n", + dev->flags & IFF_PROMISC ? "entered" : "left"); if (audit_enabled) { current_uid_gid(&uid, &gid); audit_log(audit_context(), GFP_ATOMIC,