DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Cc: <dev@dpdk.org>, Akhil Goyal <gakhil@marvell.com>,
	Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	"Sunil Kumar Kori" <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>,
	"Harman Kalra" <hkalra@marvell.com>,
	Ankur Dwivedi <adwivedi@marvell.com>,
	"Anoob Joseph" <anoobj@marvell.com>,
	Tejasree Kondoj <ktejasree@marvell.com>
Subject: Re: [v1] crypto/cnxk: add ML crypto support
Date: Fri, 29 May 2026 08:27:29 -0700	[thread overview]
Message-ID: <20260529082729.79c51aee@phoenix.local> (raw)
In-Reply-To: <20260529091330.6308-1-gmuthukrishn@marvell.com>

On Fri, 29 May 2026 14:43:26 +0530
Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com> wrote:

> +
> +int
> +roc_re_ml_zeta_get(uint64_t *tbl)
> +{
> +	int len = (RE_MLKEM_ZETA_LEN + RE_MLDSA_ZETA_LEN);
Unneeded paraens.

> +	const char name[] = RE_ML_TBL_NAME;
> +	const struct plt_memzone *mz;
> +	struct re_ml_tbl *ml;
> +	uint8_t *data;
> +
> +	if (tbl == NULL)
> +		return -EINVAL;
> +
> +	mz = plt_memzone_lookup(name);
> +	if (mz == NULL) {
> +		/* Create memzone first time */
> +		mz = plt_memzone_reserve_cache_align(name, sizeof(struct re_ml_tbl) + len);
> +		if (mz == NULL)
> +			return -ENOMEM;
> +	}
> +
> +	ml = (struct re_ml_tbl *)mz->addr;
mz->addr is void * so cast here is unnecessary.

> +	if (plt_atomic_fetch_add_explicit(&ml->refcount, 1, plt_memory_order_seq_cst) != 0)
> +		return 0;


> +
> +	data = PLT_PTR_ADD(mz->addr, sizeof(uint64_t));
> +	memcpy(data, re_ml_zeta_tbl[0].data, re_ml_zeta_tbl[0].len);
> +	tbl[0] = plt_cpu_to_be_64((uintptr_t)data);
> +
> +	data = PLT_PTR_ADD(data, re_ml_zeta_tbl[0].len);
> +	memcpy(data, re_ml_zeta_tbl[1].data, re_ml_zeta_tbl[1].len);
> +	tbl[1] = plt_cpu_to_be_64((uintptr_t)data);
> +
> +	return 0;
> +}

      parent reply	other threads:[~2026-05-29 15:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29  9:13 [v1] crypto/cnxk: add ML crypto support Gowrishankar Muthukrishnan
2026-05-29 15:25 ` Stephen Hemminger
2026-05-29 15:27 ` Stephen Hemminger [this message]

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=20260529082729.79c51aee@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=adwivedi@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=gmuthukrishn@marvell.com \
    --cc=hkalra@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ktejasree@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.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