RE: [Intel-wired-lan] [PATCH iwl-next v4 09/15] idpf: refactor idpf to use libie control queues
From: Salin, Samuel
Date: Tue Jun 10 2025 - 17:51:51 EST
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf Of
> Larysa Zaremba
> Sent: Friday, May 16, 2025 7:58 AM
> To: intel-wired-lan@xxxxxxxxxxxxxxxx; Nguyen, Anthony L
> <anthony.l.nguyen@xxxxxxxxx>
> Cc: David S. Miller <davem@xxxxxxxxxxxxx>; Eric Dumazet
> <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni
> <pabeni@xxxxxxxxxx>; Simon Horman <horms@xxxxxxxxxx>; Jonathan
> Corbet <corbet@xxxxxxx>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@xxxxxxxxx>; Jiri Pirko <jiri@xxxxxxxxxxx>; Nikolova, Tatyana
> E <tatyana.e.nikolova@xxxxxxxxx>; Andrew Lunn <andrew+netdev@xxxxxxx>;
> Lobakin, Aleksander <aleksander.lobakin@xxxxxxxxx>; Michael Ellerman
> <mpe@xxxxxxxxxxxxxx>; Fijalkowski, Maciej <maciej.fijalkowski@xxxxxxxxx>;
> Lee Trager <lee@xxxxxxxxx>; Madhavan Srinivasan <maddy@xxxxxxxxxxxxx>;
> Zaremba, Larysa <larysa.zaremba@xxxxxxxxx>; Samudrala, Sridhar
> <sridhar.samudrala@xxxxxxxxx>; Keller, Jacob E <jacob.e.keller@xxxxxxxxx>;
> Michal Swiatkowski <michal.swiatkowski@xxxxxxxxxxxxxxx>; Polchlopek,
> Mateusz <mateusz.polchlopek@xxxxxxxxx>; Zaki, Ahmed
> <ahmed.zaki@xxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; linux-
> doc@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Karlsson, Magnus
> <magnus.karlsson@xxxxxxxxx>; Tantilov, Emil S <emil.s.tantilov@xxxxxxxxx>;
> Chittim, Madhu <madhu.chittim@xxxxxxxxx>; Hay, Joshua A
> <joshua.a.hay@xxxxxxxxx>; Olech, Milena <milena.olech@xxxxxxxxx>; Linga,
> Pavan Kumar <pavan.kumar.linga@xxxxxxxxx>; Singhai, Anjali
> <anjali.singhai@xxxxxxxxx>; Kubiak, Michal <michal.kubiak@xxxxxxxxx>
> Subject: [Intel-wired-lan] [PATCH iwl-next v4 09/15] idpf: refactor idpf to use
> libie control queues
>
> From: Pavan Kumar Linga <pavan.kumar.linga@xxxxxxxxx>
>
> Support to initialize and configure controlqs, and manage their
> transactions was introduced in libie. As part of it, most of the existing
> controlq structures are renamed and modified. Use those APIs in idpf and
> make all the necessary changes.
>
> Previously for the send and receive virtchnl messages, there used to be a
> memcpy involved in controlq code to copy the buffer info passed by the send
> function into the controlq specific buffers. There was no restriction to
> use automatic memory in that case. The new implementation in libie removed
> copying of the send buffer info and introduced DMA mapping of the send
> buffer itself. To accommodate it, use dynamic memory for the larger send
> buffers. For smaller ones (<= 128 bytes) libie still can copy them into the
> pre-allocated message memory.
>
> In case of receive, idpf receives a page pool buffer allocated by the libie
> and care should be taken to release it after use in the idpf.
>
> The changes are fairly trivial and localized, with a notable exception
> being the consolidation of idpf_vc_xn_shutdown and idpf_deinit_dflt_mbx
> under the latter name. This has some additional consequences that are
> addressed in the following patches.
>
> This refactoring introduces roughly additional 40KB of module storage used
> for systems that only run idpf, so idpf + libie_cp + libie_pci takes about
> 7% more storage than just idpf before refactoring.
>
> We now pre-allocate small TX buffers, so that does increase the memory
> usage, but reduces the need to allocate. This results in additional 256 *
> 128B of memory permanently used, increasing the worst-case memory usage
> by
> 32KB but our ctlq RX buffers need to be of size 4096B anyway (not changed
> by the patchset), so this is hardly noticeable.
>
> As for the timings, the fact that we are mostly limited by the HW response
> time which is far from instant, is not changed by this refactor.
>
> Reviewed-by: Michal Kubiak <michal.kubiak@xxxxxxxxx>
> Signed-off-by: Pavan Kumar Linga <pavan.kumar.linga@xxxxxxxxx>
> Co-developed-by: Larysa Zaremba <larysa.zaremba@xxxxxxxxx>
> Signed-off-by: Larysa Zaremba <larysa.zaremba@xxxxxxxxx>
> ---
> 2.47.0
Tested-by: Samuel Salin <Samuel.salin@xxxxxxxxx>