[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250317100037.7o7r7gch433s5lq4@skbuf>
Date: Mon, 17 Mar 2025 12:00:37 +0200
From: Vladimir Oltean <vladimir.oltean@....com>
To: Wei Fang <wei.fang@....com>
Cc: Claudiu Manoil <claudiu.manoil@....com>,
Clark Wang <xiaoning.wang@....com>,
"andrew+netdev@...n.ch" <andrew+netdev@...n.ch>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"christophe.leroy@...roup.eu" <christophe.leroy@...roup.eu>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"imx@...ts.linux.dev" <imx@...ts.linux.dev>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v4 net-next 01/14] net: enetc: add initial netc-lib
driver to support NTMP
On Mon, Mar 17, 2025 at 11:55:26AM +0200, Wei Fang wrote:
> Actually I did this is the original version, I mean in downstream kernel 6.6
> tree. I add a "ntmp_mfe" in ntmp.h like below
>
> struct ntmp_mfe {
> u8 mac[ETH_ALEN];
> u16 si_bitmap;
> };
>
> And the conversion was done by the NTMP driver. But then I found that this was
> very troublesome. We get data from kernel "struct A,B,C", then the enetc driver
> converts them to "struct D", and finally the ntmp driver converts it to "struct E".
> So I thought why don't we convert "struct A,B,C" to "struct E" from the beginning?
> After all, these data structures are only used by enetc and netc switch drivers, so
> in kernel 6.12, I changed it to the current way.
I understand. With pack_fields(), "struct E" (the packed representation
of "struct D") doesn't explicitly exist, just an abstract type
representing the u8 *buffer, and the struct packed_field_u8 array[]
which is hidden inside the NTMP layer.
Powered by blists - more mailing lists