Date: Mon, 28 Jun 2010 13:26:00 GMT From: Alexandre Fiveg <afiveg@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 180293 for review Message-ID: <201006281326.o5SDQ0xj024031@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@180293?ac=10 Change 180293 by afiveg@cottonmouth on 2010/06/28 13:25:08 - Time stamping in delayed interrupt function added - new scripts for installing and loading thw whole ringmap Affected files ... .. //depot/projects/soc2010/ringmap/current/contrib/libpcap/ringmap_pcap.c#5 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.c#13 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.h#11 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.c#12 edit .. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.h#10 edit .. //depot/projects/soc2010/ringmap/current/sys/net/ringmap.c#16 edit .. //depot/projects/soc2010/ringmap/current/sys/net/ringmap.h#16 edit .. //depot/projects/soc2010/ringmap/scripts/build_ringmap.sh#1 add .. //depot/projects/soc2010/ringmap/scripts/set_ringmap.sh#1 add .. //depot/projects/soc2010/ringmap/tests/libpcap/Makefile#2 edit .. //depot/projects/soc2010/ringmap/tests/libpcap/easy_pcap.c#3 edit .. //depot/projects/soc2010/ringmap/tests/libpcap/test_pcap.c#3 edit Differences ... ==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/ringmap_pcap.c#5 (text+ko) ==== @@ -32,12 +32,6 @@ #include "../../sys/net/ringmap.h" -/* Driver Kernel object file id */ -// int if_em_ko_fileid = -1; - -/* to_ms parameter of pcap */ -// int fiveg_to_ms = 0; - /* File descriptor of fiveg_cdev */ int ringmap_cdev_fd = -1; @@ -46,9 +40,6 @@ int init_mmapped_capturing(const char *device, pcap_t *); void uninit_mmapped_capturing(pcap_t *); int pcap_read_ringmap(pcap_t *, int , pcap_handler , u_char *); -//int ringmap_stats(pcap_t *p, struct pcap_stat *ps); -//void ringmap_enable_capturing(); -// void ringmap_disable_capturing(); /* @@ -358,11 +349,11 @@ curr_slot = R_MODULO(SW_TAIL(ring) + 1); - mb = (struct mbuf *)ring->slot[curr_slot].mbuf.user; + mb = (struct mbuf *)U_MBUF(ring, curr_slot); pkthdr.ts = ring->slot[curr_slot].ts; pkthdr.caplen = pkthdr.len = mb->m_len; - datap = (caddr_t)ring->slot[curr_slot].packet.user; + datap = (caddr_t)U_PACKET(ring, curr_slot); (*callback)(user, &pkthdr, datap); @@ -415,7 +406,7 @@ printf("Number of interrupts: %llu\n", p->ring->interrupts_counter); printf("Packets per Interrupt: %llu\n", - (((unsigned long long )p->ring->pkt_counter) / p->ring->interrupts_counter)); + (((unsigned long long )p->ring->pkt_counter) / (p->ring->interrupts_counter))); return (err); } ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.c#13 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.h#11 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.c#12 (text+ko) ==== @@ -90,7 +90,7 @@ #ifdef RINGMAP_TIMESTAMP - + getmicrotime(&adapter->rm->ring->last_ts); #endif RINGMAP_INTR(end); ==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.h#10 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap.c#16 (text+ko) ==== @@ -61,27 +61,29 @@ * Character Device for access on if_em driver structures */ static struct cdevsw ringmap_devsw = { - /* version */ .d_version = D_VERSION, - /* open */ .d_open = ringmap_open, - /* close */ .d_close = ringmap_close, - /* ioctl */ .d_ioctl = ringmap_ioctl, - /* mmap */ .d_mmap = ringmap_mmap, - /* name */ .d_name = "ringmap_cdev" + .d_version = D_VERSION, + .d_open = ringmap_open, + .d_close = ringmap_close, + .d_ioctl = ringmap_ioctl, + .d_mmap = ringmap_mmap, + .d_name = "ringmap_cdev" }; struct device_type supported_devices[] = { - { 0x1079, 8254 }, /* 8254GB, COPPER, Dual Port */ - { 0x105E, 8257 }, /* 82571EB, COPPER, PCIe Dual Port */ + /* PCI ID, Controller */ + + { 0x1079 , 8254 }, /* 8254GB, COPPER, Dual Port */ + { 0x105E , 8257 }, /* 82571EB, COPPER, PCIe Dual Port */ { 0, 0} /* last entry */ }; /* * If pci_dev_id is supported by ringmap, then controller_type related to this * pci_dev_id will be returned. Look for device_type structure in ringmap.h! - * Now only 8254* and 8257* controllers are supported. The list of supported - * controllers doesn't include all of them, but only the controllers that I've - * tested. + * Im -curent branch only 8254* controllers are supported. The list of + * supported controllers doesn't include all of them, but only the controllers + * that I've tested. */ int is_supported (unsigned int pci_dev_id) @@ -109,9 +111,8 @@ case 8254: RINGMAP_FUNC_DEBUG(Controller Type: 8254); - /* Set ringmap pointer in the drivrs structure of adapter */ rm->funcs->set_ringmap_to_adapter = - rm_8254_set_ringmap_to_adapter; + rm_8254_set_ringmap_to_adapter; rm->funcs->enable_intr = rm_8254_enable_intr; rm->funcs->disable_intr = rm_8254_disable_intr; rm->funcs->init_slots = rm_8254_init_slots; ==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap.h#16 (text+ko) ==== @@ -37,6 +37,9 @@ /* Enable/Disable Transiv. If 0, then the adapter will only receive pkts */ #define RINGMAP_TX_ENABLE 0 +/* 1 - enable time stamping in the driver */ +#define RINGMAP_TIMESTAMP 1 + struct address { bus_addr_t phys; @@ -90,7 +93,7 @@ * kernrp - ring HEAD. Should be changed ONLY in driver. And should be * synchronized with the adapter-ring-HEAD register. Adapter increments * the value in its HEAD-register after storing the incomming packets - * in the RAM. The driver shoud in the ISR check the value in the + * in the RAM. The driver should in the ISR check the value in the * adapter-HEAD-register and set this value in kernrp. */ unsigned int volatile kernrp; @@ -141,6 +144,8 @@ */ unsigned long long pkt_counter; + struct timeval last_ts; + /* Array of slots */ struct ring_slot slot[SLOTS_NUMBER]; }; @@ -325,6 +330,18 @@ #define TAIL_PACKET(ringp) \ TAIL_SLOT(ringp).packet +#define U_MBUF(ringp, i) \ + RING_SLOT((ringp), (i)).mbuf.user + +#define K_MBUF(ringp, i) \ + RING_SLOT((ringp), (i)).mbuf.kern + +#define U_PACKET(ringp, i) \ + RING_SLOT((ringp), (i)).packet.user + +#define K_PACKET(ringp, i) \ + RING_SLOT((ringp), (i)).packet.kern + /* * DEBUG OUTPUT */ @@ -401,3 +418,5 @@ + + ==== //depot/projects/soc2010/ringmap/tests/libpcap/Makefile#2 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/tests/libpcap/easy_pcap.c#3 (text+ko) ==== ==== //depot/projects/soc2010/ringmap/tests/libpcap/test_pcap.c#3 (text+ko) ====
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006281326.o5SDQ0xj024031>