[ammarfaizi2-block:mellanox/linux/queue-next 2/14] net/xfrm/xfrm_device.c:280:3: error: call to undeclared function 'dev_put_track'; ISO C99 and later do not support implicit function declarations

From: kernel test robot
Date: Tue Jun 28 2022 - 07:15:13 EST


tree: https://github.com/ammarfaizi2/linux-block mellanox/linux/queue-next
head: 62681695cd9969a82026b2b93d0c4ca1a8500eee
commit: 0a1347c1f766cddc63032227434bc7b581904dc2 [2/14] xfrm: add new full offload flag
config: i386-randconfig-a004-20220627 (https://download.01.org/0day-ci/archive/20220628/202206281926.yJ1l888L-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project df18167ac56d05f2ab55f9d874aee7ab6d5bc9a2)
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/ammarfaizi2/linux-block/commit/0a1347c1f766cddc63032227434bc7b581904dc2
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block mellanox/linux/queue-next
git checkout 0a1347c1f766cddc63032227434bc7b581904dc2
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash net/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> net/xfrm/xfrm_device.c:280:3: error: call to undeclared function 'dev_put_track'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
dev_put_track(dev, &xso->dev_tracker);
^
net/xfrm/xfrm_device.c:280:3: note: did you mean 'get_net_track'?
include/net/net_namespace.h:331:27: note: 'get_net_track' declared here
static inline struct net *get_net_track(struct net *net,
^
1 error generated.


vim +/dev_put_track +280 net/xfrm/xfrm_device.c

208
209 int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
210 struct xfrm_user_offload *xuo)
211 {
212 int err;
213 struct dst_entry *dst;
214 struct net_device *dev;
215 struct xfrm_dev_offload *xso = &x->xso;
216 xfrm_address_t *saddr;
217 xfrm_address_t *daddr;
218
219 if (!x->type_offload)
220 return -EINVAL;
221
222 /* We don't yet support UDP encapsulation and TFC padding. */
223 if (x->encap || x->tfcpad)
224 return -EINVAL;
225
226 if (xuo->flags & ~(XFRM_OFFLOAD_IPV6 | XFRM_OFFLOAD_INBOUND))
227 return -EINVAL;
228
229 dev = dev_get_by_index(net, xuo->ifindex);
230 if (!dev) {
231 if (!(xuo->flags & XFRM_OFFLOAD_INBOUND)) {
232 saddr = &x->props.saddr;
233 daddr = &x->id.daddr;
234 } else {
235 saddr = &x->id.daddr;
236 daddr = &x->props.saddr;
237 }
238
239 dst = __xfrm_dst_lookup(net, 0, 0, saddr, daddr,
240 x->props.family,
241 xfrm_smark_get(0, x));
242 if (IS_ERR(dst))
243 return 0;
244
245 dev = dst->dev;
246
247 dev_hold(dev);
248 dst_release(dst);
249 }
250
251 if (!dev->xfrmdev_ops || !dev->xfrmdev_ops->xdo_dev_state_add) {
252 xso->dev = NULL;
253 dev_put(dev);
254 return 0;
255 }
256
257 if (x->props.flags & XFRM_STATE_ESN &&
258 !dev->xfrmdev_ops->xdo_dev_state_advance_esn) {
259 xso->dev = NULL;
260 dev_put(dev);
261 return -EINVAL;
262 }
263
264 xso->dev = dev;
265 netdev_tracker_alloc(dev, &xso->dev_tracker, GFP_ATOMIC);
266 xso->real_dev = dev;
267
268 if (xuo->flags & XFRM_OFFLOAD_INBOUND)
269 xso->dir = XFRM_DEV_OFFLOAD_IN;
270 else
271 xso->dir = XFRM_DEV_OFFLOAD_OUT;
272
273 xso->type = XFRM_DEV_OFFLOAD_CRYPTO;
274
275 err = dev->xfrmdev_ops->xdo_dev_state_add(x);
276 if (err) {
277 xso->dev = NULL;
278 xso->dir = 0;
279 xso->real_dev = NULL;
> 280 dev_put_track(dev, &xso->dev_tracker);
281 xso->type = XFRM_DEV_OFFLOAD_UNSPECIFIED;
282
283 if (err != -EOPNOTSUPP)
284 return err;
285 }
286
287 return 0;
288 }
289 EXPORT_SYMBOL_GPL(xfrm_dev_state_add);
290

--
0-DAY CI Kernel Test Service
https://01.org/lkp