Re: [PATCH 2/2] IB/mlx4: Add port and TID to MAD debug print

From: kbuild test robot
Date: Mon Sep 17 2018 - 12:06:21 EST


Hi Håkon,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.19-rc4 next-20180913]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/H-kon-Bugge/IB-mlx4-Enable-debug-print-of-SMPs/20180917-232956
config: i386-randconfig-x002-201837 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All warnings (new ones prefixed by >>):

In file included from include/linux/kernel.h:14:0,
from include/linux/list.h:9,
from include/rdma/ib_mad.h:40,
from drivers/infiniband//hw/mlx4/mad.c:33:
drivers/infiniband//hw/mlx4/mad.c: In function 'ib_process_mad':
>> include/linux/kern_levels.h:5:18: warning: format '%x' expects argument of type 'unsigned int', but argument 9 has type 'long long unsigned int' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/printk.h:136:10: note: in definition of macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
^~~
include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH'
#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
^~~~~~~~
include/linux/printk.h:346:12: note: in expansion of macro 'KERN_DEBUG'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~
>> drivers/infiniband//hw/mlx4/mad.c:811:3: note: in expansion of macro 'pr_debug'
pr_debug("received MAD: port:%d slid:%d sqpn:%d "
^~~~~~~~
drivers/infiniband//hw/mlx4/mad.c:812:48: note: format string is defined here
"dlid_bits:%d dqpn:%d wc_flags:0x%x tid:%08x cls:%x mtd:%x atr:%x\n",
~~~^
%08llx
--
In file included from include/linux/kernel.h:14:0,
from include/linux/list.h:9,
from include/rdma/ib_mad.h:40,
from drivers/infiniband/hw/mlx4/mad.c:33:
drivers/infiniband/hw/mlx4/mad.c: In function 'ib_process_mad':
>> include/linux/kern_levels.h:5:18: warning: format '%x' expects argument of type 'unsigned int', but argument 9 has type 'long long unsigned int' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/printk.h:136:10: note: in definition of macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
^~~
include/linux/kern_levels.h:15:20: note: in expansion of macro 'KERN_SOH'
#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
^~~~~~~~
include/linux/printk.h:346:12: note: in expansion of macro 'KERN_DEBUG'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~
drivers/infiniband/hw/mlx4/mad.c:811:3: note: in expansion of macro 'pr_debug'
pr_debug("received MAD: port:%d slid:%d sqpn:%d "
^~~~~~~~
drivers/infiniband/hw/mlx4/mad.c:812:48: note: format string is defined here
"dlid_bits:%d dqpn:%d wc_flags:0x%x tid:%08x cls:%x mtd:%x atr:%x\n",
~~~^
%08llx

vim +/pr_debug +811 drivers/infiniband//hw/mlx4/mad.c

801
802 static int ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
803 const struct ib_wc *in_wc, const struct ib_grh *in_grh,
804 const struct ib_mad *in_mad, struct ib_mad *out_mad)
805 {
806 u16 slid, prev_lid = 0;
807 int err;
808 struct ib_port_attr pattr;
809
810 if (in_wc && in_wc->qp) {
> 811 pr_debug("received MAD: port:%d slid:%d sqpn:%d "
812 "dlid_bits:%d dqpn:%d wc_flags:0x%x tid:%08x cls:%x mtd:%x atr:%x\n",
813 port_num,
814 in_wc->slid, in_wc->src_qp,
815 in_wc->dlid_path_bits,
816 in_wc->qp->qp_num,
817 in_wc->wc_flags,
818 be64_to_cpu(in_mad->mad_hdr.tid),
819 in_mad->mad_hdr.mgmt_class, in_mad->mad_hdr.method,
820 be16_to_cpu(in_mad->mad_hdr.attr_id));
821 if (in_wc->wc_flags & IB_WC_GRH) {
822 pr_debug("sgid_hi:0x%016llx sgid_lo:0x%016llx\n",
823 be64_to_cpu(in_grh->sgid.global.subnet_prefix),
824 be64_to_cpu(in_grh->sgid.global.interface_id));
825 pr_debug("dgid_hi:0x%016llx dgid_lo:0x%016llx\n",
826 be64_to_cpu(in_grh->dgid.global.subnet_prefix),
827 be64_to_cpu(in_grh->dgid.global.interface_id));
828 }
829 }
830
831 slid = in_wc ? ib_lid_cpu16(in_wc->slid) : be16_to_cpu(IB_LID_PERMISSIVE);
832
833 if (in_mad->mad_hdr.method == IB_MGMT_METHOD_TRAP && slid == 0) {
834 forward_trap(to_mdev(ibdev), port_num, in_mad);
835 return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED;
836 }
837
838 if (in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
839 in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) {
840 if (in_mad->mad_hdr.method != IB_MGMT_METHOD_GET &&
841 in_mad->mad_hdr.method != IB_MGMT_METHOD_SET &&
842 in_mad->mad_hdr.method != IB_MGMT_METHOD_TRAP_REPRESS)
843 return IB_MAD_RESULT_SUCCESS;
844
845 /*
846 * Don't process SMInfo queries -- the SMA can't handle them.
847 */
848 if (in_mad->mad_hdr.attr_id == IB_SMP_ATTR_SM_INFO)
849 return IB_MAD_RESULT_SUCCESS;
850 } else if (in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_PERF_MGMT ||
851 in_mad->mad_hdr.mgmt_class == MLX4_IB_VENDOR_CLASS1 ||
852 in_mad->mad_hdr.mgmt_class == MLX4_IB_VENDOR_CLASS2 ||
853 in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_CONG_MGMT) {
854 if (in_mad->mad_hdr.method != IB_MGMT_METHOD_GET &&
855 in_mad->mad_hdr.method != IB_MGMT_METHOD_SET)
856 return IB_MAD_RESULT_SUCCESS;
857 } else
858 return IB_MAD_RESULT_SUCCESS;
859
860 if ((in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
861 in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) &&
862 in_mad->mad_hdr.method == IB_MGMT_METHOD_SET &&
863 in_mad->mad_hdr.attr_id == IB_SMP_ATTR_PORT_INFO &&
864 !ib_query_port(ibdev, port_num, &pattr))
865 prev_lid = ib_lid_cpu16(pattr.lid);
866
867 err = mlx4_MAD_IFC(to_mdev(ibdev),
868 (mad_flags & IB_MAD_IGNORE_MKEY ? MLX4_MAD_IFC_IGNORE_MKEY : 0) |
869 (mad_flags & IB_MAD_IGNORE_BKEY ? MLX4_MAD_IFC_IGNORE_BKEY : 0) |
870 MLX4_MAD_IFC_NET_VIEW,
871 port_num, in_wc, in_grh, in_mad, out_mad);
872 if (err)
873 return IB_MAD_RESULT_FAILURE;
874
875 if (!out_mad->mad_hdr.status) {
876 smp_snoop(ibdev, port_num, in_mad, prev_lid);
877 /* slaves get node desc from FW */
878 if (!mlx4_is_slave(to_mdev(ibdev)->dev))
879 node_desc_override(ibdev, out_mad);
880 }
881
882 /* set return bit in status of directed route responses */
883 if (in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE)
884 out_mad->mad_hdr.status |= cpu_to_be16(1 << 15);
885
886 if (in_mad->mad_hdr.method == IB_MGMT_METHOD_TRAP_REPRESS)
887 /* no response for trap repress */
888 return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED;
889
890 return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY;
891 }
892

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip