netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [1/2] [IPV4]: Uninline inet_lookup_listener
@ 2006-08-08  8:46 Herbert Xu
  2006-08-08  8:47 ` [2/2] [IPV4]: Use network-order dport for all visible inet_lookup_* Herbert Xu
  2006-08-08  9:21 ` [1/2] [IPV4]: Uninline inet_lookup_listener David Miller
  0 siblings, 2 replies; 8+ messages in thread
From: Herbert Xu @ 2006-08-08  8:46 UTC (permalink / raw)
  To: David S. Miller, netdev

Hi:

[IPV4]: Uninline inet_lookup_listener

By modern standards this function is way too big to be inlined.  It's
even bigger than __inet_lookup_listener :)

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -271,39 +271,10 @@ static inline int inet_iif(const struct 
 	return ((struct rtable *)skb->dst)->rt_iif;
 }
 
-extern struct sock *__inet_lookup_listener(const struct hlist_head *head,
-					   const u32 daddr,
-					   const unsigned short hnum,
-					   const int dif);
-
-/* Optimize the common listener case. */
-static inline struct sock *
+extern struct sock *
 		inet_lookup_listener(struct inet_hashinfo *hashinfo,
 				     const u32 daddr,
-				     const unsigned short hnum, const int dif)
-{
-	struct sock *sk = NULL;
-	const struct hlist_head *head;
-
-	read_lock(&hashinfo->lhash_lock);
-	head = &hashinfo->listening_hash[inet_lhashfn(hnum)];
-	if (!hlist_empty(head)) {
-		const struct inet_sock *inet = inet_sk((sk = __sk_head(head)));
-
-		if (inet->num == hnum && !sk->sk_node.next &&
-		    (!inet->rcv_saddr || inet->rcv_saddr == daddr) &&
-		    (sk->sk_family == PF_INET || !ipv6_only_sock(sk)) &&
-		    !sk->sk_bound_dev_if)
-			goto sherry_cache;
-		sk = __inet_lookup_listener(head, daddr, hnum, dif);
-	}
-	if (sk) {
-sherry_cache:
-		sock_hold(sk);
-	}
-	read_unlock(&hashinfo->lhash_lock);
-	return sk;
-}
+				     const unsigned short hnum, const int dif);
 
 /* Socket demux engine toys. */
 #ifdef __BIG_ENDIAN
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -124,8 +124,10 @@ EXPORT_SYMBOL(inet_listen_wlock);
  * remote address for the connection. So always assume those are both
  * wildcarded during the search since they can never be otherwise.
  */
-struct sock *__inet_lookup_listener(const struct hlist_head *head, const u32 daddr,
-				    const unsigned short hnum, const int dif)
+static struct sock *__inet_lookup_listener(const struct hlist_head *head,
+					   const u32 daddr,
+					   const unsigned short hnum,
+					   const int dif)
 {
 	struct sock *result = NULL, *sk;
 	const struct hlist_node *node;
@@ -159,7 +161,34 @@ struct sock *__inet_lookup_listener(cons
 	return result;
 }
 
-EXPORT_SYMBOL_GPL(__inet_lookup_listener);
+/* Optimize the common listener case. */
+struct sock *inet_lookup_listener(struct inet_hashinfo *hashinfo,
+				  const u32 daddr, const unsigned short hnum,
+				  const int dif)
+{
+	struct sock *sk = NULL;
+	const struct hlist_head *head;
+
+	read_lock(&hashinfo->lhash_lock);
+	head = &hashinfo->listening_hash[inet_lhashfn(hnum)];
+	if (!hlist_empty(head)) {
+		const struct inet_sock *inet = inet_sk((sk = __sk_head(head)));
+
+		if (inet->num == hnum && !sk->sk_node.next &&
+		    (!inet->rcv_saddr || inet->rcv_saddr == daddr) &&
+		    (sk->sk_family == PF_INET || !ipv6_only_sock(sk)) &&
+		    !sk->sk_bound_dev_if)
+			goto sherry_cache;
+		sk = __inet_lookup_listener(head, daddr, hnum, dif);
+	}
+	if (sk) {
+sherry_cache:
+		sock_hold(sk);
+	}
+	read_unlock(&hashinfo->lhash_lock);
+	return sk;
+}
+EXPORT_SYMBOL_GPL(inet_lookup_listener);
 
 /* called with local bh disabled */
 static int __inet_check_established(struct inet_timewait_death_row *death_row,

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

* [2/2] [IPV4]: Use network-order dport for all visible inet_lookup_*
  2006-08-08  8:46 [1/2] [IPV4]: Uninline inet_lookup_listener Herbert Xu
@ 2006-08-08  8:47 ` Herbert Xu
  2006-08-08  9:24   ` David Miller
  2006-08-08  9:21 ` [1/2] [IPV4]: Uninline inet_lookup_listener David Miller
  1 sibling, 1 reply; 8+ messages in thread
From: Herbert Xu @ 2006-08-08  8:47 UTC (permalink / raw)
  To: David S. Miller, netdev

Hi:

[IPV4]: Use network-order dport for all visible inet_lookup_*

Right now most inet_lookup_* functions take a host-order hnum instead
of a network-order dport because that's how it is represented internally.

This means that users of these functions have to be careful about using
the right byte-order.  To add more confusion, inet_lookup takes a
network-order dport unlike all other functions.

So this patch changes all visible inet_lookup functions to take a dport
and move all dport->hnum conversion inside them.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -274,7 +274,7 @@ static inline int inet_iif(const struct 
 extern struct sock *
 		inet_lookup_listener(struct inet_hashinfo *hashinfo,
 				     const u32 daddr,
-				     const unsigned short hnum, const int dif);
+				     const u16 dport, const int dif);
 
 /* Socket demux engine toys. */
 #ifdef __BIG_ENDIAN
@@ -328,10 +328,11 @@ extern struct sock *
 static inline struct sock *
 	__inet_lookup_established(struct inet_hashinfo *hashinfo,
 				  const u32 saddr, const u16 sport,
-				  const u32 daddr, const u16 hnum,
+				  const u32 daddr, const u16 dport,
 				  const int dif)
 {
 	INET_ADDR_COOKIE(acookie, saddr, daddr)
+	u16 hnum = ntohs(dport);
 	const __u32 ports = INET_COMBINED_PORTS(sport, hnum);
 	struct sock *sk;
 	const struct hlist_node *node;
@@ -364,12 +365,12 @@ hit:
 
 static inline struct sock *__inet_lookup(struct inet_hashinfo *hashinfo,
 					 const u32 saddr, const u16 sport,
-					 const u32 daddr, const u16 hnum,
+					 const u32 daddr, const u16 dport,
 					 const int dif)
 {
 	struct sock *sk = __inet_lookup_established(hashinfo, saddr, sport, daddr,
-						    hnum, dif);
-	return sk ? : inet_lookup_listener(hashinfo, daddr, hnum, dif);
+						    dport, dif);
+	return sk ? : inet_lookup_listener(hashinfo, daddr, dport, dif);
 }
 
 static inline struct sock *inet_lookup(struct inet_hashinfo *hashinfo,
@@ -380,7 +381,7 @@ static inline struct sock *inet_lookup(s
 	struct sock *sk;
 
 	local_bh_disable();
-	sk = __inet_lookup(hashinfo, saddr, sport, daddr, ntohs(dport), dif);
+	sk = __inet_lookup(hashinfo, saddr, sport, daddr, dport, dif);
 	local_bh_enable();
 
 	return sk;
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -607,7 +607,7 @@ static struct sock *dccp_v4_hnd_req(stru
 
 	nsk = __inet_lookup_established(&dccp_hashinfo,
 					iph->saddr, dh->dccph_sport,
-					iph->daddr, ntohs(dh->dccph_dport),
+					iph->daddr, dh->dccph_dport,
 					inet_iif(skb));
 	if (nsk != NULL) {
 		if (nsk->sk_state != DCCP_TIME_WAIT) {
@@ -921,7 +921,7 @@ static int dccp_v4_rcv(struct sk_buff *s
 	 * 	Look up flow ID in table and get corresponding socket */
 	sk = __inet_lookup(&dccp_hashinfo,
 			   skb->nh.iph->saddr, dh->dccph_sport,
-			   skb->nh.iph->daddr, ntohs(dh->dccph_dport),
+			   skb->nh.iph->daddr, dh->dccph_dport,
 			   inet_iif(skb));
 
 	/* 
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -163,11 +163,12 @@ static struct sock *__inet_lookup_listen
 
 /* Optimize the common listener case. */
 struct sock *inet_lookup_listener(struct inet_hashinfo *hashinfo,
-				  const u32 daddr, const unsigned short hnum,
+				  const u32 daddr, const u16 dport,
 				  const int dif)
 {
 	struct sock *sk = NULL;
 	const struct hlist_head *head;
+	u16 hnum = ntohs(dport);
 
 	read_lock(&hashinfo->lhash_lock);
 	head = &hashinfo->listening_hash[inet_lhashfn(hnum)];
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -950,7 +950,7 @@ static struct sock *tcp_v4_hnd_req(struc
 
 	nsk = __inet_lookup_established(&tcp_hashinfo, skb->nh.iph->saddr,
 					th->source, skb->nh.iph->daddr,
-					ntohs(th->dest), inet_iif(skb));
+					th->dest, inet_iif(skb));
 
 	if (nsk) {
 		if (nsk->sk_state != TCP_TIME_WAIT) {
@@ -1087,7 +1087,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
 	TCP_SKB_CB(skb)->sacked	 = 0;
 
 	sk = __inet_lookup(&tcp_hashinfo, skb->nh.iph->saddr, th->source,
-			   skb->nh.iph->daddr, ntohs(th->dest),
+			   skb->nh.iph->daddr, th->dest,
 			   inet_iif(skb));
 
 	if (!sk)
@@ -1165,7 +1165,7 @@ do_time_wait:
 	case TCP_TW_SYN: {
 		struct sock *sk2 = inet_lookup_listener(&tcp_hashinfo,
 							skb->nh.iph->daddr,
-							ntohs(th->dest),
+							th->dest,
 							inet_iif(skb));
 		if (sk2) {
 			inet_twsk_deschedule((struct inet_timewait_sock *)sk,

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

* Re: [1/2] [IPV4]: Uninline inet_lookup_listener
  2006-08-08  8:46 [1/2] [IPV4]: Uninline inet_lookup_listener Herbert Xu
  2006-08-08  8:47 ` [2/2] [IPV4]: Use network-order dport for all visible inet_lookup_* Herbert Xu
@ 2006-08-08  9:21 ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2006-08-08  9:21 UTC (permalink / raw)
  To: herbert; +Cc: netdev

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Tue, 8 Aug 2006 18:46:14 +1000

> [IPV4]: Uninline inet_lookup_listener
> 
> By modern standards this function is way too big to be inlined.  It's
> even bigger than __inet_lookup_listener :)
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Applied, thanks.

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

* Re: [2/2] [IPV4]: Use network-order dport for all visible inet_lookup_*
  2006-08-08  8:47 ` [2/2] [IPV4]: Use network-order dport for all visible inet_lookup_* Herbert Xu
@ 2006-08-08  9:24   ` David Miller
  2006-08-08 11:11     ` Herbert Xu
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2006-08-08  9:24 UTC (permalink / raw)
  To: herbert; +Cc: netdev

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Tue, 8 Aug 2006 18:47:29 +1000

> So this patch changes all visible inet_lookup functions to take a
> dport and move all dport->hnum conversion inside them.

This isn't so nice because we will now byte-swap the port twice when
we try looking up a listening socket.  Once for the established lookup
and once for the listening hash lookup.

It should be easy to do the byte-swap once at a higher level right?

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

* Re: [2/2] [IPV4]: Use network-order dport for all visible inet_lookup_*
  2006-08-08  9:24   ` David Miller
@ 2006-08-08 11:11     ` Herbert Xu
  2006-08-08 13:29       ` Christoph Hellwig
  2006-08-09 22:47       ` David Miller
  0 siblings, 2 replies; 8+ messages in thread
From: Herbert Xu @ 2006-08-08 11:11 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On Tue, Aug 08, 2006 at 02:24:43AM -0700, David Miller wrote:
> 
> This isn't so nice because we will now byte-swap the port twice when
> we try looking up a listening socket.  Once for the established lookup
> and once for the listening hash lookup.
> 
> It should be easy to do the byte-swap once at a higher level right?

Good point.  This patch eliminates the double swap for __inet_lookup.

[IPV4]: Use network-order dport for all visible inet_lookup_*

Right now most inet_lookup_* functions take a host-order hnum instead
of a network-order dport because that's how it is represented internally.

This means that users of these functions have to be careful about using
the right byte-order.  To add more confusion, inet_lookup takes a
network-order dport unlike all other functions.

So this patch changes all visible inet_lookup functions to take a dport
and move all dport->hnum conversion inside them.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
e27e3b120697dfcf46a840291de318123e9b78f4
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index bd513f3..b4491c9 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -271,10 +271,16 @@ static inline int inet_iif(const struct 
 	return ((struct rtable *)skb->dst)->rt_iif;
 }
 
-extern struct sock *
-		inet_lookup_listener(struct inet_hashinfo *hashinfo,
-				     const u32 daddr,
-				     const unsigned short hnum, const int dif);
+extern struct sock *__inet_lookup_listener(struct inet_hashinfo *hashinfo,
+					   const u32 daddr,
+					   const unsigned short hnum,
+					   const int dif);
+
+static inline struct sock *inet_lookup_listener(struct inet_hashinfo *hashinfo,
+						u32 daddr, u16 dport, int dif)
+{
+	return __inet_lookup_listener(hashinfo, daddr, ntohs(dport), dif);
+}
 
 /* Socket demux engine toys. */
 #ifdef __BIG_ENDIAN
@@ -362,14 +368,25 @@ hit:
 	goto out;
 }
 
+static inline struct sock *
+	inet_lookup_established(struct inet_hashinfo *hashinfo,
+				const u32 saddr, const u16 sport,
+				const u32 daddr, const u16 dport,
+				const int dif)
+{
+	return __inet_lookup_established(hashinfo, saddr, sport, daddr,
+					 ntohs(dport), dif);
+}
+
 static inline struct sock *__inet_lookup(struct inet_hashinfo *hashinfo,
 					 const u32 saddr, const u16 sport,
-					 const u32 daddr, const u16 hnum,
+					 const u32 daddr, const u16 dport,
 					 const int dif)
 {
+	u16 hnum = ntohs(dport);
 	struct sock *sk = __inet_lookup_established(hashinfo, saddr, sport, daddr,
 						    hnum, dif);
-	return sk ? : inet_lookup_listener(hashinfo, daddr, hnum, dif);
+	return sk ? : __inet_lookup_listener(hashinfo, daddr, hnum, dif);
 }
 
 static inline struct sock *inet_lookup(struct inet_hashinfo *hashinfo,
@@ -380,7 +397,7 @@ static inline struct sock *inet_lookup(s
 	struct sock *sk;
 
 	local_bh_disable();
-	sk = __inet_lookup(hashinfo, saddr, sport, daddr, ntohs(dport), dif);
+	sk = __inet_lookup(hashinfo, saddr, sport, daddr, dport, dif);
 	local_bh_enable();
 
 	return sk;
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 7f56f7e..58c3275 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -605,10 +605,10 @@ static struct sock *dccp_v4_hnd_req(stru
 	if (req != NULL)
 		return dccp_check_req(sk, skb, req, prev);
 
-	nsk = __inet_lookup_established(&dccp_hashinfo,
-					iph->saddr, dh->dccph_sport,
-					iph->daddr, ntohs(dh->dccph_dport),
-					inet_iif(skb));
+	nsk = inet_lookup_established(&dccp_hashinfo,
+				      iph->saddr, dh->dccph_sport,
+				      iph->daddr, dh->dccph_dport,
+				      inet_iif(skb));
 	if (nsk != NULL) {
 		if (nsk->sk_state != DCCP_TIME_WAIT) {
 			bh_lock_sock(nsk);
@@ -921,7 +921,7 @@ static int dccp_v4_rcv(struct sk_buff *s
 	 * 	Look up flow ID in table and get corresponding socket */
 	sk = __inet_lookup(&dccp_hashinfo,
 			   skb->nh.iph->saddr, dh->dccph_sport,
-			   skb->nh.iph->daddr, ntohs(dh->dccph_dport),
+			   skb->nh.iph->daddr, dh->dccph_dport,
 			   inet_iif(skb));
 
 	/* 
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index bfc3906..fb296c9 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -124,10 +124,10 @@ EXPORT_SYMBOL(inet_listen_wlock);
  * remote address for the connection. So always assume those are both
  * wildcarded during the search since they can never be otherwise.
  */
-static struct sock *__inet_lookup_listener(const struct hlist_head *head,
-					   const u32 daddr,
-					   const unsigned short hnum,
-					   const int dif)
+static struct sock *inet_lookup_listener_slow(const struct hlist_head *head,
+					      const u32 daddr,
+					      const unsigned short hnum,
+					      const int dif)
 {
 	struct sock *result = NULL, *sk;
 	const struct hlist_node *node;
@@ -162,9 +162,9 @@ static struct sock *__inet_lookup_listen
 }
 
 /* Optimize the common listener case. */
-struct sock *inet_lookup_listener(struct inet_hashinfo *hashinfo,
-				  const u32 daddr, const unsigned short hnum,
-				  const int dif)
+struct sock *__inet_lookup_listener(struct inet_hashinfo *hashinfo,
+				    const u32 daddr, const unsigned short hnum,
+				    const int dif)
 {
 	struct sock *sk = NULL;
 	const struct hlist_head *head;
@@ -179,7 +179,7 @@ struct sock *inet_lookup_listener(struct
 		    (sk->sk_family == PF_INET || !ipv6_only_sock(sk)) &&
 		    !sk->sk_bound_dev_if)
 			goto sherry_cache;
-		sk = __inet_lookup_listener(head, daddr, hnum, dif);
+		sk = inet_lookup_listener_slow(head, daddr, hnum, dif);
 	}
 	if (sk) {
 sherry_cache:
@@ -188,7 +188,7 @@ sherry_cache:
 	read_unlock(&hashinfo->lhash_lock);
 	return sk;
 }
-EXPORT_SYMBOL_GPL(inet_lookup_listener);
+EXPORT_SYMBOL_GPL(__inet_lookup_listener);
 
 /* called with local bh disabled */
 static int __inet_check_established(struct inet_timewait_death_row *death_row,
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 4b04c3e..ba3e2a7 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -948,9 +948,9 @@ static struct sock *tcp_v4_hnd_req(struc
 	if (req)
 		return tcp_check_req(sk, skb, req, prev);
 
-	nsk = __inet_lookup_established(&tcp_hashinfo, skb->nh.iph->saddr,
-					th->source, skb->nh.iph->daddr,
-					ntohs(th->dest), inet_iif(skb));
+	nsk = inet_lookup_established(&tcp_hashinfo, skb->nh.iph->saddr,
+				      th->source, skb->nh.iph->daddr,
+				      th->dest, inet_iif(skb));
 
 	if (nsk) {
 		if (nsk->sk_state != TCP_TIME_WAIT) {
@@ -1087,7 +1087,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
 	TCP_SKB_CB(skb)->sacked	 = 0;
 
 	sk = __inet_lookup(&tcp_hashinfo, skb->nh.iph->saddr, th->source,
-			   skb->nh.iph->daddr, ntohs(th->dest),
+			   skb->nh.iph->daddr, th->dest,
 			   inet_iif(skb));
 
 	if (!sk)
@@ -1165,7 +1165,7 @@ do_time_wait:
 	case TCP_TW_SYN: {
 		struct sock *sk2 = inet_lookup_listener(&tcp_hashinfo,
 							skb->nh.iph->daddr,
-							ntohs(th->dest),
+							th->dest,
 							inet_iif(skb));
 		if (sk2) {
 			inet_twsk_deschedule((struct inet_timewait_sock *)sk,

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

* Re: [2/2] [IPV4]: Use network-order dport for all visible inet_lookup_*
  2006-08-08 11:11     ` Herbert Xu
@ 2006-08-08 13:29       ` Christoph Hellwig
  2006-08-08 13:40         ` Herbert Xu
  2006-08-09 22:47       ` David Miller
  1 sibling, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2006-08-08 13:29 UTC (permalink / raw)
  To: Herbert Xu; +Cc: David Miller, netdev

On Tue, Aug 08, 2006 at 09:11:40PM +1000, Herbert Xu wrote:
> On Tue, Aug 08, 2006 at 02:24:43AM -0700, David Miller wrote:
> > 
> > This isn't so nice because we will now byte-swap the port twice when
> > we try looking up a listening socket.  Once for the established lookup
> > and once for the listening hash lookup.
> > 
> > It should be easy to do the byte-swap once at a higher level right?
> 
> Good point.  This patch eliminates the double swap for __inet_lookup.
> 
> [IPV4]: Use network-order dport for all visible inet_lookup_*

Shouldn't it use __be16 types then?


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

* Re: [2/2] [IPV4]: Use network-order dport for all visible inet_lookup_*
  2006-08-08 13:29       ` Christoph Hellwig
@ 2006-08-08 13:40         ` Herbert Xu
  0 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2006-08-08 13:40 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: herbert, davem, netdev

Christoph Hellwig <hch@infradead.org> wrote:
>
>> [IPV4]: Use network-order dport for all visible inet_lookup_*
> 
> Shouldn't it use __be16 types then?

Yes it should.

However, we can't easily annotate the stack piecemeal.  So this should
be annotated along with the rest of the stack (e.g., tcphdr, etc.).

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [2/2] [IPV4]: Use network-order dport for all visible inet_lookup_*
  2006-08-08 11:11     ` Herbert Xu
  2006-08-08 13:29       ` Christoph Hellwig
@ 2006-08-09 22:47       ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2006-08-09 22:47 UTC (permalink / raw)
  To: herbert; +Cc: netdev

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Tue, 8 Aug 2006 21:11:40 +1000

> Good point.  This patch eliminates the double swap for __inet_lookup.
> 
> [IPV4]: Use network-order dport for all visible inet_lookup_*

Applied, thanks Herbert.

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

end of thread, other threads:[~2006-08-09 22:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-08  8:46 [1/2] [IPV4]: Uninline inet_lookup_listener Herbert Xu
2006-08-08  8:47 ` [2/2] [IPV4]: Use network-order dport for all visible inet_lookup_* Herbert Xu
2006-08-08  9:24   ` David Miller
2006-08-08 11:11     ` Herbert Xu
2006-08-08 13:29       ` Christoph Hellwig
2006-08-08 13:40         ` Herbert Xu
2006-08-09 22:47       ` David Miller
2006-08-08  9:21 ` [1/2] [IPV4]: Uninline inet_lookup_listener 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).