PERFORCE change 181086 for review
Alexandre Fiveg
afiveg at FreeBSD.org
Sat Jul 17 12:32:23 UTC 2010
http://p4web.freebsd.org/@@181086?ac=10
Change 181086 by afiveg at cottonmouth on 2010/07/17 12:32:01
Start with port to ixgbe: initial details, not important.
Affected files ...
.. //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap-bpf.c#13 edit
.. //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap-int.h#13 edit
.. //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap.c#16 edit
.. //depot/projects/soc2010/ringmap/current/contrib/libpcap/ringmap_pcap.c#21 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.c#28 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.c#27 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.h#25 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_e1000.h#17 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_ixgbe.c#1 add
.. //depot/projects/soc2010/ringmap/current/sys/modules/em/Makefile#10 edit
.. //depot/projects/soc2010/ringmap/current/sys/modules/ringmap/Makefile#3 edit
.. //depot/projects/soc2010/ringmap/current/sys/modules/ringmap/Makefile.em#1 add
.. //depot/projects/soc2010/ringmap/current/sys/modules/ringmap/Makefile.ixgbe#1 add
.. //depot/projects/soc2010/ringmap/current/sys/net/ringmap.c#32 edit
.. //depot/projects/soc2010/ringmap/current/sys/net/ringmap.h#32 edit
.. //depot/projects/soc2010/ringmap/current/sys/net/ringmap_kernel.h#3 edit
.. //depot/projects/soc2010/ringmap/scripts/build_ringmap.sh#16 edit
.. //depot/projects/soc2010/ringmap/scripts/set_ringmap.sh#17 edit
.. //depot/projects/soc2010/ringmap/scripts/tailf_ringmap_msgs.sh#11 edit
.. //depot/projects/soc2010/ringmap/tests/libpcap/easy_pcap.c#10 edit
.. //depot/projects/soc2010/ringmap/tests/ringmap/close.c#3 edit
.. //depot/projects/soc2010/ringmap/tests/ringmap/ioctl.c#3 edit
.. //depot/projects/soc2010/ringmap/tests/ringmap/main.c#5 edit
.. //depot/projects/soc2010/ringmap/tests/ringmap/mmap.c#5 edit
.. //depot/projects/soc2010/ringmap/tests/ringmap/open.c#5 edit
Differences ...
==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap-bpf.c#13 (text+ko) ====
==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap-int.h#13 (text+ko) ====
==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/pcap.c#16 (text+ko) ====
==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/ringmap_pcap.c#21 (text+ko) ====
==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.c#28 (text+ko) ====
==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.c#27 (text+ko) ====
==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.h#25 (text+ko) ====
==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_e1000.h#17 (text+ko) ====
==== //depot/projects/soc2010/ringmap/current/sys/modules/em/Makefile#10 (text+ko) ====
==== //depot/projects/soc2010/ringmap/current/sys/modules/ringmap/Makefile#3 (text+ko) ====
@@ -1,30 +1,7 @@
-# $FreeBSD: src/sys/modules/em/Makefile,v 1.16 2010/03/29 23:36:34 jfv Exp $
-.PATH: ${.CURDIR}/../../dev/e1000 : ${.CURDIR}/../../net
+.if defined(EM_RINGMAP)
+.include "Makefile.em"
+.endif
-KMOD = if_ringmap
-SRCS = device_if.h bus_if.h pci_if.h opt_inet.h
-SRCS += $(CORE_SRC) $(LEGACY_SRC) $(RINGMAP_SRC)
-SRCS += $(COMMON_SHARED) $(LEGACY_SHARED) $(PCIE_SHARED)
-CORE_SRC = if_em.c e1000_osdep.c
-
-RINGMAP_SRC = ringmap.c ringmap_8254.c
-
-# This is the Legacy, pre-PCIE source, it can be
-# undefined when using modular driver if not needed
-LEGACY_SRC += if_lem.c
-COMMON_SHARED = e1000_api.c e1000_phy.c e1000_nvm.c e1000_mac.c e1000_manage.c
-PCIE_SHARED = e1000_80003es2lan.c e1000_ich8lan.c e1000_82571.c e1000_82575.c
-LEGACY_SHARED = e1000_82540.c e1000_82542.c e1000_82541.c e1000_82543.c
-
-CFLAGS += -g -I${.CURDIR}/../../dev/e1000 -DRINGMAP -DE1000_RINGMAP
-
-# DEVICE_POLLING for a non-interrupt-driven method
-#CFLAGS += -DDEVICE_POLLING
-
-clean:
- rm -f device_if.h bus_if.h pci_if.h setdef*
- rm -f *.o *.kld *.ko
- rm -f @ machine
- rm -f ${CLEANFILES}
-
-.include <bsd.kmod.mk>
+.if defined(IXGBE_RINGMAP)
+.include "Makefile.ixgbe"
+.endif
==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap.c#32 (text+ko) ====
@@ -25,6 +25,8 @@
#include <vm/vm.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
+#include <vm/vm_kern.h>
+#include <vm/vm_object.h>
#include <vm/vm_param.h>
#include <vm/vm_kern.h>
@@ -47,7 +49,7 @@
d_close_t ringmap_close;
d_ioctl_t ringmap_ioctl;
d_read_t ringmap_read;
-d_mmap_single_t ringmap_mmap;
+d_mmap_single_t ringmap_mmap_single;
static struct cdevsw ringmap_devsw = {
.d_version = D_VERSION,
@@ -55,7 +57,7 @@
.d_close = ringmap_close,
.d_ioctl = ringmap_ioctl,
.d_read = ringmap_read,
- .d_mmap_single = ringmap_mmap,
+ .d_mmap_single = ringmap_mmap_single,
.d_name = "ringmap_cdev"
};
@@ -270,16 +272,41 @@
int
-ringmap_mmap(struct cdev *cdev, vm_ooffset_t *offset,
+ringmap_mmap_single(struct cdev *cdev, vm_ooffset_t *offset,
vm_size_t size, struct vm_object **object, int nprot)
{
+ struct ringmap *rm = NULL;
+ struct capt_object *co = NULL;
+
vm_object_t obj;
vm_map_entry_t entry;
vm_pindex_t pindex;
vm_prot_t prot;
boolean_t wired;
- vm_map_lookup(&kmem_map, addr, VM_PROT_ALL,
+
+ RINGMAP_FUNC_DEBUG(start);
+
+
+ rm = get_ringmap_p(get_device_p(cdev));
+ if ( rm == NULL ) {
+ RINGMAP_ERROR(Null pointer to ringmap structure);
+
+ return (EIO);
+ }
+
+ SLIST_FOREACH(co, &rm->object_list, objects) {
+ if (co->td == curthread){
+ break;
+ }
+ }
+
+ if ((co == NULL) || (co->ring == NULL)){
+ RINGMAP_ERROR(Null pointer);
+ return (EIO);
+ }
+
+ vm_map_lookup(&kmem_map, (vm_offset_t)co->ring, VM_PROT_ALL,
&entry, &obj, &pindex, &prot, &wired);
vm_map_lookup_done(kmem_map, entry);
@@ -289,7 +316,12 @@
RINGMAP_FUNC_DEBUG(Got other obj);
}
- object = obj;
+ object = &obj;
+
+
+ RINGMAP_FUNC_DEBUG(start);
+
+
return (0);
}
==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap.h#32 (text+ko) ====
==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap_kernel.h#3 (text+ko) ====
==== //depot/projects/soc2010/ringmap/scripts/build_ringmap.sh#16 (text+ko) ====
==== //depot/projects/soc2010/ringmap/scripts/set_ringmap.sh#17 (text+ko) ====
==== //depot/projects/soc2010/ringmap/scripts/tailf_ringmap_msgs.sh#11 (text+ko) ====
==== //depot/projects/soc2010/ringmap/tests/libpcap/easy_pcap.c#10 (text+ko) ====
==== //depot/projects/soc2010/ringmap/tests/ringmap/close.c#3 (text+ko) ====
==== //depot/projects/soc2010/ringmap/tests/ringmap/ioctl.c#3 (text+ko) ====
==== //depot/projects/soc2010/ringmap/tests/ringmap/main.c#5 (text+ko) ====
==== //depot/projects/soc2010/ringmap/tests/ringmap/mmap.c#5 (text+ko) ====
@@ -17,6 +17,8 @@
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/proc.h>
+#include <sys/conf.h>
+
#include <sys/mbuf.h>
#include <sys/linker.h>
==== //depot/projects/soc2010/ringmap/tests/ringmap/open.c#5 (text+ko) ====
More information about the p4-projects
mailing list