All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC V1 net-next 2/4] net: Expose available time stamping layers to user space.
@ 2022-01-03 23:25 Richard Cochran
  2022-01-03 23:51 ` Russell King (Oracle)
  2022-01-04 10:00 ` kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Cochran @ 2022-01-03 23:25 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Andrew Lunn, David Miller, Grygorii Strashko,
	Jakub Kicinski, Joakim Zhang, Kurt Kanzenbach, Miroslav Lichvar,
	Russell King, Vladimir Oltean

Time stamping on network packets may happen either in the MAC or in
the PHY, but not both.  In preparation for making the choice
selectable, expose both the current and available layers via sysfs.

In accordance with the kernel implementation as it stands, the current
layer will always read as "phy" when a PHY time stamping device is
present.  Future patches will allow changing the current layer
administratively.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 .../ABI/testing/sysfs-class-net-timestamping  | 17 ++++++
 drivers/net/phy/phy_device.c                  |  2 +
 include/linux/netdevice.h                     | 10 ++++
 net/core/net-sysfs.c                          | 60 +++++++++++++++++++
 4 files changed, 89 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-class-net-timestamping

diff --git a/Documentation/ABI/testing/sysfs-class-net-timestamping b/Documentation/ABI/testing/sysfs-class-net-timestamping
new file mode 100644
index 000000000000..529c3a6eb607
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-net-timestamping
@@ -0,0 +1,17 @@
+What:		/sys/class/net/<iface>/available_timestamping_providers
+Date:		January 2022
+Contact:	Richard Cochran <richardcochran@gmail.com>
+Description:
+		Enumerates the available providers for SO_TIMESTAMPING.
+		The possible values are:
+		- "mac"  The MAC provides time stamping.
+		- "phy"  The PHY or MII device provides time stamping.
+
+What:		/sys/class/net/<iface>/current_timestamping_provider
+Date:		January 2022
+Contact:	Richard Cochran <richardcochran@gmail.com>
+Description:
+		Show the current SO_TIMESTAMPING provider.
+		The possible values are:
+		- "mac"  The MAC provides time stamping.
+		- "phy"  The PHY or MII device provides time stamping.
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 74d8e1dc125f..5538ee27e865 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1415,6 +1415,7 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
 
 	phydev->phy_link_change = phy_link_change;
 	if (dev) {
+		dev->selected_timestamping_layer = PHY_TIMESTAMPING;
 		phydev->attached_dev = dev;
 		dev->phydev = phydev;
 
@@ -1727,6 +1728,7 @@ void phy_detach(struct phy_device *phydev)
 
 	phy_suspend(phydev);
 	if (dev) {
+		dev->selected_timestamping_layer = MAC_TIMESTAMPING;
 		phydev->attached_dev->phydev = NULL;
 		phydev->attached_dev = NULL;
 	}
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 2684bdb6defa..b44ae00df3a8 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1687,6 +1687,11 @@ enum netdev_ml_priv_type {
 	ML_PRIV_CAN,
 };
 
+enum timestamping_layer {
+	MAC_TIMESTAMPING,
+	PHY_TIMESTAMPING,
+};
+
 /**
  *	struct net_device - The DEVICE structure.
  *
@@ -1927,6 +1932,9 @@ enum netdev_ml_priv_type {
  *
  *	@threaded:	napi threaded mode is enabled
  *
+ *	@selected_timestamping_layer:	Tracks whether the MAC or the PHY
+ *					performs packet time stamping.
+ *
  *	@net_notifier_list:	List of per-net netdev notifier block
  *				that follow this device when it is moved
  *				to another network namespace.
@@ -2263,6 +2271,8 @@ struct net_device {
 	unsigned		wol_enabled:1;
 	unsigned		threaded:1;
 
+	enum timestamping_layer selected_timestamping_layer;
+
 	struct list_head	net_notifier_list;
 
 #if IS_ENABLED(CONFIG_MACSEC)
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 53ea262ecafd..4ff7ef417c38 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -618,6 +618,64 @@ static ssize_t threaded_store(struct device *dev,
 }
 static DEVICE_ATTR_RW(threaded);
 
+static ssize_t available_timestamping_providers_show(struct device *dev,
+						     struct device_attribute *attr,
+						     char *buf)
+{
+	const struct ethtool_ops *ops;
+	struct net_device *netdev;
+	struct phy_device *phydev;
+	int ret = 0;
+
+	netdev = to_net_dev(dev);
+	phydev = netdev->phydev;
+	ops = netdev->ethtool_ops;
+
+	if (!rtnl_trylock())
+		return restart_syscall();
+
+	ret += sprintf(buf, "%s\n", "mac");
+	buf += 4;
+
+	if (phy_has_tsinfo(phydev)) {
+		ret += sprintf(buf, "%s\n", "phy");
+		buf += 4;
+	}
+
+	rtnl_unlock();
+
+	return ret;
+}
+static DEVICE_ATTR_RO(available_timestamping_providers);
+
+static ssize_t current_timestamping_provider_show(struct device *dev,
+						  struct device_attribute *attr,
+						  char *buf)
+{
+	const struct ethtool_ops *ops;
+	struct net_device *netdev;
+	struct phy_device *phydev;
+	int ret;
+
+	netdev = to_net_dev(dev);
+	phydev = netdev->phydev;
+	ops = netdev->ethtool_ops;
+
+	if (!rtnl_trylock())
+		return restart_syscall();
+
+	if (phy_has_tsinfo(phydev)) {
+		ret = sprintf(buf, "%s\n", "phy");
+	} else {
+		ret = sprintf(buf, "%s\n", "mac");
+	}
+
+	rtnl_unlock();
+
+	return ret;
+}
+static DEVICE_ATTR_RO(current_timestamping_provider);
+
 static struct attribute *net_class_attrs[] __ro_after_init = {
 	&dev_attr_netdev_group.attr,
 	&dev_attr_type.attr,
@@ -651,6 +709,8 @@ static struct attribute *net_class_attrs[] __ro_after_init = {
 	&dev_attr_carrier_up_count.attr,
 	&dev_attr_carrier_down_count.attr,
 	&dev_attr_threaded.attr,
+	&dev_attr_available_timestamping_providers.attr,
+	&dev_attr_current_timestamping_provider.attr,
 	NULL,
 };
 ATTRIBUTE_GROUPS(net_class);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH RFC V1 net-next 2/4] net: Expose available time stamping layers to user space.
  2022-01-03 23:25 [PATCH RFC V1 net-next 2/4] net: Expose available time stamping layers to user space Richard Cochran
@ 2022-01-03 23:51 ` Russell King (Oracle)
  2022-01-04 10:00 ` kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2022-01-03 23:51 UTC (permalink / raw)
  To: Richard Cochran
  Cc: netdev, linux-kernel, Andrew Lunn, David Miller,
	Grygorii Strashko, Jakub Kicinski, Joakim Zhang, Kurt Kanzenbach,
	Miroslav Lichvar, Vladimir Oltean

On Mon, Jan 03, 2022 at 03:25:53PM -0800, Richard Cochran wrote:
> Time stamping on network packets may happen either in the MAC or in
> the PHY, but not both.  In preparation for making the choice
> selectable, expose both the current and available layers via sysfs.
> 
> In accordance with the kernel implementation as it stands, the current
> layer will always read as "phy" when a PHY time stamping device is
> present.  Future patches will allow changing the current layer
> administratively.
> 
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>

Did you mean to introduce "selected_timestamping_layer" in this patch -
it appears to be a write only variable.

As it stands, it gets set to indicate PHY mode just by a network driver
binding to a PHY. If this gets used based on that decision to direct
where get_ts_info() goes, then this will break mvpp2 PTP.

I suggest that the introduction of "selected_timestamping_layer" is
moved to the patch where it's actually used for a better review.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RFC V1 net-next 2/4] net: Expose available time stamping layers to user space.
  2022-01-03 23:25 [PATCH RFC V1 net-next 2/4] net: Expose available time stamping layers to user space Richard Cochran
  2022-01-03 23:51 ` Russell King (Oracle)
@ 2022-01-04 10:00 ` kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2022-01-04 10:00 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2965 bytes --]

Hi Richard,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Richard-Cochran/Make-MAC-PHY-time-stamping-selectable/20220104-072717
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 3d694552fd8fe502e7ffd22ffa0e085bfd73b19a
config: arc-buildonly-randconfig-r001-20220104 (https://download.01.org/0day-ci/archive/20220104/202201041705.Qy6C7VUP-lkp(a)intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/c7ffd872b92c08c5ffdb864da31410adb78f6a17
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Richard-Cochran/Make-MAC-PHY-time-stamping-selectable/20220104-072717
        git checkout c7ffd872b92c08c5ffdb864da31410adb78f6a17
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   net/core/net-sysfs.c: In function 'available_timestamping_providers_show':
>> net/core/net-sysfs.c:625:35: warning: variable 'ops' set but not used [-Wunused-but-set-variable]
     625 |         const struct ethtool_ops *ops;
         |                                   ^~~
   net/core/net-sysfs.c: In function 'current_timestamping_provider_show':
   net/core/net-sysfs.c:655:35: warning: variable 'ops' set but not used [-Wunused-but-set-variable]
     655 |         const struct ethtool_ops *ops;
         |                                   ^~~


vim +/ops +625 net/core/net-sysfs.c

   620	
   621	static ssize_t available_timestamping_providers_show(struct device *dev,
   622							     struct device_attribute *attr,
   623							     char *buf)
   624	{
 > 625		const struct ethtool_ops *ops;
   626		struct net_device *netdev;
   627		struct phy_device *phydev;
   628		int ret = 0;
   629	
   630		netdev = to_net_dev(dev);
   631		phydev = netdev->phydev;
   632		ops = netdev->ethtool_ops;
   633	
   634		if (!rtnl_trylock())
   635			return restart_syscall();
   636	
   637		ret += sprintf(buf, "%s\n", "mac");
   638		buf += 4;
   639	
   640		if (phy_has_tsinfo(phydev)) {
   641			ret += sprintf(buf, "%s\n", "phy");
   642			buf += 4;
   643		}
   644	
   645		rtnl_unlock();
   646	
   647		return ret;
   648	}
   649	static DEVICE_ATTR_RO(available_timestamping_providers);
   650	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RFC V1 net-next 2/4] net: Expose available time stamping layers to user space.
@ 2022-01-08 21:19 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2022-01-08 21:19 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 17104 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20220103232555.19791-3-richardcochran@gmail.com>
References: <20220103232555.19791-3-richardcochran@gmail.com>
TO: Richard Cochran <richardcochran@gmail.com>

Hi Richard,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Richard-Cochran/Make-MAC-PHY-time-stamping-selectable/20220104-072717
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 3d694552fd8fe502e7ffd22ffa0e085bfd73b19a
:::::: branch date: 5 days ago
:::::: commit date: 5 days ago
config: x86_64-randconfig-c007-20220105 (https://download.01.org/0day-ci/archive/20220109/202201090507.DjVyQPOP-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d5b6e30ed3acad794dd0aec400e617daffc6cc3d)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/c7ffd872b92c08c5ffdb864da31410adb78f6a17
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Richard-Cochran/Make-MAC-PHY-time-stamping-selectable/20220104-072717
        git checkout c7ffd872b92c08c5ffdb864da31410adb78f6a17
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   sound/soc/sof/pcm.c:505:2: warning: Value stored to 'dai' is never read [clang-analyzer-deadcode.DeadStores]
           dai = bytes_to_frames(substream->runtime,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sof/pcm.c:505:2: note: Value stored to 'dai' is never read
           dai = bytes_to_frames(substream->runtime,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   sound/soc/bcm/bcm63xx-pcm-whistler.c:263:31: warning: The left operand of '+' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                   prtd->dma_addr_next = val_1 + val_2;
                                         ~~~~~ ^
   sound/soc/bcm/bcm63xx-pcm-whistler.c:234:59: note: 'val_1' declared without an initial value
           unsigned int availdepth, ifflevel, offlevel, int_status, val_1, val_2;
                                                                    ^~~~~
   sound/soc/bcm/bcm63xx-pcm-whistler.c:249:2: note: Assuming the condition is false
           if (int_status & I2S_RX_DESC_OFF_INTR_EN_MSK) {
           ^
   include/linux/compiler.h:56:45: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   sound/soc/bcm/bcm63xx-pcm-whistler.c:249:2: note: '?' condition is false
           if (int_status & I2S_RX_DESC_OFF_INTR_EN_MSK) {
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                 ^
   sound/soc/bcm/bcm63xx-pcm-whistler.c:249:2: note: '?' condition is true
           if (int_status & I2S_RX_DESC_OFF_INTR_EN_MSK) {
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   sound/soc/bcm/bcm63xx-pcm-whistler.c:249:2: note: Taking true branch
           if (int_status & I2S_RX_DESC_OFF_INTR_EN_MSK) {
           ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   sound/soc/bcm/bcm63xx-pcm-whistler.c:258:3: note: Loop condition is false. Execution continues on line 263
                   while (offlevel) {
                   ^
   sound/soc/bcm/bcm63xx-pcm-whistler.c:263:31: note: The left operand of '+' is a garbage value
                   prtd->dma_addr_next = val_1 + val_2;
                                         ~~~~~ ^
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   14 warnings generated.
>> net/core/net-sysfs.c:632:2: warning: Value stored to 'ops' is never read [clang-analyzer-deadcode.DeadStores]
           ops = netdev->ethtool_ops;
           ^     ~~~~~~~~~~~~~~~~~~~
   net/core/net-sysfs.c:632:2: note: Value stored to 'ops' is never read
           ops = netdev->ethtool_ops;
           ^     ~~~~~~~~~~~~~~~~~~~
>> net/core/net-sysfs.c:642:3: warning: Value stored to 'buf' is never read [clang-analyzer-deadcode.DeadStores]
                   buf += 4;
                   ^      ~
   net/core/net-sysfs.c:642:3: note: Value stored to 'buf' is never read
                   buf += 4;
                   ^      ~
   net/core/net-sysfs.c:662:2: warning: Value stored to 'ops' is never read [clang-analyzer-deadcode.DeadStores]
           ops = netdev->ethtool_ops;
           ^     ~~~~~~~~~~~~~~~~~~~
   net/core/net-sysfs.c:662:2: note: Value stored to 'ops' is never read
           ops = netdev->ethtool_ops;
           ^     ~~~~~~~~~~~~~~~~~~~
   net/core/net-sysfs.c:1829:2: warning: Value stored to 'txq' is never read [clang-analyzer-deadcode.DeadStores]
           txq = real_tx;
           ^     ~~~~~~~
   net/core/net-sysfs.c:1829:2: note: Value stored to 'txq' is never read
           txq = real_tx;
           ^     ~~~~~~~
   Suppressed 10 warnings (8 in non-user code, 2 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   8 warnings generated.
   Suppressed 8 warnings (8 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   8 warnings generated.
   Suppressed 8 warnings (8 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   57 warnings generated.
   Suppressed 57 warnings (57 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   9 warnings generated.
   net/core/drop_monitor.c:870:2: warning: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
           kfree(hw_metadata->fa_cookie);
           ^
   net/core/drop_monitor.c:941:6: note: Assuming field 'trap_type' is not equal to DEVLINK_TRAP_TYPE_CONTROL
           if (metadata->trap_type == DEVLINK_TRAP_TYPE_CONTROL)
               ^
   include/linux/compiler.h:56:47: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                                                 ^~~~
   include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                      ^~~~
   net/core/drop_monitor.c:941:2: note: '?' condition is false
           if (metadata->trap_type == DEVLINK_TRAP_TYPE_CONTROL)
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                 ^
   net/core/drop_monitor.c:941:16: note: Field 'trap_type' is not equal to DEVLINK_TRAP_TYPE_CONTROL
           if (metadata->trap_type == DEVLINK_TRAP_TYPE_CONTROL)
                         ^
   net/core/drop_monitor.c:941:2: note: '?' condition is false
           if (metadata->trap_type == DEVLINK_TRAP_TYPE_CONTROL)
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   net/core/drop_monitor.c:941:2: note: Taking false branch
           if (metadata->trap_type == DEVLINK_TRAP_TYPE_CONTROL)
           ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   net/core/drop_monitor.c:944:2: note: '?' condition is false
           if (!skb_mac_header_was_set(skb))
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:31: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                 ^
   net/core/drop_monitor.c:944:2: note: '?' condition is false
           if (!skb_mac_header_was_set(skb))
           ^
   include/linux/compiler.h:56:28: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                              ^
   include/linux/compiler.h:58:69: note: expanded from macro '__trace_if_var'
   #define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
                                                                       ^
   include/linux/compiler.h:69:2: note: expanded from macro '__trace_if_value'
           (cond) ?                                        \
           ^
   net/core/drop_monitor.c:944:2: note: Taking false branch
           if (!skb_mac_header_was_set(skb))
           ^
   include/linux/compiler.h:56:23: note: expanded from macro 'if'
   #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
                         ^
   net/core/drop_monitor.c:948:6: note: Assuming 'nskb' is non-null
           if (!nskb)

vim +/ops +632 net/core/net-sysfs.c

5fdd2f0e5c6484 Wei Wang        2021-02-08  620  
c7ffd872b92c08 Richard Cochran 2022-01-03  621  static ssize_t available_timestamping_providers_show(struct device *dev,
c7ffd872b92c08 Richard Cochran 2022-01-03  622  						     struct device_attribute *attr,
c7ffd872b92c08 Richard Cochran 2022-01-03  623  						     char *buf)
c7ffd872b92c08 Richard Cochran 2022-01-03  624  {
c7ffd872b92c08 Richard Cochran 2022-01-03  625  	const struct ethtool_ops *ops;
c7ffd872b92c08 Richard Cochran 2022-01-03  626  	struct net_device *netdev;
c7ffd872b92c08 Richard Cochran 2022-01-03  627  	struct phy_device *phydev;
c7ffd872b92c08 Richard Cochran 2022-01-03  628  	int ret = 0;
c7ffd872b92c08 Richard Cochran 2022-01-03  629  
c7ffd872b92c08 Richard Cochran 2022-01-03  630  	netdev = to_net_dev(dev);
c7ffd872b92c08 Richard Cochran 2022-01-03  631  	phydev = netdev->phydev;
c7ffd872b92c08 Richard Cochran 2022-01-03 @632  	ops = netdev->ethtool_ops;
c7ffd872b92c08 Richard Cochran 2022-01-03  633  
c7ffd872b92c08 Richard Cochran 2022-01-03  634  	if (!rtnl_trylock())
c7ffd872b92c08 Richard Cochran 2022-01-03  635  		return restart_syscall();
c7ffd872b92c08 Richard Cochran 2022-01-03  636  
c7ffd872b92c08 Richard Cochran 2022-01-03  637  	ret += sprintf(buf, "%s\n", "mac");
c7ffd872b92c08 Richard Cochran 2022-01-03  638  	buf += 4;
c7ffd872b92c08 Richard Cochran 2022-01-03  639  
c7ffd872b92c08 Richard Cochran 2022-01-03  640  	if (phy_has_tsinfo(phydev)) {
c7ffd872b92c08 Richard Cochran 2022-01-03  641  		ret += sprintf(buf, "%s\n", "phy");
c7ffd872b92c08 Richard Cochran 2022-01-03 @642  		buf += 4;
c7ffd872b92c08 Richard Cochran 2022-01-03  643  	}
c7ffd872b92c08 Richard Cochran 2022-01-03  644  
c7ffd872b92c08 Richard Cochran 2022-01-03  645  	rtnl_unlock();
c7ffd872b92c08 Richard Cochran 2022-01-03  646  
c7ffd872b92c08 Richard Cochran 2022-01-03  647  	return ret;
c7ffd872b92c08 Richard Cochran 2022-01-03  648  }
c7ffd872b92c08 Richard Cochran 2022-01-03  649  static DEVICE_ATTR_RO(available_timestamping_providers);
c7ffd872b92c08 Richard Cochran 2022-01-03  650  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-08 21:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03 23:25 [PATCH RFC V1 net-next 2/4] net: Expose available time stamping layers to user space Richard Cochran
2022-01-03 23:51 ` Russell King (Oracle)
2022-01-04 10:00 ` kernel test robot
2022-01-08 21:19 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.