[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM6PR13MB3705F0963A853D5C794FC639FC3C9@DM6PR13MB3705.namprd13.prod.outlook.com>
Date: Mon, 7 Nov 2022 09:50:41 +0000
From: Yinjun Zhang <yinjun.zhang@...igine.com>
To: Leon Romanovsky <leon@...nel.org>
CC: David Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Steffen Klassert <steffen.klassert@...unet.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Chengtian Liu <chengtian.liu@...igine.com>,
HuanHuan Wang <huanhuan.wang@...igine.com>,
Louis Peens <louis.peens@...igine.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
oss-drivers <oss-drivers@...igine.com>,
Simon Horman <simon.horman@...igine.com>
Subject: RE: [PATCH net-next v3 3/3] nfp: implement xfrm callbacks and expose
ipsec offload feature to upper layer
On Sun, 6 Nov 2022 21:48:10 +0200, Leon Romanovsky wrote:
<...>
> > + if (x->aalg) {
> > + p = (__be32 *)x->aalg->alg_key;
> > + key_len = DIV_ROUND_UP(x->aalg->alg_key_len,
> BITS_PER_BYTE);
> > + if (key_len > sizeof(cfg->auth_key)) {
> > + nn_err(nn, "Insufficient space for offloaded auth
> key\n");
> > + return -EINVAL;
> > + }
> > + for (i = 0; i < key_len / sizeof(cfg->auth_key[0]) ; i++)
> > + cfg->auth_key[i] = ntohl(*p++);
>
> I wonder if you can't declare p as u32 and use memcpy here instead of
> u32->__be32->u32 conversions.
The BE/LE process is necessary as HW requires it, we'll use get_ unaligned_be32
instead to make it simpler.
>
> Thanks
Powered by blists - more mailing lists