Re: [PATCH V3 6/6] crypto/nx: Add P9 NX support for 842 compression engine
From: Michael Neuling <hidden>
Date: 2017-09-02 13:42:38
Also in:
linux-crypto
quoted
quoted
+static int nx842_powernv_crypto_init_vas(struct crypto_tfm *tfm) +{ +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct nx842_crypto_ctx *c=
tx =3D crypto_tfm_ctx(tfm);
quoted
quoted
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct nx842_workmem *wmem=
;
quoted
quoted
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct nx842_coproc *copro=
c;
quoted
quoted
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0int ret; + +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ret =3D nx842_crypto_init(=
tfm, &nx842_powernv_driver);
quoted
quoted
+ +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (ret) +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0return ret;
quoted
quoted
+ +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0wmem =3D PTR_ALIGN((struct=
nx842_workmem *)ctx->wmem,
quoted
quoted
WORKMEM_ALIGN); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0coproc =3D per_cpu(coproc_=
inst, smp_processor_id());
quoted
=20 this is wrong.=C2=A0=C2=A0the crypto transform init function is not gua=
ranteed
quoted
to be called by the same processor that later uses it.=C2=A0=C2=A0Just =
because
quoted
that happens to be how zswap operates doesn't guarantee other crypto users will do the same.=20 Dan, Sorry missed this comment.=C2=A0 =20 Right, The actual crypto request can be executed on other processor than =
the
CPU when the init is executed. The main goal is open send window on the N=
X
engine which is on the same chip for the corresponding CPU. So we are OK =
if
the request is scheduled on other CPU as long as it belongs to same chip. Otherwise in the worst case we will end up using remote NX.=C2=A0=C2=A0
You want the NX to be close to the requester CPU, but probably more importa= ntly you want the NX close to the memory it's going to be operating on.=C2=A0 Preferably they would all be on the same node. Mikey=20