mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: James Lee <james@codeconstruct.com.au>
Cc: Jeremy Kerr <jk@codeconstruct.com.au>,
	Matt Johnston <matt@codeconstruct.com.au>,
	 Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	 Kees Cook <kees@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	netdev@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH net-next v3 6/7] net: mctp: usblib: Add initial kunit tx tests
Date: Fri, 23 Oct 2026 15:39:06 +0200	[thread overview]
Message-ID: <CAMuHMdXTGGdGWZ9sKz5_sQF1237gV844cEhkXr6v_TUHPOb78Q@mail.gmail.com> (raw)
In-Reply-To: <20261014-dev-mctp-usb-lib-test-v3-6-ee5bc3ea1db1@codeconstruct.com.au>

Hi James,

On Wed, 14 Oct 2026 at 06:54, James Lee <james@codeconstruct.com.au> wrote:
> Add tests for the transmit path, where MCTP packets are handed to
> outgoing USB transfer data. Testing a spanning transfer that is expected
> to succeed, the failure paths when sends fail, and large sequential
> sends.
>
> Signed-off-by: James Lee <james@codeconstruct.com.au>
>
> ---
> v2:
> - Correct flex array reference
> - Simply return when mctp_usblib_test_tx_send() fails
> - Use skb_put_data() instead of manual assignment
> - Remember span parameter exists

Thanks for your patch, which is now commit 1e12f734afc10477 ("net:
mctp: usblib: Add initial kunit tx tests") upstream.

> --- a/drivers/net/mctp/mctp-usblib-test.c
> +++ b/drivers/net/mctp/mctp-usblib-test.c

> +
> +/* Test sending multiple packets in the same transfer, followed by one that
> + * spans multiple subsequent transfers.
> + */
> +static void mctp_usblib_test_tx_multi_push(struct kunit *test)
> +{
> +       struct mctp_usblib_test_ctx *ctx;
> +       size_t i, max_length, tx_length;
> +       struct mctp_usblib_tx_ops ops;
> +       u8 *buf, *flat_tx, *index;
> +       struct mctp_usblib_tx *tx;
> +       struct net_device *ndev;
> +       struct sk_buff *skb;
> +       const struct {
> +               size_t len;
> +               bool more;
> +       } sends[] = {
> +               { 1000, true  },
> +               {  500, false },
> +               { 5000, false },
> +       };
> +       int rc;
> +
> +       static_assert(!sends[ARRAY_SIZE(sends) - 1].more,
> +                     "The last push must claim there will be no more");

This fails with gcc-14 (the latest available in Ubuntu 24.04LTS)
and earlier:

drivers/net/mctp/mctp-usblib-test.c:819:23: error: expression in
static assertion is not constant
  819 |         static_assert(!sends[ARRAY_SIZE(sends) - 1].more,
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2026-10-23 13:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14  4:47 [PATCH net-next v3 0/7] net: mctp: usblib: Increase coverage of kunit testing James Lee
2026-10-14  4:47 ` [PATCH net-next v3 1/7] net: mctp: usblib: Add to parameterized kunit tests James Lee
2026-10-14  4:47 ` [PATCH net-next v3 2/7] net: mctp: usblib: Add test for splits inside headers James Lee
2026-10-14  4:47 ` [PATCH net-next v3 3/7] net: mctp: usblib: Add tests of invalid headers James Lee
2026-10-14  4:47 ` [PATCH net-next v3 4/7] net: mctp: usblib: Complete rx tests James Lee
2026-10-14  4:47 ` [PATCH net-next v3 5/7] net: mctp: usblib: Simplify allocation logic in mctp_usblib_test_rx_init James Lee
2026-10-14  4:47 ` [PATCH net-next v3 6/7] net: mctp: usblib: Add initial kunit tx tests James Lee
2026-10-23 13:39   ` Geert Uytterhoeven [this message]
2026-10-26  2:24     ` James Lee
2026-10-14  4:47 ` [PATCH net-next v3 7/7] net: mctp: usblib: Add test for failing append James Lee
2026-10-20 21:30 ` [PATCH net-next v3 0/7] net: mctp: usblib: Increase coverage of kunit testing patchwork-bot+netdevbpf

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=CAMuHMdXTGGdGWZ9sKz5_sQF1237gV844cEhkXr6v_TUHPOb78Q@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gustavoars@kernel.org \
    --cc=james@codeconstruct.com.au \
    --cc=jk@codeconstruct.com.au \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeconstruct.com.au \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®