ndt-dev - [ndt-dev] [ndt] r851 committed - Adds support for the Web10G userland 2.0.7 and the next upcoming userl...
Subject: NDT-DEV email list created
List archive
[ndt-dev] [ndt] r851 committed - Adds support for the Web10G userland 2.0.7 and the next upcoming userl...
Chronological Thread
- From:
- To:
- Subject: [ndt-dev] [ndt] r851 committed - Adds support for the Web10G userland 2.0.7 and the next upcoming userl...
- Date: Sat, 26 Oct 2013 07:53:29 +0000
Revision: 851
Author:
Date: Sat Oct 26 07:53:16 2013 UTC
Log: Adds support for the Web10G userland 2.0.7 and the next upcoming userland based on Chris Rapier's patch, which is expected to be released in the next couple of weeks (http://code.google.com/p/web10g-userland/).
This means we currently support the kernel patches from Linux 3.6-3.9 and partially support the 3.5 kernel (without logging).
http://code.google.com/p/ndt/source/detail?r=851
Modified:
/trunk/README_WEB10G
/trunk/src/web10g-util.c
=======================================
--- /trunk/README_WEB10G Tue Oct 15 12:40:39 2013 UTC
+++ /trunk/README_WEB10G Sat Oct 26 07:53:16 2013 UTC
@@ -1,16 +1,24 @@
ndt-web10g
+Updated: 26th October 2013
Required libraries:
Web10G
Download and install the latest userland and your kernel patch from
-http://web10g.org. You will need the use the Web10G userland-2.0.6.2
-(as at time of writing the newest release).
+http://web10g.org. You will need the use the Web10G userland-2.0.6.2,
+userland-2.0.7. Support for the next upcoming userland has also
+been added however this does not appear to have backwards support for
+the 3.5-3.9 kernels and as such is untested.
This is known/expected to work with the following web10g kernel patches:
+Web10G-0.7-patches (Linux kernel 3.9)
Web10G-0.6.2-patches (Linux kernel 3.6, 3.7 & 3.8).
Web10G-0.4-3.5-patch - You will have to make a small modification
+You can choose to use either the userland-2.0.6.2 or userland-2.0.7.
+The 2.0.7 userland appears to be compatible with the 3.5-2.8 kernels,
+however only limited testing has been performed.
+
IMPORTANT - Web10G-0.4-3.5-patch modification
Swap the single occurrence of ktime_to_ns(...) to ktime_to_us(...)
before applying the patch.
=======================================
--- /trunk/src/web10g-util.c Tue Oct 15 12:40:39 2013 UTC
+++ /trunk/src/web10g-util.c Sat Oct 26 07:53:16 2013 UTC
@@ -36,7 +36,11 @@
socklen_t peer_name_len = sizeof(peer_name);
int connection_id = -1;
struct estats_connection_list* clist = NULL;
+#ifdef ESTATS_LIST_FOREACH /* Web10G Userland 2.0.6 */
struct estats_list* list_pos;
+#else /* Web10G Userland 2.0.7 + */
+ struct estats_connection* cp;
+#endif
/* Get the ip address of ourself on the localsocket */
if (getsockname(sockfd, (struct sockaddr*) &local_name,
@@ -59,18 +63,27 @@
estats_connection_list_new(&clist);
estats_list_conns(clist, client);
-
+#ifdef ESTATS_LIST_FOREACH /* Web10G Userland 2.0.6 */
ESTATS_LIST_FOREACH(list_pos, &(clist->connection_head)) {
struct estats_connection* cp =
ESTATS_LIST_ENTRY(list_pos, estats_connection, list);
+#elif defined(estats_list_for_each) /* Web10G Userland 2.0.8 */
+ estats_list_for_each(&(clist->connection_head), cp, list) {
+#else /* Web10G Userland 2.0.7 */
+ list_for_each(&(clist->connection_head), cp, list) {
+#endif
struct estats_connection_tuple* ct =
(struct estats_connection_tuple*) cp;
if (local_name.ss_family == AF_INET &&
peer_name.ss_family == AF_INET &&
+#ifdef estats_list_for_each /* Web10G Userland 2.0.8 */
+ ct->addr_type == ESTATS_ADDRTYPE_IPV4) {
+#else /* Web10G Userland 2.0.6/7 */
ct->local_addr[16] == ESTATS_ADDRTYPE_IPV4 &&
ct->rem_addr[16] == ESTATS_ADDRTYPE_IPV4) {
- /* All IPv4 - compare addresses */
+#endif
+ /* All IPv4 - compare addresses */
struct sockaddr_in * ipv4_local =
(struct sockaddr_in *) &local_name;
struct sockaddr_in * ipv4_peer =
@@ -91,8 +104,12 @@
}
} else if (local_name.ss_family == AF_INET6 &&
peer_name.ss_family == AF_INET6 &&
+#ifdef estats_list_for_each /* Web10G Userland 2.0.8 */
+ ct->addr_type == ESTATS_ADDRTYPE_IPV6) {
+#else /* Web10G Userland 2.0.6/7 */
ct->local_addr[16] == ESTATS_ADDRTYPE_IPV6 &&
ct->rem_addr[16] == ESTATS_ADDRTYPE_IPV6) {
+#endif
/* We are IPv6 - compare addresses */
struct sockaddr_in6 * ipv6_local =
(struct sockaddr_in6 *) &local_name;
@@ -137,24 +154,42 @@
int web10g_get_remote_addr(tcp_stat_agent* client,
tcp_stat_connection conn, char* out, int size) {
struct estats_connection_list* clist = NULL;
+#ifdef ESTATS_LIST_FOREACH /* Web10G Userland 2.0.6 */
struct estats_list* list_pos;
+#else /* Web10G Userland 2.0.7 + */
+ struct estats_connection* cp;
+#endif
estats_connection_list_new(&clist);
estats_list_conns(clist, client);
out[0] = 0;
+#ifdef ESTATS_LIST_FOREACH /* Web10G Userland 2.0.6 */
ESTATS_LIST_FOREACH(list_pos, &(clist->connection_head)) {
struct estats_connection* cp =
ESTATS_LIST_ENTRY(list_pos, estats_connection, list);
+#elif defined(estats_list_for_each) /* Web10G Userland 2.0.8 */
+ estats_list_for_each(&(clist->connection_head), cp, list) {
+#else /* Web10G Userland 2.0.7 */
+ list_for_each(&(clist->connection_head), cp, list) {
+#endif
struct estats_connection_tuple* ct =
(struct estats_connection_tuple*) cp;
if (ct->cid == conn) {
+#ifdef estats_list_for_each /* Web10G Userland 2.0.8 */
+ if (ct->addr_type == ESTATS_ADDRTYPE_IPV4) {
+#else /* Web10G Userland 2.0.6/7 */
if (ct->local_addr[16] == ESTATS_ADDRTYPE_IPV4) {
+#endif
inet_ntop(AF_INET, &(ct->rem_addr[0]), out, size);
log_println(1, "Got remote address IPv4 %s", out);
goto Cleanup;
+#ifdef estats_list_for_each /* Web10G Userland 2.0.8 */
+ } else if (ct->addr_type == ESTATS_ADDRTYPE_IPV6) {
+#else /* Web10G Userland 2.0.6/7 */
} else if (ct->local_addr[16] == ESTATS_ADDRTYPE_IPV6) {
+#endif
inet_ntop(AF_INET6, &(ct->rem_addr[0]), out, size);
log_println(1, "Got remote address IPv6 %s", out);
goto Cleanup;
- [ndt-dev] [ndt] r851 committed - Adds support for the Web10G userland 2.0.7 and the next upcoming userl..., ndt, 10/26/2013
Archive powered by MHonArc 2.6.16.