smb/client: print "Unknown" instead of bogus link speed value
Subsystems (2)
PATCH 1/1 smb/client: print "Unknown" instead of bogus link speed value
The virtio driver for Linux guests will not set a link speed to its paravirtualized NICs. This will be seen as -1 in the ethernet layer, and when some servers (e.g. samba) fetches it, it's converted to an unsigned value (and multiplied by 1000 * 1000), so in client side we end up with:
1) Speed: 4294967295000000 bps
in DebugData.
This patch uses phy_speed_to_str() if interface speed is between SPEED_10 and SPEED_800000, and print "Unknown" otherwise.
The reason to not change the value in iface->speed is because we don't know the real speed of the HW backing the server NIC, so let's keep considering these as the fastest NICs available.
Also print "Capabilities: None" when the interface doesn't support any.
--- fs/smb/client/cifs_debug.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/smb/client/cifs_debug.c +5 -1
@@ -12,6 +12,7 @@#include <linux/module.h> #include <linux/proc_fs.h> #include <linux/uaccess.h> +#include <linux/phy.h> #include "cifspdu.h" #include "cifsglob.h" #include "cifsproto.h"
@@ -152,12 +153,15 @@ cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface)struct sockaddr_in *ipv4 = (struct sockaddr_in *)&iface->sockaddr;struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)&iface->sockaddr; -seq_printf (m,"\tSpeed: %zu bps\n" , iface->speed); +seq_printf (m,"\tSpeed: %s\n" , (iface->speed >SPEED_10 && iface->speed <SPEED_800000 ) ? +phy_speed_to_str (iface->speed) :"Unknown" );seq_puts (m,"\t\tCapabilities: " );if (iface->rdma_capable)seq_puts (m,"rdma " );if (iface->rss_capable)seq_puts (m,"rss " ); +if (!iface->rdma_capable && !iface->rss_capable) +seq_puts (m,"None" );seq_putc (m,'\n' );if (iface->sockaddr.ss_family ==AF_INET )seq_printf (m,"\t\tIPv4: %pI4\n" , &ipv4->sin_addr);
Signature · 1 line
2.40.1
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Enzo,
kernel test robot noticed the following build errors:
[auto build test ERROR on cifs/for-next]
[also build test ERROR on linus/master v6.4-rc5 next-20230608] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Enzo-Matsumiya/smb-client-print-Unknown-instead-of-bogus-link-speed-value/20230609-041241 base: git://git.samba.org/sfrench/cifs-2.6.git for-next patch link: https://lore.kernel.org/r/20230608201055.9716-1-ematsumiya%40suse.de patch subject: [PATCH] smb/client: print "Unknown" instead of bogus link speed value config: x86_64-randconfig-x062-20230608 (https://download.01.org/0day-ci/archive/20230609/[email protected]/config) compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build):
mkdir -p ~/bin
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
git remote add cifs git://git.samba.org/sfrench/cifs-2.6.git
git fetch cifs for-next
git checkout cifs/for-next
b4 shazam https://lore.kernel.org/r/[email protected]
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> ERROR: modpost: "phy_speed_to_str" [fs/smb/client/cifs.ko] undefined!
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Enzo,
kernel test robot noticed the following build errors:
[auto build test ERROR on cifs/for-next]
[also build test ERROR on linus/master v6.4-rc5 next-20230608] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Enzo-Matsumiya/smb-client-print-Unknown-instead-of-bogus-link-speed-value/20230609-041241 base: git://git.samba.org/sfrench/cifs-2.6.git for-next patch link: https://lore.kernel.org/r/20230608201055.9716-1-ematsumiya%40suse.de patch subject: [PATCH] smb/client: print "Unknown" instead of bogus link speed value config: i386-randconfig-m021-20230608 (https://download.01.org/0day-ci/archive/20230609/[email protected]/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build):
git remote add cifs git://git.samba.org/sfrench/cifs-2.6.git
git fetch cifs for-next
git checkout cifs/for-next
b4 shazam https://lore.kernel.org/r/[email protected]
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 olddefconfig
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> ERROR: modpost: "phy_speed_to_str" [fs/smb/client/cifs.ko] undefined!
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Enzo,
kernel test robot noticed the following build errors:
[auto build test ERROR on cifs/for-next]
[also build test ERROR on linus/master v6.4-rc5 next-20230608] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Enzo-Matsumiya/smb-client-print-Unknown-instead-of-bogus-link-speed-value/20230609-041241 base: git://git.samba.org/sfrench/cifs-2.6.git for-next patch link: https://lore.kernel.org/r/20230608201055.9716-1-ematsumiya%40suse.de patch subject: [PATCH] smb/client: print "Unknown" instead of bogus link speed value config: x86_64-randconfig-a011-20230608 (https://download.01.org/0day-ci/archive/20230609/[email protected]/config) compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce (this is a W=1 build):
mkdir -p ~/bin
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
git remote add cifs git://git.samba.org/sfrench/cifs-2.6.git
git fetch cifs for-next
git checkout cifs/for-next
b4 shazam https://lore.kernel.org/r/[email protected]
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> ld.lld: error: undefined symbol: phy_speed_to_str >>> referenced by cifs_debug.c:157 (fs/smb/client/cifs_debug.c:157) >>> fs/smb/client/cifs_debug.o:(cifs_debug_data_proc_show) in archive vmlinux.a
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki