mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Wei Fang <wei.fang@nxp.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	Shenwei Wang <shenwei.wang@nxp.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	Frank Li <frank.li@nxp.com>
Subject: Re: [PATCH net-next v2 07/10] net: fec: fec_enet_rx_queue(): replace manual VLAN header calculation with skb_vlan_eth_hdr()
Date: Mon, 16 Jun 2025 15:12:37 +0200	[thread overview]
Message-ID: <4877c76a-d0c1-41d7-95c6-553542e2d9b1@lunn.ch> (raw)
In-Reply-To: <PAXPR04MB8510A1946372F37B5F97E9F28870A@PAXPR04MB8510.eurprd04.prod.outlook.com>

On Mon, Jun 16, 2025 at 01:42:08AM +0000, Wei Fang wrote:
> > >  drivers/net/ethernet/freescale/fec_main.c | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/net/ethernet/freescale/fec_main.c
> > > b/drivers/net/ethernet/freescale/fec_main.c
> > > index 6b456372de9a..f238cb60aa65 100644
> > > --- a/drivers/net/ethernet/freescale/fec_main.c
> > > +++ b/drivers/net/ethernet/freescale/fec_main.c
> > > @@ -1860,8 +1860,7 @@ fec_enet_rx_queue(struct net_device *ndev, u16
> > queue_id, int budget)
> > >  		    fep->bufdesc_ex &&
> > >  		    (ebdp->cbd_esc & cpu_to_fec32(BD_ENET_RX_VLAN))) {
> > >  			/* Push and remove the vlan tag */
> > > -			struct vlan_hdr *vlan_header =
> > > -					(struct vlan_hdr *) (data + ETH_HLEN);
> > > +			struct vlan_ethhdr *vlan_header = skb_vlan_eth_hdr(skb);
> > 
> > This is not 'obviously correct', so probably the commit message needs expanding.
> > 
> > static inline struct vlan_ethhdr *skb_vlan_eth_hdr(const struct sk_buff *skb) {
> > 	return (struct vlan_ethhdr *)skb->data; }
> > 
> > I can see a few lines early:
> > 
> > 		data = skb->data;
> > 
> > but what about the + ETH_HLEN?
> > 
> 
> The type of vlan_header has been changed from "struct vlan_hdr *" to
> "struct vlan_ethhdr *", so it is correct to use skb->data directly.

Doh! I missed that, sorry. Maybe extend the commit message, you
mention skb_vlan_eth_hdr() but you could add something like

... and change the type of vlan_header to struct vlan_ethhdr to take
into account the ethernet header plus vlan header is returned.

With that, please add: Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

  reply	other threads:[~2025-06-16 13:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12 14:15 [PATCH net-next v2 00/10] net: fec: cleanups, update quirk, update IRQ naming Marc Kleine-Budde
2025-06-12 14:15 ` [PATCH net-next v2 01/10] net: fec: fix typos found by codespell Marc Kleine-Budde
2025-06-13 18:20   ` Andrew Lunn
2025-06-12 14:15 ` [PATCH net-next v2 02/10] net: fec: struct fec_enet_private: remove obsolete comment Marc Kleine-Budde
2025-06-13 18:21   ` Andrew Lunn
2025-06-12 14:15 ` [PATCH net-next v2 03/10] net: fec: add missing header files Marc Kleine-Budde
2025-06-13 18:22   ` Andrew Lunn
2025-06-12 14:15 ` [PATCH net-next v2 04/10] net: fec: rename struct fec_devinfo fec_imx6x_info -> fec_imx6sx_info Marc Kleine-Budde
2025-06-13 18:24   ` Andrew Lunn
2025-06-12 14:15 ` [PATCH net-next v2 05/10] net: fec: fec_restart(): introduce a define for FEC_ECR_SPEED Marc Kleine-Budde
2025-06-13 18:28   ` Andrew Lunn
2025-06-12 14:15 ` [PATCH net-next v2 06/10] net: fec: fec_enet_rx_queue(): use same signature as fec_enet_tx_queue() Marc Kleine-Budde
2025-06-13  6:22   ` Wei Fang
2025-06-13 18:30   ` Andrew Lunn
2025-06-12 14:16 ` [PATCH net-next v2 07/10] net: fec: fec_enet_rx_queue(): replace manual VLAN header calculation with skb_vlan_eth_hdr() Marc Kleine-Budde
2025-06-13 18:37   ` Andrew Lunn
2025-06-16  1:42     ` Wei Fang
2025-06-16 13:12       ` Andrew Lunn [this message]
2025-06-16 13:34         ` Marc Kleine-Budde
2025-06-12 14:16 ` [PATCH net-next v2 08/10] net: fec: fec_enet_rx_queue(): reduce scope of data Marc Kleine-Budde
2025-06-12 14:16 ` [PATCH net-next v2 09/10] net: fec: fec_enet_rx_queue(): move_call to _vlan_hwaccel_put_tag() Marc Kleine-Budde
2025-06-12 14:16 ` [PATCH net-next v2 10/10] net: fec: fec_enet_rx_queue(): factor out VLAN handling into separate function fec_enet_rx_vlan() Marc Kleine-Budde
2025-06-12 14:18 ` [PATCH net-next v2 00/10] net: fec: cleanups, update quirk, update IRQ naming Marc Kleine-Budde
2025-06-13  6:19   ` Wei Fang
2025-06-13  6:22     ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4877c76a-d0c1-41d7-95c6-553542e2d9b1@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=frank.li@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=shenwei.wang@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®