summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2012-07-08 23:20:15 +0000
committerattilio <attilio@FreeBSD.org>2012-07-08 23:20:15 +0000
commit593da627a7f6c117e4b7a93a1a7dab70cb3b9f52 (patch)
tree4baba03166bf64d15df3cb68f899a0bf5b752619 /sys
parent7ad1887bf1b9902b3f133410164231be23bfaac0 (diff)
downloadFreeBSD-src-593da627a7f6c117e4b7a93a1a7dab70cb3b9f52.zip
FreeBSD-src-593da627a7f6c117e4b7a93a1a7dab70cb3b9f52.tar.gz
MFC
Diffstat (limited to 'sys')
-rw-r--r--sys/ia64/ia64/machdep.c10
-rw-r--r--sys/ia64/ia64/mp_machdep.c8
-rw-r--r--sys/ia64/include/md_var.h2
-rw-r--r--sys/netinet/ipfw/ip_fw_table.c9
-rw-r--r--sys/netinet6/frag6.c13
-rw-r--r--sys/vm/vm_pageout.c6
6 files changed, 35 insertions, 13 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c
index 49a9057..fbc35d1 100644
--- a/sys/ia64/ia64/machdep.c
+++ b/sys/ia64/ia64/machdep.c
@@ -506,6 +506,14 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
}
void
+cpu_pcpu_setup(struct pcpu *pc, u_int acpi_id, u_int sapic_id)
+{
+
+ pc->pc_acpi_id = acpi_id;
+ pc->pc_md.lid = IA64_LID_SET_SAPIC_ID(sapic_id);
+}
+
+void
spinlock_enter(void)
{
struct thread *td;
@@ -791,7 +799,7 @@ ia64_init(void)
ia64_set_k4((u_int64_t)pcpup);
pcpu_init(pcpup, 0, sizeof(pcpu0));
dpcpu_init(ia64_physmem_alloc(DPCPU_SIZE, PAGE_SIZE), 0);
- PCPU_SET(md.lid, ia64_get_lid());
+ cpu_pcpu_setup(pcpup, ~0U, ia64_get_lid());
PCPU_SET(curthread, &thread0);
/*
diff --git a/sys/ia64/ia64/mp_machdep.c b/sys/ia64/ia64/mp_machdep.c
index 0d8f241..8f92460 100644
--- a/sys/ia64/ia64/mp_machdep.c
+++ b/sys/ia64/ia64/mp_machdep.c
@@ -309,9 +309,8 @@ cpu_mp_add(u_int acpi_id, u_int id, u_int eid)
} else
pc = pcpup;
- pc->pc_acpi_id = acpi_id;
- pc->pc_md.lid = IA64_LID_SET_SAPIC_ID(sapic_id);
-
+ cpu_pcpu_setup(pc, acpi_id, sapic_id);
+
CPU_SET(pc->pc_cpuid, &all_cpus);
}
@@ -466,6 +465,7 @@ cpu_mp_unleash(void *dummy)
*/
ia64_bind_intr();
}
+SYSINIT(start_aps, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, cpu_mp_unleash, NULL);
/*
* send an IPI to a set of cpus.
@@ -522,5 +522,3 @@ ipi_send(struct pcpu *cpu, int xiv)
ia64_mf_a();
CTR3(KTR_SMP, "ipi_send(%p, %d): cpuid=%d", cpu, xiv, PCPU_GET(cpuid));
}
-
-SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL);
diff --git a/sys/ia64/include/md_var.h b/sys/ia64/include/md_var.h
index 6669c65..9c7638e 100644
--- a/sys/ia64/include/md_var.h
+++ b/sys/ia64/include/md_var.h
@@ -61,6 +61,7 @@ ia64_bsp_adjust(uint64_t bsp, int nslots)
#ifdef _KERNEL
struct _special;
+struct pcpu;
struct thread;
struct trapframe;
@@ -80,6 +81,7 @@ void *acpi_find_table(const char *sig);
void busdma_swi(void);
int copyout_regstack(struct thread *, uint64_t *, uint64_t *);
void cpu_mp_add(u_int, u_int, u_int);
+void cpu_pcpu_setup(struct pcpu *, u_int, u_int);
int do_ast(struct trapframe *);
void ia32_trap(int, struct trapframe *);
int ia64_count_cpus(void);
diff --git a/sys/netinet/ipfw/ip_fw_table.c b/sys/netinet/ipfw/ip_fw_table.c
index 597817b..68a6220 100644
--- a/sys/netinet/ipfw/ip_fw_table.c
+++ b/sys/netinet/ipfw/ip_fw_table.c
@@ -344,9 +344,12 @@ ipfw_del_table_entry(struct ip_fw_chain *ch, uint16_t tbl, void *paddr,
struct xaddr_iface ifname, ifmask;
memset(&ifname, 0, sizeof(ifname));
+ /* Include last \0 into comparison */
+ mlen++;
+
/* Set 'total' structure length */
- KEY_LEN(ifname) = mlen;
- KEY_LEN(ifmask) = mlen;
+ KEY_LEN(ifname) = KEY_LEN_IFACE + mlen;
+ KEY_LEN(ifmask) = KEY_LEN_IFACE + mlen;
/* Assume direct match */
/* FIXME: Add interface pattern matching */
#if 0
@@ -569,7 +572,7 @@ ipfw_lookup_table_extended(struct ip_fw_chain *ch, uint16_t tbl, void *paddr,
case IPFW_TABLE_INTERFACE:
KEY_LEN(iface) = KEY_LEN_IFACE +
- strlcpy(iface.ifname, (char *)paddr, IF_NAMESIZE);
+ strlcpy(iface.ifname, (char *)paddr, IF_NAMESIZE) + 1;
/* Assume direct match */
/* FIXME: Add interface pattern matching */
xent = (struct table_xentry *)(rnh->rnh_lookup(&iface, NULL, rnh));
diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c
index 1523133..b2e8e04 100644
--- a/sys/netinet6/frag6.c
+++ b/sys/netinet6/frag6.c
@@ -221,6 +221,19 @@ frag6_input(struct mbuf **mp, int *offp, int proto)
/* offset now points to data portion */
offset += sizeof(struct ip6_frag);
+ /*
+ * XXX-BZ RFC XXXX (draft-gont-6man-ipv6-atomic-fragments)
+ * Handle "atomic" fragments (offset and m bit set to 0) upfront,
+ * unrelated to any reassembly. Just skip the fragment header.
+ */
+ if ((ip6f->ip6f_offlg & ~IP6F_RESERVED_MASK) == 0) {
+ /* XXX-BZ we want dedicated counters for this. */
+ V_ip6stat.ip6s_reassembled++;
+ in6_ifstat_inc(dstifp, ifs6_reass_ok);
+ *offp = offset;
+ return (ip6f->ip6f_nxt);
+ }
+
IP6Q_LOCK();
/*
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 9485fdd..11d040d 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -1030,7 +1030,6 @@ rescan0:
++pageout_lock_miss;
if (object->flags & OBJ_MIGHTBEDIRTY)
vnodes_skipped++;
- vm_page_lock_queues();
goto unlock_and_continue;
}
KASSERT(mp != NULL,
@@ -1041,7 +1040,6 @@ rescan0:
if (vget(vp, LK_EXCLUSIVE | LK_TIMELOCK,
curthread)) {
VM_OBJECT_LOCK(object);
- vm_page_lock_queues();
++pageout_lock_miss;
if (object->flags & OBJ_MIGHTBEDIRTY)
vnodes_skipped++;
@@ -1083,14 +1081,14 @@ rescan0:
* be undergoing I/O, so skip it
*/
if (m->hold_count) {
- vm_page_lock_queues();
- queues_locked = TRUE;
vm_page_unlock(m);
vm_page_requeue(m);
if (object->flags & OBJ_MIGHTBEDIRTY)
vnodes_skipped++;
goto unlock_and_continue;
}
+ vm_page_unlock_queues();
+ queues_locked = FALSE;
}
/*
OpenPOWER on IntegriCloud