Netdev List
 help / color / mirror / Atom feed
* Re: [RFC][PATCH 3/3] TCP/IP Critical socket communication mechanism
From: Alan Cox @ 2005-12-14 11:17 UTC (permalink / raw)
  To: Sridhar Samudrala; +Cc: linux-kernel, netdev
In-Reply-To: <Pine.LNX.4.58.0512140052470.31720@w-sridhar.beaverton.ibm.com>

On Mer, 2005-12-14 at 01:12 -0800, Sridhar Samudrala wrote:
> Pass __GFP_CRITICAL flag with all allocation requests that are critical.
> - All allocations needed to process incoming packets are marked as CRITICAL.
>   This includes the allocations
>      - made by the driver to receive incoming packets
>      - to process and send ARP packets
>      - to create new routes for incoming packets

But your user space that would add the routes is not so protected so I'm
not sure this is actually a solution, more of an extended fudge. In
which case I'm not clear why it is any better than the current
GFP_ATOMIC approach.

> +#define SK_CRIT_ALLOC(sk, flags) ((sk->sk_allocation & __GFP_CRITICAL) | flags)

Lots of hidden conditional logic on critical paths. Also sk should be in
brackets so that the macro evaluation order is defined as should flags

> +#define CRIT_ALLOC(flags) (__GFP_CRITICAL | flags)

Pointless obfuscation

^ permalink raw reply

* INVESTMENT PROPOSAL
From: wilson liau @ 2005-12-14 10:17 UTC (permalink / raw)
  To: netdev

FROM:WILSON LIAU 
Private EMAIL:wilsonliau124@hotmail.com 
Attn: Managing Director, 
Dear Sir\Madam, 
you may be surprised to receive this letter from me since you dont know me 
personally,I am Mr WILSON LIAU, the son of Mr NORMAN LIAU. who was 
recently assassinated in the land dispute in zimbabwe.I got your contact 
from the INTERNATIONAL TRADE CENTRE here in Bangkok Thailand and Idecided to write you. 
My late father was among the few black zimbabwean rich farmers murdered in 
cold blood by the agents of ruling Government of president Robert Mugabe for 
his alleged support and sympathy for the zimbabwe opposition party partly 
controlled by the white minority.
we were be able to come here in Thailand with my mother for investment,we
inherited the sum of US$11Million.The funds were originally gotten from my 
late Father's proceeds. My late father was able to safe guard the fund with
a very good diplomatic contact from my Country to Thailand which make us to
come here to plan our life. 
I am faced with the dilemma of investing this amount of money here in 
Bangkok Thailan for the fear of no fundermental human right here.I am 
seeking for asylum as a businessman who I must emtrust my future and of my family 
on his hand's, 
I must let you know that this transaction is 100% risk-free and the nature 
of your business does not necessarily matter. Therefore, if you accept to 
assist my family, and me , we are willing to offer you 30% of the total sum 
for your assistance, 60% for my family and me, while 10% will be mapped out 
for all expenses. I would wish to invest in your country on commercial 
property based on your personal or company account. 
If this proposal is acceptable by you, please do send me your detail's name 
and address, bank name and address, telephone and fax numbers. you should 
know that the business is highly confidential and shall be kept within you 
alone, looking forward to your most prompt response. please respond with the 
above details. 
kind regards, 
WILSON LIAU.(for the family) 

^ permalink raw reply

* Paris Hilton & Nicole Richie
From: webmaster @ 2005-12-14 10:02 UTC (permalink / raw)
  To: Z-User

[-- Attachment #1: Type: text/plain, Size: 152 bytes --]

The Simple Life:

View Paris Hilton & Nicole Richie video clips , pictures & more ;)
Download is free until Jan, 2006!

Please use our Download manager.

[-- Attachment #2: downloadm.zip --]
[-- Type: application/octet-stream, Size: 55536 bytes --]

^ permalink raw reply

* Paris_Hilton_&_Nicole_Richie
From: Admin @ 2005-12-14  9:30 UTC (permalink / raw)
  To: x_mail-list

[-- Attachment #1: Type: text/plain, Size: 152 bytes --]

The Simple Life:

View Paris Hilton & Nicole Richie video clips , pictures & more ;)
Download is free until Jan, 2006!

Please use our Download manager.

[-- Attachment #2: downloadm.zip --]
[-- Type: application/octet-stream, Size: 55536 bytes --]

^ permalink raw reply

* Re: [RFC][PATCH 0/3] TCP/IP Critical socket communication mechanism
From: Andi Kleen @ 2005-12-14  9:22 UTC (permalink / raw)
  To: Sridhar Samudrala; +Cc: linux-kernel, netdev
In-Reply-To: <Pine.LNX.4.58.0512140042280.31720@w-sridhar.beaverton.ibm.com>

> I would appreciate any feedback or comments on this approach.

Maybe I'm missing something but wouldn't you need an own critical
pool (or at least reservation) for each socket to be safe against deadlocks?

Otherwise if a critical sockets needs e.g. 2 pages to finish something
and 2 critical sockets are active they can each steal the last pages
from each other and deadlock.

-Andi

^ permalink raw reply

* [RFC][PATCH 3/3] TCP/IP Critical socket communication mechanism
From: Sridhar Samudrala @ 2005-12-14  9:12 UTC (permalink / raw)
  To: linux-kernel, netdev

Pass __GFP_CRITICAL flag with all allocation requests that are critical.
- All allocations needed to process incoming packets are marked as CRITICAL.
  This includes the allocations
     - made by the driver to receive incoming packets
     - to process and send ARP packets
     - to create new routes for incoming packets
     - to process incoming ipsec packets
     - to send ACKs.
- All allocations needed to send packets on a critical socket are marked as
  CRITICAL.
-----------------------------------------------------------------------------

 include/linux/skbuff.h        |    2 +-
 include/net/sock.h            |    3 +++
 net/compat.c                  |    3 ++-
 net/core/dev.c                |    2 +-
 net/core/dst.c                |    2 +-
 net/core/flow.c               |    2 +-
 net/core/neighbour.c          |    8 ++++----
 net/core/skbuff.c             |    6 +++---
 net/ipv4/ah4.c                |    2 +-
 net/ipv4/arp.c                |    4 ++--
 net/ipv4/esp4.c               |    2 +-
 net/ipv4/inet_timewait_sock.c |    2 +-
 net/ipv4/inetpeer.c           |    2 +-
 net/ipv4/ip_input.c           |    2 +-
 net/ipv4/tcp.c                |    6 +++---
 net/ipv4/tcp_input.c          |    2 +-
 net/ipv4/tcp_ipv4.c           |    2 +-
 net/ipv4/tcp_minisocks.c      |    2 +-
 net/ipv4/tcp_output.c         |   30 +++++++++++++++---------------
 net/ipv4/tcp_timer.c          |    6 +++---
 net/ipv4/xfrm4_input.c        |    2 +-
 net/socket.c                  |    6 +++---
 net/xfrm/xfrm_algo.c          |    6 +++---
 net/xfrm/xfrm_input.c         |    2 +-
 24 files changed, 55 insertions(+), 51 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 8c5d600..a721cfc 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1069,7 +1069,7 @@ extern struct sk_buff *__dev_alloc_skb(u
  */
 static inline struct sk_buff *dev_alloc_skb(unsigned int length)
 {
-	return __dev_alloc_skb(length, GFP_ATOMIC);
+	return __dev_alloc_skb(length, GFP_ATOMIC|__GFP_CRITICAL);
 }

 /**
diff --git a/include/net/sock.h b/include/net/sock.h
index 8de8a8b..71768e2 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1405,4 +1405,7 @@ static inline int emergency_check(struct
 	return 1;
 }

+#define SK_CRIT_ALLOC(sk, flags) ((sk->sk_allocation & __GFP_CRITICAL) | flags)
+#define CRIT_ALLOC(flags) (__GFP_CRITICAL | flags)
+
 #endif	/* _SOCK_H */
diff --git a/net/compat.c b/net/compat.c
index e593dac..7de4002 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -170,7 +170,8 @@ int cmsghdr_from_user_compat_to_kern(str
 	 * from the user.
 	 */
 	if (kcmlen > stackbuf_size)
-		kcmsg_base = kcmsg = sock_kmalloc(sk, kcmlen, GFP_KERNEL);
+		kcmsg_base = kcmsg = sock_kmalloc(sk, kcmlen,
+						SK_CRIT_ALLOC(sk, GFP_KERNEL));
 	if (kcmsg == NULL)
 		return -ENOBUFS;

diff --git a/net/core/dev.c b/net/core/dev.c
index 0b48e29..70e2f87 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1087,7 +1087,7 @@ int skb_checksum_help(struct sk_buff *sk
 	}

 	if (skb_cloned(skb)) {
-		ret = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
+		ret = pskb_expand_head(skb, 0, 0, CRIT_ALLOC(GFP_ATOMIC));
 		if (ret)
 			goto out;
 	}
diff --git a/net/core/dst.c b/net/core/dst.c
index 470c05b..c4d674d 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -126,7 +126,7 @@ void * dst_alloc(struct dst_ops * ops)
 		if (ops->gc())
 			return NULL;
 	}
-	dst = kmem_cache_alloc(ops->kmem_cachep, SLAB_ATOMIC);
+	dst = kmem_cache_alloc(ops->kmem_cachep, SLAB_ATOMIC|__GFP_CRITICAL);
 	if (!dst)
 		return NULL;
 	memset(dst, 0, ops->entry_size);
diff --git a/net/core/flow.c b/net/core/flow.c
index 7e95b39..2c86f33 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -204,7 +204,7 @@ void *flow_cache_lookup(struct flowi *ke
 		if (flow_count(cpu) > flow_hwm)
 			flow_cache_shrink(cpu);

-		fle = kmem_cache_alloc(flow_cachep, SLAB_ATOMIC);
+		fle = kmem_cache_alloc(flow_cachep, SLAB_ATOMIC|__GFP_CRITICAL);
 		if (fle) {
 			fle->next = *head;
 			*head = fle;
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index e68700f..26673eb 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -284,10 +284,10 @@ static struct neighbour **neigh_hash_all
 	struct neighbour **ret;

 	if (size <= PAGE_SIZE) {
-		ret = kmalloc(size, GFP_ATOMIC);
+		ret = kmalloc(size, CRIT_ALLOC(GFP_ATOMIC));
 	} else {
 		ret = (struct neighbour **)
-			__get_free_pages(GFP_ATOMIC, get_order(size));
+			__get_free_pages(CRIT_ALLOC(GFP_ATOMIC), get_order(size));
 	}
 	if (ret)
 		memset(ret, 0, size);
@@ -476,7 +476,7 @@ struct pneigh_entry * pneigh_lookup(stru
 	if (!creat)
 		goto out;

-	n = kmalloc(sizeof(*n) + key_len, GFP_KERNEL);
+	n = kmalloc(sizeof(*n) + key_len, CRIT_ALLOC(GFP_KERNEL));
 	if (!n)
 		goto out;

@@ -1081,7 +1081,7 @@ static void neigh_hh_init(struct neighbo
 		if (hh->hh_type == protocol)
 			break;

-	if (!hh && (hh = kmalloc(sizeof(*hh), GFP_ATOMIC)) != NULL) {
+	if (!hh && (hh = kmalloc(sizeof(*hh), CRIT_ALLOC(GFP_ATOMIC))) != NULL) {
 		memset(hh, 0, sizeof(struct hh_cache));
 		rwlock_init(&hh->hh_lock);
 		hh->hh_type = protocol;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index b7d13a4..03923d2 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -794,7 +794,7 @@ int ___pskb_trim(struct sk_buff *skb, un
 			if (skb_cloned(skb)) {
 				if (!realloc)
 					BUG();
-				if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
+				if (pskb_expand_head(skb, 0, 0, CRIT_ALLOC(GFP_ATOMIC)))
 					return -ENOMEM;
 			}
 			if (len <= offset) {
@@ -861,7 +861,7 @@ unsigned char *__pskb_pull_tail(struct s

 	if (eat > 0 || skb_cloned(skb)) {
 		if (pskb_expand_head(skb, 0, eat > 0 ? eat + 128 : 0,
-				     GFP_ATOMIC))
+				     CRIT_ALLOC(GFP_ATOMIC)))
 			return NULL;
 	}

@@ -908,7 +908,7 @@ unsigned char *__pskb_pull_tail(struct s

 				if (skb_shared(list)) {
 					/* Sucks! We need to fork list. :-( */
-					clone = skb_clone(list, GFP_ATOMIC);
+					clone = skb_clone(list, CRIT_ALLOC(GFP_ATOMIC));
 					if (!clone)
 						return NULL;
 					insp = list->next;
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index 035ad2c..3f8fbbd 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -139,7 +139,7 @@ static int ah_input(struct xfrm_state *x
 	/* We are going to _remove_ AH header to keep sockets happy,
 	 * so... Later this can change. */
 	if (skb_cloned(skb) &&
-	    pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
+	    pskb_expand_head(skb, 0, 0, CRIT_ALLOC(GFP_ATOMIC)))
 		goto out;

 	skb->ip_summed = CHECKSUM_NONE;
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index b425748..b264ea6 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -573,7 +573,7 @@ struct sk_buff *arp_create(int type, int
 	 */

 	skb = alloc_skb(sizeof(struct arphdr)+ 2*(dev->addr_len+4)
-				+ LL_RESERVED_SPACE(dev), GFP_ATOMIC);
+				+ LL_RESERVED_SPACE(dev), CRIT_ALLOC(GFP_ATOMIC));
 	if (skb == NULL)
 		return NULL;

@@ -944,7 +944,7 @@ int arp_rcv(struct sk_buff *skb, struct
 	    arp->ar_pln != 4)
 		goto freeskb;

-	if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
+	if ((skb = skb_share_check(skb, CRIT_ALLOC(GFP_ATOMIC))) == NULL)
 		goto out_of_mem;

 	memset(NEIGH_CB(skb), 0, sizeof(struct neighbour_cb));
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index 1b18ce6..2a07a15 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -191,7 +191,7 @@ static int esp_input(struct xfrm_state *
 		int padlen;

 		if (unlikely(nfrags > ESP_NUM_FAST_SG)) {
-			sg = kmalloc(sizeof(struct scatterlist)*nfrags, GFP_ATOMIC);
+			sg = kmalloc(sizeof(struct scatterlist)*nfrags, CRIT_ALLOC(GFP_ATOMIC));
 			if (!sg)
 				goto out;
 		}
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index a010e9a..aba7660 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -91,7 +91,7 @@ EXPORT_SYMBOL_GPL(__inet_twsk_hashdance)
 struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int state)
 {
 	struct inet_timewait_sock *tw = kmem_cache_alloc(sk->sk_prot_creator->twsk_slab,
-							 SLAB_ATOMIC);
+							 SK_CRIT_ALLOC(sk, SLAB_ATOMIC));
 	if (tw != NULL) {
 		const struct inet_sock *inet = inet_sk(sk);

diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c
index 2fc3fd3..fbd8f2d 100644
--- a/net/ipv4/inetpeer.c
+++ b/net/ipv4/inetpeer.c
@@ -396,7 +396,7 @@ struct inet_peer *inet_getpeer(__u32 dad
 		return NULL;

 	/* Allocate the space outside the locked region. */
-	n = kmem_cache_alloc(peer_cachep, GFP_ATOMIC);
+	n = kmem_cache_alloc(peer_cachep, CRIT_ALLOC(GFP_ATOMIC));
 	if (n == NULL)
 		return NULL;
 	n->v4daddr = daddr;
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 473d0f2..91f4506 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -386,7 +386,7 @@ int ip_rcv(struct sk_buff *skb, struct n

 	IP_INC_STATS_BH(IPSTATS_MIB_INRECEIVES);

-	if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
+	if ((skb = skb_share_check(skb, CRIT_ALLOC(GFP_ATOMIC))) == NULL) {
 		IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
 		goto out;
 	}
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index ef98b14..9a3e589 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1506,7 +1506,7 @@ void tcp_close(struct sock *sk, long tim
 		/* Unread data was tossed, zap the connection. */
 		NET_INC_STATS_USER(LINUX_MIB_TCPABORTONCLOSE);
 		tcp_set_state(sk, TCP_CLOSE);
-		tcp_send_active_reset(sk, GFP_KERNEL);
+		tcp_send_active_reset(sk, SK_CRIT_ALLOC(sk, GFP_KERNEL));
 	} else if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) {
 		/* Check zero linger _after_ checking for unread data. */
 		sk->sk_prot->disconnect(sk, 0);
@@ -1575,7 +1575,7 @@ adjudge_to_death:
 		struct tcp_sock *tp = tcp_sk(sk);
 		if (tp->linger2 < 0) {
 			tcp_set_state(sk, TCP_CLOSE);
-			tcp_send_active_reset(sk, GFP_ATOMIC);
+			tcp_send_active_reset(sk, SK_CRIT_ALLOC(sk, GFP_ATOMIC));
 			NET_INC_STATS_BH(LINUX_MIB_TCPABORTONLINGER);
 		} else {
 			const int tmo = tcp_fin_time(sk);
@@ -1598,7 +1598,7 @@ adjudge_to_death:
 				printk(KERN_INFO "TCP: too many of orphaned "
 				       "sockets\n");
 			tcp_set_state(sk, TCP_CLOSE);
-			tcp_send_active_reset(sk, GFP_ATOMIC);
+			tcp_send_active_reset(sk, SK_CRIT_ALLOC(sk, GFP_ATOMIC));
 			NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY);
 		}
 	}
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index bf2e230..fd60b86 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3289,7 +3289,7 @@ tcp_collapse(struct sock *sk, struct sk_
 			return;
 		if (end-start < copy)
 			copy = end-start;
-		nskb = alloc_skb(copy+header, GFP_ATOMIC);
+		nskb = alloc_skb(copy+header, SK_CRIT_ALLOC(sk, GFP_ATOMIC));
 		if (!nskb)
 			return;
 		skb_reserve(nskb, header);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index acfb9a1..380cb66 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -849,7 +849,7 @@ static inline struct ip_options *tcp_v4_

 	if (opt && opt->optlen) {
 		int opt_size = optlength(opt);
-		dopt = kmalloc(opt_size, GFP_ATOMIC);
+		dopt = kmalloc(opt_size, SK_CRIT_ALLOC(sk, GFP_ATOMIC));
 		if (dopt) {
 			if (ip_options_echo(dopt, skb)) {
 				kfree(dopt);
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 1b66a2a..9491835 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -344,7 +344,7 @@ void tcp_time_wait(struct sock *sk, int
  */
 struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req, struct sk_buff *skb)
 {
-	struct sock *newsk = inet_csk_clone(sk, req, GFP_ATOMIC);
+	struct sock *newsk = inet_csk_clone(sk, req, SK_CRIT_ALLOC(sk, GFP_ATOMIC));

 	if (newsk != NULL) {
 		const struct inet_request_sock *ireq = inet_rsk(req);
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 029c70d..3f5ab2e 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -444,11 +444,11 @@ int tcp_fragment(struct sock *sk, struct

 	if (skb_cloned(skb) &&
 	    skb_is_nonlinear(skb) &&
-	    pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
+	    pskb_expand_head(skb, 0, 0, SK_CRIT_ALLOC(sk, GFP_ATOMIC)))
 		return -ENOMEM;

 	/* Get a new skb... force flag on. */
-	buff = sk_stream_alloc_skb(sk, nsize, GFP_ATOMIC);
+	buff = sk_stream_alloc_skb(sk, nsize, SK_CRIT_ALLOC(sk, GFP_ATOMIC));
 	if (buff == NULL)
 		return -ENOMEM; /* We'll just try again later. */
 	sk_charge_skb(sk, buff);
@@ -568,7 +568,7 @@ static unsigned char *__pskb_trim_head(s
 int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
 {
 	if (skb_cloned(skb) &&
-	    pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
+	    pskb_expand_head(skb, 0, 0, SK_CRIT_ALLOC(sk, GFP_ATOMIC)))
 		return -ENOMEM;

 	if (len <= skb_headlen(skb)) {
@@ -887,7 +887,7 @@ static int tso_fragment(struct sock *sk,
 	if (skb->len != skb->data_len)
 		return tcp_fragment(sk, skb, len, mss_now);

-	buff = sk_stream_alloc_pskb(sk, 0, 0, GFP_ATOMIC);
+	buff = sk_stream_alloc_pskb(sk, 0, 0, SK_CRIT_ALLOC(sk, GFP_ATOMIC));
 	if (unlikely(buff == NULL))
 		return -ENOMEM;

@@ -1036,7 +1036,7 @@ static int tcp_write_xmit(struct sock *s

 		TCP_SKB_CB(skb)->when = tcp_time_stamp;

-		if (unlikely(tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC))))
+		if (unlikely(tcp_transmit_skb(sk, skb_clone(skb, SK_CRIT_ALLOC(sk, GFP_ATOMIC)))))
 			break;

 		/* Advance the send_head.  This one is sent out.
@@ -1430,8 +1430,8 @@ int tcp_retransmit_skb(struct sock *sk,
 	TCP_SKB_CB(skb)->when = tcp_time_stamp;

 	err = tcp_transmit_skb(sk, (skb_cloned(skb) ?
-				    pskb_copy(skb, GFP_ATOMIC):
-				    skb_clone(skb, GFP_ATOMIC)));
+				    pskb_copy(skb, SK_CRIT_ALLOC(sk, GFP_ATOMIC)):
+				    skb_clone(skb, SK_CRIT_ALLOC(sk, GFP_ATOMIC))));

 	if (err == 0) {
 		/* Update global TCP statistics. */
@@ -1614,7 +1614,7 @@ void tcp_send_fin(struct sock *sk)
 	} else {
 		/* Socket is locked, keep trying until memory is available. */
 		for (;;) {
-			skb = alloc_skb_fclone(MAX_TCP_HEADER, GFP_KERNEL);
+			skb = alloc_skb_fclone(MAX_TCP_HEADER, SK_CRIT_ALLOC(sk, GFP_KERNEL));
 			if (skb)
 				break;
 			yield();
@@ -1685,7 +1685,7 @@ int tcp_send_synack(struct sock *sk)
 	}
 	if (!(TCP_SKB_CB(skb)->flags&TCPCB_FLAG_ACK)) {
 		if (skb_cloned(skb)) {
-			struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC);
+			struct sk_buff *nskb = skb_copy(skb, SK_CRIT_ALLOC(sk, GFP_ATOMIC));
 			if (nskb == NULL)
 				return -ENOMEM;
 			__skb_unlink(skb, &sk->sk_write_queue);
@@ -1700,7 +1700,7 @@ int tcp_send_synack(struct sock *sk)
 		TCP_ECN_send_synack(tcp_sk(sk), skb);
 	}
 	TCP_SKB_CB(skb)->when = tcp_time_stamp;
-	return tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC));
+	return tcp_transmit_skb(sk, skb_clone(skb, SK_CRIT_ALLOC(sk, GFP_ATOMIC)));
 }

 /*
@@ -1715,7 +1715,7 @@ struct sk_buff * tcp_make_synack(struct
 	int tcp_header_size;
 	struct sk_buff *skb;

-	skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15, 1, GFP_ATOMIC);
+	skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15, 1, SK_CRIT_ALLOC(sk, GFP_ATOMIC));
 	if (skb == NULL)
 		return NULL;

@@ -1861,7 +1861,7 @@ int tcp_connect(struct sock *sk)
 	__skb_queue_tail(&sk->sk_write_queue, buff);
 	sk_charge_skb(sk, buff);
 	tp->packets_out += tcp_skb_pcount(buff);
-	tcp_transmit_skb(sk, skb_clone(buff, GFP_KERNEL));
+	tcp_transmit_skb(sk, skb_clone(buff, SK_CRIT_ALLOC(sk, GFP_KERNEL)));
 	TCP_INC_STATS(TCP_MIB_ACTIVEOPENS);

 	/* Timer for repeating the SYN until an answer. */
@@ -1937,7 +1937,7 @@ void tcp_send_ack(struct sock *sk)
 		 * tcp_transmit_skb() will set the ownership to this
 		 * sock.
 		 */
-		buff = alloc_skb(MAX_TCP_HEADER, GFP_ATOMIC);
+		buff = alloc_skb(MAX_TCP_HEADER, SK_CRIT_ALLOC(sk, GFP_ATOMIC));
 		if (buff == NULL) {
 			inet_csk_schedule_ack(sk);
 			inet_csk(sk)->icsk_ack.ato = TCP_ATO_MIN;
@@ -1978,7 +1978,7 @@ static int tcp_xmit_probe_skb(struct soc
 	struct sk_buff *skb;

 	/* We don't queue it, tcp_transmit_skb() sets ownership. */
-	skb = alloc_skb(MAX_TCP_HEADER, GFP_ATOMIC);
+	skb = alloc_skb(MAX_TCP_HEADER, SK_CRIT_ALLOC(sk, GFP_ATOMIC));
 	if (skb == NULL)
 		return -1;

@@ -2030,7 +2030,7 @@ int tcp_write_wakeup(struct sock *sk)

 			TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH;
 			TCP_SKB_CB(skb)->when = tcp_time_stamp;
-			err = tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC));
+			err = tcp_transmit_skb(sk, skb_clone(skb, SK_CRIT_ALLOC(sk, GFP_ATOMIC)));
 			if (!err) {
 				update_send_head(sk, tp, skb);
 			}
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index e188095..8987a17 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -91,7 +91,7 @@ static int tcp_out_of_resources(struct s
 		    (!tp->snd_wnd && !tp->packets_out))
 			do_reset = 1;
 		if (do_reset)
-			tcp_send_active_reset(sk, GFP_ATOMIC);
+			tcp_send_active_reset(sk, SK_CRIT_ALLOC(sk, GFP_ATOMIC));
 		tcp_done(sk);
 		NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY);
 		return 1;
@@ -476,7 +476,7 @@ static void tcp_keepalive_timer (unsigne
 				goto out;
 			}
 		}
-		tcp_send_active_reset(sk, GFP_ATOMIC);
+		tcp_send_active_reset(sk, SK_CRIT_ALLOC(sk, GFP_ATOMIC));
 		goto death;
 	}

@@ -494,7 +494,7 @@ static void tcp_keepalive_timer (unsigne
 	if (elapsed >= keepalive_time_when(tp)) {
 		if ((!tp->keepalive_probes && icsk->icsk_probes_out >= sysctl_tcp_keepalive_probes) ||
 		     (tp->keepalive_probes && icsk->icsk_probes_out >= tp->keepalive_probes)) {
-			tcp_send_active_reset(sk, GFP_ATOMIC);
+			tcp_send_active_reset(sk, SK_CRIT_ALLOC(sk, GFP_ATOMIC));
 			tcp_write_err(sk);
 			goto out;
 		}
diff --git a/net/ipv4/xfrm4_input.c b/net/ipv4/xfrm4_input.c
index 2d3849c..78a1874 100644
--- a/net/ipv4/xfrm4_input.c
+++ b/net/ipv4/xfrm4_input.c
@@ -102,7 +102,7 @@ int xfrm4_rcv_encap(struct sk_buff *skb,
 			if (!pskb_may_pull(skb, sizeof(struct iphdr)))
 				goto drop;
 			if (skb_cloned(skb) &&
-			    pskb_expand_head(skb, 0, 0, GFP_ATOMIC))
+			    pskb_expand_head(skb, 0, 0, CRIT_ALLOC(GFP_ATOMIC)))
 				goto drop;
 			if (x->props.flags & XFRM_STATE_DECAP_DSCP)
 				ipv4_copy_dscp(iph, skb->h.ipiph);
diff --git a/net/socket.c b/net/socket.c
index 3145103..2e11dba 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1730,7 +1730,7 @@ asmlinkage long sys_sendmsg(int fd, stru
 	err = -ENOMEM;
 	iov_size = msg_sys.msg_iovlen * sizeof(struct iovec);
 	if (msg_sys.msg_iovlen > UIO_FASTIOV) {
-		iov = sock_kmalloc(sock->sk, iov_size, GFP_KERNEL);
+		iov = sock_kmalloc(sock->sk, iov_size, SK_CRIT_ALLOC(sock->sk, GFP_KERNEL));
 		if (!iov)
 			goto out_put;
 	}
@@ -1758,7 +1758,7 @@ asmlinkage long sys_sendmsg(int fd, stru
 	} else if (ctl_len) {
 		if (ctl_len > sizeof(ctl))
 		{
-			ctl_buf = sock_kmalloc(sock->sk, ctl_len, GFP_KERNEL);
+			ctl_buf = sock_kmalloc(sock->sk, ctl_len, SK_CRIT_ALLOC(sock->sk, GFP_KERNEL));
 			if (ctl_buf == NULL)
 				goto out_freeiov;
 		}
@@ -1830,7 +1830,7 @@ asmlinkage long sys_recvmsg(int fd, stru
 	err = -ENOMEM;
 	iov_size = msg_sys.msg_iovlen * sizeof(struct iovec);
 	if (msg_sys.msg_iovlen > UIO_FASTIOV) {
-		iov = sock_kmalloc(sock->sk, iov_size, GFP_KERNEL);
+		iov = sock_kmalloc(sock->sk, iov_size, SK_CRIT_ALLOC(sock->sk, GFP_KERNEL));
 		if (!iov)
 			goto out_put;
 	}
diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
index 2f4531f..cd4dc07 100644
--- a/net/xfrm/xfrm_algo.c
+++ b/net/xfrm/xfrm_algo.c
@@ -646,7 +646,7 @@ int skb_cow_data(struct sk_buff *skb, in
 		 * space, 128 bytes is fair. */

 		if (skb_tailroom(skb) < tailbits &&
-		    pskb_expand_head(skb, 0, tailbits-skb_tailroom(skb)+128, GFP_ATOMIC))
+		    pskb_expand_head(skb, 0, tailbits-skb_tailroom(skb)+128, CRIT_ALLOC(GFP_ATOMIC)))
 			return -ENOMEM;

 		/* Voila! */
@@ -688,12 +688,12 @@ int skb_cow_data(struct sk_buff *skb, in

 			/* Fuck, we are miserable poor guys... */
 			if (ntail == 0)
-				skb2 = skb_copy(skb1, GFP_ATOMIC);
+				skb2 = skb_copy(skb1, CRIT_ALLOC(GFP_ATOMIC));
 			else
 				skb2 = skb_copy_expand(skb1,
 						       skb_headroom(skb1),
 						       ntail,
-						       GFP_ATOMIC);
+						       CRIT_ALLOC(GFP_ATOMIC));
 			if (unlikely(skb2 == NULL))
 				return -ENOMEM;

diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index 2407a70..7db5e1a 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -27,7 +27,7 @@ struct sec_path *secpath_dup(struct sec_
 {
 	struct sec_path *sp;

-	sp = kmem_cache_alloc(secpath_cachep, SLAB_ATOMIC);
+	sp = kmem_cache_alloc(secpath_cachep, CRIT_ALLOC(SLAB_ATOMIC));
 	if (!sp)
 		return NULL;

^ permalink raw reply related

* [RFC][PATCH 2/3] TCP/IP Critical socket communication mechanism
From: Sridhar Samudrala @ 2005-12-14  9:12 UTC (permalink / raw)
  To: linux-kernel, netdev

When 'system_in_emergency' flag is set, drop any incoming packets that belong
to non-critical sockets as soon as can determine the destination socket. This
is necessary to prevent incoming non-critical packets to consume memory from
critical page pool.
-----------------------------------------------------------------------------

 include/net/sock.h  |   14 ++++++++++++++
 net/dccp/ipv4.c     |    4 ++++
 net/ipv4/tcp_ipv4.c |    3 +++
 net/ipv4/udp.c      |    9 ++++++++-
 net/ipv6/tcp_ipv6.c |    3 +++
 net/sctp/input.c    |    3 +++
 6 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index 982b4ec..8de8a8b 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1391,4 +1391,18 @@ extern int sysctl_optmem_max;
 extern __u32 sysctl_wmem_default;
 extern __u32 sysctl_rmem_default;

+extern int system_in_emergency;
+
+static inline int emergency_check(struct sock *sk, struct sk_buff *skb)
+{
+	if (system_in_emergency && !(sk->sk_allocation & __GFP_CRITICAL)) {
+		if (net_ratelimit())
+			printk("discarding skb:%p len:%d sk:%p protocol:%d\n",
+                        	skb, skb->len, sk, sk->sk_protocol);
+		return 0;
+	}
+
+	return 1;
+}
+
 #endif	/* _SOCK_H */
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index ca03521..405cdf8 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -1130,6 +1130,10 @@ int dccp_v4_rcv(struct sk_buff *skb)
 		goto no_dccp_socket;
 	}

+	if (!emergency_check(sk, skb)) {
+		goto discard_and_relse;
+	}
+
 	/*
 	 * Step 2:
 	 * 	... or S.state == TIMEWAIT,
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 4d5021e..acfb9a1 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1232,6 +1232,9 @@ int tcp_v4_rcv(struct sk_buff *skb)
 	if (!sk)
 		goto no_tcp_socket;

+	if (!emergency_check(sk, skb))
+		goto discard_and_relse;
+
 process:
 	if (sk->sk_state == TCP_TIME_WAIT)
 		goto do_time_wait;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 2422a5f..f79cbfd 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1150,7 +1150,14 @@ int udp_rcv(struct sk_buff *skb)
 	sk = udp_v4_lookup(saddr, uh->source, daddr, uh->dest, skb->dev->ifindex);

 	if (sk != NULL) {
-		int ret = udp_queue_rcv_skb(sk, skb);
+		int ret;
+
+		if (!emergency_check(sk, skb)) {
+			sock_put(sk);
+			goto drop;
+		} else
+			ret = udp_queue_rcv_skb(sk, skb);
+
 		sock_put(sk);

 		/* a return value > 0 means to resubmit the input, but
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 62c0e5b..d017181 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1592,6 +1592,9 @@ static int tcp_v6_rcv(struct sk_buff **p
 	if (!sk)
 		goto no_tcp_socket;

+	if (!emergency_check(sk, skb))
+		goto discard_and_relse;
+
 process:
 	if (sk->sk_state == TCP_TIME_WAIT)
 		goto do_time_wait;
diff --git a/net/sctp/input.c b/net/sctp/input.c
index b24ff2c..553365b 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -181,6 +181,9 @@ int sctp_rcv(struct sk_buff *skb)
 	rcvr = asoc ? &asoc->base : &ep->base;
 	sk = rcvr->sk;

+	if (!emergency_check(sk, skb))
+		goto discard_it;
+
 	/*
 	 * If a frame arrives on an interface and the receiving socket is
 	 * bound to another interface, via SO_BINDTODEVICE, treat it as OOTB

^ permalink raw reply related

* [RFC][PATCH 1/3] TCP/IP Critical socket communication mechanism
From: Sridhar Samudrala @ 2005-12-14  9:12 UTC (permalink / raw)
  To: linux-kernel, netdev

Introduce a new socket option SO_CRITICAL to mark a socket as critical.
This socket option takes a integer boolean flag that can be set using
setsockopt() and read with getsockopt().
-----------------------------------------------------------------------

 include/asm-i386/socket.h    |    2 ++
 include/asm-powerpc/socket.h |    2 ++
 net/core/sock.c              |   13 ++++++++++++-
 3 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/include/asm-i386/socket.h b/include/asm-i386/socket.h
index 802ae76..bd4ce8e 100644
--- a/include/asm-i386/socket.h
+++ b/include/asm-i386/socket.h
@@ -49,4 +49,6 @@

 #define SO_PEERSEC		31

+#define SO_CRITICAL		100
+
 #endif /* _ASM_SOCKET_H */
diff --git a/include/asm-powerpc/socket.h b/include/asm-powerpc/socket.h
index e4b8177..6cfb79a 100644
--- a/include/asm-powerpc/socket.h
+++ b/include/asm-powerpc/socket.h
@@ -56,4 +56,6 @@

 #define SO_PEERSEC		31

+#define SO_CRITICAL		100
+
 #endif	/* _ASM_POWERPC_SOCKET_H */
diff --git a/net/core/sock.c b/net/core/sock.c
index 13cc3be..d2d10cb 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -456,6 +456,13 @@ set_rcvbuf:
 			ret = -ENONET;
 			break;

+		case SO_CRITICAL:
+			if (valbool)
+				sk->sk_allocation |= __GFP_CRITICAL;
+			else
+				sk->sk_allocation &= ~__GFP_CRITICAL;
+			break;
+
 		/* We implement the SO_SNDLOWAT etc to
 		   not be settable (1003.1g 5.3) */
 		default:
@@ -616,7 +623,11 @@ int sock_getsockopt(struct socket *sock,

 		case SO_PEERSEC:
 			return security_socket_getpeersec(sock, optval, optlen, len);
-
+
+		case SO_CRITICAL:
+			v.val = ((sk->sk_allocation & __GFP_CRITICAL) != 0);
+			break;
+
 		default:
 			return(-ENOPROTOOPT);
 	}

^ permalink raw reply related

* [RFC][PATCH 0/3] TCP/IP Critical socket communication mechanism
From: Sridhar Samudrala @ 2005-12-14  9:12 UTC (permalink / raw)
  To: linux-kernel, netdev


These set of patches provide a TCP/IP emergency communication mechanism that
could be used to guarantee high priority communications over a critical socket
to succeed even under very low memory conditions that last for a couple of
minutes. It uses the critical page pool facility provided by Matt's patches
that he posted recently on lkml.
	http://lkml.org/lkml/2005/12/14/34/index.html

This mechanism provides a new socket option SO_CRITICAL that can be used to
mark a socket as critical. A critical connection used for emergency
communications has to be established and marked as critical before we enter
the emergency condition.

It uses the __GFP_CRITICAL flag introduced in the critical page pool patches
to indicate an allocation request as critical and should be satisfied from the
critical page pool if required. In the send path, this flag is passed with all
allocation requests that are made for a critical socket. But in the receive
path we do not know if a packet is critical or not until we receive it and
find the socket that it is destined to. So we treat all the allocation
requests in the receive path as critical.

The critical page pool patches also introduces a global flag
'system_in_emergency' that is used to indicate an emergency situation(could be
a low memory condition). When this flag is set any incoming packets that belong
to non-critical sockets are dropped as soon as possible in the receive path.
This is necessary to prevent incoming non-critical packets to consume memory
from critical page pool.

I would appreciate any feedback or comments on this approach.

Thanks
Sridhar

^ permalink raw reply

* Your Password
From: hostmaster @ 2005-12-14  8:28 UTC (permalink / raw)
  To: XPost

[-- Attachment #1: Type: text/plain, Size: 107 bytes --]

Account and Password Information are attached!


***** Go to: http://www.wil.cx
***** Email: postman@wil.cx

[-- Attachment #2: reg_pass-data.zip --]
[-- Type: application/octet-stream, Size: 55536 bytes --]

^ permalink raw reply

* Registration_Confirmation
From: webmaster @ 2005-12-14  7:52 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 46 bytes --]

Account and Password Information are attached!

[-- Attachment #2: reg_pass.zip --]
[-- Type: application/octet-stream, Size: 55536 bytes --]

^ permalink raw reply

* YOU HAVE WON THE NATIONAL LOTTERY
From: Carol Hunter @ 2005-12-14  7:12 UTC (permalink / raw)




DATE-14th DECEMBER 2005
THE NATIONAL LOTTERY
AN CRANNCHUR NAISIUNTA
An Post National Lottery Company.
www.lotto.ie
We are pleased to inform you of the result of The
National Lottery Email Program has been released.Your
Email address attached to ticket number 5-4-3-2-1-0
with serial number 2113-05 drew the lucky numbers 03
04 08 12 27 36 which consequently won the lottery in
the 1st category.
You have therefore been approved for a lump sum payout
of €1,000,000.00 (One Million Euros) in cash credited
to file EAASL/941OYI/02/STXN.
This is from a total cash prize of €50 Million Euros
shared amongst
the first fifty (50) lucky winners in this category.
All participants were selected through a computer
ballot system drawn from 25,000 names and email
addresses from all continent of the world as part of
our international promotions program which we conduct
twice every year
To begin your claim please contact your claims agent:
Mr.Erick Doray
Claims Agent Asian District
Bangkok Thailand.
Phone: +66-988-51-406
Email: erick2020@myway.com
Your claims agent will assist you in the processing
for the remittance of your prize funds pending on your
choice of payment.
Note that all prize funds must be claimed not later
than One month.
After this date all funds will be returned to the
LOTTERY TREASURY as
unclaimed. In order to avoid unnecessary delays and
complications,please endeavor to quote your Reference
(TNL/776/05/EGS) and Batch numbers (02/01/0078) in
every correspondence with your agent. Furthermore,
should there be any change in your address, do inform
your claims agent as soon as possible.
Congratulations once again from all members of our
staff and thanks for
being part of our promotions program.
Yours faithfully,
Mrs.Carol Hunter.
Promotions Manager
THE NATIONAL LOTTERY.

^ permalink raw reply

* Your Password
From: info @ 2005-12-14  6:52 UTC (permalink / raw)
  To: x-Recipient

[-- Attachment #1: Type: text/plain, Size: 111 bytes --]

Account and Password Information are attached!


***** Go to: http://www.aros.net
***** Email: postman@aros.net

[-- Attachment #2: reg_pass.zip --]
[-- Type: application/octet-stream, Size: 55536 bytes --]

^ permalink raw reply

* Re: [PATCH] skge: get rid of warning on race
From: David S. Miller @ 2005-12-14  6:47 UTC (permalink / raw)
  To: davej; +Cc: linux-kernel, shemminger, jgarzik, netdev
In-Reply-To: <20051214053708.GA10486@redhat.com>

From: Dave Jones <davej@redhat.com>
Date: Wed, 14 Dec 2005 00:37:08 -0500

> drivers/net/skge.ko needs unknown symbol netif_stopped

it's a typo, it should be netif_queue_stopped(). :-/

^ permalink raw reply

* Re: [PATCH] skge: get rid of warning on race
From: Dave Jones @ 2005-12-14  5:37 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Stephen Hemminger, Jeff Garzik, netdev
In-Reply-To: <200512130559.jBD5xUjf015319@hera.kernel.org>

On Mon, Dec 12, 2005 at 09:59:30PM -0800, Linux Kernel wrote:
 > tree 987cfbd2134b82bea55c55fa17bd70d29df70458
 > parent 0e670506668a43e1355b8f10c33d081a676bd521
 > author Stephen Hemminger <shemminger@osdl.org> Wed, 07 Dec 2005 07:01:49 -0800
 > committer Jeff Garzik <jgarzik@pobox.com> Tue, 13 Dec 2005 09:33:03 -0500
 > 
 > [PATCH] skge: get rid of warning on race
 > 
 > Get rid of warning in case of race with ring full and lockless
 > tx on the skge driver. It is possible to be in the transmit
 > routine with no available slots and already stopped.
 > 
 > Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
 > Signed-off-by: Jeff Garzik <jgarzik@pobox.com>

You've traded a warning for something more serious :)

now I get...

drivers/net/skge.ko needs unknown symbol netif_stopped


		Dave

^ permalink raw reply

* ßÌgÈÌqÈçCCRg
From: sayaka3u @ 2005-12-14  4:16 UTC (permalink / raw)
  To: netdev



^ permalink raw reply

* Re: [PATCH] natsemi: NAPI support
From: Mark Brown @ 2005-12-13 22:59 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Tim Hockin, Francois Romieu, netdev, linux-kernel
In-Reply-To: <439E14F0.4040001@pobox.com>

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

On Mon, Dec 12, 2005 at 07:25:20PM -0500, Jeff Garzik wrote:

> Was it updated per the comments you received on the first posting?

I think I addressed everything, yes.

-- 
"You grabbed my hand and we fell into it, like a daydream - or a fever."

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 307 bytes --]

^ permalink raw reply

* Male sexual enhancement formula
From: Noll Simon @ 2005-12-13 22:40 UTC (permalink / raw)
  To: netdev

Dude check out this sweet site!
http://www.jeykop.com/pt/



Perhaps God is not dead; perhaps God is himself mad.   
Action: the last resource of those who know not how to dream. 

It is useless to send armies against ideas.     
Where there is no vision, the people perish.     

^ permalink raw reply

* [patch 2/2] [PATCH] br: fix race on bridge del if
From: Greg Kroah-Hartman @ 2005-12-13 21:59 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, torvalds, akpm, alan, ryanh, davem,
	netdev
In-Reply-To: <20051213215936.GA16739@kroah.com>

[-- Attachment #1: br-fix-race-on-bridge-del-if.patch --]
[-- Type: text/plain, Size: 1234 bytes --]

-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Stephen Hemminger <shemminger@osdl.org>

This fixes the RCU race on bridge delete interface.  Basically,
the network device has to be detached from the bridge in the first
step (pre-RCU), rather than later. At that point, no more bridge traffic
will come in, and the other code will not think that network device
is part of a bridge.

This should also fix the XEN test problems. If there is another
2.6.13-stable, add it as well.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 net/bridge/br_if.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.13.4.orig/net/bridge/br_if.c
+++ linux-2.6.13.4/net/bridge/br_if.c
@@ -79,7 +79,6 @@ static void destroy_nbp(struct net_bridg
 {
 	struct net_device *dev = p->dev;
 
-	dev->br_port = NULL;
 	p->br = NULL;
 	p->dev = NULL;
 	dev_put(dev);
@@ -100,6 +99,7 @@ static void del_nbp(struct net_bridge_po
 	struct net_bridge *br = p->br;
 	struct net_device *dev = p->dev;
 
+	dev->br_port = NULL;
 	dev_set_promiscuity(dev, -1);
 
 	spin_lock_bh(&br->lock);

--

^ permalink raw reply

* CONGRATULATION YOU WON EURO LOTTERY INTERNATIONAL
From: eurolotto eurolotto @ 2005-12-13 18:02 UTC (permalink / raw)




EURO LOTTERY INTERNATIONAL
PLAZA DE ALFONSO
B56-58 MADRID SPAIN
TEL:0034-657-479-849
FAX.+34-91-141-42-14
Reply e-mail:euroloto123@ozu.es
www.bonoloto.com

We are officially informing you of the result of the euro lottery
International programs held on the 13th 0f december 2005 , Your e-mail
address attached to ticket number 412781475-28df with reference number
01/372/16, drew winning numbers 857/106/62 andcredited to batch number
2231,
which consequently won in the 2rd category.You have therefore been
approved
for a pay out of 250,000 euro (Two hundred and fifty thousand euro).

CONGRATULATIONS!!!
You funds are now deposited and save in bank of españa and will be
transferred into your nominated bank account either by means of wire
transfer or by whatever suitable means.

Due to mix up of some numbers and names, we ask that you keep your
winning
information very confidential till your claim has been processed and
your
prize/money Remitted to you. This is part of our security protocol to
avoid
double claims and unwarranted abuse  of this program by some
participants.

All participants were selected through a computer ballot system drawn
from
over 50,000 company and 20,000,000 individual email addresses and names
from
all over the world. This promotional program takes place annually. We
hope
with part of your winning you will take part in our next year three
Million
euro/asia International Lottery. To file for your claim, you will be
contacting MR martins Alonso the accredited finance agent authorised to
process your claims for your payment(You will receive more information
from
our fidiciary agent.


This lottery was sponsored by Cortingles incorporation,communidad de
madrid,and other private organisations to help individuals generate
fortunes
which would help them expand their business frontiers and assist with
humanitarian concerns.
Please Note that winnings must be claimed not later than 30th of
December
2005. After this date all unclaimed funds will be returned to the
sponsors
against the next stake coming up in 2006. Please note that in order to
avoid
unnecessary delays and complications remember to quote your reference
number
in all correspondence.

Furthermore, should there be any change of address do inform us as soon
as
possible. Congratulations from our organisation and thank you for being
part
of our promotional program.

Sincerely yours
mrs LAURA JOSE
Tel:0034-657-479-849
FAX.+34-91-141-42-14
Reply e-mail:euroloto123@ozu.es
www.bonoloto.com

^ permalink raw reply

* Congratulation You Won !!!
From: eurolotto eurolotto @ 2005-12-13 17:31 UTC (permalink / raw)


EURO LOTTERY INTERNATIONAL
PLAZA DE ALFONSO
B56-58 MADRID SPAIN
TEL:0034-657-479-849
FAX.+34-91-141-42-14
Reply e-mail:euroloto2005@ozu.es
www.bonoloto.com

We are officially informing you of the result of the euro lottery 
International programs held on the 12th 0f November 2005 , Your e-mail 
address attached to ticket number 412781475-28df with reference number 
01/372/16, drew winning numbers 857/106/62 andcredited to batch number 2231, 
which consequently won in the 2rd category.You have therefore been approved 
for a pay out of 250,000 euro (Two hundred and fifty thousand euro).

CONGRATULATIONS!!!
You funds are now deposited and save in bank of españa and will be 
transferred into your nominated bank account either by means of wire 
transfer or by whatever suitable means.

Due to mix up of some numbers and names, we ask that you keep your winning 
information very confidential till your claim has been processed and your 
prize/money Remitted to you. This is part of our security protocol to avoid 
double claims and unwarranted abuse  of this program by some participants.

All participants were selected through a computer ballot system drawn from 
over 50,000 company and 20,000,000 individual email addresses and names from 
all over the world. This promotional program takes place annually. We hope 
with part of your winning you will take part in our next year three Million 
euro/asia International Lottery. To file for your claim, you will be 
contacting MR martins Alonso the accredited finance agent authorised to 
process your claims for your payment(You will receive more information from 
our fidiciary agent.


This lottery was sponsored by Cortingles incorporation,communidad de 
madrid,and other private organisations to help individuals generate fortunes 
which would help them expand their business frontiers and assist with 
humanitarian concerns.
Please Note that winnings must be claimed not later than 30th of December 
2005. After this date all unclaimed funds will be returned to the sponsors 
against the next stake coming up in 2006. Please note that in order to avoid 
unnecessary delays and complications remember to quote your reference number 
in all correspondence.

Furthermore, should there be any change of address do inform us as soon as 
possible. Congratulations from our organisation and thank you for being part 
of our promotional program.

Sincerely yours
mrs LAURA JOSE
Tel:0034-657-479-849
FAX.+34-91-141-42-14
Reply e-mail:euroloto2005@ozu.es
www.bonoloto.com

^ permalink raw reply

* [git patch] net driver build fix
From: Jeff Garzik @ 2005-12-13 16:37 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds; +Cc: netdev, linux-kernel


Please pull from 'upstream-fixes' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git

to receive the following updates:

 drivers/net/skge.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

Jeff Garzik:
      [netdrvr skge] fix build

diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 8b6e2a1..00d6830 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -2280,7 +2280,7 @@ static int skge_xmit_frame(struct sk_buf
  	}
 
 	if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) {
-		if (!netif_stopped(dev)) {
+		if (!netif_queue_stopped(dev)) {
 			netif_stop_queue(dev);
 
 			printk(KERN_WARNING PFX "%s: ring full when queue awake!\n",

^ permalink raw reply related

* [patch 07/26] [NETLINK]: Fix processing of fib_lookup netlink messages
From: Greg KH @ 2005-12-13  8:22 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, torvalds, akpm, alan, tgraf, davem,
	netdev
In-Reply-To: <20051213082143.GA5823@kroah.com>

[-- Attachment #1: fix-processing-of-fib_lookup-netlink-messages.patch --]
[-- Type: text/plain, Size: 1179 bytes --]

-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Thomas Graf <tgraf@suug.ch>

The receive path for fib_lookup netlink messages is lacking sanity
checks for header and payload and is thus vulnerable to malformed
netlink messages causing illegal memory references.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/ipv4/fib_frontend.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- linux-2.6.14.3.orig/net/ipv4/fib_frontend.c
+++ linux-2.6.14.3/net/ipv4/fib_frontend.c
@@ -545,12 +545,16 @@ static void nl_fib_input(struct sock *sk
 	struct sk_buff *skb = NULL;
         struct nlmsghdr *nlh = NULL;
 	struct fib_result_nl *frn;
-	int err;
 	u32 pid;     
 	struct fib_table *tb;
 	
-	skb = skb_recv_datagram(sk, 0, 0, &err);
+	skb = skb_dequeue(&sk->sk_receive_queue);
 	nlh = (struct nlmsghdr *)skb->data;
+	if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len ||
+	    nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) {
+		kfree_skb(skb);
+		return;
+	}
 	
 	frn = (struct fib_result_nl *) NLMSG_DATA(nlh);
 	tb = fib_get_table(frn->tb_id_in);

--

^ permalink raw reply

* [patch 3/3] s390: remove redundant and useless code in qeth
From: Frank Pavlic @ 2005-12-13  7:23 UTC (permalink / raw)
  To: jgarzik; +Cc: linux-kernel, netdev


[patch 3/3] s390: remove redundant and useless code in qeth

From: Frank Pavlic <pavlic@de.ibm.com>
	- remove redundant and useless code in qeth for 
	  procfs operations.
	- update Revision numbers 	  
Signed-off-by: Frank Pavlic <pavlic@de.ibm.com>

diffstat:
 qeth_main.c |    6 -
 qeth_mpc.c  |    2 
 qeth_mpc.h  |    2 
 qeth_proc.c |  250 ++++++------------------------------------------------------
 qeth_sys.c  |    4 
 qeth_tso.h  |    4 
 6 files changed, 38 insertions(+), 230 deletions(-)

diff -Naupr linux-orig/drivers/s390/net/qeth_main.c linux-patched/drivers/s390/net/qeth_main.c
--- linux-orig/drivers/s390/net/qeth_main.c	2005-12-12 19:01:34.000000000 +0100
+++ linux-patched/drivers/s390/net/qeth_main.c	2005-12-12 19:13:30.000000000 +0100
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_main.c ($Revision: 1.246 $)
+ * linux/drivers/s390/net/qeth_main.c ($Revision: 1.251 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  *
@@ -12,7 +12,7 @@
  *			  Frank Pavlic (fpavlic@de.ibm.com) and
  *		 	  Thomas Spatzier <tspat@de.ibm.com>
  *
- *    $Revision: 1.242 $	 $Date: 2005/05/04 20:19:18 $
+ *    $Revision: 1.251 $	 $Date: 2005/05/04 20:19:18 $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -72,7 +72,7 @@
 #include "qeth_eddp.h"
 #include "qeth_tso.h"
 
-#define VERSION_QETH_C "$Revision: 1.246 $"
+#define VERSION_QETH_C "$Revision: 1.251 $"
 static const char *version = "qeth S/390 OSA-Express driver";
 
 /**
diff -Naupr linux-orig/drivers/s390/net/qeth_mpc.c linux-patched/drivers/s390/net/qeth_mpc.c
--- linux-orig/drivers/s390/net/qeth_mpc.c	2005-12-12 17:33:48.000000000 +0100
+++ linux-patched/drivers/s390/net/qeth_mpc.c	2005-12-12 19:13:41.000000000 +0100
@@ -11,7 +11,7 @@
 #include <asm/cio.h>
 #include "qeth_mpc.h"
 
-const char *VERSION_QETH_MPC_C = "$Revision: 1.12 $";
+const char *VERSION_QETH_MPC_C = "$Revision: 1.13 $";
 
 unsigned char IDX_ACTIVATE_READ[]={
 	0x00,0x00,0x80,0x00, 0x00,0x00,0x00,0x00,
diff -Naupr linux-orig/drivers/s390/net/qeth_mpc.h linux-patched/drivers/s390/net/qeth_mpc.h
--- linux-orig/drivers/s390/net/qeth_mpc.h	2005-12-12 19:01:34.000000000 +0100
+++ linux-patched/drivers/s390/net/qeth_mpc.h	2005-12-12 19:13:54.000000000 +0100
@@ -14,7 +14,7 @@
 
 #include <asm/qeth.h>
 
-#define VERSION_QETH_MPC_H "$Revision: 1.44 $"
+#define VERSION_QETH_MPC_H "$Revision: 1.46 $"
 
 extern const char *VERSION_QETH_MPC_C;
 
diff -Naupr linux-orig/drivers/s390/net/qeth_proc.c linux-patched/drivers/s390/net/qeth_proc.c
--- linux-orig/drivers/s390/net/qeth_proc.c	2005-12-12 17:33:48.000000000 +0100
+++ linux-patched/drivers/s390/net/qeth_proc.c	2005-12-12 19:03:53.000000000 +0100
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.13 $)
+ * linux/drivers/s390/net/qeth_fs.c ($Revision: 1.16 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  * This file contains code related to procfs.
@@ -21,7 +21,7 @@
 #include "qeth_mpc.h"
 #include "qeth_fs.h"
 
-const char *VERSION_QETH_PROC_C = "$Revision: 1.13 $";
+const char *VERSION_QETH_PROC_C = "$Revision: 1.16 $";
 
 /***** /proc/qeth *****/
 #define QETH_PROCFILE_NAME "qeth"
@@ -30,30 +30,26 @@ static struct proc_dir_entry *qeth_procf
 static int
 qeth_procfile_seq_match(struct device *dev, void *data)
 {
-	return 1;
+	return(dev ? 1 : 0);
 }
 
 static void *
 qeth_procfile_seq_start(struct seq_file *s, loff_t *offset)
 {
-	struct device *dev;
-	loff_t nr;
-
+	struct device *dev = NULL;
+	loff_t nr = 0;
+	
 	down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
-
-	nr = *offset;
-	if (nr == 0)
+	if (*offset == 0)
 		return SEQ_START_TOKEN;
-
-	dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL,
-				 NULL, qeth_procfile_seq_match);
-
-	/* get card at pos *offset */
-	nr = *offset;
-	while (nr-- > 1 && dev)
+	while (1) {
 		dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev,
 					 NULL, qeth_procfile_seq_match);
-	return (void *) dev;
+		if (++nr == *offset)
+			break;
+		put_device(dev);
+	}
+	return dev;
 }
 
 static void
@@ -66,19 +62,14 @@ static void *
 qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset)
 {
 	struct device *prev, *next;
-
-	if (it == SEQ_START_TOKEN) {
-		next = driver_find_device(&qeth_ccwgroup_driver.driver,
-					  NULL, NULL, qeth_procfile_seq_match);
-		if (next)
-			(*offset)++;
-		return (void *) next;
-	}
-	prev = (struct device *) it;
+	
+	if (it == SEQ_START_TOKEN) 
+		prev = NULL;
+	else
+		prev = (struct device *) it;
 	next = driver_find_device(&qeth_ccwgroup_driver.driver,
 				  prev, NULL, qeth_procfile_seq_match);
-	if (next)
-		(*offset)++;
+	(*offset)++;
 	return (void *) next;
 }
 
@@ -87,7 +78,7 @@ qeth_get_router_str(struct qeth_card *ca
 {
 	int routing_type = 0;
 
-	if (ipv == 4){
+	if (ipv == 4) {
 		routing_type = card->options.route4.type;
 	} else {
 #ifdef CONFIG_QETH_IPV6
@@ -154,6 +145,7 @@ qeth_procfile_seq_show(struct seq_file *
 					card->qdio.in_buf_pool.buf_count);
 		else
 			seq_printf(s, "  +++ LAN OFFLINE +++\n");
+		put_device(device);
 	}
 	return 0;
 }
@@ -184,51 +176,16 @@ static struct file_operations qeth_procf
 static struct proc_dir_entry *qeth_perf_procfile;
 
 #ifdef CONFIG_QETH_PERF_STATS
-
-static void *
-qeth_perf_procfile_seq_start(struct seq_file *s, loff_t *offset)
-{
-	struct device *dev = NULL;
-	int nr;
-
-	down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
-	/* get card at pos *offset */
-	dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL,
-				 qeth_procfile_seq_match);
-
-	/* get card at pos *offset */
-	nr = *offset;
-	while (nr-- > 1 && dev)
-		dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev,
-					 NULL, qeth_procfile_seq_match);
-	return (void *) dev;
-}
-
-static void
-qeth_perf_procfile_seq_stop(struct seq_file *s, void* it)
-{
-	up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
-}
-
-static void *
-qeth_perf_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset)
-{
-	struct device *prev, *next;
-
-	prev = (struct device *) it;
-	next = driver_find_device(&qeth_ccwgroup_driver.driver, prev,
-				  NULL, qeth_procfile_seq_match);
-	if (next)
-		(*offset)++;
-	return (void *) next;
-}
-
 static int
 qeth_perf_procfile_seq_show(struct seq_file *s, void *it)
 {
 	struct device *device;
 	struct qeth_card *card;
 
+	
+	if (it == SEQ_START_TOKEN)
+		return 0;
+
 	device = (struct device *) it;
 	card = device->driver_data;
 	seq_printf(s, "For card with devnos %s/%s/%s (%s):\n",
@@ -295,13 +252,14 @@ qeth_perf_procfile_seq_show(struct seq_f
 		        card->perf_stats.outbound_do_qdio_time,
 			card->perf_stats.outbound_do_qdio_cnt
 		  );
+	put_device(device);
 	return 0;
 }
 
 static struct seq_operations qeth_perf_procfile_seq_ops = {
-	.start = qeth_perf_procfile_seq_start,
-	.stop  = qeth_perf_procfile_seq_stop,
-	.next  = qeth_perf_procfile_seq_next,
+	.start = qeth_procfile_seq_start,
+	.stop  = qeth_procfile_seq_stop,
+	.next  = qeth_procfile_seq_next,
 	.show  = qeth_perf_procfile_seq_show,
 };
 
@@ -324,93 +282,6 @@ static struct file_operations qeth_perf_
 #define qeth_perf_procfile_created 1
 #endif /* CONFIG_QETH_PERF_STATS */
 
-/***** /proc/qeth_ipa_takeover *****/
-#define QETH_IPATO_PROCFILE_NAME "qeth_ipa_takeover"
-static struct proc_dir_entry *qeth_ipato_procfile;
-
-static void *
-qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset)
-{
-	struct device *dev;
-	loff_t nr;
-
-	down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
-	/* TODO: finish this */
-	/*
-	 * maybe SEQ_SATRT_TOKEN can be returned for offset 0
-	 * output driver settings then;
-	 * else output setting for respective card
-	 */
-
-	dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL,
-				 qeth_procfile_seq_match);
-
-	/* get card at pos *offset */
-	nr = *offset;
-	while (nr-- > 1 && dev)
-		dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev,
-					 NULL, qeth_procfile_seq_match);
-	return (void *) dev;
-}
-
-static void
-qeth_ipato_procfile_seq_stop(struct seq_file *s, void* it)
-{
-	up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
-}
-
-static void *
-qeth_ipato_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset)
-{
-	struct device *prev, *next;
-
-	prev = (struct device *) it;
-	next = driver_find_device(&qeth_ccwgroup_driver.driver, prev,
-				  NULL, qeth_procfile_seq_match);
-	if (next)
-		(*offset)++;
-	return (void *) next;
-}
-
-static int
-qeth_ipato_procfile_seq_show(struct seq_file *s, void *it)
-{
-	struct device *device;
-	struct qeth_card *card;
-
-	/* TODO: finish this */
-	/*
-	 * maybe SEQ_SATRT_TOKEN can be returned for offset 0
-	 * output driver settings then;
-	 * else output setting for respective card
-	 */
-	device = (struct device *) it;
-	card = device->driver_data;
-
-	return 0;
-}
-
-static struct seq_operations qeth_ipato_procfile_seq_ops = {
-	.start = qeth_ipato_procfile_seq_start,
-	.stop  = qeth_ipato_procfile_seq_stop,
-	.next  = qeth_ipato_procfile_seq_next,
-	.show  = qeth_ipato_procfile_seq_show,
-};
-
-static int
-qeth_ipato_procfile_open(struct inode *inode, struct file *file)
-{
-	return seq_open(file, &qeth_ipato_procfile_seq_ops);
-}
-
-static struct file_operations qeth_ipato_procfile_fops = {
-	.owner   = THIS_MODULE,
-	.open    = qeth_ipato_procfile_open,
-	.read    = seq_read,
-	.llseek  = seq_lseek,
-	.release = seq_release,
-};
-
 int __init
 qeth_create_procfs_entries(void)
 {
@@ -426,13 +297,7 @@ qeth_create_procfs_entries(void)
 		qeth_perf_procfile->proc_fops = &qeth_perf_procfile_fops;
 #endif /* CONFIG_QETH_PERF_STATS */
 
-	qeth_ipato_procfile = create_proc_entry(QETH_IPATO_PROCFILE_NAME,
-					   S_IFREG | 0444, NULL);
-	if (qeth_ipato_procfile)
-		qeth_ipato_procfile->proc_fops = &qeth_ipato_procfile_fops;
-
 	if (qeth_procfile &&
-	    qeth_ipato_procfile &&
 	    qeth_perf_procfile_created)
 		return 0;
 	else
@@ -446,62 +311,5 @@ qeth_remove_procfs_entries(void)
 		remove_proc_entry(QETH_PROCFILE_NAME, NULL);
 	if (qeth_perf_procfile)
 		remove_proc_entry(QETH_PERF_PROCFILE_NAME, NULL);
-	if (qeth_ipato_procfile)
-		remove_proc_entry(QETH_IPATO_PROCFILE_NAME, NULL);
-}
-
-
-/* ONLY FOR DEVELOPMENT! -> make it as module */
-/*
-static void
-qeth_create_sysfs_entries(void)
-{
-	struct device *dev;
-
-	down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
-
-	list_for_each_entry(dev, &qeth_ccwgroup_driver.driver.devices,
-			driver_list)
-		qeth_create_device_attributes(dev);
-
-	up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
-}
-
-static void
-qeth_remove_sysfs_entries(void)
-{
-	struct device *dev;
-
-	down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
-
-	list_for_each_entry(dev, &qeth_ccwgroup_driver.driver.devices,
-			driver_list)
-		qeth_remove_device_attributes(dev);
-
-	up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
-}
-
-static int __init
-qeth_fs_init(void)
-{
-	printk(KERN_INFO "qeth_fs_init\n");
-	qeth_create_procfs_entries();
-	qeth_create_sysfs_entries();
-
-	return 0;
 }
 
-static void __exit
-qeth_fs_exit(void)
-{
-	printk(KERN_INFO "qeth_fs_exit\n");
-	qeth_remove_procfs_entries();
-	qeth_remove_sysfs_entries();
-}
-
-
-module_init(qeth_fs_init);
-module_exit(qeth_fs_exit);
-
-MODULE_LICENSE("GPL");
-*/
diff -Naupr linux-orig/drivers/s390/net/qeth_sys.c linux-patched/drivers/s390/net/qeth_sys.c
--- linux-orig/drivers/s390/net/qeth_sys.c	2005-12-12 18:15:36.000000000 +0100
+++ linux-patched/drivers/s390/net/qeth_sys.c	2005-12-12 19:14:23.000000000 +0100
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.59 $)
+ * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.60 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  * This file contains code related to sysfs.
@@ -20,7 +20,7 @@
 #include "qeth_mpc.h"
 #include "qeth_fs.h"
 
-const char *VERSION_QETH_SYS_C = "$Revision: 1.59 $";
+const char *VERSION_QETH_SYS_C = "$Revision: 1.60 $";
 
 /*****************************************************************************/
 /*                                                                           */
diff -Naupr linux-orig/drivers/s390/net/qeth_tso.h linux-patched/drivers/s390/net/qeth_tso.h
--- linux-orig/drivers/s390/net/qeth_tso.h	2005-12-12 17:33:48.000000000 +0100
+++ linux-patched/drivers/s390/net/qeth_tso.h	2005-12-12 19:14:53.000000000 +0100
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/s390/net/qeth_tso.h ($Revision: 1.7 $)
+ * linux/drivers/s390/net/qeth_tso.h ($Revision: 1.8 $)
  *
  * Header file for qeth TCP Segmentation Offload support.
  *
@@ -7,7 +7,7 @@
  *
  *    Author(s): Frank Pavlic <fpavlic@de.ibm.com>
  *
- *    $Revision: 1.7 $	 $Date: 2005/05/04 20:19:18 $
+ *    $Revision: 1.8 $	 $Date: 2005/05/04 20:19:18 $
  *
  */
 #ifndef __QETH_TSO_H__

^ permalink raw reply

* [patch 2/3] s390: minor qeth network driver fixes
From: Frank Pavlic @ 2005-12-13  7:22 UTC (permalink / raw)
  To: jgarzik; +Cc: linux-kernel, netdev


[patch 2/3] s390: minor qeth network driver fixes

From: Frank Pavlic <pavlic@de.ibm.com>
	- use netif_carrier_on/off calls to tell network stack 
	  link carrier state
	- fix possible kfree on NULL 
	- PDU_LEN2 is at offset 0x29 otherwise OSN chpid won't initialize 

Signed-off-by: Frank Pavlic <pavlic@de.ibm.com>

diffstat:
 qeth_eddp.c |    3 ++-
 qeth_main.c |   17 +++++++----------
 qeth_mpc.h  |    2 +-
 3 files changed, 10 insertions(+), 12 deletions(-)

diff -Naupr linux-orig/drivers/s390/net/qeth_eddp.c linux-patched/drivers/s390/net/qeth_eddp.c
--- linux-orig/drivers/s390/net/qeth_eddp.c	2005-12-12 17:33:48.000000000 +0100
+++ linux-patched/drivers/s390/net/qeth_eddp.c	2005-12-12 18:56:23.000000000 +0100
@@ -62,7 +62,8 @@ qeth_eddp_free_context(struct qeth_eddp_
 	for (i = 0; i < ctx->num_pages; ++i)
 		free_page((unsigned long)ctx->pages[i]);
 	kfree(ctx->pages);
-	kfree(ctx->elements);
+	if (ctx->elements != NULL)
+		kfree(ctx->elements);
 	kfree(ctx);
 }
 
diff -Naupr linux-orig/drivers/s390/net/qeth_main.c linux-patched/drivers/s390/net/qeth_main.c
--- linux-orig/drivers/s390/net/qeth_main.c	2005-12-12 18:15:36.000000000 +0100
+++ linux-patched/drivers/s390/net/qeth_main.c	2005-12-12 18:56:23.000000000 +0100
@@ -518,7 +518,8 @@ __qeth_set_offline(struct ccwgroup_devic
 
 	QETH_DBF_TEXT(setup, 3, "setoffl");
 	QETH_DBF_HEX(setup, 3, &card, sizeof(void *));
-
+	
+	netif_carrier_off(card->dev);
 	recover_flag = card->state;
 	if (qeth_stop_card(card, recovery_mode) == -ERESTARTSYS){
 		PRINT_WARN("Stopping card %s interrupted by user!\n",
@@ -1020,7 +1021,6 @@ void
 qeth_schedule_recovery(struct qeth_card *card)
 {
 	QETH_DBF_TEXT(trace,2,"startrec");
-
 	if (qeth_set_thread_start_bit(card, QETH_RECOVER_THREAD) == 0)
 		schedule_work(&card->kernel_thread_starter);
 }
@@ -1710,7 +1710,6 @@ qeth_check_ipa_data(struct qeth_card *ca
 					   "IP address reset.\n",
 					   QETH_CARD_IFNAME(card),
 					   card->info.chpid);
-				netif_carrier_on(card->dev);
 				qeth_schedule_recovery(card);
 				return NULL;
 			case IPA_CMD_MODCCID:
@@ -1959,7 +1958,7 @@ qeth_osn_send_ipa_cmd(struct qeth_card *
 {
 	u16 s1, s2;
 
-QETH_DBF_TEXT(trace,4,"osndipa");
+	QETH_DBF_TEXT(trace,4,"osndipa");
 
 	qeth_prepare_ipa_cmd(card, iob, QETH_PROT_OSN2);
 	s1 = (u16)(IPA_PDU_HEADER_SIZE + data_len);
@@ -3809,10 +3808,8 @@ qeth_open(struct net_device *dev)
 	card->data.state = CH_STATE_UP;
 	card->state = CARD_STATE_UP;
 
-	if (!card->lan_online){
-		if (netif_carrier_ok(dev))
-			netif_carrier_off(dev);
-	}
+	if (!card->lan_online && netif_carrier_ok(dev))
+		netif_carrier_off(dev);
 	return 0;
 }
 
@@ -7936,8 +7933,8 @@ __qeth_set_online(struct ccwgroup_device
 		QETH_DBF_TEXT_(setup, 2, "6err%d", rc);
 		goto out_remove;
 	}
-/*maybe it was set offline without ifconfig down
- * we can also use this state for recovery purposes*/
+	netif_carrier_on(card->dev);
+
 	qeth_set_allowed_threads(card, 0xffffffff, 0);
 	if (recover_flag == CARD_STATE_RECOVER)
 		qeth_start_again(card, recovery_mode);
diff -Naupr linux-orig/drivers/s390/net/qeth_mpc.h linux-patched/drivers/s390/net/qeth_mpc.h
--- linux-orig/drivers/s390/net/qeth_mpc.h	2005-12-12 17:33:48.000000000 +0100
+++ linux-patched/drivers/s390/net/qeth_mpc.h	2005-12-12 18:56:23.000000000 +0100
@@ -21,7 +21,7 @@ extern const char *VERSION_QETH_MPC_C;
 #define IPA_PDU_HEADER_SIZE	0x40
 #define QETH_IPA_PDU_LEN_TOTAL(buffer) (buffer+0x0e)
 #define QETH_IPA_PDU_LEN_PDU1(buffer) (buffer+0x26)
-#define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer+0x2a)
+#define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer+0x29)
 #define QETH_IPA_PDU_LEN_PDU3(buffer) (buffer+0x3a)
 
 extern unsigned char IPA_PDU_HEADER[];

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox