Article View: linux.kernel.netdev
Article #6832Re: [PATCH net-next v3 6/7] net: mctp: usblib: Add initial kunit tx tests
From: Geert Uytterhoeven
Date: Fri, 23 Oct 2026 13:39
Date: Fri, 23 Oct 2026 13:39
68 lines
12898 bytes
12898 bytes
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
Technical Details
Message-ID:
<CAMuHMdXTGGdGWZ9sKz5_sQF1237gV844cEhkXr6v_TUHPOb78Q@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351086-linux-kernel-netdev=dewy.ruReferences:
<20261014-dev-mctp-usb-lib-test-v3-0-ee5bc3ea1db1@codeconstruct.com.au> <20261014-dev-mctp-usb-lib-test-v3-6-ee5bc3ea1db1@codeconstruct.com.au>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351086-linux-kernel-netdev=dewy.ru
From: geert@linux-m68k.org (Geert Uytterhoeven)
Newsgroups: linux.kernel.netdev
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
Organization: Usenet Network
Message-ID: <CAMuHMdXTGGdGWZ9sKz5_sQF1237gV844cEhkXr6v_TUHPOb78Q@mail.gmail.com>
References: <20261014-dev-mctp-usb-lib-test-v3-0-ee5bc3ea1db1@codeconstruct.com.au>
<20261014-dev-mctp-usb-lib-test-v3-6-ee5bc3ea1db1@codeconstruct.com.au>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: usenet.network;
logging-data="512400"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:jXBo0e83X9ma4KlSQUg94LyayhU= sha256:+Hij072l1TpAxL3/65s4J5daRASSJe56Rs0IRT+8miQ=
sha1:1SOO6lH/0fWGnqMghx7/B1yPtTQ= sha256:q/oZiKlPf+BYXixlvNtoQ+2kS3g0Pzm70GxEBytFTIY=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 166091114C0; Fri, 23 Oct 2026 16:46:46 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.95
X-Spam-Status: No, score=-2.95 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id Vq5X4skwGLrF;
Fri, 23 Oct 2026 16:46:43 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-351086-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=linux-m68k.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id C41DF111489; Fri, 23 Oct 2026 16:46:39 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id F111846C7F; Fri, 23 Oct 2026 13:39:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1792762766;
b=5TfD2xTkoYpTnPLi75/s+jdXl9aRLTJsjD/y7jYyUBAXVAOVF3QYX94X5OWfJnohMp9f
Bg+fwguS510HR8r81QgBpNKrZr6tFFmGVtkVBtI1Nnos/kUMwrqQQtRf3LP1Q7l1ZUnax
It8CBVLLdS8aK25wE7zDiXdjlj32a8LCfnO5N5UOTFZzlp3YNnH2KqnIVtxyJEJ2+AVv9
jaOO8IguMGwdCg19ZZ72+IKaHR8vPYn0K1yorTsRnIod5LAE+dGGIWN2wkc6HeiTYRKdp
NAGmROikHKo/0gS2BubRvS5mIznpKxDNv1A6WjkByGoqe/YLJEKXVx4BNVc2Ogt68gA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792762766;
h=X-Original-To:Received:DMARC-Filter:Received:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
Received:X-Forwarded-Encrypted:X-Received:X-Mailing-List:List-Id:
List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
Precedence:MIME-Version:References:In-Reply-To:From:Date:
X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
Content-Type;
bh=q/FXb9aWk8RMV4mySgy4meuQjo/Ip780RyKlEE+DHWA=;
b=A0F1tSvW6H31CGrJwmEwn/ET9XWwAqBeCC/VaFl5uYUaSShz6/EjQ0dCRVjajHLuT3OU
BI4OitFBPLVx7OoBFpEVl2S5g04SxEMu/MLT2RIV6dYEEHlByyp8ryj7xw/8T1lzWxq2C
IFuvugwGfC9MCvVYOUigu1+wdPC9c6RPHoAFa53xmUroyOBebbgD9LcV91O4+As9YVsdw
ZNr2m1IouWcXw20xhEbeEBGiIjrTbTOzFdpi5cLPO++TUZL82fOQv33aLnnuGoumFg23X
tWCJsy3dJsPBDSuXB83S8L1yAQw9uTcKSo5zC0cRm8+hAbSFCJrx938Jhp9jJ82eV8A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dmarc=none header.from=linux-m68k.org;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 4EBBE606A33B;
Fri, 23 Oct 2026 13:39:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.45
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792762765;
b=mhu93Lu8T+zlmUlYwrjHxoNs8K5i7aGM0JPhm5C8nx5MEIBCX6yZAv2/UYvmUiGwSqst
rk1tHCa/vnR/0g2RY34TDFDlYQ6LhIp97nnlDTjvrI1XVAL8uM/OLEowdlGXyTBFEzegB
l028g1TYbPqjLwO9wyleyAsdTzZerlxDM9w/vbSkuelDZpgW5O/UvadFuV+2NevxHZg8t
kJIJO3F7W+GEWim36di6KITX2ApsWwnJaA3Pn/cU6qI+U1dnKRQaXoxfKjBq6fr9g10cr
PmfB9EmzM4Icaren/oT8SzeEX+bHYX48udZSx4TuLc2jFTOk/kIK7bkBGgPwoVeBLbg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792762765;
h=DMARC-Filter:Received:X-Google-DKIM-Signature:X-Forwarded-Encrypted:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Received:
X-Forwarded-Encrypted:X-Received:MIME-Version:References:In-Reply-To:
From:Date:X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:
Subject:To:Cc:Content-Type;
bh=q/FXb9aWk8RMV4mySgy4meuQjo/Ip780RyKlEE+DHWA=;
b=NQFzZWs/GG99MFItyMNortRJWE06D2lwK3LOhZ8fcptNSdLCDoixedhhNNijPepwLJIl
By/FjznsvpB6J5/jGmqhEa7YwhkbCqNXagFk84TckpK0/mK3ypX9W3FkRsV841FWwRIM3
HCV73WAuJBF2GU4aB8fGCyopphFzMaHOxbXN0dFbQbZLL9tXYP4ZM/2dptenoQAMhnC0y
/cce2J7bXV7yh3yInkd5dIyAjZCQ2r9nnsSUslmVlhyoeFRQLMQNxO8cPivBgiVBlUNJh
ThYWwZY0APdQMTAQifk1YcaUWzx+gYU9V+chFma0pfiEQyorhLcnt1vqNj3dggmodug==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=none header.from=linux-m68k.org;
spf=pass smtp.mailfrom=gmail.com;
arc=none smtp.remote-ip=209.85.218.45
X-Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39300606A32A
for <netdev@vger.kernel.org>; Fri, 23 Oct 2026 13:39:25 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 39300606A32A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-c40e02b2ebaso144049666b.1
for <netdev@vger.kernel.org>; Fri, 23 Oct 2026 06:39:25 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792762764; x=1793367564;
h=content-type:cc:to:subject:message-id:date:from:in-reply-to
:references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to:content-type;
bh=q/FXb9aWk8RMV4mySgy4meuQjo/Ip780RyKlEE+DHWA=;
b=Y6Ir9jceO3WvFnJ1D/1cWGZBVkHXMMsKDv0BaSPLWRT3daAugxKTRgZkkn0FM0B6f3
O5i0/5ethwv7LyZgcA23z0hUoFEGmVZXgGASIGVE9ldvantE4lDwsRzFfknTsX6pbovk
UUUS6ICArQ/qoD6a45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EA==
X-Received: by 2002:a17:907:3e29:b0:c42:bc58:f26 with SMTP id a640c23a62f3a-c46a93d3068mr340891766b.26.1792762763495;
Fri, 23 Oct 2026 06:39:23 -0700 (PDT)
X-Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com. [209.85.208.52])
by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c46b8bc4c97sm2102366b.46.2026.10.23.06.39.20
for <netdev@vger.kernel.org>
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Fri, 23 Oct 2026 06:39:22 -0700 (PDT)
X-Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-6b2232d8ef5so1390987a12.3
for <netdev@vger.kernel.org>; Fri, 23 Oct 2026 06:39:20 -0700 (PDT)
X-Forwarded-Encrypted: i=1; AKwUvBymWsb1TV5Ltw/1wiS0UrgCGd6pTC1bXMqMUr5RVsDLxB7p19rjjS3K0D8QJZMn9ryHtpPArq0=@vger.kernel.org
X-Received: by 2002:a05:6402:1f11:b0:6b1:d148:5a0a with SMTP id
4fb4d7f45d1cf-6b432be9346mr3876276a12.19.1792762760594; Fri, 23 Oct 2026
06:39:20 -0700 (PDT)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261014-dev-mctp-usb-lib-test-v3-6-ee5bc3ea1db1@codeconstruct.com.au>
X-Gmail-Original-Message-ID: <CAMuHMdXTGGdGWZ9sKz5_sQF1237gV844cEhkXr6v_TUHPOb78Q@mail.gmail.com>
X-Gm-Features: AclHuK_taSWkqoWJ55TGYbrilVkTwq1Avu2z2PyWM4RMVHph7TJaMbjqEHNy60Q
X-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