netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset
@ 2011-04-22 11:07 Shan Wei
  2011-04-28 20:29 ` David Miller
  2011-05-02 22:20 ` Chris Metcalf
  0 siblings, 2 replies; 6+ messages in thread
From: Shan Wei @ 2011-04-22 11:07 UTC (permalink / raw)
  To: David Miller, netdev, cmetcalf

Although these are equivalent, but the skb_checksum_start_offset() is more readable.


Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
 drivers/net/tile/tilepro.c |    2 +-
 net/ipv6/udp.c             |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tile/tilepro.c b/drivers/net/tile/tilepro.c
index 0825db6..1e980fd 100644
--- a/drivers/net/tile/tilepro.c
+++ b/drivers/net/tile/tilepro.c
@@ -1930,7 +1930,7 @@ static int tile_net_tx(struct sk_buff *skb, struct net_device *dev)
 	unsigned int len = skb->len;
 	unsigned char *data = skb->data;
 
-	unsigned int csum_start = skb->csum_start - skb_headroom(skb);
+	unsigned int csum_start = skb_checksum_start_offset(skb);
 
 	lepp_frag_t frags[LEPP_MAX_FRAGS];
 
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 15c3774..95c62a1 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1328,7 +1328,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features)
 	/* Do software UFO. Complete and fill in the UDP checksum as HW cannot
 	 * do checksum of UDP packets sent as multiple IP fragments.
 	 */
-	offset = skb->csum_start - skb_headroom(skb);
+	offset = skb_checksum_start_offset(skb);
 	csum = skb_checksum(skb, offset, skb->len- offset, 0);
 	offset += skb->csum_offset;
 	*(__sum16 *)(skb->data + offset) = csum_fold(csum);
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset
  2011-04-22 11:07 [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset Shan Wei
@ 2011-04-28 20:29 ` David Miller
  2011-05-02 22:20 ` Chris Metcalf
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2011-04-28 20:29 UTC (permalink / raw)
  To: shanwei; +Cc: netdev, cmetcalf

From: Shan Wei <shanwei@cn.fujitsu.com>
Date: Fri, 22 Apr 2011 19:07:41 +0800

> Although these are equivalent, but the skb_checksum_start_offset() is more readable.
> 
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>

Applied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset
  2011-04-22 11:07 [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset Shan Wei
  2011-04-28 20:29 ` David Miller
@ 2011-05-02 22:20 ` Chris Metcalf
  2011-05-02 22:21   ` David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Chris Metcalf @ 2011-05-02 22:20 UTC (permalink / raw)
  To: Shan Wei; +Cc: David Miller, netdev

On 4/22/2011 7:07 AM, Shan Wei wrote:
> Although these are equivalent, but the skb_checksum_start_offset() is more readable.
>
>
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> ---
>  drivers/net/tile/tilepro.c |    2 +-
>  net/ipv6/udp.c             |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/tile/tilepro.c b/drivers/net/tile/tilepro.c
> index 0825db6..1e980fd 100644
> --- a/drivers/net/tile/tilepro.c
> +++ b/drivers/net/tile/tilepro.c
> @@ -1930,7 +1930,7 @@ static int tile_net_tx(struct sk_buff *skb, struct net_device *dev)
>  	unsigned int len = skb->len;
>  	unsigned char *data = skb->data;
>  
> -	unsigned int csum_start = skb->csum_start - skb_headroom(skb);
> +	unsigned int csum_start = skb_checksum_start_offset(skb);
>  
>  	lepp_frag_t frags[LEPP_MAX_FRAGS];
>  
> diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
> index 15c3774..95c62a1 100644
> --- a/net/ipv6/udp.c
> +++ b/net/ipv6/udp.c
> @@ -1328,7 +1328,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features)
>  	/* Do software UFO. Complete and fill in the UDP checksum as HW cannot
>  	 * do checksum of UDP packets sent as multiple IP fragments.
>  	 */
> -	offset = skb->csum_start - skb_headroom(skb);
> +	offset = skb_checksum_start_offset(skb);
>  	csum = skb_checksum(skb, offset, skb->len- offset, 0);
>  	offset += skb->csum_offset;
>  	*(__sum16 *)(skb->data + offset) = csum_fold(csum);

I took the drivers/net/tile/ change into my tree, but I'll defer to David
or some other net person to take the net/ipv6/udp.c change.  Thanks!

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset
  2011-05-02 22:20 ` Chris Metcalf
@ 2011-05-02 22:21   ` David Miller
  2011-05-02 22:29     ` Chris Metcalf
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2011-05-02 22:21 UTC (permalink / raw)
  To: cmetcalf; +Cc: shanwei, netdev

From: Chris Metcalf <cmetcalf@tilera.com>
Date: Mon, 2 May 2011 18:20:01 -0400

> I took the drivers/net/tile/ change into my tree, but I'll defer to David
> or some other net person to take the net/ipv6/udp.c change.  Thanks!

I took them both into my tree.  Didn't you see my reply?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset
  2011-05-02 22:21   ` David Miller
@ 2011-05-02 22:29     ` Chris Metcalf
  2011-05-02 22:35       ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Metcalf @ 2011-05-02 22:29 UTC (permalink / raw)
  To: David Miller; +Cc: shanwei, netdev

On 5/2/2011 6:21 PM, David Miller wrote:
> From: Chris Metcalf <cmetcalf@tilera.com>
> Date: Mon, 2 May 2011 18:20:01 -0400
>
>> I took the drivers/net/tile/ change into my tree, but I'll defer to David
>> or some other net person to take the net/ipv6/udp.c change.  Thanks!
> I took them both into my tree.  Didn't you see my reply?

I did, but I didn't see the change yet in .39-rc5, so I figured it would be
harmless to also take it into the tile tree.  And, I thought you might have
just taken the platform-independent part of the change.  I'll revert the
tile part of the change out of my tree.  Thanks!

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset
  2011-05-02 22:29     ` Chris Metcalf
@ 2011-05-02 22:35       ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2011-05-02 22:35 UTC (permalink / raw)
  To: cmetcalf; +Cc: shanwei, netdev

From: Chris Metcalf <cmetcalf@tilera.com>
Date: Mon, 2 May 2011 18:29:11 -0400

> On 5/2/2011 6:21 PM, David Miller wrote:
>> From: Chris Metcalf <cmetcalf@tilera.com>
>> Date: Mon, 2 May 2011 18:20:01 -0400
>>
>>> I took the drivers/net/tile/ change into my tree, but I'll defer to David
>>> or some other net person to take the net/ipv6/udp.c change.  Thanks!
>> I took them both into my tree.  Didn't you see my reply?
> 
> I did, but I didn't see the change yet in .39-rc5, so I figured it would be
> harmless to also take it into the tile tree.

This change will show up in net-next-2.6 and as a consequence linux-2.6-next

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-02 22:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-22 11:07 [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset Shan Wei
2011-04-28 20:29 ` David Miller
2011-05-02 22:20 ` Chris Metcalf
2011-05-02 22:21   ` David Miller
2011-05-02 22:29     ` Chris Metcalf
2011-05-02 22:35       ` 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).