public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Stephen Hemminger" <stephen@networkplumber.org>,
	"Daniel Gregory" <code@danielg0.com>
Cc: "Stanisław Kardach" <stanislaw.kardach@gmail.com>,
	dev@dpdk.org, "Punit Agrawal" <punit.agrawal@bytedance.com>,
	"Liang Ma" <liangma@liangbit.com>,
	"Pengcheng Wang" <wangpengcheng.pp@bytedance.com>,
	"Chunsong Feng" <fengchunsong@bytedance.com>,
	"Daniel Gregory" <daniel.gregory@bytedance.com>,
	"Sun Yuechi" <sunyuechi@iscas.ac.cn>
Subject: RE: [PATCH v4 00/10] riscv: implement accelerated crc using zbc
Date: Sun, 22 Feb 2026 20:42:29 +0100	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35F6573B@smartserver.smartshare.dk> (raw)
In-Reply-To: <20260222100313.5fd90e0c@phoenix.local>

> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Sunday, 22 February 2026 19.03
> 
> On Sun, 22 Feb 2026 16:29:54 +0100
> Daniel Gregory <code@danielg0.com> wrote:
> 
> > The RISC-V Zbc extension adds instructions for carry-less
> multiplication
> > we can use to implement CRC in hardware. This patch set contains two
> new
> > implementations:
> >
> > - one in lib/hash/rte_crc_riscv64.h that uses a Barrett reduction to
> >   implement the four rte_hash_crc_* functions
> > - one in lib/net/net_crc_zbc.c that uses repeated single-folds to
> reduce
> >   the buffer until it is small enough for a Barrett reduction to
> >   implement rte_crc16_ccitt_zbc_handler and rte_crc32_eth_zbc_handler
> >
> 
> AI patch review summary: the overall approach looks good — the hwprobe
> integration is clean and the Barrett reduction math appears correct.
> A few issues need addressing before this can be merged:
> 
> 1. [ERROR, patch 01] 1 << n used for all 26 HWCAP mask entries
> 
>    The feature table entries now store masks in a uint64_t field, but
>    all 26 existing RISCV_ISA_* entries still use plain '1 << n' (signed
>    int). This produces 32-bit values stored in a 64-bit field and
> causes
>    undefined behaviour for n >= 31. All entries must use UINT64_C(1) <<
> n:
> 
>      FEAT_DEF(RISCV_ISA_A, REG_HWCAP, UINT64_C(1) <<  0)
>      ...
>      FEAT_DEF(RISCV_ISA_Z, REG_HWCAP, UINT64_C(1) << 25)

Furthermore, RTE_BIT64(25) [1] is preferred over UINT64_C(1) << 25.

[1]: https://elixir.bootlin.com/dpdk/v25.11/source/lib/eal/include/rte_bitops.h#L36

It seems the AI missed this preference.


  reply	other threads:[~2026-02-22 19:42 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18 17:41 [PATCH 0/5] riscv: implement accelerated crc using zbc Daniel Gregory
2024-06-18 17:41 ` [PATCH 1/5] config/riscv: add flag for using Zbc extension Daniel Gregory
2024-06-18 20:03   ` Stephen Hemminger
2024-06-19  7:08     ` Morten Brørup
2024-06-19 14:49       ` Stephen Hemminger
2024-06-19 16:41       ` Daniel Gregory
2024-10-07  8:14         ` Stanisław Kardach
2024-10-07 15:20           ` Stephen Hemminger
2024-10-08  5:52             ` Stanisław Kardach
2024-10-08 15:35               ` Stephen Hemminger
2024-06-18 17:41 ` [PATCH 2/5] hash: implement crc using riscv carryless multiply Daniel Gregory
2024-06-18 17:41 ` [PATCH 3/5] net: " Daniel Gregory
2024-06-18 17:41 ` [PATCH 4/5] examples/l3fwd: use accelerated crc on riscv Daniel Gregory
2024-06-18 17:41 ` [PATCH 5/5] ipfrag: " Daniel Gregory
2024-07-12 15:46 ` [PATCH v2 0/9] riscv: implement accelerated crc using zbc Daniel Gregory
2024-07-12 15:46   ` [PATCH v2 1/9] config/riscv: detect presence of Zbc extension Daniel Gregory
2024-07-12 15:46   ` [PATCH v2 2/9] hash: implement crc using riscv carryless multiply Daniel Gregory
2024-07-12 15:46   ` [PATCH v2 3/9] net: " Daniel Gregory
2024-07-12 15:46   ` [PATCH v2 4/9] config/riscv: add qemu crossbuild target Daniel Gregory
2024-07-12 15:46   ` [PATCH v2 5/9] examples/l3fwd: use accelerated crc on riscv Daniel Gregory
2024-07-12 15:46   ` [PATCH v2 6/9] ipfrag: " Daniel Gregory
2024-07-12 15:46   ` [PATCH v2 7/9] examples/l3fwd-power: " Daniel Gregory
2024-07-12 15:46   ` [PATCH v2 8/9] hash/cuckoo: " Daniel Gregory
2024-07-12 15:46   ` [PATCH v2 9/9] member: " Daniel Gregory
2024-07-12 17:19   ` [PATCH v2 0/9] riscv: implement accelerated crc using zbc David Marchand
2024-08-27 15:32   ` [PATCH v3 " Daniel Gregory
2024-08-27 15:32     ` [PATCH v3 1/9] config/riscv: detect presence of Zbc extension Daniel Gregory
2024-08-27 15:32     ` [PATCH v3 2/9] hash: implement CRC using riscv carryless multiply Daniel Gregory
2024-08-27 15:32     ` [PATCH v3 3/9] net: " Daniel Gregory
2024-08-27 15:32     ` [PATCH v3 4/9] config/riscv: add qemu crossbuild target Daniel Gregory
2024-08-27 15:36     ` [PATCH v3 5/9] examples/l3fwd: use accelerated CRC on riscv Daniel Gregory
2024-08-27 15:36       ` [PATCH v3 6/9] ipfrag: " Daniel Gregory
2024-08-27 15:36       ` [PATCH v3 7/9] examples/l3fwd-power: " Daniel Gregory
2024-08-27 15:36       ` [PATCH v3 8/9] hash/cuckoo: " Daniel Gregory
2024-08-27 15:36       ` [PATCH v3 9/9] member: " Daniel Gregory
2024-09-17 14:26     ` [PATCH v3 0/9] riscv: implement accelerated crc using zbc Daniel Gregory
2025-11-17  4:47       ` sunyuechi
2026-01-13  1:07     ` Stephen Hemminger
2026-02-22 15:29     ` [PATCH v4 00/10] " Daniel Gregory
2026-02-22 15:29       ` [PATCH v4 01/10] config/riscv: detect presence of Zbc extension Daniel Gregory
2026-02-22 15:29       ` [PATCH v4 02/10] hash: implement CRC using riscv carryless multiply Daniel Gregory
2026-02-22 15:29       ` [PATCH v4 03/10] net: " Daniel Gregory
2026-02-22 15:29       ` [PATCH v4 04/10] config/riscv: add qemu crossbuild target Daniel Gregory
2026-02-22 15:29       ` [PATCH v4 05/10] examples/l3fwd: use accelerated CRC on riscv Daniel Gregory
2026-02-22 15:30       ` [PATCH v4 06/10] ipfrag: " Daniel Gregory
2026-02-22 15:30       ` [PATCH v4 07/10] examples/l3fwd-power: " Daniel Gregory
2026-02-22 15:30       ` [PATCH v4 08/10] hash: " Daniel Gregory
2026-02-22 15:30       ` [PATCH v4 09/10] member: " Daniel Gregory
2026-02-22 15:30       ` [PATCH v4 10/10] doc: implement CRC using riscv carryless multiply Daniel Gregory
2026-02-22 18:03       ` [PATCH v4 00/10] riscv: implement accelerated crc using zbc Stephen Hemminger
2026-02-22 19:42         ` Morten Brørup [this message]
2026-03-23  5:42       ` dangshiwei
2026-03-29 18:22       ` 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=98CBD80474FA8B44BF855DF32C47DC35F6573B@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=code@danielg0.com \
    --cc=daniel.gregory@bytedance.com \
    --cc=dev@dpdk.org \
    --cc=fengchunsong@bytedance.com \
    --cc=liangma@liangbit.com \
    --cc=punit.agrawal@bytedance.com \
    --cc=stanislaw.kardach@gmail.com \
    --cc=stephen@networkplumber.org \
    --cc=sunyuechi@iscas.ac.cn \
    --cc=wangpengcheng.pp@bytedance.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