All of lore.kernel.org
 help / color / mirror / Atom feed
From: chas williams <chas@cmf.nrl.navy.mil>
To: davem@redhat.com
Cc: netdev@oss.sgi.com
Subject: [PATCH][ATM] minor cleanups for 2.5
Date: Wed, 16 Jul 2003 17:18:04 -0400	[thread overview]
Message-ID: <200307162120.h6GLKWsG023003@ginger.cmf.nrl.navy.mil> (raw)

just some cleanup work for the 2.5 kernels.  one biggish
oopsy -- never checked the return code from atm_dev_lookup()
in vcc_connect.  found it last week, and someone else found it
recently as well.  the lec timers now use mod_timer() and go
away with del_timer_sync() (and how does __inline__ work
when its the timer function?)



[atm]:  make sigd_sleep conditional with WAIT_FOR_DEMON

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1364  -> 1.1365 
#	 net/atm/signaling.c	1.17    -> 1.18   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/06/21	chas@relax.cmf.nrl.navy.mil	1.1365
# signaling.c:
#   make sigd_sleep conditional with WAIT_FOR_DEMON
# --------------------------------------------
#
diff -Nru a/net/atm/signaling.c b/net/atm/signaling.c
--- a/net/atm/signaling.c	Mon Jun 23 09:45:13 2003
+++ b/net/atm/signaling.c	Mon Jun 23 09:45:13 2003
@@ -31,7 +31,9 @@
 
 
 struct atm_vcc *sigd = NULL;
+#ifdef WAIT_FOR_DEMON
 static DECLARE_WAIT_QUEUE_HEAD(sigd_sleep);
+#endif
 
 
 static void sigd_put_skb(struct sk_buff *skb)
@@ -254,6 +256,8 @@
 	vcc_insert_socket(vcc->sk);
 	set_bit(ATM_VF_META,&vcc->flags);
 	set_bit(ATM_VF_READY,&vcc->flags);
+#ifdef WAIT_FOR_DEMON
 	wake_up(&sigd_sleep);
+#endif
 	return 0;
 }





[atm]: return ENODEV if !dev

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1413  -> 1.1414 
#	    net/atm/common.c	1.43    -> 1.44   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/07/16	chas@relax.cmf.nrl.navy.mil	1.1414
# return ENODEV if !dev
# --------------------------------------------
#
diff -Nru a/net/atm/common.c b/net/atm/common.c
--- a/net/atm/common.c	Wed Jul 16 17:06:05 2003
+++ b/net/atm/common.c	Wed Jul 16 17:06:05 2003
@@ -478,6 +478,8 @@
 		return -EINVAL;
 	if (itf != ATM_ITF_ANY) {
 		dev = atm_dev_lookup(itf);
+		if (!dev)
+			return -ENODEV;
 		error = __vcc_connect(vcc, dev, vpi, vci);
 		if (error) {
 			atm_dev_put(dev);



[atm]: if !IFF_UP drop the frames

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1380.1.43 -> 1.1380.1.44
#	       net/atm/lec.c	1.33    -> 1.34   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/07/08	chas@relax.cmf.nrl.navy.mil	1.1380.1.44
# if !IFF_UP drop the frames
# --------------------------------------------
#
diff -Nru a/net/atm/lec.c b/net/atm/lec.c
--- a/net/atm/lec.c	Wed Jul 16 17:05:18 2003
+++ b/net/atm/lec.c	Wed Jul 16 17:05:18 2003
@@ -692,10 +692,11 @@
 
                 atm_return(vcc,skb->truesize);
                 if (*(uint16_t *)skb->data == htons(priv->lecid) ||
-                    !priv->lecd) { 
+                    !priv->lecd ||
+                    !(dev->flags & IFF_UP)) { 
                         /* Probably looping back, or if lecd is missing,
                            lecd has gone down */
-                        DPRINTK("Ignoring loopback frame...\n");
+                        DPRINTK("Ignoring frame...\n");
                         dev_kfree_skb(skb);
                         return;
                 }


[atm]: cleanup timers in lec

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1380.1.44 -> 1.1380.1.45
#	       net/atm/lec.c	1.34    -> 1.35   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/07/08	chas@relax.cmf.nrl.navy.mil	1.1380.1.45
# timer cleanup
# --------------------------------------------
#
diff -Nru a/net/atm/lec.c b/net/atm/lec.c
--- a/net/atm/lec.c	Wed Jul 16 17:05:30 2003
+++ b/net/atm/lec.c	Wed Jul 16 17:05:30 2003
@@ -1031,7 +1031,7 @@
 #define LEC_ARP_REFRESH_INTERVAL (3*HZ)
 
 static void lec_arp_check_expire(unsigned long data);
-static __inline__ void lec_arp_expire_arp(unsigned long data);
+static void lec_arp_expire_arp(unsigned long data);
 void dump_arp_table(struct lec_priv *priv);
 
 /* 
@@ -1371,7 +1371,7 @@
         struct lec_arp_table *entry, *next;
         int i;
 
-        del_timer(&priv->lec_arp_timer);
+        del_timer_sync(&priv->lec_arp_timer);
         
         /*
          * Remove all entries
@@ -1386,7 +1386,7 @@
         entry = priv->lec_arp_empty_ones;
         while(entry) {
                 next = entry->next;
-                del_timer(&entry->timer);
+                del_timer_sync(&entry->timer);
                 lec_arp_clear_vccs(entry);
                 kfree(entry);
                 entry = next;
@@ -1395,7 +1395,7 @@
         entry = priv->lec_no_forward;
         while(entry) {
                 next = entry->next;
-                del_timer(&entry->timer);
+                del_timer_sync(&entry->timer);
                 lec_arp_clear_vccs(entry);
                 kfree(entry);
                 entry = next;
@@ -1404,7 +1404,7 @@
         entry = priv->mcast_fwds;
         while(entry) {
                 next = entry->next;
-                del_timer(&entry->timer);
+                /* No timer, LANEv2 7.1.20 and 2.3.5.3 */
                 lec_arp_clear_vccs(entry);
                 kfree(entry);
                 entry = next;
@@ -1478,8 +1478,6 @@
 
         entry = (struct lec_arp_table *)data;
 
-        del_timer(&entry->timer);
-
         DPRINTK("lec_arp_expire_arp\n");
         if (entry->status == ESI_ARP_PENDING) {
                 if (entry->no_tries <= entry->priv->max_retry_count) {
@@ -1489,8 +1487,7 @@
                                 send_to_lecd(entry->priv, l_arp_xmt, entry->mac_addr, NULL, NULL);
                         entry->no_tries++;
                 }
-                entry->timer.expires = jiffies + (1*HZ);
-                add_timer(&entry->timer);
+                mod_timer(&entry->timer, jiffies + (1*HZ));
         }
 }
 
@@ -1562,8 +1559,6 @@
         unsigned long time_to_check;
         int i;
 
-        del_timer(&priv->lec_arp_timer);
-
         DPRINTK("lec_arp_check_expire %p,%d\n",priv,
                 atomic_read(&priv->lec_arp_users));
         DPRINTK("expire: eo:%p nf:%p\n",priv->lec_arp_empty_ones,
@@ -1621,8 +1616,8 @@
                 }
                 lec_arp_put(priv);
         }
-        priv->lec_arp_timer.expires = jiffies + LEC_ARP_REFRESH_INTERVAL;
-        add_timer(&priv->lec_arp_timer);
+
+        mod_timer(&priv->lec_arp_timer, jiffies + LEC_ARP_REFRESH_INTERVAL);
 }
 /*
  * Try to find vcc where mac_address is attached.

             reply	other threads:[~2003-07-16 21:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-16 21:18 chas williams [this message]
2003-07-21 12:24 ` [PATCH][ATM] minor cleanups for 2.5 David S. Miller
2003-07-21 15:03   ` chas williams

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=200307162120.h6GLKWsG023003@ginger.cmf.nrl.navy.mil \
    --to=chas@cmf.nrl.navy.mil \
    --cc=chas3@users.sourceforge.net \
    --cc=davem@redhat.com \
    --cc=netdev@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.