* [PATCH] firewire net: Ensure checksumming in upper layer. @ 2013-01-20 7:43 YOSHIFUJI Hideaki 2013-01-20 9:50 ` Stefan Richter 2013-01-21 4:16 ` David Miller 0 siblings, 2 replies; 8+ messages in thread From: YOSHIFUJI Hideaki @ 2013-01-20 7:43 UTC (permalink / raw) To: linux1394-devel, netdev; +Cc: linux-kernel It is wrong to set skb->ip_summed to CHECKSUM_UNNECESSARY unless the device has already checked it. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> --- drivers/firewire/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index e7a711f5..df6a1ca 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c @@ -520,7 +520,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net, dev = netdev_priv(net); /* Write metadata, and then pass to the receive level */ skb->dev = net; - skb->ip_summed = CHECKSUM_UNNECESSARY; /* don't check it */ + skb->ip_summed = CHECKSUM_NONE; /* * Parse the encapsulation header. This actually does the job of -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] firewire net: Ensure checksumming in upper layer. 2013-01-20 7:43 [PATCH] firewire net: Ensure checksumming in upper layer YOSHIFUJI Hideaki @ 2013-01-20 9:50 ` Stefan Richter 2013-01-20 10:37 ` YOSHIFUJI Hideaki 2013-01-21 4:16 ` David Miller 1 sibling, 1 reply; 8+ messages in thread From: Stefan Richter @ 2013-01-20 9:50 UTC (permalink / raw) To: YOSHIFUJI Hideaki; +Cc: netdev, linux1394-devel, linux-kernel On Jan 20 YOSHIFUJI Hideaki wrote: > It is wrong to set skb->ip_summed to CHECKSUM_UNNECESSARY unless > the device has already checked it. > > Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> > --- > drivers/firewire/net.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c > index e7a711f5..df6a1ca 100644 > --- a/drivers/firewire/net.c > +++ b/drivers/firewire/net.c > @@ -520,7 +520,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net, > dev = netdev_priv(net); > /* Write metadata, and then pass to the receive level */ > skb->dev = net; > - skb->ip_summed = CHECKSUM_UNNECESSARY; /* don't check it */ > + skb->ip_summed = CHECKSUM_NONE; > > /* > * Parse the encapsulation header. This actually does the job of Indeed neither the device nor the lower drivers check protocol checksums. But the CRCs of the encapsulating 1394 packets are checked in hardware. Shall protocol checksums be verified regardless? -- Stefan Richter -=====-===-= ---= =-=-- http://arcgraph.de/sr/ ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_123012 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] firewire net: Ensure checksumming in upper layer. 2013-01-20 9:50 ` Stefan Richter @ 2013-01-20 10:37 ` YOSHIFUJI Hideaki 2013-01-20 14:46 ` Stephan Gatzka 0 siblings, 1 reply; 8+ messages in thread From: YOSHIFUJI Hideaki @ 2013-01-20 10:37 UTC (permalink / raw) To: Stefan Richter; +Cc: linux1394-devel, netdev, linux-kernel, YOSHIFUJI Hideaki Stefan Richter wrote: > On Jan 20 YOSHIFUJI Hideaki wrote: >> It is wrong to set skb->ip_summed to CHECKSUM_UNNECESSARY unless >> the device has already checked it. >> >> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> >> --- >> drivers/firewire/net.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c >> index e7a711f5..df6a1ca 100644 >> --- a/drivers/firewire/net.c >> +++ b/drivers/firewire/net.c >> @@ -520,7 +520,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net, >> dev = netdev_priv(net); >> /* Write metadata, and then pass to the receive level */ >> skb->dev = net; >> - skb->ip_summed = CHECKSUM_UNNECESSARY; /* don't check it */ >> + skb->ip_summed = CHECKSUM_NONE; >> >> /* >> * Parse the encapsulation header. This actually does the job of > > Indeed neither the device nor the lower drivers check protocol checksums. > But the CRCs of the encapsulating 1394 packets are checked in hardware. > Shall protocol checksums be verified regardless? Yes, because packets may come from off-link source. --yoshfuji ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] firewire net: Ensure checksumming in upper layer. 2013-01-20 10:37 ` YOSHIFUJI Hideaki @ 2013-01-20 14:46 ` Stephan Gatzka 2013-01-20 15:10 ` YOSHIFUJI Hideaki 0 siblings, 1 reply; 8+ messages in thread From: Stephan Gatzka @ 2013-01-20 14:46 UTC (permalink / raw) To: YOSHIFUJI Hideaki; +Cc: Stefan Richter, linux1394-devel, netdev, linux-kernel >> Indeed neither the device nor the lower drivers check protocol checksums. >> But the CRCs of the encapsulating 1394 packets are checked in hardware. >> Shall protocol checksums be verified regardless? > > Yes, because packets may come from off-link source. > Hm, I can't see any off-link packets coming from fwnet_finish_incoming_packet() So I wont verify checksums in the driver. Stephan ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] firewire net: Ensure checksumming in upper layer. 2013-01-20 14:46 ` Stephan Gatzka @ 2013-01-20 15:10 ` YOSHIFUJI Hideaki 2013-01-20 15:17 ` Stephan Gatzka 0 siblings, 1 reply; 8+ messages in thread From: YOSHIFUJI Hideaki @ 2013-01-20 15:10 UTC (permalink / raw) To: stephan.gatzka Cc: Stefan Richter, linux1394-devel, netdev, linux-kernel, YOSHIFUJI Hideaki Stephan Gatzka wrote: > >>> Indeed neither the device nor the lower drivers check protocol checksums. >>> But the CRCs of the encapsulating 1394 packets are checked in hardware. >>> Shall protocol checksums be verified regardless? >> >> Yes, because packets may come from off-link source. >> > > Hm, I can't see any off-link packets coming from fwnet_finish_incoming_packet() > > So I wont verify checksums in the driver. "Off-link source" means the source exists on the different L2 network. In other words, source is connected via router(s). ethernet firewire Host -------------- Router ------------ Host --yoshfuji ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] firewire net: Ensure checksumming in upper layer. 2013-01-20 15:10 ` YOSHIFUJI Hideaki @ 2013-01-20 15:17 ` Stephan Gatzka 2013-01-20 15:48 ` YOSHIFUJI Hideaki 0 siblings, 1 reply; 8+ messages in thread From: Stephan Gatzka @ 2013-01-20 15:17 UTC (permalink / raw) To: YOSHIFUJI Hideaki; +Cc: netdev, Stefan Richter, linux1394-devel, linux-kernel > "Off-link source" means the source exists on the different L2 > network. In other words, source is connected via router(s). > > ethernet firewire > Host -------------- Router ------------ Host > O.k., understood. But the receiving router verifies the checksum of incoming packets and sends them on the firewire link. On firewire we have CRC checksums to ensure the integrity of packets. I agree with your patch but I don't see why we should check them in the driver. I thought your patch will ensure that the checksums will be verified in the upper layers. Stephan ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_123012 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] firewire net: Ensure checksumming in upper layer. 2013-01-20 15:17 ` Stephan Gatzka @ 2013-01-20 15:48 ` YOSHIFUJI Hideaki 0 siblings, 0 replies; 8+ messages in thread From: YOSHIFUJI Hideaki @ 2013-01-20 15:48 UTC (permalink / raw) To: stephan.gatzka Cc: YOSHIFUJI Hideaki, netdev, Stefan Richter, linux1394-devel, linux-kernel Stephan Gatzka wrote: > >> "Off-link source" means the source exists on the different L2 >> network. In other words, source is connected via router(s). >> >> ethernet firewire >> Host -------------- Router ------------ Host >> > > O.k., understood. But the receiving router verifies the checksum of incoming packets and sends them on the firewire link. On firewire we have CRC checksums to ensure the integrity of packets. > > I agree with your patch but I don't see why we should check them in the driver. I thought your patch will ensure that the checksums will be verified in the upper layers. Routers do not inspect whole packet. For IPv4, we have IP checksum, but routers (usually) do not check upper-layer (e.g. UDP) checksum. For IPv6, we do not have IP checksum. CHECKSUM_UNNECESSARY means the driver has verified upper layer (e.g. TCP/UDP) checksum. Modern hardware can perform upper-layer checksumming as well. But of course, not all drivers are required to verify the upper-layer checksum; if the driver do not verify checksum in the packet, just say CHECKSUM_NONE. Regards, --yoshfuji ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_123012 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] firewire net: Ensure checksumming in upper layer. 2013-01-20 7:43 [PATCH] firewire net: Ensure checksumming in upper layer YOSHIFUJI Hideaki 2013-01-20 9:50 ` Stefan Richter @ 2013-01-21 4:16 ` David Miller 1 sibling, 0 replies; 8+ messages in thread From: David Miller @ 2013-01-21 4:16 UTC (permalink / raw) To: yoshfuji; +Cc: linux1394-devel, netdev, linux-kernel From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Date: Sun, 20 Jan 2013 16:43:40 +0900 > It is wrong to set skb->ip_summed to CHECKSUM_UNNECESSARY unless > the device has already checked it. > > Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Applied. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-01-21 4:16 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-01-20 7:43 [PATCH] firewire net: Ensure checksumming in upper layer YOSHIFUJI Hideaki 2013-01-20 9:50 ` Stefan Richter 2013-01-20 10:37 ` YOSHIFUJI Hideaki 2013-01-20 14:46 ` Stephan Gatzka 2013-01-20 15:10 ` YOSHIFUJI Hideaki 2013-01-20 15:17 ` Stephan Gatzka 2013-01-20 15:48 ` YOSHIFUJI Hideaki 2013-01-21 4:16 ` David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).