DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Joshua Washington <joshwash@google.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v2 00/14] Introduce RTE_DIV_ROUND_UP
Date: Mon, 21 Sep 2026 17:36:38 -0700	[thread overview]
Message-ID: <20260921173638.0e3cbea5@phoenix.local> (raw)
In-Reply-To: <20260813172241.964736-1-joshwash@google.com>

On Thu, 13 Aug 2026 10:22:25 -0700
Joshua Washington <joshwash@google.com> wrote:

> Numerous drivers independently define the DIV_ROUND_UP macro, using the
> same definition. Attempt to commonize by introducing RTE_DIV_ROUND_UP to
> rte_common.h and replacing usages of DIV_ROUND_UP with RTE_DIV_ROUND_UP.


Looks ok, predates use of AI review, so ran it manually.

The biggest issue reported is tat changing base/ code here
is problematic. You can do it a base/ wrapper header but
not directly at call sites.

Tested: applies cleanly to main, builds with -Werror on x86/gcc for all
touched drivers, and no DIV_ROUND_UP users remain.

Patch 1:

    Needs a test in app/test/test_common.c (exact, remainder, n=0, d=1).
    Needs a release notes entry.
    Doxygen should document the params and the caveats: d evaluated twice,
    unsigned only, and n + d - 1 can wrap (RTE_DIV_ROUND_UP(UINT32_MAX, 2)
    on uint32_t is 0). Consider ((n) / (d) + ((n) % (d) != 0)) instead.
    DIV_CEIL in app/test/test_compressdev.c and
    app/test-compress-perf/comp_perf_test_common.c could be converted too.

Base code (qede, cxgbe, ena):
Please don't edit call sites under base/. That code is synced from
vendor trees (ena-com is shared with Linux and FreeBSD) and this will
conflict on the next update. Do what i40e/ice/idpf did: keep
#define DIV_ROUND_UP(n, d) RTE_DIV_ROUND_UP(n, d)
in the osdep/platform header and leave base/ alone.

Minor:

    qede, nfp: drop the rewraps; the original lines fit in 100 columns.
    hinic: the "X must be nonnegative" comment is lost; move it to the
    rte_common.h doxygen.
    ena: leaves a double blank line in ena_plat_dpdk.h.
    13/14: subject should be "net/nfp:", not "drivers:".

The osdep-only patches (i40e, idpf, ice, hns3, bnx2x, ifpga, procinfo)
look fine.

  parent reply	other threads:[~2026-09-22  0:36 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 22:30 [PATCH] eal: introduce division round up macro Joshua Washington
2026-08-13  1:29 ` Stephen Hemminger
2026-08-13 17:22 ` [PATCH v2 00/14] Introduce RTE_DIV_ROUND_UP Joshua Washington
2026-08-13 17:22   ` [PATCH v2 01/14] eal: introduce division round up macro Joshua Washington
2026-08-13 17:22   ` [PATCH v2 02/14] net/i40e: use common " Joshua Washington
2026-08-13 17:22   ` [PATCH v2 03/14] net/idpf: " Joshua Washington
2026-08-13 17:22   ` [PATCH v2 04/14] net/ice: " Joshua Washington
2026-08-13 17:22   ` [PATCH v2 05/14] net/qede: " Joshua Washington
2026-08-13 17:22   ` [PATCH v2 06/14] net/rnp: " Joshua Washington
2026-08-13 17:22   ` [PATCH v2 07/14] net/hns3: " Joshua Washington
2026-08-13 17:22   ` [PATCH v2 08/14] net/hinic: " Joshua Washington
2026-08-13 17:22   ` [PATCH v2 09/14] net/bnx2x: " Joshua Washington
2026-08-13 17:22   ` [PATCH v2 10/14] net/cxgbe: " Joshua Washington
2026-08-13 17:22   ` [PATCH v2 11/14] net/ena: " Joshua Washington
2026-08-13 17:22   ` [PATCH v2 12/14] raw/ifpga/base: " Joshua Washington
2026-08-13 17:22   ` [PATCH v2 13/14] drivers: " Joshua Washington
2026-08-13 17:22   ` [PATCH v2 14/14] app/procinfo: " Joshua Washington
2026-08-15 15:32   ` [PATCH v2 00/14] Introduce RTE_DIV_ROUND_UP Stephen Hemminger
2026-09-22  0:36   ` Stephen Hemminger [this message]
2026-09-23  1:07 ` [PATCH v3 00/16] " Joshua Washington
2026-09-23  1:07   ` [PATCH v3 01/16] eal: introduce division round up macro Joshua Washington
2026-09-23  7:29     ` Bruce Richardson
2026-09-24  7:47     ` fengchengwen
2026-09-23  1:07   ` [PATCH v3 02/16] net/i40e: use common " Joshua Washington
2026-09-23  7:30     ` Bruce Richardson
2026-09-23  7:35       ` Bruce Richardson
2026-09-29 22:44         ` Joshua Washington
2026-09-30  7:31           ` Bruce Richardson
2026-09-23  1:07   ` [PATCH v3 03/16] net/idpf: " Joshua Washington
2026-09-23  7:31     ` Bruce Richardson
2026-09-23  1:07   ` [PATCH v3 04/16] net/ice: " Joshua Washington
2026-09-23  7:31     ` Bruce Richardson
2026-09-23  1:07   ` [PATCH v3 05/16] net/qede: " Joshua Washington
2026-09-23  1:07   ` [PATCH v3 06/16] net/rnp: " Joshua Washington
2026-09-23  1:07   ` [PATCH v3 07/16] net/hns3: " Joshua Washington
2026-09-24  7:48     ` fengchengwen
2026-09-23  1:07   ` [PATCH v3 08/16] net/hinic: " Joshua Washington
2026-09-23  1:07   ` [PATCH v3 09/16] net/bnx2x: " Joshua Washington
2026-09-23  1:07   ` [PATCH v3 10/16] net/cxgbe: " Joshua Washington
2026-09-23  1:07   ` [PATCH v3 11/16] net/ena: " Joshua Washington
2026-09-23  1:07   ` [PATCH v3 12/16] raw/ifpga/base: " Joshua Washington
2026-09-23  1:07   ` [PATCH v3 13/16] net/nfp: " Joshua Washington
2026-09-23  1:07   ` [PATCH v3 14/16] app/procinfo: " Joshua Washington
2026-09-24  7:49     ` fengchengwen
2026-09-23  1:07   ` [PATCH v3 15/16] app/test: " Joshua Washington
2026-09-23  7:36     ` Bruce Richardson
2026-09-24  7:51     ` fengchengwen
2026-09-23  1:07   ` [PATCH v3 16/16] app/test-compress-perf: " Joshua Washington
2026-09-23  7:36     ` Bruce Richardson
2026-09-24  7:51     ` fengchengwen
2026-09-23 17:32   ` [PATCH v3 00/16] Introduce RTE_DIV_ROUND_UP Stephen Hemminger
2026-10-06  2:30   ` [PATCH v4 00/15] " Joshua Washington
2026-10-06  2:30     ` [PATCH v4 01/15] eal: introduce division round up macro Joshua Washington
2026-10-06  2:30     ` [PATCH v4 02/15] net/i40e: use common " Joshua Washington
2026-10-06  2:30     ` [PATCH v4 03/15] net/idpf: " Joshua Washington
2026-10-06  2:30     ` [PATCH v4 04/15] net/ice: " Joshua Washington
2026-10-06  2:30     ` [PATCH v4 05/15] net/qede: " Joshua Washington
2026-10-06  2:30     ` [PATCH v4 06/15] net/rnp: " Joshua Washington
2026-10-06  2:30     ` [PATCH v4 07/15] net/hns3: " Joshua Washington
2026-10-06  2:30     ` [PATCH v4 08/15] net/hinic: " Joshua Washington
2026-10-06  2:30     ` [PATCH v4 09/15] net/bnx2x: " Joshua Washington
2026-10-06  2:30     ` [PATCH v4 10/15] net/cxgbe: " Joshua Washington
2026-10-06  2:30     ` [PATCH v4 11/15] net/ena: " Joshua Washington
2026-10-06  2:30     ` [PATCH v4 12/15] net/nfp: " Joshua Washington
2026-10-06  2:30     ` [PATCH v4 13/15] app/procinfo: " Joshua Washington
2026-10-06  2:30     ` [PATCH v4 14/15] app/test: " Joshua Washington
2026-10-06  2:30     ` [PATCH v4 15/15] app/test-compress-perf: " Joshua Washington
2026-10-06 16:38     ` [PATCH v4 00/15] Introduce RTE_DIV_ROUND_UP Stephen Hemminger
2026-10-07 20:21       ` Thomas Monjalon

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=20260921173638.0e3cbea5@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=joshwash@google.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