[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201710260810.F44rGP1d%fengguang.wu@intel.com>
Date: Thu, 26 Oct 2017 08:27:54 +0800
From: kbuild test robot <lkp@...el.com>
To: avivh@...lanox.com
Cc: kbuild-all@...org, Steffen Klassert <steffen.klassert@...unet.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Boris Pismenny <borisp@...lanox.com>,
Yossi Kuperman <yossiku@...lanox.com>,
Yevgeny Kliteynik <kliteyn@...lanox.com>,
netdev@...r.kernel.org, Aviv Heller <avivh@...lanox.com>
Subject: Re: [PATCH net-next 2/3] xfrm: Fix offload dev state addition to
occur after insertion
Hi Aviv,
[auto build test WARNING on ipsec-next/master]
[also build test WARNING on v4.14-rc6 next-20171018]
[cannot apply to net-next/master]
[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/avivh-mellanox-com/xfrm-Fix-xfrm_input-to-verify-state-is-valid-when-encap_type-0/20171026-060151
base: https://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git master
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c: In function 'mlx5e_xfrm_add_state':
>> drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c:307:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
xfrm_dev_set_offload_handle(x, (u64)sa_entry);
^
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c: In function 'mlx5e_xfrm_del_state':
>> drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c:323:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
struct mlx5e_ipsec_sa_entry *sa_entry = (void *)xfrm_dev_offload_handle(x);
^
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c: In function 'mlx5e_xfrm_free_state':
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c:345:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
struct mlx5e_ipsec_sa_entry *sa_entry = (void *)xfrm_dev_offload_handle(x);
^
vim +307 drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
260
261 static int mlx5e_xfrm_add_state(struct xfrm_state *x)
262 {
263 struct mlx5e_ipsec_sa_entry *sa_entry = NULL;
264 struct net_device *netdev = x->xso.dev;
265 struct mlx5_accel_ipsec_sa hw_sa;
266 struct mlx5e_priv *priv;
267 void *context;
268 int err;
269
270 priv = netdev_priv(netdev);
271
272 err = mlx5e_xfrm_validate_state(x);
273 if (err)
274 return err;
275
276 sa_entry = kzalloc(sizeof(*sa_entry), GFP_KERNEL);
277 if (!sa_entry) {
278 err = -ENOMEM;
279 goto out;
280 }
281
282 sa_entry->x = x;
283 sa_entry->ipsec = priv->ipsec;
284
285 /* Add the SA to handle processed incoming packets before the add SA
286 * completion was received
287 */
288 if (x->xso.flags & XFRM_OFFLOAD_INBOUND) {
289 err = mlx5e_ipsec_sadb_rx_add(sa_entry);
290 if (err) {
291 netdev_info(netdev, "Failed adding to SADB_RX: %d\n", err);
292 goto err_entry;
293 }
294 }
295
296 mlx5e_ipsec_build_hw_sa(MLX5_IPSEC_CMD_ADD_SA, sa_entry, &hw_sa);
297 context = mlx5_accel_ipsec_sa_cmd_exec(sa_entry->ipsec->en_priv->mdev, &hw_sa);
298 if (IS_ERR(context)) {
299 err = PTR_ERR(context);
300 goto err_sadb_rx;
301 }
302
303 err = mlx5_accel_ipsec_sa_cmd_wait(context);
304 if (err)
305 goto err_sadb_rx;
306
> 307 xfrm_dev_set_offload_handle(x, (u64)sa_entry);
308 goto out;
309
310 err_sadb_rx:
311 if (x->xso.flags & XFRM_OFFLOAD_INBOUND) {
312 mlx5e_ipsec_sadb_rx_del(sa_entry);
313 mlx5e_ipsec_sadb_rx_free(sa_entry);
314 }
315 err_entry:
316 kfree(sa_entry);
317 out:
318 return err;
319 }
320
321 static void mlx5e_xfrm_del_state(struct xfrm_state *x)
322 {
> 323 struct mlx5e_ipsec_sa_entry *sa_entry = (void *)xfrm_dev_offload_handle(x);
324 struct mlx5_accel_ipsec_sa hw_sa;
325 void *context;
326
327 if (!sa_entry)
328 return;
329
330 WARN_ON(sa_entry->x != x);
331
332 if (x->xso.flags & XFRM_OFFLOAD_INBOUND)
333 mlx5e_ipsec_sadb_rx_del(sa_entry);
334
335 mlx5e_ipsec_build_hw_sa(MLX5_IPSEC_CMD_DEL_SA, sa_entry, &hw_sa);
336 context = mlx5_accel_ipsec_sa_cmd_exec(sa_entry->ipsec->en_priv->mdev, &hw_sa);
337 if (IS_ERR(context))
338 return;
339
340 sa_entry->context = context;
341 }
342
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Download attachment ".config.gz" of type "application/gzip" (61800 bytes)
Powered by blists - more mailing lists