[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<PAXPR04MB85102BB0EC0EB736AEECA29B88592@PAXPR04MB8510.eurprd04.prod.outlook.com>
Date: Tue, 12 Nov 2024 01:30:57 +0000
From: Wei Fang <wei.fang@....com>
To: Claudiu Manoil <claudiu.manoil@....com>
CC: "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>, Vladimir Oltean
<vladimir.oltean@....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>,
Frank Li <frank.li@....com>
Subject: RE: [PATCH v2 net-next 2/5] net: enetc: add Tx checksum offload for
i.MX95 ENETC
> -----Original Message-----
> From: Claudiu Manoil <claudiu.manoil@....com>
> Sent: 2024年11月12日 0:11
> To: Wei Fang <wei.fang@....com>
> Cc: netdev@...r.kernel.org; linux-kernel@...r.kernel.org; imx@...ts.linux.dev;
> Vladimir Oltean <vladimir.oltean@....com>; Clark Wang
> <xiaoning.wang@....com>; andrew+netdev@...n.ch; davem@...emloft.net;
> edumazet@...gle.com; kuba@...nel.org; pabeni@...hat.com; Frank Li
> <frank.li@....com>
> Subject: RE: [PATCH v2 net-next 2/5] net: enetc: add Tx checksum offload for
> i.MX95 ENETC
>
> > -----Original Message-----
> > From: Wei Fang <wei.fang@....com>
> > Sent: Monday, November 11, 2024 11:26 AM
> [...]
> > Subject: RE: [PATCH v2 net-next 2/5] net: enetc: add Tx checksum offload for
> > i.MX95 ENETC
> >
> > > > --- a/drivers/net/ethernet/freescale/enetc/enetc.c
> > > > +++ b/drivers/net/ethernet/freescale/enetc/enetc.c
> > > > @@ -143,6 +143,27 @@ static int enetc_ptp_parse(struct sk_buff *skb,
> > > > u8 *udp,
> > > > return 0;
> > > > }
> > > >
> > > > +static bool enetc_tx_csum_offload_check(struct sk_buff *skb) {
> > > > + if (ip_hdr(skb)->version == 4)
> > >
> > > I would avoid using ip_hdr(), or any form of touching packed data and
> > > try extract this kind of info directly from the skb metadata instead,
> > > see also comment below.
> > >
> > > i.e., why not:
> > > if (skb->protocol == htons(ETH_P_IPV6)) .. etc. ?
> >
> > skb->protocol may be VLAN protocol, such as ETH_P_8021Q,
> ETH_P_8021AD.
> > If so, it is impossible to determine whether it is an IPv4 or IPv6 frames
> through
> > protocol.
> >
>
> vlan_get_protocol() then?
> I see you're using this helper in the LSO patch, so let's be consistent then. :)
> I still think it's better than the ip_hdr(skb) approach.
Yes, vlan_get_protocol() can also help us get the IP version, so let's be
consistent. Thanks.
Powered by blists - more mailing lists