PERFORCE change 128391 for review
Kip Macy
kmacy at FreeBSD.org
Tue Oct 30 22:08:12 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=128391
Change 128391 by kmacy at kmacy:storage:toestack on 2007/10/31 05:07:32
remove NETEVENT references
remove procfs reference
drop l2t_data lock as soon after last update to l2t_data
Affected files ...
.. //depot/projects/toestack/sys/dev/cxgb/cxgb_l2t.c#8 edit
.. //depot/projects/toestack/sys/dev/cxgb/cxgb_l2t.h#7 edit
Differences ...
==== //depot/projects/toestack/sys/dev/cxgb/cxgb_l2t.c#8 (text+ko) ====
@@ -385,6 +385,8 @@
mtx_lock(&e->lock); /* avoid race with t3_l2t_free */
e->next = d->l2tab[hash].first;
d->l2tab[hash].first = e;
+ rw_wunlock(&d->lock);
+
e->state = L2T_STATE_RESOLVING;
e->addr = addr;
e->ifindex = ifidx;
@@ -401,7 +403,10 @@
#endif
e->vlan = VLAN_NONE;
mtx_unlock(&e->lock);
+
+ return (e);
}
+
done:
rw_wunlock(&d->lock);
return e;
@@ -503,12 +508,6 @@
d->l2tab[i].state = L2T_STATE_UNUSED;
mtx_init(&d->l2tab[i].lock, "L2TAB", NULL, MTX_DEF);
atomic_store_rel_int(&d->l2tab[i].refcnt, 0);
-#ifndef NETEVENT
-#ifdef CONFIG_CHELSIO_T3_MODULE
- setup_timer(&d->l2tab[i].update_timer, update_timer_cb,
- (unsigned long)&d->l2tab[i]);
-#endif
-#endif
}
return d;
}
@@ -516,86 +515,6 @@
void
t3_free_l2t(struct l2t_data *d)
{
-#ifndef NETEVENT
-#ifdef CONFIG_CHELSIO_T3_MODULE
- int i;
-
- /* Stop all L2T timers */
- for (i = 0; i < d->nentries; ++i)
- del_timer_sync(&d->l2tab[i].update_timer);
-#endif
-#endif
cxgb_free_mem(d);
}
-#ifdef CONFIG_PROC_FS
-#include <linux/module.h>
-#include <linux/proc_fs.h>
-#include <linux/seq_file.h>
-
-static inline void *
-l2t_get_idx(struct seq_file *seq, loff_t pos)
-{
- struct l2t_data *d = seq->private;
-
- return pos >= d->nentries ? NULL : &d->l2tab[pos];
-}
-
-static void *
-l2t_seq_start(struct seq_file *seq, loff_t *pos)
-{
- return *pos ? l2t_get_idx(seq, *pos) : SEQ_START_TOKEN;
-}
-
-static void *
-l2t_seq_next(struct seq_file *seq, void *v, loff_t *pos)
-{
- v = l2t_get_idx(seq, *pos + 1);
- if (v)
- ++*pos;
- return v;
-}
-
-static void
-l2t_seq_stop(struct seq_file *seq, void *v)
-{
-}
-
-static char
-l2e_state(const struct l2t_entry *e)
-{
- switch (e->state) {
- case L2T_STATE_VALID: return 'V'; /* valid, fast-path entry */
- case L2T_STATE_STALE: return 'S'; /* needs revalidation, but usable */
- case L2T_STATE_RESOLVING:
- return e->arpq_head ? 'A' : 'R';
- default:
- return 'U';
- }
-}
-
-static int
-l2t_seq_show(struct seq_file *seq, void *v)
-{
- if (v == SEQ_START_TOKEN)
- seq_puts(seq, "Index IP address Ethernet address VLAN "
- "Prio State Users SMTIDX Port\n");
- else {
- char ip[20];
- struct l2t_entry *e = v;
-
- mtx_lock(&e->lock);
- sprintf(ip, "%u.%u.%u.%u", NIPQUAD(e->addr));
- seq_printf(seq, "%-5u %-15s %02x:%02x:%02x:%02x:%02x:%02x %4d"
- " %3u %c %7u %4u %s\n",
- e->idx, ip, e->dmac[0], e->dmac[1], e->dmac[2],
- e->dmac[3], e->dmac[4], e->dmac[5],
- e->vlan & EVL_VLID_MASK, vlan_prio(e),
- l2e_state(e), atomic_load_acq_int(&e->refcnt), e->smt_idx,
- e->neigh ? e->neigh->dev->name : "");
- mtx_unlock(&e->lock);
- }
- return 0;
-}
-
-#endif
==== //depot/projects/toestack/sys/dev/cxgb/cxgb_l2t.h#7 (text+ko) ====
@@ -76,12 +76,6 @@
struct mtx lock;
volatile uint32_t refcnt; /* entry reference count */
uint8_t dmac[6]; /* neighbour's MAC address */
-#ifndef NETEVENT
-#ifdef CONFIG_CHELSIO_T3_MODULE
- struct timer_list update_timer;
- struct t3cdev *tdev;
-#endif
-#endif
};
struct l2t_data {
More information about the p4-projects
mailing list