mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Al Viro <viro@ftp.linux.org.uk>
To: torvalds@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, davem@davemloft.net
Subject: [PATCH] inet_lro: trivial endianness annotations
Date: Sun, 14 Oct 2007 19:40:59 +0100	[thread overview]
Message-ID: <E1Ih8OZ-0004Bx-7p@ZenIV.linux.org.uk> (raw)


Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 include/linux/inet_lro.h |    6 +++---
 net/ipv4/inet_lro.c      |   14 +++++++-------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h
index e1fc1d1..bb1c877 100644
--- a/include/linux/inet_lro.h
+++ b/include/linux/inet_lro.h
@@ -52,14 +52,14 @@ struct net_lro_desc {
 	struct tcphdr *tcph;
 	struct vlan_group *vgrp;
 	__wsum  data_csum;
-	u32 tcp_rcv_tsecr;
-	u32 tcp_rcv_tsval;
+	__be32 tcp_rcv_tsecr;
+	__be32 tcp_rcv_tsval;
 	u32 tcp_ack;
 	u32 tcp_next_seq;
 	u32 skb_tot_frags_len;
 	u16 ip_tot_len;
 	u16 tcp_saw_tstamp; 		/* timestamps enabled */
-	u16 tcp_window;
+	__be16 tcp_window;
 	u16 vlan_tag;
 	int pkt_aggr_cnt;		/* counts aggregated packets */
 	int vlan_packet;
diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c
index 4545b64..7f22474 100644
--- a/net/ipv4/inet_lro.c
+++ b/net/ipv4/inet_lro.c
@@ -77,7 +77,7 @@ static int lro_tcp_ip_check(struct iphdr *iph, struct tcphdr *tcph,
 
 	/* check tcp options (only timestamp allowed) */
 	if (tcph->doff == TCPH_LEN_W_TIMESTAMP) {
-		u32 *topt = (u32 *)(tcph + 1);
+		__be32 *topt = (__be32 *)(tcph + 1);
 
 		if (*topt != htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16)
 				   | (TCPOPT_TIMESTAMP << 8)
@@ -103,14 +103,14 @@ static void lro_update_tcp_ip_header(struct net_lro_desc *lro_desc)
 {
 	struct iphdr *iph = lro_desc->iph;
 	struct tcphdr *tcph = lro_desc->tcph;
-	u32 *p;
+	__be32 *p;
 	__wsum tcp_hdr_csum;
 
 	tcph->ack_seq = lro_desc->tcp_ack;
 	tcph->window = lro_desc->tcp_window;
 
 	if (lro_desc->tcp_saw_tstamp) {
-		p = (u32 *)(tcph + 1);
+		p = (__be32 *)(tcph + 1);
 		*(p+2) = lro_desc->tcp_rcv_tsecr;
 	}
 
@@ -150,7 +150,7 @@ static void lro_init_desc(struct net_lro_desc *lro_desc, struct sk_buff *skb,
 			  u16 vlan_tag, struct vlan_group *vgrp)
 {
 	int nr_frags;
-	u32 *ptr;
+	__be32 *ptr;
 	u32 tcp_data_len = TCP_PAYLOAD_LENGTH(iph, tcph);
 
 	nr_frags = skb_shinfo(skb)->nr_frags;
@@ -166,7 +166,7 @@ static void lro_init_desc(struct net_lro_desc *lro_desc, struct sk_buff *skb,
 	lro_desc->ip_tot_len = ntohs(iph->tot_len);
 
 	if (tcph->doff == 8) {
-		ptr = (u32 *)(tcph+1);
+		ptr = (__be32 *)(tcph+1);
 		lro_desc->tcp_saw_tstamp = 1;
 		lro_desc->tcp_rcv_tsval = *(ptr+1);
 		lro_desc->tcp_rcv_tsecr = *(ptr+2);
@@ -190,7 +190,7 @@ static void lro_add_common(struct net_lro_desc *lro_desc, struct iphdr *iph,
 			   struct tcphdr *tcph, int tcp_data_len)
 {
 	struct sk_buff *parent = lro_desc->parent;
-	u32 *topt;
+	__be32 *topt;
 
 	lro_desc->pkt_aggr_cnt++;
 	lro_desc->ip_tot_len += tcp_data_len;
@@ -200,7 +200,7 @@ static void lro_add_common(struct net_lro_desc *lro_desc, struct iphdr *iph,
 
 	/* don't update tcp_rcv_tsval, would not work with PAWS */
 	if (lro_desc->tcp_saw_tstamp) {
-		topt = (u32 *) (tcph + 1);
+		topt = (__be32 *) (tcph + 1);
 		lro_desc->tcp_rcv_tsecr = *(topt + 2);
 	}
 
-- 
1.5.3.GIT



                 reply	other threads:[~2007-10-14 18:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1Ih8OZ-0004Bx-7p@ZenIV.linux.org.uk \
    --to=viro@ftp.linux.org.uk \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®