tree:
https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git wip/jgg-for-next
head: d677f424c78cf2ae42e97127fa1a4077476da781
commit: 2a49a50546427ee595cac0916295001d2384f416 [112/113] RDMA: Fix link active_speed
size
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.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
git checkout 2a49a50546427ee595cac0916295001d2384f416
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/rdma/uverbs_types.h:9,
from include/rdma/uverbs_std_types.h:9,
from drivers/infiniband/core/uverbs_std_types_device.c:6:
drivers/infiniband/core/uverbs_std_types_device.c: In function
'copy_port_attr_to_resp':
> drivers/infiniband/core/uverbs_std_types_device.c:169:54: error:
'IB_SPEED_NDR' undeclared (first use in this function); did you mean
'IB_SPEED_HDR'?
169 | resp->active_speed = min_t(u16,
attr->active_speed, IB_SPEED_NDR);
| ^~~~~~~~~~~~
include/linux/kernel.h:850:40: note: in definition of macro '__typecheck'
850 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^
include/linux/kernel.h:874:24: note: in expansion of macro '__safe_cmp'
874 | __builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~
include/linux/kernel.h:942:27: note: in expansion of macro '__careful_cmp'
942 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <)
| ^~~~~~~~~~~~~
drivers/infiniband/core/uverbs_std_types_device.c:169:23: note: in expansion of macro
'min_t'
169 | resp->active_speed = min_t(u16, attr->active_speed, IB_SPEED_NDR);
| ^~~~~
drivers/infiniband/core/uverbs_std_types_device.c:169:54: note: each undeclared
identifier is reported only once for each function it appears in
169 | resp->active_speed = min_t(u16, attr->active_speed, IB_SPEED_NDR);
| ^~~~~~~~~~~~
include/linux/kernel.h:850:40: note: in definition of macro '__typecheck'
850 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^
include/linux/kernel.h:874:24: note: in expansion of macro '__safe_cmp'
874 | __builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~
include/linux/kernel.h:942:27: note: in expansion of macro '__careful_cmp'
942 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <)
| ^~~~~~~~~~~~~
drivers/infiniband/core/uverbs_std_types_device.c:169:23: note: in expansion of macro
'min_t'
169 | resp->active_speed = min_t(u16, attr->active_speed, IB_SPEED_NDR);
| ^~~~~
> include/linux/kernel.h:874:2: error: first argument to
'__builtin_choose_expr' not a constant
874 |
__builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:942:27: note: in expansion of macro '__careful_cmp'
942 | #define min_t(type, x, y) __careful_cmp((type)(x), (type)(y), <)
| ^~~~~~~~~~~~~
drivers/infiniband/core/uverbs_std_types_device.c:169:23: note: in expansion of macro
'min_t'
169 | resp->active_speed = min_t(u16, attr->active_speed, IB_SPEED_NDR);
| ^~~~~
#
https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?id=...
git remote add rdma
https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git
git fetch --no-tags rdma wip/jgg-for-next
git checkout 2a49a50546427ee595cac0916295001d2384f416
vim +169 drivers/infiniband/core/uverbs_std_types_device.c
6 #include <rdma/uverbs_std_types.h>
7 #include
"rdma_core.h"
8 #include "uverbs.h"
9 #include <rdma/uverbs_ioctl.h>
10 #include <rdma/opa_addr.h>
11
12 /*
13 * This ioctl method allows calling any defined write or write_ex
14 * handler. This essentially replaces the hdr/ex_hdr system with the ioctl
15 * marshalling, and brings the non-ex path into the same marshalling as the ex
16 * path.
17 */
18 static int UVERBS_HANDLER(UVERBS_METHOD_INVOKE_WRITE)(
19 struct uverbs_attr_bundle *attrs)
20 {
21 struct uverbs_api *uapi = attrs->ufile->device->uapi;
22 const struct uverbs_api_write_method *method_elm;
23 u32 cmd;
24 int rc;
25
26 rc = uverbs_get_const(&cmd, attrs, UVERBS_ATTR_WRITE_CMD);
27 if (rc)
28 return rc;
29
30 method_elm = uapi_get_method(uapi, cmd);
31 if (IS_ERR(method_elm))
32 return PTR_ERR(method_elm);
33
34 uverbs_fill_udata(attrs, &attrs->ucore, UVERBS_ATTR_CORE_IN,
35 UVERBS_ATTR_CORE_OUT);
36
37 if (attrs->ucore.inlen < method_elm->req_size ||
38 attrs->ucore.outlen < method_elm->resp_size)
39 return -ENOSPC;
40
41 attrs->uobject = NULL;
42 rc = method_elm->handler(attrs);
43 if (attrs->uobject)
44 uverbs_finalize_object(attrs->uobject, UVERBS_ACCESS_NEW, true,
45 !rc, attrs);
46 return rc;
47 }
48
49 DECLARE_UVERBS_NAMED_METHOD(UVERBS_METHOD_INVOKE_WRITE,
50 UVERBS_ATTR_CONST_IN(UVERBS_ATTR_WRITE_CMD,
51 enum ib_uverbs_write_cmds,
52 UA_MANDATORY),
53 UVERBS_ATTR_PTR_IN(UVERBS_ATTR_CORE_IN,
54 UVERBS_ATTR_MIN_SIZE(sizeof(u32)),
55 UA_OPTIONAL),
56 UVERBS_ATTR_PTR_OUT(UVERBS_ATTR_CORE_OUT,
57 UVERBS_ATTR_MIN_SIZE(0),
58 UA_OPTIONAL),
59 UVERBS_ATTR_UHW());
60
61 static uint32_t *
62 gather_objects_handle(struct ib_uverbs_file *ufile,
63 const struct uverbs_api_object *uapi_object,
64 struct uverbs_attr_bundle *attrs,
65 ssize_t out_len,
66 u64 *total)
67 {
68 u64 max_count = out_len / sizeof(u32);
69 struct ib_uobject *obj;
70 u64 count = 0;
71 u32 *handles;
72
73 /* Allocated memory that cannot page out where we gather
74 * all object ids under a spin_lock.
75 */
76 handles = uverbs_zalloc(attrs, out_len);
77 if (IS_ERR(handles))
78 return handles;
79
80 spin_lock_irq(&ufile->uobjects_lock);
81 list_for_each_entry(obj, &ufile->uobjects, list) {
82 u32 obj_id = obj->id;
83
84 if (obj->uapi_object != uapi_object)
85 continue;
86
87 if (count >= max_count)
88 break;
89
90 handles[count] = obj_id;
91 count++;
92 }
93 spin_unlock_irq(&ufile->uobjects_lock);
94
95 *total = count;
96 return handles;
97 }
98
99 static int UVERBS_HANDLER(UVERBS_METHOD_INFO_HANDLES)(
100 struct uverbs_attr_bundle *attrs)
101 {
102 const struct uverbs_api_object *uapi_object;
103 ssize_t out_len;
104 u64 total = 0;
105 u16 object_id;
106 u32 *handles;
107 int ret;
108
109 out_len = uverbs_attr_get_len(attrs, UVERBS_ATTR_INFO_HANDLES_LIST);
110 if (out_len <= 0 || (out_len % sizeof(u32) != 0))
111 return -EINVAL;
112
113 ret = uverbs_get_const(&object_id, attrs, UVERBS_ATTR_INFO_OBJECT_ID);
114 if (ret)
115 return ret;
116
117 uapi_object = uapi_get_object(attrs->ufile->device->uapi, object_id);
118 if (!uapi_object)
119 return -EINVAL;
120
121 handles = gather_objects_handle(attrs->ufile, uapi_object, attrs,
122 out_len, &total);
123 if (IS_ERR(handles))
124 return PTR_ERR(handles);
125
126 ret = uverbs_copy_to(attrs, UVERBS_ATTR_INFO_HANDLES_LIST, handles,
127 sizeof(u32) * total);
128 if (ret)
129 goto err;
130
131 ret = uverbs_copy_to(attrs, UVERBS_ATTR_INFO_TOTAL_HANDLES, &total,
132 sizeof(total));
133 err:
134 return ret;
135 }
136
137 void copy_port_attr_to_resp(struct ib_port_attr *attr,
138 struct ib_uverbs_query_port_resp *resp,
139 struct ib_device *ib_dev, u8 port_num)
140 {
141 resp->state = attr->state;
142 resp->max_mtu = attr->max_mtu;
143 resp->active_mtu = attr->active_mtu;
144 resp->gid_tbl_len = attr->gid_tbl_len;
145 resp->port_cap_flags = make_port_cap_flags(attr);
146 resp->max_msg_sz = attr->max_msg_sz;
147 resp->bad_pkey_cntr = attr->bad_pkey_cntr;
148 resp->qkey_viol_cntr = attr->qkey_viol_cntr;
149 resp->pkey_tbl_len = attr->pkey_tbl_len;
150
151 if (rdma_is_grh_required(ib_dev, port_num))
152 resp->flags |= IB_UVERBS_QPF_GRH_REQUIRED;
153
154 if (rdma_cap_opa_ah(ib_dev, port_num)) {
155 resp->lid = OPA_TO_IB_UCAST_LID(attr->lid);
156 resp->sm_lid = OPA_TO_IB_UCAST_LID(attr->sm_lid);
157 } else {
158 resp->lid = ib_lid_cpu16(attr->lid);
159 resp->sm_lid = ib_lid_cpu16(attr->sm_lid);
160 }
161
162 resp->lmc = attr->lmc;
163 resp->max_vl_num = attr->max_vl_num;
164 resp->sm_sl = attr->sm_sl;
165 resp->subnet_timeout = attr->subnet_timeout;
166 resp->init_type_reply = attr->init_type_reply;
167 resp->active_width = attr->active_width;
168 /* This ABI needs to be extended to provide any speed more than IB_SPEED_NDR */
169 resp->active_speed = min_t(u16, attr->active_speed,
IB_SPEED_NDR);
170 resp->phys_state = attr->phys_state;
171 resp->link_layer = rdma_port_get_link_layer(ib_dev, port_num);
172 }
173
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org