PERFORCE change 130988 for review
Marcel Moolenaar
marcel at FreeBSD.org
Sat Dec 15 17:10:02 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=130988
Change 130988 by marcel at marcel_cluster on 2007/12/16 01:09:28
IFC @130987
Affected files ...
.. //depot/projects/e500/include/complex.h#3 integrate
.. //depot/projects/e500/lib/msun/Makefile#4 integrate
.. //depot/projects/e500/lib/msun/Symbol.map#3 integrate
.. //depot/projects/e500/lib/msun/man/csqrt.3#1 branch
.. //depot/projects/e500/lib/msun/src/s_csqrt.c#1 branch
.. //depot/projects/e500/lib/msun/src/s_csqrtf.c#1 branch
.. //depot/projects/e500/share/man/man3/tgmath.3#2 integrate
.. //depot/projects/e500/share/man/man4/Makefile#8 integrate
.. //depot/projects/e500/share/man/man4/hptrr.4#1 branch
.. //depot/projects/e500/sys/amd64/conf/GENERIC#8 integrate
.. //depot/projects/e500/sys/amd64/conf/NOTES#5 integrate
.. //depot/projects/e500/sys/conf/files.amd64#6 integrate
.. //depot/projects/e500/sys/conf/files.i386#6 integrate
.. //depot/projects/e500/sys/conf/files.powerpc#11 integrate
.. //depot/projects/e500/sys/conf/options#8 integrate
.. //depot/projects/e500/sys/conf/options.powerpc#3 integrate
.. //depot/projects/e500/sys/dev/cxgb/cxgb_adapter.h#5 integrate
.. //depot/projects/e500/sys/dev/cxgb/cxgb_include.h#3 integrate
.. //depot/projects/e500/sys/dev/cxgb/cxgb_l2t.c#3 integrate
.. //depot/projects/e500/sys/dev/cxgb/cxgb_l2t.h#3 integrate
.. //depot/projects/e500/sys/dev/cxgb/cxgb_main.c#6 integrate
.. //depot/projects/e500/sys/dev/cxgb/cxgb_offload.c#3 integrate
.. //depot/projects/e500/sys/dev/cxgb/cxgb_offload.h#4 integrate
.. //depot/projects/e500/sys/dev/cxgb/cxgb_osdep.h#5 integrate
.. //depot/projects/e500/sys/dev/cxgb/cxgb_sge.c#5 integrate
.. //depot/projects/e500/sys/dev/cxgb/t3cdev.h#1 branch
.. //depot/projects/e500/sys/dev/cxgb/ulp/toecore/cxgb_toedev.h#1 branch
.. //depot/projects/e500/sys/dev/cxgb/ulp/toecore/toedev.c#1 branch
.. //depot/projects/e500/sys/dev/cxgb/ulp/toecore/toedev.h#2 delete
.. //depot/projects/e500/sys/dev/hptrr/amd64-elf.hptrr_lib.o.uu#1 branch
.. //depot/projects/e500/sys/dev/hptrr/array.h#1 branch
.. //depot/projects/e500/sys/dev/hptrr/him.h#1 branch
.. //depot/projects/e500/sys/dev/hptrr/himfuncs.h#1 branch
.. //depot/projects/e500/sys/dev/hptrr/hptintf.h#1 branch
.. //depot/projects/e500/sys/dev/hptrr/hptrr_config.c#1 branch
.. //depot/projects/e500/sys/dev/hptrr/hptrr_config.h#1 branch
.. //depot/projects/e500/sys/dev/hptrr/hptrr_os_bsd.c#1 branch
.. //depot/projects/e500/sys/dev/hptrr/hptrr_osm_bsd.c#1 branch
.. //depot/projects/e500/sys/dev/hptrr/i386-elf.hptrr_lib.o.uu#1 branch
.. //depot/projects/e500/sys/dev/hptrr/ldm.h#1 branch
.. //depot/projects/e500/sys/dev/hptrr/list.h#1 branch
.. //depot/projects/e500/sys/dev/hptrr/os_bsd.h#1 branch
.. //depot/projects/e500/sys/dev/hptrr/osm.h#1 branch
.. //depot/projects/e500/sys/i386/conf/GENERIC#8 integrate
.. //depot/projects/e500/sys/i386/conf/NOTES#5 integrate
.. //depot/projects/e500/sys/i386/conf/PAE#4 integrate
.. //depot/projects/e500/sys/kern/kern_mbuf.c#5 integrate
.. //depot/projects/e500/sys/kern/kern_mutex.c#6 integrate
.. //depot/projects/e500/sys/kern/kern_rwlock.c#6 integrate
.. //depot/projects/e500/sys/kern/kern_sx.c#7 integrate
.. //depot/projects/e500/sys/kern/kern_thread.c#8 integrate
.. //depot/projects/e500/sys/kern/sched_4bsd.c#6 integrate
.. //depot/projects/e500/sys/kern/sched_ule.c#6 integrate
.. //depot/projects/e500/sys/kern/subr_lock.c#6 integrate
.. //depot/projects/e500/sys/modules/Makefile#6 integrate
.. //depot/projects/e500/sys/modules/cxgb/Makefile#5 integrate
.. //depot/projects/e500/sys/modules/cxgb/cxgb/Makefile#1 branch
.. //depot/projects/e500/sys/modules/cxgb/toecore/Makefile#1 branch
.. //depot/projects/e500/sys/modules/hptrr/Makefile#1 branch
.. //depot/projects/e500/sys/net/if.h#5 integrate
.. //depot/projects/e500/sys/netinet/toedev.h#2 integrate
.. //depot/projects/e500/sys/powerpc/conf/GENERIC#7 integrate
.. //depot/projects/e500/sys/powerpc/conf/NOTES#4 integrate
.. //depot/projects/e500/sys/powerpc/include/fpu.h#3 integrate
.. //depot/projects/e500/sys/sys/_lock.h#2 integrate
.. //depot/projects/e500/sys/sys/lock_profile.h#5 integrate
.. //depot/projects/e500/sys/sys/proc.h#7 integrate
.. //depot/projects/e500/sys/sys/sx.h#5 integrate
.. //depot/projects/e500/tools/regression/lib/msun/Makefile#2 integrate
.. //depot/projects/e500/tools/regression/lib/msun/test-csqrt.c#1 branch
.. //depot/projects/e500/tools/regression/lib/msun/test-csqrt.t#1 branch
Differences ...
==== //depot/projects/e500/include/complex.h#3 (text+ko) ====
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2001 The FreeBSD Project.
+ * Copyright (c) 2001-2007 The FreeBSD Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/include/complex.h,v 1.7 2007/12/12 23:43:51 das Exp $
+ * $FreeBSD: src/include/complex.h,v 1.8 2007/12/15 08:38:44 das Exp $
*/
#ifndef _COMPLEX_H
@@ -57,6 +57,8 @@
double creal(double complex);
float crealf(float complex);
long double creall(long double complex);
+double complex csqrt(double complex);
+float complex csqrtf(float complex);
__END_DECLS
==== //depot/projects/e500/lib/msun/Makefile#4 (text+ko) ====
@@ -1,5 +1,5 @@
# @(#)Makefile 5.1beta 93/09/24
-# $FreeBSD: src/lib/msun/Makefile,v 1.79 2007/12/12 23:43:50 das Exp $
+# $FreeBSD: src/lib/msun/Makefile,v 1.80 2007/12/15 08:38:44 das Exp $
#
# ====================================================
# Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -40,7 +40,8 @@
k_tan.c k_tanf.c \
s_asinh.c s_asinhf.c s_atan.c s_atanf.c s_carg.c s_cargf.c \
s_cbrt.c s_cbrtf.c s_ceil.c s_ceilf.c s_ceill.c \
- s_copysign.c s_copysignf.c s_cos.c s_cosf.c s_erf.c s_erff.c \
+ s_copysign.c s_copysignf.c s_cos.c s_cosf.c \
+ s_csqrt.c s_csqrtf.c s_erf.c s_erff.c \
s_exp2.c s_exp2f.c s_expm1.c s_expm1f.c s_fabsf.c s_fdim.c \
s_finite.c s_finitef.c \
s_floor.c s_floorf.c s_floorl.c s_fma.c s_fmaf.c \
@@ -93,7 +94,7 @@
INCS= fenv.h math.h
MAN= acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 ceil.3 \
- cimag.3 copysign.3 cos.3 cosh.3 erf.3 exp.3 fabs.3 fdim.3 \
+ cimag.3 copysign.3 cos.3 cosh.3 csqrt.3 erf.3 exp.3 fabs.3 fdim.3 \
feclearexcept.3 feenableexcept.3 fegetenv.3 \
fegetround.3 fenv.3 floor.3 \
fma.3 fmax.3 fmod.3 hypot.3 ieee.3 ieee_test.3 ilogb.3 j0.3 \
@@ -114,6 +115,7 @@
MLINKS+=copysign.3 copysignf.3 copysign.3 copysignl.3
MLINKS+=cos.3 cosf.3
MLINKS+=cosh.3 coshf.3
+MLINKS+=csqrt.3 csqrtf.3
MLINKS+=erf.3 erfc.3 erf.3 erff.3 erf.3 erfcf.3
MLINKS+=exp.3 expm1.3 exp.3 log.3 exp.3 log10.3 exp.3 log1p.3 exp.3 pow.3 \
exp.3 exp2.3 exp.3 exp2f.3 exp.3 expf.3 \
==== //depot/projects/e500/lib/msun/Symbol.map#3 (text) ====
@@ -1,6 +1,8 @@
/*
- * $FreeBSD: src/lib/msun/Symbol.map,v 1.6 2007/12/14 03:08:10 das Exp $
+ * $FreeBSD: src/lib/msun/Symbol.map,v 1.7 2007/12/15 08:39:03 das Exp $
*/
+
+/* 7.0-CURRENT */
FBSD_1.0 {
__fe_dfl_env;
tgamma;
@@ -60,8 +62,6 @@
asinhf;
atan;
atanf;
- carg;
- cargf;
cbrt;
cbrtf;
ceil;
@@ -183,3 +183,11 @@
drem;
dremf;
};
+
+/* First added in 8.0-CURRENT */
+FBSD_1.1 {
+ carg;
+ cargf;
+ csqrt;
+ csqrtf;
+};
==== //depot/projects/e500/share/man/man3/tgmath.3#2 (text+ko) ====
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man3/tgmath.3,v 1.2 2005/01/13 11:22:29 ru Exp $
+.\" $FreeBSD: src/share/man/man3/tgmath.3,v 1.3 2007/12/15 02:40:10 das Exp $
.\"
.Dd August 14, 2004
.Os
@@ -101,6 +101,7 @@
.It Fn exp Ta Fn exp Ta Fn cexp
.It Fn log Ta Fn log Ta Fn clog
.It Fn pow Ta Fn pow Ta Fn cpow
+.It Fn sqrt Ta Fn sqrt Ta Fn csqrt
.It Fn fabs Ta Fn fabs Ta Fn cabs
.El
.Pp
==== //depot/projects/e500/share/man/man4/Makefile#8 (text+ko) ====
@@ -1,5 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 6/18/93
-# $FreeBSD: src/share/man/man4/Makefile,v 1.399 2007/11/13 11:23:52 ru Exp $
+# $FreeBSD: src/share/man/man4/Makefile,v 1.400 2007/12/15 00:56:15 scottl Exp $
MAN= aac.4 \
acpi.4 \
@@ -103,6 +103,7 @@
hme.4 \
${_hptiop.4} \
${_hptmv.4} \
+ ${_hptrr.4} \
hwpmc.4 \
ichsmb.4 \
${_ichwd.4} \
@@ -547,6 +548,7 @@
_coretemp.4= coretemp.4
_hptiop.4= hptiop.4
_hptmv.4= hptmv.4
+_hptrr.4= hptrr.4
_ichwd.4= ichwd.4
_if_nfe.4= if_nfe.4
_if_nve.4= if_nve.4
==== //depot/projects/e500/sys/amd64/conf/GENERIC#8 (text+ko) ====
@@ -16,7 +16,7 @@
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
-# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.489 2007/12/02 20:40:30 rwatson Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.490 2007/12/15 00:56:16 scottl Exp $
cpu HAMMER
ident GENERIC
@@ -131,6 +131,7 @@
device ciss # Compaq Smart RAID 5*
device dpt # DPT Smartcache III, IV - See NOTES for options
device hptmv # Highpoint RocketRAID 182x
+device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx
device rr232x # Highpoint RocketRAID 232x
device iir # Intel Integrated RAID
device ips # IBM (Adaptec) ServeRAID
==== //depot/projects/e500/sys/amd64/conf/NOTES#5 (text+ko) ====
@@ -4,7 +4,7 @@
# This file contains machine dependent kernel configuration notes. For
# machine independent notes, look in /sys/conf/NOTES.
#
-# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.72 2007/12/01 20:07:44 phk Exp $
+# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.73 2007/12/15 00:56:16 scottl Exp $
#
#
@@ -372,11 +372,15 @@
device aacp # SCSI Passthrough interface (optional, CAM required)
#
-# Highpoint RocketRAID 182x. This is really just software RAID on a
-# Marvell SATA chip.
+# Highpoint RocketRAID 182x.
device hptmv
#
+# Highpoint RocketRAID. Supports RR172x, RR222x, RR2240, RR232x, RR2340,
+# RR2210, RR174x, RR2522, RR231x, RR230x.
+device hptrr
+
+#
# Highpoint RocketRAID 232x. This is software RAID but with hardware
# acceleration assistance for RAID_5.
device rr232x
==== //depot/projects/e500/sys/conf/files.amd64#6 (text+ko) ====
@@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
-# $FreeBSD: src/sys/conf/files.amd64,v 1.116 2007/12/09 21:00:36 alc Exp $
+# $FreeBSD: src/sys/conf/files.amd64,v 1.117 2007/12/15 00:56:15 scottl Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -72,6 +72,11 @@
dependency "$S/dev/hptmv/amd64-elf.raid.o.uu" \
compile-with "uudecode < $S/dev/hptmv/amd64-elf.raid.o.uu" \
no-implicit-rule
+hptrr_lib.o optional hptrr \
+ dependency "$S/dev/hptrr/amd64-elf.hptrr_lib.o.uu" \
+ compile-with "uudecode < $S/dev/hptrr/amd64-elf.hptrr_lib.o.uu" \
+ no-implicit-rule
+#
rr232x_lib.o optional rr232x \
dependency "$S/dev/rr232x/amd64-elf.rr232x_lib.o.uu" \
compile-with "uudecode < $S/dev/rr232x/amd64-elf.rr232x_lib.o.uu" \
@@ -183,6 +188,9 @@
dev/hptmv/gui_lib.c optional hptmv
dev/hptmv/hptproc.c optional hptmv
dev/hptmv/ioctl.c optional hptmv
+dev/hptrr/hptrr_os_bsd.c optional hptrr
+dev/hptrr/hptrr_osm_bsd.c optional hptrr
+dev/hptrr/hptrr_config.c optional hptrr
dev/hwpmc/hwpmc_amd.c optional hwpmc
dev/hwpmc/hwpmc_piv.c optional hwpmc
dev/hwpmc/hwpmc_x86.c optional hwpmc
==== //depot/projects/e500/sys/conf/files.i386#6 (text+ko) ====
@@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
-# $FreeBSD: src/sys/conf/files.i386,v 1.589 2007/12/09 21:00:36 alc Exp $
+# $FreeBSD: src/sys/conf/files.i386,v 1.590 2007/12/15 00:56:15 scottl Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
@@ -77,12 +77,16 @@
compile-with "uudecode < $S/dev/hptmv/i386-elf.raid.o.uu" \
no-implicit-rule
#
+hptrr_lib.o optional hptrr \
+ dependency "$S/dev/hptrr/i386-elf.hptrr_lib.o.uu" \
+ compile-with "uudecode < $S/dev/hptrr/i386-elf.hptrr_lib.o.uu" \
+ no-implicit-rule
+#
rr232x_lib.o optional rr232x \
dependency "$S/dev/rr232x/i386-elf.rr232x_lib.o.uu" \
compile-with "uudecode < $S/dev/rr232x/i386-elf.rr232x_lib.o.uu" \
no-implicit-rule
#
-#
compat/linprocfs/linprocfs.c optional linprocfs
compat/linsysfs/linsysfs.c optional linsysfs
compat/linux/linux_emul.c optional compat_linux
@@ -194,6 +198,9 @@
dev/hptmv/gui_lib.c optional hptmv
dev/hptmv/hptproc.c optional hptmv
dev/hptmv/ioctl.c optional hptmv
+dev/hptrr/hptrr_os_bsd.c optional hptrr
+dev/hptrr/hptrr_osm_bsd.c optional hptrr
+dev/hptrr/hptrr_config.c optional hptrr
dev/hwpmc/hwpmc_amd.c optional hwpmc
dev/hwpmc/hwpmc_pentium.c optional hwpmc
dev/hwpmc/hwpmc_piv.c optional hwpmc
==== //depot/projects/e500/sys/conf/files.powerpc#11 (text+ko) ====
@@ -1,7 +1,7 @@
# This file tells config what files go into building a kernel,
# files marked standard are always included.
#
-# $FreeBSD: src/sys/conf/files.powerpc,v 1.69 2007/12/14 23:47:39 marcel Exp $
+# $FreeBSD: src/sys/conf/files.powerpc,v 1.70 2007/12/16 01:02:47 marcel Exp $
#
# The long compile-with and dependency lines are required because of
# limitations in config: backslash-newline doesn't work in strings, and
==== //depot/projects/e500/sys/conf/options#8 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.611 2007/12/06 02:32:42 marcel Exp $
+# $FreeBSD: src/sys/conf/options,v 1.613 2007/12/15 23:13:31 jeff Exp $
#
# On the handling of kernel options
#
@@ -540,7 +540,6 @@
MUTEX_NOINLINE opt_global.h
LOCK_PROFILING opt_global.h
LOCK_PROFILING_FAST opt_global.h
-LOCK_PROFILING_SHARED opt_global.h
MSIZE opt_global.h
REGRESSION opt_global.h
RESTARTABLE_PANICS opt_global.h
@@ -752,3 +751,6 @@
# Interrupt filtering
INTR_FILTER opt_global.h
+
+#Disable code to dispatch tcp offloading
+TCP_OFFLOAD_DISABLE opt_inet.h
==== //depot/projects/e500/sys/conf/options.powerpc#3 (text+ko) ====
@@ -1,9 +1,8 @@
-# $FreeBSD: src/sys/conf/options.powerpc,v 1.9 2004/06/25 13:44:34 grehan Exp $
+# $FreeBSD: src/sys/conf/options.powerpc,v 1.10 2007/12/16 00:45:56 marcel Exp $
# Options specific to the powerpc platform kernels
AIM opt_global.h
E500 opt_global.h
-IPKDB
GFB_DEBUG opt_gfb.h
GFB_NO_FONT_LOADING opt_gfb.h
==== //depot/projects/e500/sys/dev/cxgb/cxgb_adapter.h#5 (text+ko) ====
@@ -26,7 +26,7 @@
POSSIBILITY OF SUCH DAMAGE.
-$FreeBSD: src/sys/dev/cxgb/cxgb_adapter.h,v 1.20 2007/09/10 00:59:51 kmacy Exp $
+$FreeBSD: src/sys/dev/cxgb/cxgb_adapter.h,v 1.21 2007/12/15 21:54:58 kmacy Exp $
***************************************************************************/
@@ -55,12 +55,14 @@
#ifdef CONFIG_DEFINED
#include <cxgb_osdep.h>
-#include <ulp/toecore/toedev.h>
+#include <t3cdev.h>
#include <sys/mbufq.h>
+#include <ulp/toecore/cxgb_toedev.h>
#else
#include <dev/cxgb/cxgb_osdep.h>
+#include <dev/cxgb/t3cdev.h>
#include <dev/cxgb/sys/mbufq.h>
-#include <dev/cxgb/ulp/toecore/toedev.h>
+#include <dev/cxgb/ulp/toecore/cxgb_toedev.h>
#endif
#define USE_SX
@@ -371,7 +373,7 @@
struct port_info port[MAX_NPORTS];
device_t portdev[MAX_NPORTS];
- struct toedev tdev;
+ struct t3cdev tdev;
char fw_version[64];
uint32_t open_device_map;
uint32_t registered_device_map;
@@ -497,7 +499,7 @@
void t3_os_link_changed(adapter_t *adapter, int port_id, int link_status,
int speed, int duplex, int fc);
void t3_sge_err_intr_handler(adapter_t *adapter);
-int t3_offload_tx(struct toedev *, struct mbuf *);
+int t3_offload_tx(struct t3cdev *, struct mbuf *);
void t3_os_ext_intr_handler(adapter_t *adapter);
void t3_os_set_hw_addr(adapter_t *adapter, int port_idx, u8 hw_addr[]);
int t3_mgmt_tx(adapter_t *adap, struct mbuf *m);
@@ -554,7 +556,7 @@
}
static __inline struct adapter *
-tdev2adap(struct toedev *d)
+tdev2adap(struct t3cdev *d)
{
return container_of(d, struct adapter, tdev);
}
==== //depot/projects/e500/sys/dev/cxgb/cxgb_include.h#3 (text+ko) ====
@@ -1,8 +1,9 @@
/*
- * $FreeBSD: src/sys/dev/cxgb/cxgb_include.h,v 1.2 2007/09/10 00:59:51 kmacy Exp $
+ * $FreeBSD: src/sys/dev/cxgb/cxgb_include.h,v 1.3 2007/12/15 21:54:58 kmacy Exp $
*/
+
#ifdef CONFIG_DEFINED
#include <cxgb_osdep.h>
#include <common/cxgb_common.h>
@@ -14,11 +15,9 @@
#include <common/cxgb_sge_defs.h>
#include <common/cxgb_firmware_exports.h>
#include <sys/mvec.h>
-#include <ulp/toecore/toedev.h>
#include <sys/mbufq.h>
#include <common/jhash.h>
-
-
+#include <ulp/toecore/cxgb_toedev.h>
#else
#include <dev/cxgb/cxgb_osdep.h>
#include <dev/cxgb/common/cxgb_common.h>
@@ -31,7 +30,9 @@
#include <dev/cxgb/common/cxgb_firmware_exports.h>
#include <dev/cxgb/sys/mvec.h>
-#include <dev/cxgb/ulp/toecore/toedev.h>
#include <dev/cxgb/sys/mbufq.h>
#include <dev/cxgb/common/jhash.h>
+#include <dev/cxgb/ulp/toecore/cxgb_toedev.h>
#endif
+
+
==== //depot/projects/e500/sys/dev/cxgb/cxgb_l2t.c#3 (text+ko) ====
@@ -28,7 +28,7 @@
***************************************************************************/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_l2t.c,v 1.3 2007/08/17 05:57:03 kmacy Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cxgb/cxgb_l2t.c,v 1.4 2007/12/15 21:54:58 kmacy Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -59,7 +59,7 @@
#define VLAN_NONE 0xfff
#define SDL(s) ((struct sockaddr_dl *)s)
-#define RT_ENADDR(rt) ((u_char *)LLADDR(SDL((rt))))
+#define RT_ENADDR(sa) ((u_char *)LLADDR(SDL((sa))))
#define rt_expire rt_rmx.rmx_expire
struct llinfo_arp {
@@ -103,11 +103,8 @@
RT_ADDREF(rt);
RT_UNLOCK(rt);
- if (e->neigh) {
- RT_LOCK(e->neigh);
- RT_REMREF(e->neigh);
- RT_UNLOCK(e->neigh);
- }
+ if (e->neigh)
+ RTFREE(e->neigh);
e->neigh = rt;
}
@@ -117,7 +114,7 @@
* entry locked.
*/
static int
-setup_l2e_send_pending(struct toedev *dev, struct mbuf *m,
+setup_l2e_send_pending(struct t3cdev *dev, struct mbuf *m,
struct l2t_entry *e)
{
struct cpl_l2t_write_req *req;
@@ -130,13 +127,14 @@
* XXX MH_ALIGN
*/
req = mtod(m, struct cpl_l2t_write_req *);
+ m->m_pkthdr.len = m->m_len = sizeof(*req);
+
req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, e->idx));
req->params = htonl(V_L2T_W_IDX(e->idx) | V_L2T_W_IFF(e->smt_idx) |
V_L2T_W_VLAN(e->vlan & EVL_VLID_MASK) |
V_L2T_W_PRIO(vlan_prio(e)));
- memcpy(e->dmac, RT_ENADDR(e->neigh), sizeof(e->dmac));
memcpy(req->dst_mac, e->dmac, sizeof(req->dst_mac));
m_set_priority(m, CPL_PRIORITY_CONTROL);
cxgb_ofld_send(dev, m);
@@ -168,21 +166,24 @@
}
int
-t3_l2t_send_slow(struct toedev *dev, struct mbuf *m,
- struct l2t_entry *e)
+t3_l2t_send_slow(struct t3cdev *dev, struct mbuf *m, struct l2t_entry *e)
{
- struct rtentry *rt;
- struct mbuf *m0;
+ struct rtentry *rt = e->neigh;
+ struct sockaddr_in sin;
+
+ bzero(&sin, sizeof(struct sockaddr_in));
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof(struct sockaddr_in);
+ sin.sin_addr.s_addr = e->addr;
+
+
- if ((m0 = m_gethdr(M_NOWAIT, MT_DATA)) == NULL)
- return (ENOMEM);
-
- rt = e->neigh;
+ printf("send slow on rt=%p eaddr=0x%08x\n", rt, e->addr);
again:
switch (e->state) {
case L2T_STATE_STALE: /* entry is stale, kick off revalidation */
- arpresolve(rt->rt_ifp, rt, m0, rt->rt_gateway, RT_ENADDR(rt));
+ arpresolve(rt->rt_ifp, rt, NULL, (struct sockaddr *)&sin, e->dmac);
mtx_lock(&e->lock);
if (e->state == L2T_STATE_STALE)
e->state = L2T_STATE_VALID;
@@ -197,9 +198,8 @@
}
arpq_enqueue(e, m);
mtx_unlock(&e->lock);
-
- if ((m0 = m_gethdr(M_NOWAIT, MT_DATA)) == NULL)
- return (ENOMEM);
+ printf("enqueueing arp request\n");
+
/*
* Only the first packet added to the arpq should kick off
* resolution. However, because the m_gethdr below can fail,
@@ -208,7 +208,13 @@
* A better way would be to use a work request to retry L2T
* entries when there's no memory.
*/
- if (arpresolve(rt->rt_ifp, rt, m0, rt->rt_gateway, RT_ENADDR(rt)) == 0) {
+ printf("doing arpresolve on 0x%x \n", e->addr);
+ if (arpresolve(rt->rt_ifp, rt, NULL, (struct sockaddr *)&sin, e->dmac) == 0) {
+ printf("mac=%x:%x:%x:%x:%x:%x\n",
+ e->dmac[0], e->dmac[1], e->dmac[2], e->dmac[3], e->dmac[4], e->dmac[5]);
+
+ if ((m = m_gethdr(M_NOWAIT, MT_DATA)) == NULL)
+ return (ENOMEM);
mtx_lock(&e->lock);
if (e->arpq_head)
@@ -216,16 +222,21 @@
else
m_freem(m);
mtx_unlock(&e->lock);
- }
+ } else
+ printf("arpresolve returned non-zero\n");
}
return 0;
}
void
-t3_l2t_send_event(struct toedev *dev, struct l2t_entry *e)
+t3_l2t_send_event(struct t3cdev *dev, struct l2t_entry *e)
{
struct rtentry *rt;
struct mbuf *m0;
+ struct sockaddr_in sin;
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof(struct sockaddr_in);
+ sin.sin_addr.s_addr = e->addr;
if ((m0 = m_gethdr(M_NOWAIT, MT_DATA)) == NULL)
return;
@@ -234,7 +245,7 @@
again:
switch (e->state) {
case L2T_STATE_STALE: /* entry is stale, kick off revalidation */
- arpresolve(rt->rt_ifp, rt, m0, rt->rt_gateway, RT_ENADDR(rt));
+ arpresolve(rt->rt_ifp, rt, m0, (struct sockaddr *)&sin, e->dmac);
mtx_lock(&e->lock);
if (e->state == L2T_STATE_STALE) {
e->state = L2T_STATE_VALID;
@@ -261,7 +272,7 @@
* A better way would be to use a work request to retry L2T
* entries when there's no memory.
*/
- arpresolve(rt->rt_ifp, rt, m0, rt->rt_gateway, RT_ENADDR(rt));
+ arpresolve(rt->rt_ifp, rt, m0, (struct sockaddr *)&sin, e->dmac);
}
return;
@@ -301,6 +312,7 @@
}
e->state = L2T_STATE_UNUSED;
}
+
return e;
}
@@ -318,19 +330,21 @@
void
t3_l2e_free(struct l2t_data *d, struct l2t_entry *e)
{
+ struct rtentry *rt = NULL;
+
mtx_lock(&e->lock);
if (atomic_load_acq_int(&e->refcnt) == 0) { /* hasn't been recycled */
- if (e->neigh) {
- RT_LOCK(e->neigh);
- RT_REMREF(e->neigh);
- RT_UNLOCK(e->neigh);
- e->neigh = NULL;
- }
+ rt = e->neigh;
+ e->neigh = NULL;
}
+
mtx_unlock(&e->lock);
atomic_add_int(&d->nfree, 1);
+ if (rt)
+ RTFREE(rt);
}
+
/*
* Update an L2T entry that was previously used for the same next hop as neigh.
* Must be called with softirqs disabled.
@@ -346,7 +360,7 @@
if (neigh != e->neigh)
neigh_replace(e, neigh);
- if (memcmp(e->dmac, RT_ENADDR(neigh), sizeof(e->dmac)) ||
+ if (memcmp(e->dmac, RT_ENADDR(neigh->rt_gateway), sizeof(e->dmac)) ||
(neigh->rt_expire > time_uptime))
e->state = L2T_STATE_RESOLVING;
else if (la->la_hold == NULL)
@@ -357,14 +371,15 @@
}
struct l2t_entry *
-t3_l2t_get(struct toedev *dev, struct rtentry *neigh,
- unsigned int smt_idx)
+t3_l2t_get(struct t3cdev *dev, struct rtentry *neigh, struct ifnet *ifp,
+ struct sockaddr *sa)
{
struct l2t_entry *e;
struct l2t_data *d = L2DATA(dev);
- u32 addr = *(u32 *) rt_key(neigh);
+ u32 addr = ((struct sockaddr_in *)sa)->sin_addr.s_addr;
int ifidx = neigh->rt_ifp->if_index;
int hash = arp_hash(addr, ifidx, d);
+ unsigned int smt_idx = ((struct port_info *)ifp->if_softc)->port_id;
rw_wlock(&d->lock);
for (e = d->l2tab[hash].first; e; e = e->next)
@@ -379,14 +394,21 @@
/* Need to allocate a new entry */
e = alloc_l2e(d);
if (e) {
+ printf("initializing new entry\n");
+
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;
e->smt_idx = smt_idx;
atomic_store_rel_int(&e->refcnt, 1);
+ e->neigh = NULL;
+
+
neigh_replace(e, neigh);
#ifdef notyet
/*
@@ -398,7 +420,10 @@
#endif
e->vlan = VLAN_NONE;
mtx_unlock(&e->lock);
+
+ return (e);
}
+
done:
rw_wunlock(&d->lock);
return e;
@@ -413,7 +438,7 @@
* handler.
*/
static void
-handle_failed_resolution(struct toedev *dev, struct mbuf *arpq)
+handle_failed_resolution(struct t3cdev *dev, struct mbuf *arpq)
{
while (arpq) {
@@ -433,21 +458,20 @@
}
-#if defined(NETEVENT) || !defined(CONFIG_CHELSIO_T3_MODULE)
-/*
- * Called when the host's ARP layer makes a change to some entry that is
- * loaded into the HW L2 table.
- */
void
-t3_l2t_update(struct toedev *dev, struct rtentry *neigh)
+t3_l2t_update(struct t3cdev *dev, struct rtentry *neigh, struct sockaddr *sa)
{
struct l2t_entry *e;
struct mbuf *arpq = NULL;
struct l2t_data *d = L2DATA(dev);
- u32 addr = *(u32 *) rt_key(neigh);
+ u32 addr = *(u32 *) &((struct sockaddr_in *)sa)->sin_addr;
int ifidx = neigh->rt_ifp->if_index;
int hash = arp_hash(addr, ifidx, d);
struct llinfo_arp *la;
+ u_char edst[ETHER_ADDR_LEN];
+
+
+ printf("t3_l2t_update called with arp info\n");
rw_rlock(&d->lock);
for (e = d->l2tab[hash].first; e; e = e->next)
@@ -456,10 +480,16 @@
goto found;
}
rw_runlock(&d->lock);
+ printf("addr=0x%08x not found\n", addr);
return;
found:
+ printf("found 0x%08x\n", addr);
+ arpresolve(neigh->rt_ifp, neigh, NULL, sa, edst);
+
rw_runlock(&d->lock);
+ memcpy(e->dmac, edst, ETHER_ADDR_LEN);
+
if (atomic_load_acq_int(&e->refcnt)) {
if (neigh != e->neigh)
neigh_replace(e, neigh);
@@ -470,85 +500,19 @@
if (la->la_asked >= 5 /* arp_maxtries */) {
arpq = e->arpq_head;
e->arpq_head = e->arpq_tail = NULL;
- } else if (la->la_hold == NULL)
+ } else
setup_l2e_send_pending(dev, NULL, e);
} else {
- e->state = (la->la_hold == NULL) ?
- L2T_STATE_VALID : L2T_STATE_STALE;
- if (memcmp(e->dmac, RT_ENADDR(neigh), 6))
- setup_l2e_send_pending(dev, NULL, e);
- }
- }
- mtx_unlock(&e->lock);
-
- if (arpq)
- handle_failed_resolution(dev, arpq);
-}
-#else
-/*
- * Called from a kprobe, interrupts are off.
- */
-void
-t3_l2t_update(struct toedev *dev, struct rtentry *neigh)
-{
- struct l2t_entry *e;
- struct l2t_data *d = L2DATA(dev);
- u32 addr = *(u32 *) rt_key(neigh);
- int ifidx = neigh->dev->ifindex;
- int hash = arp_hash(addr, ifidx, d);
-
- rw_rlock(&d->lock);
- for (e = d->l2tab[hash].first; e; e = e->next)
- if (e->addr == addr && e->ifindex == ifidx) {
- mtx_lock(&e->lock);
- if (atomic_load_acq_int(&e->refcnt)) {
- if (neigh != e->neigh)
- neigh_replace(e, neigh);
- e->tdev = dev;
- mod_timer(&e->update_timer, jiffies + 1);
- }
- mtx_unlock(&e->lock);
- break;
- }
- rw_runlock(&d->lock);
-}
-
-static void
-update_timer_cb(unsigned long data)
-{
- struct mbuf *arpq = NULL;
- struct l2t_entry *e = (struct l2t_entry *)data;
- struct rtentry *neigh = e->neigh;
- struct toedev *dev = e->tdev;
-
- barrier();
- if (!atomic_load_acq_int(&e->refcnt))
- return;
-
- rw_rlock(&neigh->lock);
- mtx_lock(&e->lock);
-
- if (atomic_load_acq_int(&e->refcnt)) {
- if (e->state == L2T_STATE_RESOLVING) {
- if (neigh->nud_state & NUD_FAILED) {
- arpq = e->arpq_head;
- e->arpq_head = e->arpq_tail = NULL;
- } else if (neigh_is_connected(neigh) && e->arpq_head)
- setup_l2e_send_pending(dev, NULL, e);
- } else {
- e->state = neigh_is_connected(neigh) ?
- L2T_STATE_VALID : L2T_STATE_STALE;
- if (memcmp(e->dmac, RT_ENADDR(neigh), sizeof(e->dmac)))
+ e->state = L2T_STATE_VALID;
+ if (memcmp(e->dmac, RT_ENADDR(neigh->rt_gateway), 6))
setup_l2e_send_pending(dev, NULL, e);
}
}
mtx_unlock(&e->lock);
- rw_runlock(&neigh->lock);
if (arpq)
handle_failed_resolution(dev, arpq);
}
-#endif
struct l2t_data *
t3_init_l2t(unsigned int l2t_capacity)
@@ -570,12 +534,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;
}
@@ -583,86 +541,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/e500/sys/dev/cxgb/cxgb_l2t.h#3 (text+ko) ====
@@ -25,13 +25,13 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list