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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240105113247.wml4ldq3abvizi2a@skbuf>
Date: Fri, 5 Jan 2024 13:32:47 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Hans Ulli Kroll <ulli.kroll@...glemail.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Household Cang <canghousehold@....com>,
	Romain Gantois <romain.gantois@...tlin.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net v5 1/2] net: ethernet: cortina: Drop software
 checksum and TSO

On Tue, Jan 02, 2024 at 09:34:25PM +0100, Linus Walleij wrote:
> @@ -1143,39 +1142,13 @@ static int gmac_map_tx_bufs(struct net_device *netdev, struct sk_buff *skb,
>  	struct gmac_txdesc *txd;
>  	skb_frag_t *skb_frag;
>  	dma_addr_t mapping;
> -	unsigned short mtu;
>  	void *buffer;
> -	int ret;
> -
> -	mtu  = ETH_HLEN;
> -	mtu += netdev->mtu;
> -	if (skb->protocol == htons(ETH_P_8021Q))
> -		mtu += VLAN_HLEN;
>  
> +	/* TODO: implement proper TSO using MTU in word3 */
>  	word1 = skb->len;
> -	word3 = SOF_BIT;
> -
> -	if (word1 > mtu) {
> -		word1 |= TSS_MTU_ENABLE_BIT;
> -		word3 |= mtu;
> -	}
> +	word3 = SOF_BIT | skb->len;
>  
> -	if (skb->len >= ETH_FRAME_LEN) {
> -		/* Hardware offloaded checksumming isn't working on frames
> -		 * bigger than 1514 bytes. A hypothesis about this is that the
> -		 * checksum buffer is only 1518 bytes, so when the frames get
> -		 * bigger they get truncated, or the last few bytes get
> -		 * overwritten by the FCS.
> -		 *
> -		 * Just use software checksumming and bypass on bigger frames.
> -		 */
> -		if (skb->ip_summed == CHECKSUM_PARTIAL) {
> -			ret = skb_checksum_help(skb);
> -			if (ret)
> -				return ret;
> -		}
> -		word1 |= TSS_BYPASS_BIT;
> -	} else if (skb->ip_summed == CHECKSUM_PARTIAL) {

So are you taking back the statement that "Hardware offloaded
checksumming isn't working on frames bigger than 1514 bytes"?

Have you increased the interface MTU beyond 1500, and tested with plain
TCP (no DSA) on top of it? Who will provide the TCP checksum for them now?

I don't understand why you remove the skb_checksum_help() call.
It doesn't play nice with skb_is_gso() packets, agreed, but you removed
the TSO netdev feature.

> +	if (skb->ip_summed == CHECKSUM_PARTIAL) {
>  		int tcp = 0;
>  
>  		/* We do not switch off the checksumming on non TCP/UDP
> 
> -- 
> 2.34.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ