lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z7hTilouR44BUuHb@lore-desk>
Date: Fri, 21 Feb 2025 11:20:58 +0100
From: Lorenzo Bianconi <lorenzo@...nel.org>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
	Felix Fietkau <nbd@....name>, Sean Wang <sean.wang@...iatek.com>,
	Matthias Brugger <matthias.bgg@...il.com>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	Philipp Zabel <p.zabel@...gutronix.de>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	"Chester A. Unal" <chester.a.unal@...nc9.com>,
	Daniel Golle <daniel@...rotopia.org>,
	DENG Qingfang <dqfext@...il.com>, Andrew Lunn <andrew@...n.ch>,
	Vladimir Oltean <olteanv@...il.com>, netdev@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-mediatek@...ts.infradead.org, devicetree@...r.kernel.org,
	upstream@...oha.com
Subject: Re: [PATCH net-next v5 05/15] net: airoha: Move DSA tag in DMA
 descriptor

> On Mon, 17 Feb 2025 14:01:09 +0100 Lorenzo Bianconi wrote:
> > +static u32 airoha_get_dsa_tag(struct sk_buff *skb, struct net_device *dev)
> > +{
> > +#if IS_ENABLED(CONFIG_NET_DSA)
> > +	struct ethhdr *ehdr;
> > +	struct dsa_port *dp;
> > +	u8 xmit_tpid;
> > +	u16 tag;
> > +
> > +	if (!netdev_uses_dsa(dev))
> > +		return 0;
> > +
> > +	dp = dev->dsa_ptr;
> > +	if (IS_ERR(dp))
> > +		return 0;
> > +
> > +	if (dp->tag_ops->proto != DSA_TAG_PROTO_MTK)
> > +		return 0;
> > +
> > +	if (skb_ensure_writable(skb, ETH_HLEN))
> > +		return 0;
> 
> skb_cow_head() is a lot cheaper (for TCP)

ack, I will fix it in v6

> 
> > +	ehdr = (struct ethhdr *)skb->data;
> > +	tag = be16_to_cpu(ehdr->h_proto);
> > +	xmit_tpid = tag >> 8;
> 
> > @@ -2390,8 +2498,10 @@ static int airoha_probe(struct platform_device *pdev)
> >  	for (i = 0; i < ARRAY_SIZE(eth->ports); i++) {
> >  		struct airoha_gdm_port *port = eth->ports[i];
> >  
> > -		if (port && port->dev->reg_state == NETREG_REGISTERED)
> > +		if (port && port->dev->reg_state == NETREG_REGISTERED) {
> > +			airoha_metadata_dst_free(port);
> >  			unregister_netdev(port->dev);
> 
> Looks a tiny bit reversed, isn't it?
> First unregister the netdev, then free its metadata.

ack, I will fix it in v6

> 
> > +		}
> >  	}
> >  	free_netdev(eth->napi_dev);
> >  	platform_set_drvdata(pdev, NULL);
> > @@ -2416,6 +2526,7 @@ static void airoha_remove(struct platform_device *pdev)
> >  			continue;
> >  
> >  		airoha_dev_stop(port->dev);
> > +		airoha_metadata_dst_free(port);
> >  		unregister_netdev(port->dev);
> 
> same here

ack, I will fix it in v6

Regards,
Lorenzo

> 
> >  	}
> >  	free_netdev(eth->napi_dev);

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ