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: <1366388417.2716.6.camel@bwh-desktop.uk.solarflarecom.com>
Date:	Fri, 19 Apr 2013 17:20:17 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Jim Baxter <jim_baxter@...tor.com>
CC:	"David S. Miller" <davem@...emloft.net>,
	Fabio Estevam <fabio.estevam@...escale.com>,
	Frank Li <Frank.Li@...escale.com>,
	Fugang Duan <B38611@...escale.com>, <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v4 1/1] net: fec: Enable imx6 enet checksum
 acceleration.

On Fri, 2013-04-19 at 17:16 +0100, Jim Baxter wrote:
> On 19/04/13 16:34, Ben Hutchings wrote:
> > On Fri, 2013-04-19 at 16:10 +0100, Jim Baxter wrote:
> >> Enables hardware generation of IP header and
> >> protocol specific checksums for transmitted
> >> packets.
> >>
> >> Enabled hardware discarding of received packets with
> >> invalid IP header or protocol specific checksums.
> >>
> >> The feature is enabled by default but can be
> >> enabled/disabled by ethtool.
> >>
> >> Signed-off-by: Fugang Duan <B38611@...escale.com>
> >> Signed-off-by: Jim Baxter <jim_baxter@...tor.com>
> >> ---
> >>
> >> - Added IPV6 support.
> > [...]
> >> @@ -1439,6 +1496,14 @@ static int fec_enet_alloc_buffers(struct net_device *ndev)
> >>  		if (fep->bufdesc_ex) {
> >>  			struct bufdesc_ex *ebdp = (struct bufdesc_ex *)bdp;
> >>  			ebdp->cbd_esc = BD_ENET_TX_INT;
> >> +
> >> +			/* Enable protocol checksum flags
> >> +			 * We do not bother with the IP Checksum bits as they
> >> +			 * are done by the kernel
> >> +			 */
> >> +			if (ndev->features &
> >> +					(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM))
> >> +				ebdp->cbd_esc |= BD_ENET_TX_PINS;
> >>  		}
> >>  
> >>  		bdp = fec_enet_get_nextdesc(bdp, fep->bufdesc_ex);
> > [...]
> > 
> > This condition needs to be based on skb->ip_summed.
> > 
> > Ben.
> > 
> 
> 
> These buffers are setup when the network driver is opened
> (fec_enet_open), with the same settings as the transmit buffers.
> 
> Thinking about it, they should probably not be set here and only set
> during the fec_enet_start_xmit() function.

Right.  Even when TX checksum offload is enabled, the kernel might not
want you to offload TX checksums for every packet.  For example, if your
interface is part of a bridge, packets should be forwarded even if they
have a bad layer-4 checksum on RX, and the checksum must not be
'corrected' on TX.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ