From: kbuild test robot <lkp@intel.com>
To: avivh@mellanox.com
Cc: kbuild-all@01.org,
Steffen Klassert <steffen.klassert@secunet.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Boris Pismenny <borisp@mellanox.com>,
Yossi Kuperman <yossiku@mellanox.com>,
Yevgeny Kliteynik <kliteyn@mellanox.com>,
netdev@vger.kernel.org, Aviv Heller <avivh@mellanox.com>
Subject: Re: [PATCH net-next 2/3] xfrm: Fix offload dev state addition to occur after insertion
Date: Thu, 26 Oct 2017 08:27:54 +0800 [thread overview]
Message-ID: <201710260810.F44rGP1d%fengguang.wu@intel.com> (raw)
In-Reply-To: <1508857831-55824-2-git-send-email-avivh@mellanox.com>
[-- Attachment #1: Type: text/plain, Size: 4451 bytes --]
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
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 61800 bytes --]
next prev parent reply other threads:[~2017-10-26 0:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-24 15:10 [PATCH net-next 1/3] xfrm: Fix xfrm_input() to verify state is valid when (encap_type < 0) avivh
2017-10-24 15:10 ` [PATCH net-next 2/3] xfrm: Fix offload dev state addition to occur after insertion avivh
2017-10-25 7:22 ` Steffen Klassert
2017-10-25 13:09 ` Aviv Heller
2017-10-26 6:16 ` Steffen Klassert
2017-10-26 14:55 ` Aviv Heller
[not found] ` <mail.59f1f759.3bc0.5118b0751bd8f084@storage.wm.amazon.com>
2017-10-26 15:47 ` Aviv Heller
2017-10-26 0:27 ` kbuild test robot [this message]
2017-10-24 15:10 ` [PATCH net-next 3/3] xfrm: Remove redundant state assignment in xfrm_input() avivh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201710260810.F44rGP1d%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=avivh@mellanox.com \
--cc=borisp@mellanox.com \
--cc=herbert@gondor.apana.org.au \
--cc=kbuild-all@01.org \
--cc=kliteyn@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
--cc=yossiku@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).