All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Cc: dev@dpdk.org, ferruh.yigit@amd.com, kai.ji@intel.com,
	brian.dooley@intel.com
Subject: Re: [PATCH v5] net: add thread-safe crc api
Date: Mon, 10 Feb 2025 11:57:27 -0800	[thread overview]
Message-ID: <20250210115727.4e2570dd@hermes.local> (raw)
In-Reply-To: <20250207182443.9775-1-arkadiuszx.kusztal@intel.com>

On Fri,  7 Feb 2025 18:24:43 +0000
Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com> wrote:

> +static struct
> +{
> +	rte_net_crc_handler f[RTE_NET_CRC_REQS];
> +} handlers_dpdk26[RTE_NET_CRC_AVX512 + 1];
> +

Should have { after the struct

+void rte_net_crc_free(struct rte_net_crc *crc)
+{
+	rte_free(crc);
+}

Add rte_net_crc_free to the coccinelle script that checks for null free.
Also add function attributes please.

> diff --git a/lib/net/rte_net_crc.h b/lib/net/rte_net_crc.h
> index 72d3e10ff6..ffac8c2f1f 100644
> --- a/lib/net/rte_net_crc.h
> +++ b/lib/net/rte_net_crc.h
> @@ -1,5 +1,5 @@
>  /* SPDX-License-Identifier: BSD-3-Clause
> - * Copyright(c) 2017-2020 Intel Corporation
> + * Copyright(c) 2017-2025 Intel Corporation
>   */

Not sure what DPDK policy is around copyright date updates.
The Linux kernel has said no to this (excess churn).

> +struct rte_net_crc *rte_net_crc_set_alg_v26(enum rte_net_crc_alg alg,
> +	enum rte_net_crc_type type)

Since this now an allocator should add function attributes __rte_malloc
and __rte_dealloc(rte_crc_free, 1).


> +{
> +	uint16_t max_simd_bitwidth;
> +	struct rte_net_crc *crc;
> +
> +	crc = rte_zmalloc(NULL, sizeof(struct rte_net_crc), 0);
> +	if (crc == NULL)
> +		return NULL;

Are you using rte_malloc here because it can be shared between primary/secondary?
Otherwise regular malloc has more checks.

  reply	other threads:[~2025-02-10 19:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01 18:11 [PATCH v2 0/3] net: add thread-safe crc api Arkadiusz Kusztal
2024-10-01 18:11 ` [PATCH v2 1/3] " Arkadiusz Kusztal
2024-10-01 21:44   ` Stephen Hemminger
2024-10-02  8:28     ` Kusztal, ArkadiuszX
2024-10-02  7:42   ` David Marchand
2024-10-02  8:41     ` Kusztal, ArkadiuszX
2024-10-02  9:01       ` David Marchand
2024-10-02  9:16         ` Kusztal, ArkadiuszX
2024-10-08  3:42   ` Ferruh Yigit
2024-10-08 20:51     ` Kusztal, ArkadiuszX
2024-10-09  1:03       ` Ferruh Yigit
2024-10-09  7:48         ` Kusztal, ArkadiuszX
2024-10-09  9:11           ` Ferruh Yigit
2025-02-06 20:54         ` Kusztal, ArkadiuszX
2024-12-02 22:36   ` Stephen Hemminger
2025-02-06 20:43     ` Kusztal, ArkadiuszX
2025-02-06 20:38   ` [PATCH v3] " Arkadiusz Kusztal
2025-02-07  6:37     ` [PATCH v4] " Arkadiusz Kusztal
2025-02-07 17:12       ` Stephen Hemminger
2025-02-07 17:37         ` Kusztal, ArkadiuszX
2025-02-07 18:24       ` [PATCH v5] " Arkadiusz Kusztal
2025-02-10 19:57         ` Stephen Hemminger [this message]
2025-02-10 21:32           ` Kusztal, ArkadiuszX
2025-02-10 21:27         ` [PATCH v6] " Arkadiusz Kusztal
2025-02-11  6:23           ` Stephen Hemminger
2025-02-11  8:35             ` Kusztal, ArkadiuszX
2025-02-11  9:02           ` [PATCH v7] " Arkadiusz Kusztal
2024-10-01 18:11 ` [PATCH v2 2/3] crypto/qat: use process safe " Arkadiusz Kusztal
2024-10-01 18:11 ` [PATCH v2 3/3] test/crc: replace thread-unsafe api functions Arkadiusz Kusztal
2024-12-02 22:33   ` Stephen Hemminger

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=20250210115727.4e2570dd@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=arkadiuszx.kusztal@intel.com \
    --cc=brian.dooley@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=kai.ji@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.