[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <PH0PR11MB58302B9F3C23B4BBEB7BAACCD8D52@PH0PR11MB5830.namprd11.prod.outlook.com>
Date: Fri, 7 Mar 2025 14:20:49 +0000
From: "Song, Yoong Siang" <yoong.siang.song@...el.com>
To: "Bouska, Zdenek" <zdenek.bouska@...mens.com>, "David S . Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Simon Horman
<horms@...nel.org>, Willem de Bruijn <willemb@...gle.com>, "Bezdeka, Florian"
<florian.bezdeka@...mens.com>, Donald Hunter <donald.hunter@...il.com>,
Jonathan Corbet <corbet@....net>, Bjorn Topel <bjorn@...nel.org>, "Karlsson,
Magnus" <magnus.karlsson@...el.com>, "Fijalkowski, Maciej"
<maciej.fijalkowski@...el.com>, Jonathan Lemon <jonathan.lemon@...il.com>,
Andrew Lunn <andrew+netdev@...n.ch>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, Jesper Dangaard Brouer
<hawk@...nel.org>, John Fastabend <john.fastabend@...il.com>, "Damato, Joe"
<jdamato@...tly.com>, Stanislav Fomichev <sdf@...ichev.me>, Xuan Zhuo
<xuanzhuo@...ux.alibaba.com>, Mina Almasry <almasrymina@...gle.com>, "Daniel
Jurgens" <danielj@...dia.com>, Andrii Nakryiko <andrii@...nel.org>, "Eduard
Zingerman" <eddyz87@...il.com>, Mykola Lysenko <mykolal@...com>, "Martin
KaFai Lau" <martin.lau@...ux.dev>, Song Liu <song@...nel.org>, Yonghong Song
<yonghong.song@...ux.dev>, KP Singh <kpsingh@...nel.org>, Hao Luo
<haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>, Shuah Khan
<shuah@...nel.org>, Alexandre Torgue <alexandre.torgue@...s.st.com>, "Jose
Abreu" <joabreu@...opsys.com>, Maxime Coquelin <mcoquelin.stm32@...il.com>,
"Nguyen, Anthony L" <anthony.l.nguyen@...el.com>, "Kitszel, Przemyslaw"
<przemyslaw.kitszel@...el.com>, Faizal Rahim
<faizal.abdul.rahim@...ux.intel.com>, Choong Yong Liang
<yong.liang.choong@...ux.intel.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"linux-stm32@...md-mailman.stormreply.com"
<linux-stm32@...md-mailman.stormreply.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "intel-wired-lan@...ts.osuosl.org"
<intel-wired-lan@...ts.osuosl.org>, "xdp-hints@...-project.net"
<xdp-hints@...-project.net>
Subject: RE: [PATCH bpf-next v12 5/5] igc: Add launch time support to XDP ZC
On Friday, March 7, 2025 9:25 PM, Bouska, Zdenek <zdenek.bouska@...mens.com> wrote:
[...]
>> @@ -2996,7 +3035,13 @@ static void igc_xdp_xmit_zc(struct igc_ring *ring)
>> ntu = ring->next_to_use;
>> budget = igc_desc_unused(ring);
>>
>> - while (xsk_tx_peek_desc(pool, &xdp_desc) && budget--) {
>> + /* Packets with launch time require one data descriptor and one context
>> + * descriptor. When the launch time falls into the next Qbv cycle, we
>> + * may need to insert an empty packet, which requires two more
>> + * descriptors. Therefore, to be safe, we always ensure we have at least
>> + * 4 descriptors available.
>> + */
>> + while (xsk_tx_peek_desc(pool, &xdp_desc) && budget >= 4) {
>
>I think that here is a bug: some frames could be missed if budget < 4.
>I was able to reproduce it by sending 100000x 60 B frames with minimal IPG
>(672 ns between starts of frames) on 1Gbit/s. Always 1026 frames were not sent
>and were missing a AF_XDP competition. Interesting was that then even when I
>sent more
>frames for hours it still was 1026 frames not sent and missing competition.
>
>Bug seems to be fixed when I change this line to:
>
> while (budget >= 4 && xsk_tx_peek_desc(pool, &xdp_desc)) {
>
>Do you think this is a good fix?
>
>I think this bug is also in original code base, but I was only able to reproduce
>it with launch time.
>
Thank you for pointing out this issue and for providing a detailed
explanation of your findings. I personally agree with your proposed fix
that make sure there is enough budget in the driver, before go peek the xsk
descriptor. Do you plan to submit bug fix patch to iwl-net?
Best regards,
Siang
Powered by blists - more mailing lists