CVS commit: src/sys/rump/net/lib/libshmif

2021-07-13 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Jul 14 03:16:06 UTC 2021

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
shmif: support ALTQ


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/rump/net/lib/libshmif/if_shmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.82 src/sys/rump/net/lib/libshmif/if_shmem.c:1.83
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.82	Wed Jun 16 00:21:19 2021
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Wed Jul 14 03:16:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.82 2021/06/16 00:21:19 riastradh Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.83 2021/07/14 03:16:06 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.82 2021/06/16 00:21:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.83 2021/07/14 03:16:06 ozaki-r Exp $");
 
 #include 
 #include 
@@ -191,6 +191,7 @@ allocif(int unit, struct shmif_sc **scp)
 	IFCAP_CSUM_UDPv4_Rx	| IFCAP_CSUM_UDPv4_Tx |
 	IFCAP_CSUM_TCPv6_Rx	| IFCAP_CSUM_TCPv6_Tx |
 	IFCAP_CSUM_UDPv6_Rx	| IFCAP_CSUM_UDPv6_Tx;
+	IFQ_SET_READY(&ifp->if_snd);
 
 	mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_NONE);
 	cv_init(&sc->sc_cv, "shmifcv");
@@ -206,6 +207,7 @@ allocif(int unit, struct shmif_sc **scp)
 	}
 #endif
 
+	if_deferred_start_init(ifp, NULL);
 	ether_ifattach(ifp, enaddr);
 	if_register(ifp);
 
@@ -545,7 +547,7 @@ shmif_start(struct ifnet *ifp)
 	ifp->if_flags |= IFF_OACTIVE;
 
 	for (;;) {
-		IF_DEQUEUE(&ifp->if_snd, m);
+		IFQ_DEQUEUE(&ifp->if_snd, m);
 		if (m == NULL)
 			break;
 



CVS commit: src/sys/rump/net/lib/libpppoe

2021-04-22 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Apr 23 03:44:05 UTC 2021

Modified Files:
src/sys/rump/net/lib/libpppoe: Makefile

Log Message:
enabled PPPOE_DEBUG for librumpnet_pppoe* when RUMP_DEBUG is defined


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libpppoe/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libpppoe/Makefile
diff -u src/sys/rump/net/lib/libpppoe/Makefile:1.2 src/sys/rump/net/lib/libpppoe/Makefile:1.3
--- src/sys/rump/net/lib/libpppoe/Makefile:1.2	Sun Jan 27 02:08:49 2019
+++ src/sys/rump/net/lib/libpppoe/Makefile	Fri Apr 23 03:44:05 2021
@@ -9,5 +9,9 @@ SRCS=	if_pppoe.c if_spppsubr.c
 
 SRCS+=	pppoe_component.c
 
+.ifdef RUMP_DEBUG
+CPPFLAGS.if_pppoe.c+=	-DPPPOE_DEBUG
+.endif
+
 .include 
 .include 



CVS commit: src/sys/rump/net/lib

2021-03-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  8 20:43:22 UTC 2021

Modified Files:
src/sys/rump/net/lib/libnetinet: Makefile.inc
src/sys/rump/net/lib/libnetinet6: Makefile.inc

Log Message:
remove ip{,6}_id.c


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/rump/net/lib/libnetinet/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/sys/rump/net/lib/libnetinet6/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnetinet/Makefile.inc
diff -u src/sys/rump/net/lib/libnetinet/Makefile.inc:1.14 src/sys/rump/net/lib/libnetinet/Makefile.inc:1.15
--- src/sys/rump/net/lib/libnetinet/Makefile.inc:1.14	Thu Apr 13 22:43:28 2017
+++ src/sys/rump/net/lib/libnetinet/Makefile.inc	Mon Mar  8 15:43:22 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.14 2017/04/14 02:43:28 ozaki-r Exp $
+#	$NetBSD: Makefile.inc,v 1.15 2021/03/08 20:43:22 christos Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../netinet
@@ -7,7 +7,7 @@ CPPFLAGS+=	-DINET
 
 # INET
 SRCS+=	in_proto.c igmp.c in.c in_offload.c in_pcb.c ip_carp.c ip_icmp.c\
-	ip_flow.c ip_id.c ip_input.c ip_reass.c ip_output.c raw_ip.c	\
+	ip_flow.c ip_input.c ip_reass.c ip_output.c raw_ip.c	\
 	in_cksum.c cpu_in_cksum.c in4_cksum.c ip_encap.c portalgo.c
 
 # ARP

Index: src/sys/rump/net/lib/libnetinet6/Makefile.inc
diff -u src/sys/rump/net/lib/libnetinet6/Makefile.inc:1.5 src/sys/rump/net/lib/libnetinet6/Makefile.inc:1.6
--- src/sys/rump/net/lib/libnetinet6/Makefile.inc:1.5	Thu Feb  8 06:34:35 2018
+++ src/sys/rump/net/lib/libnetinet6/Makefile.inc	Mon Mar  8 15:43:22 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.5 2018/02/08 11:34:35 maxv Exp $
+#	$NetBSD: Makefile.inc,v 1.6 2021/03/08 20:43:22 christos Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../netinet6
@@ -8,7 +8,7 @@ CPPFLAGS+=	-DINET6
 # INET6
 SRCS+=	dest6.c frag6.c icmp6.c in6.c in6_cksum.c in6_ifattach.c	\
 	in6_offload.c in6_pcb.c in6_proto.c in6_src.c ip6_flow.c	\
-	ip6_forward.c ip6_id.c ip6_input.c ip6_mroute.c ip6_output.c	\
+	ip6_forward.c ip6_input.c ip6_mroute.c ip6_output.c		\
 	mld6.c nd6.c nd6_nbr.c nd6_rtr.c raw_ip6.c route6.c scope6.c	\
 	udp6_usrreq.c
 



CVS commit: src/sys/rump/net/lib/libtap

2020-09-29 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Sep 29 18:31:31 UTC 2020

Modified Files:
src/sys/rump/net/lib/libtap: Makefile

Log Message:
libtap: Improve comment


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/rump/net/lib/libtap/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libtap/Makefile
diff -u src/sys/rump/net/lib/libtap/Makefile:1.5 src/sys/rump/net/lib/libtap/Makefile:1.6
--- src/sys/rump/net/lib/libtap/Makefile:1.5	Tue Jan 26 23:12:19 2016
+++ src/sys/rump/net/lib/libtap/Makefile	Tue Sep 29 18:31:31 2020
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.5 2016/01/26 23:12:19 pooka Exp $
+#	$NetBSD: Makefile,v 1.6 2020/09/29 18:31:31 roy Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../net
 
 LIB=	rumpnet_tap
-COMMENT=/dev/tap virtual Ethernet interface
+COMMENT=/dev/tap Ethernet tunnel software network interface
 
 IOCONF=	TAP.ioconf
 SRCS=	if_tap.c



CVS commit: src/sys/rump/net/lib/libnet

2020-09-12 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Sep 12 10:44:32 UTC 2020

Modified Files:
src/sys/rump/net/lib/libnet: Makefile

Log Message:
rump: Add nd.c to libnet


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/rump/net/lib/libnet/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnet/Makefile
diff -u src/sys/rump/net/lib/libnet/Makefile:1.33 src/sys/rump/net/lib/libnet/Makefile:1.34
--- src/sys/rump/net/lib/libnet/Makefile:1.33	Wed Jan 29 06:13:02 2020
+++ src/sys/rump/net/lib/libnet/Makefile	Sat Sep 12 10:44:32 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.33 2020/01/29 06:13:02 thorpej Exp $
+#	$NetBSD: Makefile,v 1.34 2020/09/12 10:44:32 roy Exp $
 #
 
 
@@ -13,7 +13,7 @@ SRCS=	if.c if_loop.c if_stats.c route.c 
 	raw_cb.c if_media.c link_proto.c net_stats.c if_ethersubr.c	\
 	if_spppsubr.c
 SRCS+=	if_43.c
-SRCS+=	if_llatbl.c
+SRCS+=	if_llatbl.c nd.c
 SRCS+=	net_component.c
 SRCS+=	ether_sw_offload.c
 



CVS commit: src/sys/rump/net/lib/libwg

2020-08-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 27 02:51:15 UTC 2020

Modified Files:
src/sys/rump/net/lib/libwg: wg_user.c

Log Message:
Fix order of cleanup actions in rumpuser_wg_create error branch.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libwg/wg_user.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libwg/wg_user.c
diff -u src/sys/rump/net/lib/libwg/wg_user.c:1.2 src/sys/rump/net/lib/libwg/wg_user.c:1.3
--- src/sys/rump/net/lib/libwg/wg_user.c:1.2	Thu Aug 27 02:50:44 2020
+++ src/sys/rump/net/lib/libwg/wg_user.c	Thu Aug 27 02:51:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: wg_user.c,v 1.2 2020/08/27 02:50:44 riastradh Exp $	*/
+/*	$NetBSD: wg_user.c,v 1.3 2020/08/27 02:51:15 riastradh Exp $	*/
 
 /*
  * Copyright (C) Ryota Ozaki 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wg_user.c,v 1.2 2020/08/27 02:50:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wg_user.c,v 1.3 2020/08/27 02:51:15 riastradh Exp $");
 
 #ifndef _KERNEL
 #include 
@@ -277,13 +277,13 @@ rumpuser_wg_create(const char *tun_name,
 	return 0;
 
  oerr5:
-	close(wgu->wgu_pipe[0]);
-	close(wgu->wgu_pipe[1]);
- oerr4:
 	if (wgu->wgu_sock4 != -1)
 		close(wgu->wgu_sock4);
 	if (wgu->wgu_sock6 != -1)
 		close(wgu->wgu_sock6);
+ oerr4:
+	close(wgu->wgu_pipe[0]);
+	close(wgu->wgu_pipe[1]);
  oerr3:
 	close_tun(wgu);
  oerr2:



CVS commit: src/sys/rump/net/lib/libwg

2020-08-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 27 02:50:44 UTC 2020

Modified Files:
src/sys/rump/net/lib/libwg: wg_user.c

Log Message:
Paranoia: use strlcpy rather than strcpy here and detect truncation.

Not an issue for the one caller in tree, but let's not leave rakes to
step on.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libwg/wg_user.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libwg/wg_user.c
diff -u src/sys/rump/net/lib/libwg/wg_user.c:1.1 src/sys/rump/net/lib/libwg/wg_user.c:1.2
--- src/sys/rump/net/lib/libwg/wg_user.c:1.1	Wed Aug 26 16:03:42 2020
+++ src/sys/rump/net/lib/libwg/wg_user.c	Thu Aug 27 02:50:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: wg_user.c,v 1.1 2020/08/26 16:03:42 riastradh Exp $	*/
+/*	$NetBSD: wg_user.c,v 1.2 2020/08/27 02:50:44 riastradh Exp $	*/
 
 /*
  * Copyright (C) Ryota Ozaki 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wg_user.c,v 1.1 2020/08/26 16:03:42 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wg_user.c,v 1.2 2020/08/27 02:50:44 riastradh Exp $");
 
 #ifndef _KERNEL
 #include 
@@ -243,13 +243,18 @@ rumpuser_wg_create(const char *tun_name,
 		goto oerr1;
 	}
 
+	if (strlcpy(wgu->wgu_tun_name, tun_name, sizeof(wgu->wgu_tun_name))
+	>= sizeof(wgu->wgu_tun_name)) {
+		rv = EINVAL;
+		goto oerr2;
+	}
+	wgu->wgu_sc = wg;
+
 	wgu->wgu_fd = open_tun(tun_name);
 	if (wgu->wgu_fd == -1) {
 		rv = errno;
 		goto oerr2;
 	}
-	strcpy(wgu->wgu_tun_name, tun_name);
-	wgu->wgu_sc = wg;
 
 	if (pipe(wgu->wgu_pipe) == -1) {
 		rv = errno;



CVS commit: src/sys/rump/net/lib/libnetcan

2020-07-21 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Jul 21 18:38:18 UTC 2020

Modified Files:
src/sys/rump/net/lib/libnetcan: netcan_component.c

Log Message:
Remove spurious call to canloopinit() in an attempt to fix kern/55489

This attempt at fixing is a result of IRC discussions with martin@ and
riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libnetcan/netcan_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnetcan/netcan_component.c
diff -u src/sys/rump/net/lib/libnetcan/netcan_component.c:1.2 src/sys/rump/net/lib/libnetcan/netcan_component.c:1.3
--- src/sys/rump/net/lib/libnetcan/netcan_component.c:1.2	Sat May 27 21:02:56 2017
+++ src/sys/rump/net/lib/libnetcan/netcan_component.c	Tue Jul 21 18:38:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: netcan_component.c,v 1.2 2017/05/27 21:02:56 bouyer Exp $	*/
+/*	$NetBSD: netcan_component.c,v 1.3 2020/07/21 18:38:18 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netcan_component.c,v 1.2 2017/05/27 21:02:56 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netcan_component.c,v 1.3 2020/07/21 18:38:18 pgoyette Exp $");
 
 #include 
 #include 
@@ -44,9 +44,3 @@ RUMP_COMPONENT(RUMP_COMPONENT_NET)
 	domain_attach(&candomain);
 	rump_netisr_register(NETISR_CAN, canintr);
 }
-
-void  canloopinit(void);
-RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
-{
-	canloopinit();
-}



CVS commit: src/sys/rump/net/lib/libshmif

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  3 13:57:48 UTC 2020

Modified Files:
src/sys/rump/net/lib/libshmif: shmifvar.h

Log Message:
make constant unsigned


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/rump/net/lib/libshmif/shmifvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/shmifvar.h
diff -u src/sys/rump/net/lib/libshmif/shmifvar.h:1.10 src/sys/rump/net/lib/libshmif/shmifvar.h:1.11
--- src/sys/rump/net/lib/libshmif/shmifvar.h:1.10	Wed Sep 17 00:20:58 2014
+++ src/sys/rump/net/lib/libshmif/shmifvar.h	Fri Apr  3 09:57:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: shmifvar.h,v 1.10 2014/09/17 04:20:58 ozaki-r Exp $	*/
+/*	$NetBSD: shmifvar.h,v 1.11 2020/04/03 13:57:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -60,7 +60,7 @@ struct shmif_pkthdr {
 	uint64_t sp_sender;
 };
 
-#define BUSMEM_SIZE (1024*1024)
+#define BUSMEM_SIZE (1024*1024U)
 #define BUSMEM_DATASIZE (BUSMEM_SIZE - sizeof(struct shmif_mem))
 
 #if 0



CVS commit: src/sys/rump/net/lib/libshmif

2020-02-24 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Feb 25 03:26:18 UTC 2020

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
shmif: reduce the number of calls of cprng(9)


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/rump/net/lib/libshmif/if_shmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.80 src/sys/rump/net/lib/libshmif/if_shmem.c:1.81
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.80	Tue Feb 25 03:25:36 2020
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Tue Feb 25 03:26:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.80 2020/02/25 03:25:36 ozaki-r Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.81 2020/02/25 03:26:18 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.80 2020/02/25 03:25:36 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.81 2020/02/25 03:26:18 ozaki-r Exp $");
 
 #include 
 #include 
@@ -163,16 +163,16 @@ allocif(int unit, struct shmif_sc **scp)
 	uint8_t enaddr[ETHER_ADDR_LEN] = { 0xb2, 0xa0, 0x00, 0x00, 0x00, 0x00 };
 	struct shmif_sc *sc;
 	struct ifnet *ifp;
-	uint32_t randnum;
+	uint64_t randnum;
 	int error;
 
-	randnum = cprng_strong32();
-	memcpy(&enaddr[2], &randnum, sizeof(randnum));
+	randnum = cprng_strong64();
+	memcpy(&enaddr[2], &randnum, 4);
 
 	sc = kmem_zalloc(sizeof(*sc), KM_SLEEP);
 	sc->sc_memfd = -1;
 	sc->sc_unit = unit;
-	sc->sc_uid = cprng_strong64();
+	sc->sc_uid = randnum;
 
 	ifp = &sc->sc_ec.ec_if;
 



CVS commit: src/sys/rump/net/lib/libshmif

2020-02-24 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Feb 25 03:25:36 UTC 2020

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
shmif: s/sc_uuid/sc_uid/

It's not UUID :-/


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/rump/net/lib/libshmif/if_shmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.79 src/sys/rump/net/lib/libshmif/if_shmem.c:1.80
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.79	Tue Feb 25 03:24:48 2020
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Tue Feb 25 03:25:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.79 2020/02/25 03:24:48 ozaki-r Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.80 2020/02/25 03:25:36 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.79 2020/02/25 03:24:48 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.80 2020/02/25 03:25:36 ozaki-r Exp $");
 
 #include 
 #include 
@@ -101,7 +101,7 @@ struct shmif_sc {
 	struct lwp *sc_rcvl;
 	bool sc_dying;
 
-	uint64_t sc_uuid;
+	uint64_t sc_uid;
 };
 
 static void shmif_rcv(void *);
@@ -172,7 +172,7 @@ allocif(int unit, struct shmif_sc **scp)
 	sc = kmem_zalloc(sizeof(*sc), KM_SLEEP);
 	sc->sc_memfd = -1;
 	sc->sc_unit = unit;
-	sc->sc_uuid = cprng_strong64();
+	sc->sc_uid = cprng_strong64();
 
 	ifp = &sc->sc_ec.ec_if;
 
@@ -605,7 +605,7 @@ shmif_snd(struct ifnet *ifp, struct mbuf
 	sp.sp_len = pktsize;
 	sp.sp_sec = tv.tv_sec;
 	sp.sp_usec = tv.tv_usec;
-	sp.sp_sender = sc->sc_uuid;
+	sp.sp_sender = sc->sc_uid;
 
 	bpf_mtap(ifp, m0, BPF_D_OUT);
 
@@ -798,7 +798,7 @@ shmif_rcv(void *arg)
 		 * Test if we want to pass the packet upwards
 		 */
 		eth = mtod(m, struct ether_header *);
-		if (sp.sp_sender == sc->sc_uuid) {
+		if (sp.sp_sender == sc->sc_uid) {
 			passup = false;
 		} else if (memcmp(eth->ether_dhost, CLLADDR(ifp->if_sadl),
 		ETHER_ADDR_LEN) == 0) {



CVS commit: src/sys/rump/net/lib/libshmif

2020-02-24 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Feb 25 03:24:48 UTC 2020

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
shmif: use cprng_strong64 instead of cprng_fast64 to generate a unique ID

shmif uses random bytes generated by cprng(9) as a unique device ID
between rump kernels to identify packets fed by itself and not receive
them.  So if generated bytes are identical between shmif interfaces on
different rump kernels, shmif may drop incoming packets unintentionally.
This is one cause of recent ATF test failures of IPsec.

Fix it by using cprng_strong64 instead of cprng_fast64.  This is a
workaround and we should also investigate why cprng_fast64 starts
failing on rump kernels, although using cprng_strong64 in initialization
itself is feasible.

Fix PR kern/54897


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/rump/net/lib/libshmif/if_shmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.78 src/sys/rump/net/lib/libshmif/if_shmem.c:1.79
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.78	Thu Feb 20 08:06:15 2020
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Tue Feb 25 03:24:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.78 2020/02/20 08:06:15 ozaki-r Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.79 2020/02/25 03:24:48 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.78 2020/02/20 08:06:15 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.79 2020/02/25 03:24:48 ozaki-r Exp $");
 
 #include 
 #include 
@@ -172,7 +172,7 @@ allocif(int unit, struct shmif_sc **scp)
 	sc = kmem_zalloc(sizeof(*sc), KM_SLEEP);
 	sc->sc_memfd = -1;
 	sc->sc_unit = unit;
-	sc->sc_uuid = cprng_fast64();
+	sc->sc_uuid = cprng_strong64();
 
 	ifp = &sc->sc_ec.ec_if;
 



CVS commit: src/sys/rump/net/lib/libshmif

2020-02-20 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Feb 20 08:06:15 UTC 2020

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
shmif: use cprng_strong32 to generate random bytes for a MAC address

cprng_fast32 sometimes returns indentical bytes, which look
"20:0e:11:33" in a MAC address, on different rump_server instances.
That leads MAC address duplications resulting in a test failure.

Fix it by using cprng_strong32 instead of cprng_fast32.  However
we should rather fix cprng_fast32 (or rump itself) somehow.

The fix mitigates PR kern/54897 but test failures due to other
causes still remain.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/rump/net/lib/libshmif/if_shmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.77 src/sys/rump/net/lib/libshmif/if_shmem.c:1.78
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.77	Sat Feb  1 22:38:31 2020
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Thu Feb 20 08:06:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.77 2020/02/01 22:38:31 thorpej Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.78 2020/02/20 08:06:15 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.77 2020/02/01 22:38:31 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.78 2020/02/20 08:06:15 ozaki-r Exp $");
 
 #include 
 #include 
@@ -166,7 +166,7 @@ allocif(int unit, struct shmif_sc **scp)
 	uint32_t randnum;
 	int error;
 
-	randnum = cprng_fast32();
+	randnum = cprng_strong32();
 	memcpy(&enaddr[2], &randnum, sizeof(randnum));
 
 	sc = kmem_zalloc(sizeof(*sc), KM_SLEEP);



CVS commit: src/sys/rump/net/lib/libvirtif

2020-02-01 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Feb  1 22:45:02 UTC 2020

Modified Files:
src/sys/rump/net/lib/libvirtif: if_virt.c

Log Message:
Adopt .


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/rump/net/lib/libvirtif/if_virt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.57 src/sys/rump/net/lib/libvirtif/if_virt.c:1.58
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.57	Tue Jun 26 06:48:03 2018
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Sat Feb  1 22:45:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.57 2018/06/26 06:48:03 msaitoh Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.58 2020/02/01 22:45:01 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.57 2018/06/26 06:48:03 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.58 2020/02/01 22:45:01 thorpej Exp $");
 
 #include 
 #include 
@@ -325,7 +325,7 @@ virtif_start(struct ifnet *ifp)
 		VIFHYPER_SEND(sc->sc_viu, io, i);
 
 		m_freem(m0);
-		ifp->if_opackets++;
+		if_statinc(ifp, if_opackets);
 	}
 
 	ifp->if_flags &= ~IFF_OACTIVE;



CVS commit: src/sys/rump/net/lib/libshmif

2020-02-01 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Feb  1 22:38:31 UTC 2020

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
Adopt .


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/rump/net/lib/libshmif/if_shmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.76 src/sys/rump/net/lib/libshmif/if_shmem.c:1.77
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.76	Wed Dec 12 01:51:32 2018
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Sat Feb  1 22:38:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.76 2018/12/12 01:51:32 rin Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.77 2020/02/01 22:38:31 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.76 2018/12/12 01:51:32 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.77 2020/02/01 22:38:31 thorpej Exp $");
 
 #include 
 #include 
@@ -561,7 +561,7 @@ shmif_start(struct ifnet *ifp)
 
 		m = ether_sw_offload_tx(ifp, m);
 		if (m == NULL) {
-			ifp->if_oerrors++;
+			if_statinc(ifp, if_oerrors);
 			break;
 		}
 
@@ -630,7 +630,7 @@ shmif_snd(struct ifnet *ifp, struct mbuf
 	shmif_unlockbus(busmem);
 
 	m_freem(m0);
-	ifp->if_opackets++;
+	if_statinc(ifp, if_opackets);
 
 	DPRINTF(("shmif_start: send %d bytes at off %d\n", pktsize,
 	busmem->shm_last));



CVS commit: src/sys/rump/net/lib/libnet

2020-01-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jan 29 06:13:02 UTC 2020

Modified Files:
src/sys/rump/net/lib/libnet: Makefile

Log Message:
Add if_stats.c to rumpnet.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/rump/net/lib/libnet/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnet/Makefile
diff -u src/sys/rump/net/lib/libnet/Makefile:1.32 src/sys/rump/net/lib/libnet/Makefile:1.33
--- src/sys/rump/net/lib/libnet/Makefile:1.32	Sun Oct 13 07:28:14 2019
+++ src/sys/rump/net/lib/libnet/Makefile	Wed Jan 29 06:13:02 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.32 2019/10/13 07:28:14 mrg Exp $
+#	$NetBSD: Makefile,v 1.33 2020/01/29 06:13:02 thorpej Exp $
 #
 
 
@@ -9,7 +9,7 @@ COMMENT=Network interface and routing su
 
 IOCONF=	NET.ioconf
 # iffy stuff
-SRCS=	if.c if_loop.c route.c rtsock.c raw_usrreq.c			\
+SRCS=	if.c if_loop.c if_stats.c route.c rtsock.c raw_usrreq.c		\
 	raw_cb.c if_media.c link_proto.c net_stats.c if_ethersubr.c	\
 	if_spppsubr.c
 SRCS+=	if_43.c



CVS commit: src/sys/rump/net/lib/libshmif

2018-12-11 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Dec 12 01:51:32 UTC 2018

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
Add TX/RX offload capabilities to shmif(4). They are emulated in
software by ether_sw_offload_[tr]x().

For rump kernels, if_capabilities for shmemif(4) can be specified
by environmental variable RUMP_SHMIF_CAPENABLE:

 setenv RUMP_SHMIF_CAPENABLE 0x7ff80 (all offload)
 setenv RUMP_SHMIF_CAPENABLE 0x6aa80 (all TX)
 setenv RUMP_SHMIF_CAPENABLE 0x15500 (all RX)

part of PR kern/53562
OK msaitoh


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/rump/net/lib/libshmif/if_shmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.75 src/sys/rump/net/lib/libshmif/if_shmem.c:1.76
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.75	Tue Jun 26 06:48:03 2018
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Wed Dec 12 01:51:32 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.75 2018/06/26 06:48:03 msaitoh Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.76 2018/12/12 01:51:32 rin Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.75 2018/06/26 06:48:03 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.76 2018/12/12 01:51:32 rin Exp $");
 
 #include 
 #include 
@@ -43,6 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -76,6 +77,7 @@ struct if_clone shmif_cloner =
 static int	shmif_init(struct ifnet *);
 static int	shmif_ioctl(struct ifnet *, u_long, void *);
 static void	shmif_start(struct ifnet *);
+static void	shmif_snd(struct ifnet *, struct mbuf *);
 static void	shmif_stop(struct ifnet *, int);
 
 #include "shmifvar.h"
@@ -183,6 +185,12 @@ allocif(int unit, struct shmif_sc **scp)
 	ifp->if_stop = shmif_stop;
 	ifp->if_mtu = ETHERMTU;
 	ifp->if_dlt = DLT_EN10MB;
+	ifp->if_capabilities = IFCAP_TSOv4 | IFCAP_TSOv6 |
+	IFCAP_CSUM_IPv4_Rx	| IFCAP_CSUM_IPv4_Tx |
+	IFCAP_CSUM_TCPv4_Rx	| IFCAP_CSUM_TCPv4_Tx |
+	IFCAP_CSUM_UDPv4_Rx	| IFCAP_CSUM_UDPv4_Tx |
+	IFCAP_CSUM_TCPv6_Rx	| IFCAP_CSUM_TCPv6_Tx |
+	IFCAP_CSUM_UDPv6_Rx	| IFCAP_CSUM_UDPv6_Tx;
 
 	mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_NONE);
 	cv_init(&sc->sc_cv, "shmifcv");
@@ -197,6 +205,16 @@ allocif(int unit, struct shmif_sc **scp)
 
 		return error;
 	}
+#if 1
+	char buf[256];
+
+	if (rumpuser_getparam("RUMP_SHMIF_CAPENABLE", buf, sizeof(buf)) == 0) {
+		uint64_t capen = strtoul(buf, NULL, 0);
+
+		ifp->if_capenable = capen & ifp->if_capabilities;
+	}
+#endif
+
 	ether_ifattach(ifp, enaddr);
 	if_register(ifp);
 
@@ -527,70 +545,33 @@ shmif_ioctl(struct ifnet *ifp, u_long cm
 	return rv;
 }
 
-/* send everything in-context since it's just a matter of mem-to-mem copy */
 static void
 shmif_start(struct ifnet *ifp)
 {
 	struct shmif_sc *sc = ifp->if_softc;
-	struct shmif_mem *busmem = sc->sc_busmem;
-	struct mbuf *m, *m0;
-	uint32_t dataoff;
-	uint32_t pktsize, pktwrote;
+	struct mbuf *m, *n;
 	bool wrote = false;
-	bool wrap;
 
 	ifp->if_flags |= IFF_OACTIVE;
 
 	for (;;) {
-		struct shmif_pkthdr sp;
-		struct timeval tv;
-
-		IF_DEQUEUE(&ifp->if_snd, m0);
-		if (m0 == NULL) {
+		IF_DEQUEUE(&ifp->if_snd, m);
+		if (m == NULL)
 			break;
-		}
 
-		pktsize = 0;
-		for (m = m0; m != NULL; m = m->m_next) {
-			pktsize += m->m_len;
+		m = ether_sw_offload_tx(ifp, m);
+		if (m == NULL) {
+			ifp->if_oerrors++;
+			break;
 		}
-		KASSERT(pktsize <= ETHERMTU + ETHER_HDR_LEN);
-
-		getmicrouptime(&tv);
-		sp.sp_len = pktsize;
-		sp.sp_sec = tv.tv_sec;
-		sp.sp_usec = tv.tv_usec;
-		sp.sp_sender = sc->sc_uuid;
 
-		bpf_mtap(ifp, m0, BPF_D_OUT);
-
-		shmif_lockbus(busmem);
-		KASSERT(busmem->shm_magic == SHMIF_MAGIC);
-		busmem->shm_last = shmif_nextpktoff(busmem, busmem->shm_last);
-
-		wrap = false;
-		dataoff = shmif_buswrite(busmem,
-		busmem->shm_last, &sp, sizeof(sp), &wrap);
-		pktwrote = 0;
-		for (m = m0; m != NULL; m = m->m_next) {
-			pktwrote += m->m_len;
-			dataoff = shmif_buswrite(busmem, dataoff,
-			mtod(m, void *), m->m_len, &wrap);
-		}
-		KASSERT(pktwrote == pktsize);
-		if (wrap) {
-			busmem->shm_gen++;
-			DPRINTF(("bus generation now %" PRIu64 "\n",
-			busmem->shm_gen));
-		}
-		shmif_unlockbus(busmem);
+		do {
+			n = m->m_nextpkt;
+			shmif_snd(ifp, m);
+			m = n;
+		} while (m != NULL);
 
-		m_freem(m0);
 		wrote = true;
-		ifp->if_opackets++;
-
-		DPRINTF(("shmif_start: send %d bytes at off %d\n",
-		pktsize, busmem->shm_last));
 	}
 
 	ifp->if_flags &= ~IFF_OACTIVE;
@@ -601,6 +582,60 @@ shmif_start(struct ifnet *ifp)
 	}
 }
 
+/* send everything in-context since it's just a matter of mem-to-mem copy */
+static void
+shmif_snd(struct ifnet *ifp, struct mbuf *m0)
+{
+	struct shmif_s

CVS commit: src/sys/rump/net/lib/libnpf

2018-10-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 29 15:37:45 UTC 2018

Modified Files:
src/sys/rump/net/lib/libnpf: Makefile

Log Message:
Back to using _NPF_TESTING now that it does not change the semantics of
the calls, but only adds extra functionality.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/rump/net/lib/libnpf/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnpf/Makefile
diff -u src/sys/rump/net/lib/libnpf/Makefile:1.25 src/sys/rump/net/lib/libnpf/Makefile:1.26
--- src/sys/rump/net/lib/libnpf/Makefile:1.25	Fri Oct 26 19:34:32 2018
+++ src/sys/rump/net/lib/libnpf/Makefile	Mon Oct 29 11:37:45 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.25 2018/10/26 23:34:32 christos Exp $
+#	$NetBSD: Makefile,v 1.26 2018/10/29 15:37:45 christos Exp $
 #
 # Public Domain.
 #
@@ -32,11 +32,10 @@ SRCS+=	npf_component.c
 .include 
 
 CPPFLAGS+=	-I ${NETBSDSRCDIR}/sys/external/bsd/libnv/dist
-CPPFLAGS+=	-D_NPF_RUMP
 
-#.if ${RUMP_NPF_TESTING:Uyes} == "yes"
-#CPPFLAGS+=	-D_NPF_TESTING
-#.endif
+.if ${RUMP_NPF_TESTING:Uyes} == "yes"
+CPPFLAGS+=	-D_NPF_TESTING
+.endif
 
 .include 
 .include 



CVS commit: src/sys/rump/net/lib/libnpf

2018-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 26 23:34:33 UTC 2018

Modified Files:
src/sys/rump/net/lib/libnpf: Makefile

Log Message:
add an _NPF_RUMP define to expose the sampling function.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/rump/net/lib/libnpf/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnpf/Makefile
diff -u src/sys/rump/net/lib/libnpf/Makefile:1.24 src/sys/rump/net/lib/libnpf/Makefile:1.25
--- src/sys/rump/net/lib/libnpf/Makefile:1.24	Fri Oct 26 02:23:02 2018
+++ src/sys/rump/net/lib/libnpf/Makefile	Fri Oct 26 19:34:32 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.24 2018/10/26 06:23:02 kre Exp $
+#	$NetBSD: Makefile,v 1.25 2018/10/26 23:34:32 christos Exp $
 #
 # Public Domain.
 #
@@ -32,10 +32,11 @@ SRCS+=	npf_component.c
 .include 
 
 CPPFLAGS+=	-I ${NETBSDSRCDIR}/sys/external/bsd/libnv/dist
+CPPFLAGS+=	-D_NPF_RUMP
 
-.if ${RUMP_NPF_TESTING:Uyes} == "yes"
-CPPFLAGS+=	-D_NPF_TESTING
-.endif
+#.if ${RUMP_NPF_TESTING:Uyes} == "yes"
+#CPPFLAGS+=	-D_NPF_TESTING
+#.endif
 
 .include 
 .include 



CVS commit: src/sys/rump/net/lib/libnpf

2018-10-25 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Oct 26 06:23:02 UTC 2018

Modified Files:
src/sys/rump/net/lib/libnpf: Makefile

Log Message:
Revert previous (unbreak build) - for now anyway.

It turns out _NPF_TESTING is needed for the (rump only) function
npf_state_setsampler() in sys/net/npf/npf_state.c


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/rump/net/lib/libnpf/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnpf/Makefile
diff -u src/sys/rump/net/lib/libnpf/Makefile:1.23 src/sys/rump/net/lib/libnpf/Makefile:1.24
--- src/sys/rump/net/lib/libnpf/Makefile:1.23	Fri Oct 26 01:33:33 2018
+++ src/sys/rump/net/lib/libnpf/Makefile	Fri Oct 26 06:23:02 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.23 2018/10/26 01:33:33 christos Exp $
+#	$NetBSD: Makefile,v 1.24 2018/10/26 06:23:02 kre Exp $
 #
 # Public Domain.
 #
@@ -33,9 +33,9 @@ SRCS+=	npf_component.c
 
 CPPFLAGS+=	-I ${NETBSDSRCDIR}/sys/external/bsd/libnv/dist
 
-#.if ${RUMP_NPF_TESTING:Uyes} == "yes"
-#CPPFLAGS+=	-D_NPF_TESTING
-#.endif
+.if ${RUMP_NPF_TESTING:Uyes} == "yes"
+CPPFLAGS+=	-D_NPF_TESTING
+.endif
 
 .include 
 .include 



CVS commit: src/sys/rump/net/lib/libnpf

2018-10-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 26 01:33:33 UTC 2018

Modified Files:
src/sys/rump/net/lib/libnpf: Makefile

Log Message:
Comment out _NPF_TESTING (really should be removed)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/rump/net/lib/libnpf/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnpf/Makefile
diff -u src/sys/rump/net/lib/libnpf/Makefile:1.22 src/sys/rump/net/lib/libnpf/Makefile:1.23
--- src/sys/rump/net/lib/libnpf/Makefile:1.22	Thu Oct 25 20:38:52 2018
+++ src/sys/rump/net/lib/libnpf/Makefile	Thu Oct 25 21:33:33 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.22 2018/10/26 00:38:52 christos Exp $
+#	$NetBSD: Makefile,v 1.23 2018/10/26 01:33:33 christos Exp $
 #
 # Public Domain.
 #
@@ -33,9 +33,9 @@ SRCS+=	npf_component.c
 
 CPPFLAGS+=	-I ${NETBSDSRCDIR}/sys/external/bsd/libnv/dist
 
-.if ${RUMP_NPF_TESTING:Uyes} == "yes"
-CPPFLAGS+=	-D_NPF_TESTING
-.endif
+#.if ${RUMP_NPF_TESTING:Uyes} == "yes"
+#CPPFLAGS+=	-D_NPF_TESTING
+#.endif
 
 .include 
 .include 



CVS commit: src/sys/rump/net/lib/libnpf

2018-10-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 26 00:38:52 UTC 2018

Modified Files:
src/sys/rump/net/lib/libnpf: Makefile

Log Message:
need libnvpair


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/rump/net/lib/libnpf/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnpf/Makefile
diff -u src/sys/rump/net/lib/libnpf/Makefile:1.21 src/sys/rump/net/lib/libnpf/Makefile:1.22
--- src/sys/rump/net/lib/libnpf/Makefile:1.21	Sat Sep 29 10:41:36 2018
+++ src/sys/rump/net/lib/libnpf/Makefile	Thu Oct 25 20:38:52 2018
@@ -1,11 +1,13 @@
-#	$NetBSD: Makefile,v 1.21 2018/09/29 14:41:36 rmind Exp $
+#	$NetBSD: Makefile,v 1.22 2018/10/26 00:38:52 christos Exp $
 #
 # Public Domain.
 #
 
 NOLINT=		# defined
+S=${.CURDIR}/../../../../
+
+.PATH:	${S}/net/npf ${S}/external/bsd/libnv/dist
 
-.PATH:	${.CURDIR}/../../../../net/npf
 
 LIB=	rumpnet_npf
 COMMENT=NPF packet filter
@@ -17,6 +19,8 @@ SRCS+=	npf_ruleset.c npf_conn.c npf_conn
 SRCS+=	npf_state.c npf_state_tcp.c npf_tableset.c
 SRCS+=	lpm.c npf_sendpkt.c npf_worker.c npf_os.c npf_ifaddr.c
 
+SRCS+=	nvlist.c nvpair.c nv_kern_netbsd.c dnvlist.c
+
 SRCS+=	if_npflog.c
 
 SRCS+=	npf_alg_icmp.c



CVS commit: src/sys/rump/net/lib/libshmif

2018-04-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr  4 09:19:33 UTC 2018

Modified Files:
src/sys/rump/net/lib/libshmif: shmif_user.c

Log Message:
Unconditionally include , as we use ftruncate() unconditionally
too.
Reported (with patch) by Antonio Huete Jimenez in PR 53153, slightly
modified by me.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libshmif/shmif_user.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/shmif_user.c
diff -u src/sys/rump/net/lib/libshmif/shmif_user.c:1.1 src/sys/rump/net/lib/libshmif/shmif_user.c:1.2
--- src/sys/rump/net/lib/libshmif/shmif_user.c:1.1	Thu Mar 13 01:42:59 2014
+++ src/sys/rump/net/lib/libshmif/shmif_user.c	Wed Apr  4 09:19:33 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: shmif_user.c,v 1.1 2014/03/13 01:42:59 pooka Exp $	*/
+/*  $NetBSD: shmif_user.c,v 1.2 2018/04/04 09:19:33 martin Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -29,6 +29,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 
@@ -102,7 +103,6 @@ rumpcomp_shmif_watchwait(int kq)
 
 #include 
 #include 
-#include 
 
 int
 rumpcomp_shmif_watchsetup(int *inotifyp, int fd)
@@ -171,7 +171,6 @@ rumpcomp_shmif_watchwait(int kq)
 
 #else
 #include 
-#include 
 
 /* a polling default implementation */
 int



CVS commit: src/sys/rump/net/lib/libvirtif

2017-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 23 13:12:23 UTC 2017

Modified Files:
src/sys/rump/net/lib/libvirtif: if_virt.c

Log Message:
 Fix compile error.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/rump/net/lib/libvirtif/if_virt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.55 src/sys/rump/net/lib/libvirtif/if_virt.c:1.56
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.55	Mon Oct 23 09:24:34 2017
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Mon Oct 23 13:12:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.55 2017/10/23 09:24:34 msaitoh Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.56 2017/10/23 13:12:23 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.55 2017/10/23 09:24:34 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.56 2017/10/23 13:12:23 msaitoh Exp $");
 
 #include 
 #include 
@@ -143,13 +143,13 @@ virtif_clone(struct if_clone *ifc, int n
 		goto fail_2;
 	}
 	snprintf(sc->sc_linkstr, LINKSTRNUMLEN, "%d", sc->sc_num);
-#undef LINKSTRNUMLEN
 	error = virtif_create(ifp);
 	if (error) {
 fail_2:
 		if_detach(ifp);
 		if (sc->sc_linkstr != NULL)
 			kmem_free(sc->sc_linkstr, LINKSTRNUMLEN);
+#undef LINKSTRNUMLEN
 fail_1:
 		kmem_free(sc, sizeof(*sc));
 		ifp->if_softc = NULL;



CVS commit: src/sys/rump/net/lib/libshmif

2017-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 23 12:55:26 UTC 2017

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
 Fix compile error.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/rump/net/lib/libshmif/if_shmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.73 src/sys/rump/net/lib/libshmif/if_shmem.c:1.74
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.73	Mon Oct 23 09:31:18 2017
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Mon Oct 23 12:55:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.73 2017/10/23 09:31:18 msaitoh Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.74 2017/10/23 12:55:26 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.73 2017/10/23 09:31:18 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.74 2017/10/23 12:55:26 msaitoh Exp $");
 
 #include 
 #include 
@@ -189,7 +189,8 @@ allocif(int unit, struct shmif_sc **scp)
 
 	error = if_initialize(ifp);
 	if (error != 0) {
-		aprint_error("shmif%d: if_initialize failed(%d)\n", unit, rv);
+		aprint_error("shmif%d: if_initialize failed(%d)\n", unit,
+		error);
 		cv_destroy(&sc->sc_cv);
 		mutex_destroy(&sc->sc_mtx);
 		kmem_free(sc, sizeof(*sc));



CVS commit: src/sys/rump/net/lib/libnet

2017-01-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan 17 02:02:27 UTC 2017

Modified Files:
src/sys/rump/net/lib/libnet: net_component.c

Log Message:
pfile_init earlier (not here)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/net/lib/libnet/net_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnet/net_component.c
diff -u src/sys/rump/net/lib/libnet/net_component.c:1.7 src/sys/rump/net/lib/libnet/net_component.c:1.8
--- src/sys/rump/net/lib/libnet/net_component.c:1.7	Mon Jan 16 04:28:40 2017
+++ src/sys/rump/net/lib/libnet/net_component.c	Mon Jan 16 21:02:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: net_component.c,v 1.7 2017/01/16 09:28:40 ryo Exp $	*/
+/*	$NetBSD: net_component.c,v 1.8 2017/01/17 02:02:27 christos Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: net_component.c,v 1.7 2017/01/16 09:28:40 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: net_component.c,v 1.8 2017/01/17 02:02:27 christos Exp $");
 
 #include 
 #include 
@@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: net_componen
 
 RUMP_COMPONENT(RUMP_COMPONENT_NET)
 {
-	pfil_init();
 	ifinit1();
 	ifinit();
 	lltableinit();



CVS commit: src/sys/rump/net/lib/libnpf

2017-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jan  3 03:47:51 UTC 2017

Modified Files:
src/sys/rump/net/lib/libnpf: Makefile

Log Message:
need new file


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/rump/net/lib/libnpf/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnpf/Makefile
diff -u src/sys/rump/net/lib/libnpf/Makefile:1.19 src/sys/rump/net/lib/libnpf/Makefile:1.20
--- src/sys/rump/net/lib/libnpf/Makefile:1.19	Mon Dec 26 18:05:05 2016
+++ src/sys/rump/net/lib/libnpf/Makefile	Mon Jan  2 22:47:51 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.19 2016/12/26 23:05:05 christos Exp $
+#	$NetBSD: Makefile,v 1.20 2017/01/03 03:47:51 christos Exp $
 #
 # Public Domain.
 #
@@ -15,7 +15,7 @@ SRCS=	npf.c npf_alg.c npf_conf.c npf_ctl
 SRCS+=	npf_bpf.c npf_if.c npf_inet.c npf_mbuf.c npf_nat.c
 SRCS+=	npf_ruleset.c npf_conn.c npf_conndb.c npf_rproc.c 
 SRCS+=	npf_state.c npf_state_tcp.c npf_tableset.c
-SRCS+=	lpm.c npf_sendpkt.c npf_worker.c npf_os.c
+SRCS+=	lpm.c npf_sendpkt.c npf_worker.c npf_os.c npf_ifaddr.c
 
 SRCS+=	if_npflog.c
 



CVS commit: src/sys/rump/net/lib/libshmif

2016-12-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Dec 22 12:55:28 UTC 2016

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
Fix that rump.ifconfig shmifN destroy hangs up

rump.ifconfig shmifN destroy sometimes hangs up on closing a file
descriptor of kqueue under heavy load. It seems it happens because of
a race condition between closing a fd and kevent to the same fd on
another kthread for packet Rx. Fix it by executing the close operation
after the kthread left.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/rump/net/lib/libshmif/if_shmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.71 src/sys/rump/net/lib/libshmif/if_shmem.c:1.72
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.71	Thu Dec 22 10:13:09 2016
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Thu Dec 22 12:55:28 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.71 2016/12/22 10:13:09 ozaki-r Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.72 2016/12/22 12:55:28 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.71 2016/12/22 10:13:09 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.72 2016/12/22 12:55:28 ozaki-r Exp $");
 
 #include 
 #include 
@@ -374,7 +374,6 @@ shmif_unclone(struct ifnet *ifp)
 
 	shmif_stop(ifp, 1);
 	if_down(ifp);
-	finibackend(sc);
 
 	mutex_enter(&sc->sc_mtx);
 	sc->sc_dying = true;
@@ -385,6 +384,13 @@ shmif_unclone(struct ifnet *ifp)
 		kthread_join(sc->sc_rcvl);
 	sc->sc_rcvl = NULL;
 
+	/*
+	 * Need to be called after the kthread left, otherwise closing kqueue
+	 * (sc_kq) hangs sometimes perhaps because of a race condition between
+	 * close and kevent in the kthread on the kqueue.
+	 */
+	finibackend(sc);
+
 	vmem_xfree(shmif_units, sc->sc_unit+1, 1);
 
 	ether_ifdetach(ifp);



CVS commit: src/sys/rump/net/lib/libshmif

2016-12-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Dec 22 10:13:09 UTC 2016

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
Fix handling return value of rumpcomp_shmif_watchwait


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/rump/net/lib/libshmif/if_shmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.70 src/sys/rump/net/lib/libshmif/if_shmem.c:1.71
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.70	Thu Dec 15 09:28:07 2016
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Thu Dec 22 10:13:09 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.70 2016/12/15 09:28:07 ozaki-r Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.71 2016/12/22 10:13:09 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.70 2016/12/15 09:28:07 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.71 2016/12/22 10:13:09 ozaki-r Exp $");
 
 #include 
 #include 
@@ -685,8 +685,7 @@ shmif_rcv(void *arg)
 		shmif_nextpktoff(busmem, busmem->shm_last)
 		 == sc->sc_nextpacket) {
 			shmif_unlockbus(busmem);
-			error = 0;
-			rumpcomp_shmif_watchwait(sc->sc_kq);
+			error = rumpcomp_shmif_watchwait(sc->sc_kq);
 			if (__predict_false(error))
 printf("shmif_rcv: wait failed %d\n", error);
 			membar_consumer();



CVS commit: src/sys/rump/net/lib/libnpf

2016-12-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  9 02:50:06 UTC 2016

Modified Files:
src/sys/rump/net/lib/libnpf: Makefile

Log Message:
remove ptree add lpm


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/rump/net/lib/libnpf/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnpf/Makefile
diff -u src/sys/rump/net/lib/libnpf/Makefile:1.17 src/sys/rump/net/lib/libnpf/Makefile:1.18
--- src/sys/rump/net/lib/libnpf/Makefile:1.17	Tue Jan 26 18:12:19 2016
+++ src/sys/rump/net/lib/libnpf/Makefile	Thu Dec  8 21:50:06 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2016/01/26 23:12:19 pooka Exp $
+#	$NetBSD: Makefile,v 1.18 2016/12/09 02:50:06 christos Exp $
 #
 # Public Domain.
 #
@@ -15,7 +15,7 @@ SRCS=	npf.c npf_alg.c npf_conf.c npf_ctl
 SRCS+=	npf_bpf.c npf_if.c npf_inet.c npf_mbuf.c npf_nat.c
 SRCS+=	npf_ruleset.c npf_conn.c npf_conndb.c npf_rproc.c 
 SRCS+=	npf_state.c npf_state_tcp.c npf_tableset.c
-SRCS+=	npf_tableset_ptree.c npf_sendpkt.c npf_worker.c
+SRCS+=	lpm.c npf_sendpkt.c npf_worker.c
 
 SRCS+=	if_npflog.c
 



CVS commit: src/sys/rump/net/lib/libvlan

2016-11-26 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sat Nov 26 11:20:09 UTC 2016

Modified Files:
src/sys/rump/net/lib/libvlan: Makefile

Log Message:
Fix NetBSD keyword expansion.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libvlan/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvlan/Makefile
diff -u src/sys/rump/net/lib/libvlan/Makefile:1.1 src/sys/rump/net/lib/libvlan/Makefile:1.2
--- src/sys/rump/net/lib/libvlan/Makefile:1.1	Sat Nov 26 03:17:58 2016
+++ src/sys/rump/net/lib/libvlan/Makefile	Sat Nov 26 11:20:09 2016
@@ -1,4 +1,4 @@
-#	$NetBSD $
+#	$NetBSD: Makefile,v 1.2 2016/11/26 11:20:09 njoly Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../net



CVS commit: src/sys/rump/net/lib/libsockin

2016-11-15 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Nov 15 09:04:30 UTC 2016

Modified Files:
src/sys/rump/net/lib/libsockin: sockin.c

Log Message:
Fix build of usr.sbin/puffs/rump_nfs

XXX a better fix should be to separate nfs codes and let rump_nfs link only
XXX one that doesn't depend on rt_delete_matched_entries (and rtrequest).


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/rump/net/lib/libsockin/sockin.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libsockin/sockin.c
diff -u src/sys/rump/net/lib/libsockin/sockin.c:1.63 src/sys/rump/net/lib/libsockin/sockin.c:1.64
--- src/sys/rump/net/lib/libsockin/sockin.c:1.63	Tue Jan 26 23:12:19 2016
+++ src/sys/rump/net/lib/libsockin/sockin.c	Tue Nov 15 09:04:30 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockin.c,v 1.63 2016/01/26 23:12:19 pooka Exp $	*/
+/*	$NetBSD: sockin.c,v 1.64 2016/11/15 09:04:30 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2008, 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.63 2016/01/26 23:12:19 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.64 2016/11/15 09:04:30 ozaki-r Exp $");
 
 #include 
 #include 
@@ -707,3 +707,4 @@ sockin_unavailable(void)
 __strong_alias(rtrequest,sockin_unavailable);
 __strong_alias(ifunit,sockin_unavailable);
 __strong_alias(ifreq_setaddr,sockin_unavailable);
+__strong_alias(rt_delete_matched_entries,sockin_unavailable);



CVS commit: src/sys/rump/net/lib

2016-08-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 13 11:19:35 UTC 2016

Modified Files:
src/sys/rump/net/lib/libnetinet: netinet_component.c
src/sys/rump/net/lib/libnetinet6: netinet6_component.c

Log Message:
Don't call loopinit() here. Instead panic if -lrumpnet_net has not been
called to initialize lo0ifp.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/rump/net/lib/libnetinet/netinet_component.c
cvs rdiff -u -r1.5 -r1.6 \
src/sys/rump/net/lib/libnetinet6/netinet6_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnetinet/netinet_component.c
diff -u src/sys/rump/net/lib/libnetinet/netinet_component.c:1.6 src/sys/rump/net/lib/libnetinet/netinet_component.c:1.7
--- src/sys/rump/net/lib/libnetinet/netinet_component.c:1.6	Fri Aug 12 07:43:04 2016
+++ src/sys/rump/net/lib/libnetinet/netinet_component.c	Sat Aug 13 07:19:35 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: netinet_component.c,v 1.6 2016/08/12 11:43:04 christos Exp $	*/
+/*	$NetBSD: netinet_component.c,v 1.7 2016/08/13 11:19:35 christos Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netinet_component.c,v 1.6 2016/08/12 11:43:04 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netinet_component.c,v 1.7 2016/08/13 11:19:35 christos Exp $");
 
 #include 
 #include 
@@ -54,7 +54,6 @@ RUMP_COMPONENT(RUMP_COMPONENT_NET)
 	domain_attach(&arpdomain);
 	domain_attach(&inetdomain);
 
-	loopinit();
 	carpattach(1);
 
 	rump_netisr_register(NETISR_ARP, arpintr);
@@ -67,6 +66,9 @@ RUMP_COMPONENT(RUMP_COMPONENT_NET_IFCFG)
 	struct socket *so;
 	int error;
 
+	if (lo0ifp == NULL)
+		panic("lo0 config: rumpnet_net has not been initialized");
+
 	if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0, curlwp, NULL)) != 0)
 		panic("lo0 config: cannot create socket");
 

Index: src/sys/rump/net/lib/libnetinet6/netinet6_component.c
diff -u src/sys/rump/net/lib/libnetinet6/netinet6_component.c:1.5 src/sys/rump/net/lib/libnetinet6/netinet6_component.c:1.6
--- src/sys/rump/net/lib/libnetinet6/netinet6_component.c:1.5	Fri Aug 12 07:43:04 2016
+++ src/sys/rump/net/lib/libnetinet6/netinet6_component.c	Sat Aug 13 07:19:35 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: netinet6_component.c,v 1.5 2016/08/12 11:43:04 christos Exp $	*/
+/*	$NetBSD: netinet6_component.c,v 1.6 2016/08/13 11:19:35 christos Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netinet6_component.c,v 1.5 2016/08/12 11:43:04 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netinet6_component.c,v 1.6 2016/08/13 11:19:35 christos Exp $");
 
 #include 
 #include 
@@ -48,12 +48,12 @@ RUMP_COMPONENT(RUMP_COMPONENT_NET)
 	extern struct domain inet6domain;
 
 	domain_attach(&inet6domain);
-
-	loopinit();
 }
 
 RUMP_COMPONENT(RUMP_COMPONENT_NET_IFCFG)
 {
+	if (lo0ifp == NULL)
+		panic("lo0 config: rumpnet_net has not been initialized");
 
 	if_up(lo0ifp);
 }



CVS commit: src/sys/rump/net/lib

2016-08-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 12 11:43:04 UTC 2016

Modified Files:
src/sys/rump/net/lib/libnetinet: netinet_component.c
src/sys/rump/net/lib/libnetinet6: netinet6_component.c

Log Message:
more loopinit();


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/rump/net/lib/libnetinet/netinet_component.c
cvs rdiff -u -r1.4 -r1.5 \
src/sys/rump/net/lib/libnetinet6/netinet6_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnetinet/netinet_component.c
diff -u src/sys/rump/net/lib/libnetinet/netinet_component.c:1.5 src/sys/rump/net/lib/libnetinet/netinet_component.c:1.6
--- src/sys/rump/net/lib/libnetinet/netinet_component.c:1.5	Tue Jan 26 18:12:19 2016
+++ src/sys/rump/net/lib/libnetinet/netinet_component.c	Fri Aug 12 07:43:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: netinet_component.c,v 1.5 2016/01/26 23:12:19 pooka Exp $	*/
+/*	$NetBSD: netinet_component.c,v 1.6 2016/08/12 11:43:04 christos Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netinet_component.c,v 1.5 2016/01/26 23:12:19 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netinet_component.c,v 1.6 2016/08/12 11:43:04 christos Exp $");
 
 #include 
 #include 
@@ -54,6 +54,7 @@ RUMP_COMPONENT(RUMP_COMPONENT_NET)
 	domain_attach(&arpdomain);
 	domain_attach(&inetdomain);
 
+	loopinit();
 	carpattach(1);
 
 	rump_netisr_register(NETISR_ARP, arpintr);

Index: src/sys/rump/net/lib/libnetinet6/netinet6_component.c
diff -u src/sys/rump/net/lib/libnetinet6/netinet6_component.c:1.4 src/sys/rump/net/lib/libnetinet6/netinet6_component.c:1.5
--- src/sys/rump/net/lib/libnetinet6/netinet6_component.c:1.4	Tue Jan 26 18:12:19 2016
+++ src/sys/rump/net/lib/libnetinet6/netinet6_component.c	Fri Aug 12 07:43:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: netinet6_component.c,v 1.4 2016/01/26 23:12:19 pooka Exp $	*/
+/*	$NetBSD: netinet6_component.c,v 1.5 2016/08/12 11:43:04 christos Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netinet6_component.c,v 1.4 2016/01/26 23:12:19 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netinet6_component.c,v 1.5 2016/08/12 11:43:04 christos Exp $");
 
 #include 
 #include 
@@ -48,6 +48,8 @@ RUMP_COMPONENT(RUMP_COMPONENT_NET)
 	extern struct domain inet6domain;
 
 	domain_attach(&inet6domain);
+
+	loopinit();
 }
 
 RUMP_COMPONENT(RUMP_COMPONENT_NET_IFCFG)



CVS commit: src/sys/rump/net/lib/libtap

2016-08-08 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Aug  8 09:29:45 UTC 2016

Modified Files:
src/sys/rump/net/lib/libtap: tap_component.c

Log Message:
Part 2 of fixing if_tap module.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/net/lib/libtap/tap_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libtap/tap_component.c
diff -u src/sys/rump/net/lib/libtap/tap_component.c:1.3 src/sys/rump/net/lib/libtap/tap_component.c:1.4
--- src/sys/rump/net/lib/libtap/tap_component.c:1.3	Tue Jan 26 23:12:19 2016
+++ src/sys/rump/net/lib/libtap/tap_component.c	Mon Aug  8 09:29:45 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: tap_component.c,v 1.3 2016/01/26 23:12:19 pooka Exp $	*/
+/*	$NetBSD: tap_component.c,v 1.4 2016/08/08 09:29:45 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2015 Wei Liu.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tap_component.c,v 1.3 2016/01/26 23:12:19 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tap_component.c,v 1.4 2016/08/08 09:29:45 pgoyette Exp $");
 
 #include 
 #include 
@@ -37,27 +37,26 @@ __KERNEL_RCSID(0, "$NetBSD: tap_componen
 
 #include "ioconf.h"
 
-CFDRIVER_DECL(tap, DV_IFNET, NULL);
-
 RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
 {
 	extern const struct cdevsw tap_cdevsw;
-	devmajor_t bmaj, cmaj;
+	extern devmajor_t tap_bmajor, tap_cmajor;
 	int error;
 
-	config_cfdriver_attach(&tap_cd);
-	tapattach(0);
-
-	bmaj = cmaj = NODEVMAJOR;
-	error = devsw_attach("tap", NULL, &bmaj, &tap_cdevsw, &cmaj);
+	error = devsw_attach("tap", NULL, &tap_bmajor,
+	&tap_cdevsw, &tap_cmajor);
 	if (error != 0)
 		panic("tap devsw attach failed: %d", error);
 
-	error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/tap", cmaj, 0xf);
+	error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/tap", tap_cmajor,
+	0xf);
 	if (error != 0)
 		panic("cannot create tap device node: %d", error);
 
-	error = rump_vfs_makedevnodes(S_IFCHR, "/dev/tap", '0', cmaj, 0, 4);
+	error = rump_vfs_makedevnodes(S_IFCHR, "/dev/tap", '0', tap_cmajor,
+	0, 4);
 	if (error != 0)
 		panic("cannot create tap[0-4] device node: %d", error);
+
+	devsw_detach(NULL, &tap_cdevsw);
 }



CVS commit: src/sys/rump/net/lib/libnetmpls

2016-08-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  7 17:42:18 UTC 2016

Modified Files:
src/sys/rump/net/lib/libnetmpls: NETMPLS.ioconf netmpls_component.c

Log Message:
finish ifmpls->mpls renaming.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libnetmpls/NETMPLS.ioconf
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/net/lib/libnetmpls/netmpls_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnetmpls/NETMPLS.ioconf
diff -u src/sys/rump/net/lib/libnetmpls/NETMPLS.ioconf:1.1 src/sys/rump/net/lib/libnetmpls/NETMPLS.ioconf:1.2
--- src/sys/rump/net/lib/libnetmpls/NETMPLS.ioconf:1.1	Thu Aug 20 08:20:09 2015
+++ src/sys/rump/net/lib/libnetmpls/NETMPLS.ioconf	Sun Aug  7 13:42:18 2016
@@ -1,7 +1,7 @@
-#	$NetBSD: NETMPLS.ioconf,v 1.1 2015/08/20 12:20:09 christos Exp $
+#	$NetBSD: NETMPLS.ioconf,v 1.2 2016/08/07 17:42:18 christos Exp $
 
 ioconf		netmpls
 
 include		"conf/files"
 
-pseudo-device   ifmpls
+pseudo-device   mpls

Index: src/sys/rump/net/lib/libnetmpls/netmpls_component.c
diff -u src/sys/rump/net/lib/libnetmpls/netmpls_component.c:1.4 src/sys/rump/net/lib/libnetmpls/netmpls_component.c:1.5
--- src/sys/rump/net/lib/libnetmpls/netmpls_component.c:1.4	Tue Jan 26 18:12:19 2016
+++ src/sys/rump/net/lib/libnetmpls/netmpls_component.c	Sun Aug  7 13:42:18 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: netmpls_component.c,v 1.4 2016/01/26 23:12:19 pooka Exp $ */
+/* $NetBSD: netmpls_component.c,v 1.5 2016/08/07 17:42:18 christos Exp $ */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netmpls_component.c,v 1.4 2016/01/26 23:12:19 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netmpls_component.c,v 1.5 2016/08/07 17:42:18 christos Exp $");
 
 #include 
 #include 
@@ -60,5 +60,5 @@ RUMP_COMPONENT(RUMP_COMPONENT_NET)
 RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
 {
 
-	ifmplsattach(0);
+	mplsattach(0);
 }



CVS commit: src/sys/rump/net/lib

2016-04-18 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Apr 19 05:48:10 UTC 2016

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c
src/sys/rump/net/lib/libvirtif: if_virt.c

Log Message:
Prevent LWP migrations between CPUs during upper layer processing

This is a contract of psref(9) that is used by upper layer componenets,
e.g., bridge(4).


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/rump/net/lib/libshmif/if_shmem.c
cvs rdiff -u -r1.50 -r1.51 src/sys/rump/net/lib/libvirtif/if_virt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.65 src/sys/rump/net/lib/libshmif/if_shmem.c:1.66
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.65	Tue Feb  9 08:32:12 2016
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Tue Apr 19 05:48:10 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.65 2016/02/09 08:32:12 ozaki-r Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.66 2016/04/19 05:48:10 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.65 2016/02/09 08:32:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.66 2016/04/19 05:48:10 ozaki-r Exp $");
 
 #include 
 #include 
@@ -764,10 +764,14 @@ shmif_rcv(void *arg)
 		}
 
 		if (passup) {
+			int bound = curlwp->l_pflag & LP_BOUND;
 			ifp->if_ipackets++;
 			KERNEL_LOCK(1, NULL);
+			/* Prevent LWP migrations between CPUs for psref(9) */
+			curlwp->l_pflag |= LP_BOUND;
 			bpf_mtap(ifp, m);
 			if_input(ifp, m);
+			curlwp->l_pflag ^= bound ^ LP_BOUND;
 			KERNEL_UNLOCK_ONE(NULL);
 			m = NULL;
 		}

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.50 src/sys/rump/net/lib/libvirtif/if_virt.c:1.51
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.50	Tue Feb  9 08:32:12 2016
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Tue Apr 19 05:48:10 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.50 2016/02/09 08:32:12 ozaki-r Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.51 2016/04/19 05:48:10 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.50 2016/02/09 08:32:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.51 2016/04/19 05:48:10 ozaki-r Exp $");
 
 #include 
 #include 
@@ -374,11 +374,15 @@ VIF_DELIVERPKT(struct virtif_sc *sc, str
 	}
 
 	if (passup) {
+		int bound = curlwp->l_pflag & LP_BOUND;
 		ifp->if_ipackets++;
 		m->m_pkthdr.rcvif = ifp;
 		KERNEL_LOCK(1, NULL);
+		/* Prevent LWP migrations between CPUs for psref(9) */
+		curlwp->l_pflag |= LP_BOUND;
 		bpf_mtap(ifp, m);
 		if_input(ifp, m);
+		curlwp->l_pflag ^= bound ^ LP_BOUND;
 		KERNEL_UNLOCK_LAST(NULL);
 	} else {
 		m_freem(m);



CVS commit: src/sys/rump/net/lib/libnetbt

2015-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 30 08:33:29 UTC 2015

Modified Files:
src/sys/rump/net/lib/libnetbt: Makefile

Log Message:
Add NOLINT


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/net/lib/libnetbt/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnetbt/Makefile
diff -u src/sys/rump/net/lib/libnetbt/Makefile:1.4 src/sys/rump/net/lib/libnetbt/Makefile:1.5
--- src/sys/rump/net/lib/libnetbt/Makefile:1.4	Wed Mar 12 22:06:16 2014
+++ src/sys/rump/net/lib/libnetbt/Makefile	Sun Aug 30 04:33:29 2015
@@ -1,6 +1,8 @@
-#	$NetBSD: Makefile,v 1.4 2014/03/13 02:06:16 pooka Exp $
+#	$NetBSD: Makefile,v 1.5 2015/08/30 08:33:29 christos Exp $
 #
 
+NOLINT=	#defined
+
 .include 
 
 .PATH:	${.CURDIR}/../../../../netbt



CVS commit: src/sys/rump/net/lib

2015-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 20 12:20:10 UTC 2015

Modified Files:
src/sys/rump/net/lib/libagr: Makefile
src/sys/rump/net/lib/libbridge: Makefile
src/sys/rump/net/lib/libnet: Makefile
src/sys/rump/net/lib/libnetmpls: Makefile netmpls_component.c
src/sys/rump/net/lib/libnpf: Makefile
src/sys/rump/net/lib/libtap: Makefile tap_component.c
Added Files:
src/sys/rump/net/lib/libagr: AGR.ioconf
src/sys/rump/net/lib/libbridge: BRIDGE.ioconf
src/sys/rump/net/lib/libnet: NET.ioconf
src/sys/rump/net/lib/libnetmpls: NETMPLS.ioconf
src/sys/rump/net/lib/libnpf: NPF.ioconf
src/sys/rump/net/lib/libtap: TAP.ioconf

Log Message:
add ioconf files for pseudo device attach prototypes


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libagr/AGR.ioconf
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libagr/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libbridge/BRIDGE.ioconf
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libbridge/Makefile
cvs rdiff -u -r1.23 -r1.24 src/sys/rump/net/lib/libnet/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libnet/NET.ioconf
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libnetmpls/Makefile \
src/sys/rump/net/lib/libnetmpls/netmpls_component.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libnetmpls/NETMPLS.ioconf
cvs rdiff -u -r1.14 -r1.15 src/sys/rump/net/lib/libnpf/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libnpf/NPF.ioconf
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libtap/Makefile \
src/sys/rump/net/lib/libtap/tap_component.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libtap/TAP.ioconf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libagr/Makefile
diff -u src/sys/rump/net/lib/libagr/Makefile:1.2 src/sys/rump/net/lib/libagr/Makefile:1.3
--- src/sys/rump/net/lib/libagr/Makefile:1.2	Wed Mar 12 22:07:03 2014
+++ src/sys/rump/net/lib/libagr/Makefile	Thu Aug 20 08:20:09 2015
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.2 2014/03/13 02:07:03 pooka Exp $
+#	$NetBSD: Makefile,v 1.3 2015/08/20 12:20:09 christos Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../net/agr
 
 LIB=	rumpnet_agr
-
+IOCONF=	AGR.ioconf
 SRCS=	if_agr.c if_agrsoftc.c if_agrsubr.c if_agrtimer.c if_agrmonitor.c \
 	if_agrether.c if_agrether_hash.c ieee8023ad_marker.c ieee8023ad_lacp.c \
 	ieee8023ad_lacp_select.c ieee8023ad_lacp_timer.c \

Index: src/sys/rump/net/lib/libbridge/Makefile
diff -u src/sys/rump/net/lib/libbridge/Makefile:1.2 src/sys/rump/net/lib/libbridge/Makefile:1.3
--- src/sys/rump/net/lib/libbridge/Makefile:1.2	Wed Mar 12 22:08:24 2014
+++ src/sys/rump/net/lib/libbridge/Makefile	Thu Aug 20 08:20:09 2015
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.2 2014/03/13 02:08:24 pooka Exp $
+#	$NetBSD: Makefile,v 1.3 2015/08/20 12:20:09 christos Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../net
 
 LIB=	rumpnet_bridge
-
+IOCONF=	BRIDGE.ioconf
 SRCS=	if_bridge.c bridgestp.c
 
 SRCS+=	bridge_component.c

Index: src/sys/rump/net/lib/libnet/Makefile
diff -u src/sys/rump/net/lib/libnet/Makefile:1.23 src/sys/rump/net/lib/libnet/Makefile:1.24
--- src/sys/rump/net/lib/libnet/Makefile:1.23	Thu Apr 23 10:49:26 2015
+++ src/sys/rump/net/lib/libnet/Makefile	Thu Aug 20 08:20:09 2015
@@ -1,18 +1,19 @@
-#	$NetBSD: Makefile,v 1.23 2015/04/23 14:49:26 pooka Exp $
+#	$NetBSD: Makefile,v 1.24 2015/08/20 12:20:09 christos Exp $
 #
 
-.include 
 
 .PATH:	${.CURDIR}/../../../../net ${.CURDIR}/../../../../compat/common
 
 LIB=	rumpnet_net
-
+IOCONF=	NET.ioconf
 # iffy stuff
 SRCS=	if.c if_loop.c route.c rtsock.c raw_usrreq.c			\
 	raw_cb.c if_media.c link_proto.c net_stats.c if_ethersubr.c
 SRCS+=	if_43.c pfil.c
 SRCS+=	net_component.c
 
+.include 
+
 .if !empty(RUMP_NBCOMPAT:M50)
 SRCS+=	rtsock_50.c uipc_syscalls_50.c
 .endif

Index: src/sys/rump/net/lib/libnetmpls/Makefile
diff -u src/sys/rump/net/lib/libnetmpls/Makefile:1.2 src/sys/rump/net/lib/libnetmpls/Makefile:1.3
--- src/sys/rump/net/lib/libnetmpls/Makefile:1.2	Wed Mar 12 22:05:29 2014
+++ src/sys/rump/net/lib/libnetmpls/Makefile	Thu Aug 20 08:20:09 2015
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.2 2014/03/13 02:05:29 pooka Exp $
+# $NetBSD: Makefile,v 1.3 2015/08/20 12:20:09 christos Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../net ${.CURDIR}/../../../../netmpls
 
 LIB=	rumpnet_netmpls
-
+IOCONF=	NETMPLS.ioconf
 SRCS=	mpls_ttl.c if_mpls.c
 SRCS+=	netmpls_component.c
 
Index: src/sys/rump/net/lib/libnetmpls/netmpls_component.c
diff -u src/sys/rump/net/lib/libnetmpls/netmpls_component.c:1.2 src/sys/rump/net/lib/libnetmpls/netmpls_component.c:1.3
--- src/sys/rump/net/lib/libnetmpls/netmpls_component.c:1.2	Fri Aug 22 07:34:28 2014
+++ src/sys/rump/net/lib/libnetmpls/netmpls_component.c	Thu Aug 20 08:20:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: netmpls_component.c,v 1.2 2014/08/22 11:34:28 pooka Exp $ */
+/* $NetBSD: 

CVS commit: src/sys/rump/net/lib/libnet

2015-04-23 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Apr 23 07:56:03 UTC 2015

Modified Files:
src/sys/rump/net/lib/libnet: Makefile

Log Message:
COMPAT_OIF{DATA,REQ} are defined by compat/sys/sockio.h if need be,
don't define them here unconditionally.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/rump/net/lib/libnet/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnet/Makefile
diff -u src/sys/rump/net/lib/libnet/Makefile:1.21 src/sys/rump/net/lib/libnet/Makefile:1.22
--- src/sys/rump/net/lib/libnet/Makefile:1.21	Wed Apr 22 17:57:49 2015
+++ src/sys/rump/net/lib/libnet/Makefile	Thu Apr 23 07:56:03 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21 2015/04/22 17:57:49 pooka Exp $
+#	$NetBSD: Makefile,v 1.22 2015/04/23 07:56:03 pooka Exp $
 #
 
 .include 
@@ -18,7 +18,6 @@ SRCS+=	rtsock_50.c uipc_syscalls_50.c
 .endif
 
 CPPFLAGS+=	-I${.CURDIR}/opt -I${.CURDIR}/../libnetinet/opt
-CPPFLAGS+=	-DCOMPAT_OIFREQ -DCOMPAT_OIFDATA
 
 .include "${.CURDIR}/../libnetinet/Makefile.inc"
 .include "${.CURDIR}/../libnetinet6/Makefile.inc"



CVS commit: src/sys/rump/net/lib/libnet

2015-04-23 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Apr 23 07:55:24 UTC 2015

Modified Files:
src/sys/rump/net/lib/libnet: net_component.c

Log Message:
sprinkle COMPAT_50


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libnet/net_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnet/net_component.c
diff -u src/sys/rump/net/lib/libnet/net_component.c:1.2 src/sys/rump/net/lib/libnet/net_component.c:1.3
--- src/sys/rump/net/lib/libnet/net_component.c:1.2	Fri Aug 22 11:34:28 2014
+++ src/sys/rump/net/lib/libnet/net_component.c	Thu Apr 23 07:55:24 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: net_component.c,v 1.2 2014/08/22 11:34:28 pooka Exp $	*/
+/*	$NetBSD: net_component.c,v 1.3 2015/04/23 07:55:24 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: net_component.c,v 1.2 2014/08/22 11:34:28 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: net_component.c,v 1.3 2015/04/23 07:55:24 pooka Exp $");
 
 #include 
 #include 
@@ -49,11 +49,16 @@ RUMP_COMPONENT(RUMP_COMPONENT_NET)
 
 RUMP_COMPONENT(RUMP_COMPONENT_NET_ROUTE)
 {
-	extern struct domain routedomain, compat_50_routedomain, linkdomain;
+	extern struct domain routedomain, linkdomain;
+#ifdef COMPAT_50
+	extern struct domain compat_50_routedomain;
+#endif
 
 	domain_attach(&linkdomain);
 	domain_attach(&routedomain);
+#ifdef COMPAT_50
 	domain_attach(&compat_50_routedomain);
+#endif
 }
 
 RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)



CVS commit: src/sys/rump/net/lib/libnet/opt

2015-04-03 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Apr  3 07:56:54 UTC 2015

Added Files:
src/sys/rump/net/lib/libnet/opt: opt_net_mpsafe.h

Log Message:
Add opt_net_mpsafe.h for rump


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libnet/opt/opt_net_mpsafe.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/rump/net/lib/libnet/opt/opt_net_mpsafe.h
diff -u /dev/null src/sys/rump/net/lib/libnet/opt/opt_net_mpsafe.h:1.1
--- /dev/null	Fri Apr  3 07:56:54 2015
+++ src/sys/rump/net/lib/libnet/opt/opt_net_mpsafe.h	Fri Apr  3 07:56:54 2015
@@ -0,0 +1,3 @@
+/*	$NetBSD: opt_net_mpsafe.h,v 1.1 2015/04/03 07:56:54 ozaki-r Exp $	*/
+
+/* dummy */



CVS commit: src/sys/rump/net/lib/libvirtif

2014-11-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Nov  6 23:25:16 UTC 2014

Modified Files:
src/sys/rump/net/lib/libvirtif: if_virt.c

Log Message:
Ensure that no two VIRTIF's have the same modname, therefore
allowing them to coexist in the same rump kernel.

from Alexander Guy, via github


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/rump/net/lib/libvirtif/if_virt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.48 src/sys/rump/net/lib/libvirtif/if_virt.c:1.49
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.48	Sat Aug  9 09:47:02 2014
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Thu Nov  6 23:25:16 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.48 2014/08/09 09:47:02 ozaki-r Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.49 2014/11/06 23:25:16 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.48 2014/08/09 09:47:02 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.49 2014/11/06 23:25:16 pooka Exp $");
 
 #include 
 #include 
@@ -385,10 +385,16 @@ VIF_DELIVERPKT(struct virtif_sc *sc, str
 	m = NULL;
 }
 
-MODULE(MODULE_CLASS_DRIVER, if_virt, NULL);
-
+/*
+ * The following ensures that no two modules using if_virt end up with
+ * the same module name.  MODULE() and modcmd wrapped in ... bad mojo.
+ */
+#define VIF_MOJO(x) MODULE(MODULE_CLASS_DRIVER,x,NULL);
+#define VIF_MODULE() VIF_MOJO(VIF_BASENAME(if_virt_,VIRTIF_BASE))
+#define VIF_MODCMD VIF_BASENAME3(if_virt_,VIRTIF_BASE,_modcmd)
+VIF_MODULE();
 static int
-if_virt_modcmd(modcmd_t cmd, void *opaque)
+VIF_MODCMD(modcmd_t cmd, void *opaque)
 {
 	int error = 0;
 



CVS commit: src/sys/rump/net/lib/libshmif

2014-09-16 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Sep 17 04:20:58 UTC 2014

Modified Files:
src/sys/rump/net/lib/libshmif: shmif_busops.c shmifvar.h

Log Message:
Make shmif buildable when DRPINTF enabled


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/rump/net/lib/libshmif/shmif_busops.c
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/net/lib/libshmif/shmifvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/shmif_busops.c
diff -u src/sys/rump/net/lib/libshmif/shmif_busops.c:1.11 src/sys/rump/net/lib/libshmif/shmif_busops.c:1.12
--- src/sys/rump/net/lib/libshmif/shmif_busops.c:1.11	Fri Dec 20 10:00:59 2013
+++ src/sys/rump/net/lib/libshmif/shmif_busops.c	Wed Sep 17 04:20:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: shmif_busops.c,v 1.11 2013/12/20 10:00:59 pooka Exp $	*/
+/*	$NetBSD: shmif_busops.c,v 1.12 2014/09/17 04:20:58 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -29,10 +29,10 @@
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: shmif_busops.c,v 1.11 2013/12/20 10:00:59 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: shmif_busops.c,v 1.12 2014/09/17 04:20:58 ozaki-r Exp $");
 #else
 #include 
-__RCSID("$NetBSD: shmif_busops.c,v 1.11 2013/12/20 10:00:59 pooka Exp $");
+__RCSID("$NetBSD: shmif_busops.c,v 1.12 2014/09/17 04:20:58 ozaki-r Exp $");
 #endif
 
 #include 
@@ -111,7 +111,7 @@ shmif_buswrite(struct shmif_mem *busmem,
 
 	memcpy(busmem->shm_data + off, data, chunk);
 
-	DPRINTF(("buswrite: wrote %d bytes to %d", chunk, off));
+	DPRINTF(("buswrite: wrote %zu bytes to %d", chunk, off));
 
 	if (filledbus) {
 		*wrap = true;
@@ -122,7 +122,7 @@ shmif_buswrite(struct shmif_mem *busmem,
 		return (off + chunk) % BUSMEM_DATASIZE;
 	}
 
-	DPRINTF((", wrapped bytes %d to 0\n", len));
+	DPRINTF((", wrapped bytes %zu to 0\n", len));
 
 	shmif_advancefirst(busmem, 0, len);
 

Index: src/sys/rump/net/lib/libshmif/shmifvar.h
diff -u src/sys/rump/net/lib/libshmif/shmifvar.h:1.9 src/sys/rump/net/lib/libshmif/shmifvar.h:1.10
--- src/sys/rump/net/lib/libshmif/shmifvar.h:1.9	Sat Aug 16 06:18:01 2014
+++ src/sys/rump/net/lib/libshmif/shmifvar.h	Wed Sep 17 04:20:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: shmifvar.h,v 1.9 2014/08/16 06:18:01 ozaki-r Exp $	*/
+/*	$NetBSD: shmifvar.h,v 1.10 2014/09/17 04:20:58 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -68,6 +68,7 @@ struct shmif_pkthdr {
 #include 
 #define DPRINTF(x) rumpuser_dprintf x
 #else
+#include 
 #define DPRINTF(x) printf x
 #endif
 #else



CVS commit: src/sys/rump/net/lib/libshmif

2014-08-15 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Sat Aug 16 06:18:01 UTC 2014

Modified Files:
src/sys/rump/net/lib/libshmif: shmifvar.h

Log Message:
Bump SHMIF_VERSION


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/rump/net/lib/libshmif/shmifvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/shmifvar.h
diff -u src/sys/rump/net/lib/libshmif/shmifvar.h:1.8 src/sys/rump/net/lib/libshmif/shmifvar.h:1.9
--- src/sys/rump/net/lib/libshmif/shmifvar.h:1.8	Fri Aug 15 15:03:03 2014
+++ src/sys/rump/net/lib/libshmif/shmifvar.h	Sat Aug 16 06:18:01 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: shmifvar.h,v 1.8 2014/08/15 15:03:03 ozaki-r Exp $	*/
+/*	$NetBSD: shmifvar.h,v 1.9 2014/08/16 06:18:01 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 #define _RUMP_NET_SHMIFVAR_H_
 
 #define SHMIF_MAGIC 0xca11d054
-#define SHMIF_VERSION 2
+#define SHMIF_VERSION 3
 
 struct shmif_mem {
 	uint32_t shm_magic;



CVS commit: src/sys/rump/net/lib/libshmif

2014-08-15 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Fri Aug 15 15:03:03 UTC 2014

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c shmifvar.h

Log Message:
Make shmif SIMPLEX

Add a sender field to a packet header on a shmif bus to identify
and ignore packets sent by itself.

This makes shmif work with bridges.

ok pooka@


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/rump/net/lib/libshmif/if_shmem.c
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/net/lib/libshmif/shmifvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.62 src/sys/rump/net/lib/libshmif/if_shmem.c:1.63
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.62	Sat Aug  9 09:43:49 2014
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Fri Aug 15 15:03:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.62 2014/08/09 09:43:49 ozaki-r Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.63 2014/08/15 15:03:03 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.62 2014/08/09 09:43:49 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.63 2014/08/15 15:03:03 ozaki-r Exp $");
 
 #include 
 #include 
@@ -97,6 +97,8 @@ struct shmif_sc {
 
 	struct lwp *sc_rcvl;
 	bool sc_dying;
+
+	uint64_t sc_uuid;
 };
 
 static void shmif_rcv(void *);
@@ -167,12 +169,13 @@ allocif(int unit, struct shmif_sc **scp)
 	sc = kmem_zalloc(sizeof(*sc), KM_SLEEP);
 	sc->sc_memfd = -1;
 	sc->sc_unit = unit;
+	sc->sc_uuid = cprng_fast64();
 
 	ifp = &sc->sc_ec.ec_if;
 
 	snprintf(ifp->if_xname, sizeof(ifp->if_xname), "shmif%d", unit);
 	ifp->if_softc = sc;
-	ifp->if_flags = IFF_BROADCAST | IFF_MULTICAST;
+	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 	ifp->if_init = shmif_init;
 	ifp->if_ioctl = shmif_ioctl;
 	ifp->if_start = shmif_start;
@@ -540,6 +543,7 @@ shmif_start(struct ifnet *ifp)
 		sp.sp_len = pktsize;
 		sp.sp_sec = tv.tv_sec;
 		sp.sp_usec = tv.tv_usec;
+		sp.sp_sender = sc->sc_uuid;
 
 		bpf_mtap(ifp, m0);
 
@@ -743,7 +747,9 @@ shmif_rcv(void *arg)
 		 * Test if we want to pass the packet upwards
 		 */
 		eth = mtod(m, struct ether_header *);
-		if (memcmp(eth->ether_dhost, CLLADDR(ifp->if_sadl),
+		if (sp.sp_sender == sc->sc_uuid) {
+			passup = false;
+		} else if (memcmp(eth->ether_dhost, CLLADDR(ifp->if_sadl),
 		ETHER_ADDR_LEN) == 0) {
 			passup = true;
 		} else if (ETHER_IS_MULTICAST(eth->ether_dhost)) {

Index: src/sys/rump/net/lib/libshmif/shmifvar.h
diff -u src/sys/rump/net/lib/libshmif/shmifvar.h:1.7 src/sys/rump/net/lib/libshmif/shmifvar.h:1.8
--- src/sys/rump/net/lib/libshmif/shmifvar.h:1.7	Fri Dec 20 09:06:35 2013
+++ src/sys/rump/net/lib/libshmif/shmifvar.h	Fri Aug 15 15:03:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: shmifvar.h,v 1.7 2013/12/20 09:06:35 pooka Exp $	*/
+/*	$NetBSD: shmifvar.h,v 1.8 2014/08/15 15:03:03 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -56,6 +56,8 @@ struct shmif_pkthdr {
 
 	uint32_t sp_sec;
 	uint32_t sp_usec;
+
+	uint64_t sp_sender;
 };
 
 #define BUSMEM_SIZE (1024*1024)



CVS commit: src/sys/rump/net/lib/libvirtif

2014-08-09 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Sat Aug  9 09:47:02 UTC 2014

Modified Files:
src/sys/rump/net/lib/libvirtif: if_virt.c

Log Message:
Count packets in if_virt


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/rump/net/lib/libvirtif/if_virt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.47 src/sys/rump/net/lib/libvirtif/if_virt.c:1.48
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.47	Wed Apr  2 19:44:15 2014
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Sat Aug  9 09:47:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.47 2014/04/02 19:44:15 pooka Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.48 2014/08/09 09:47:02 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.47 2014/04/02 19:44:15 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.48 2014/08/09 09:47:02 ozaki-r Exp $");
 
 #include 
 #include 
@@ -310,6 +310,7 @@ virtif_start(struct ifnet *ifp)
 		VIFHYPER_SEND(sc->sc_viu, io, i);
 
 		m_freem(m0);
+		ifp->if_opackets++;
 	}
 
 	ifp->if_flags &= ~IFF_OACTIVE;
@@ -372,6 +373,7 @@ VIF_DELIVERPKT(struct virtif_sc *sc, str
 	}
 
 	if (passup) {
+		ifp->if_ipackets++;
 		m->m_pkthdr.rcvif = ifp;
 		KERNEL_LOCK(1, NULL);
 		bpf_mtap(ifp, m);



CVS commit: src/sys/rump/net/lib/libshmif

2014-08-09 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Sat Aug  9 09:43:49 UTC 2014

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
Count packets in if_shmem

ok @pooka


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/rump/net/lib/libshmif/if_shmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.61 src/sys/rump/net/lib/libshmif/if_shmem.c:1.62
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.61	Wed May 28 20:57:22 2014
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Sat Aug  9 09:43:49 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.61 2014/05/28 20:57:22 justin Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.62 2014/08/09 09:43:49 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.61 2014/05/28 20:57:22 justin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.62 2014/08/09 09:43:49 ozaki-r Exp $");
 
 #include 
 #include 
@@ -566,6 +566,7 @@ shmif_start(struct ifnet *ifp)
 
 		m_freem(m0);
 		wrote = true;
+		ifp->if_opackets++;
 
 		DPRINTF(("shmif_start: send %d bytes at off %d\n",
 		pktsize, busmem->shm_last));
@@ -755,6 +756,7 @@ shmif_rcv(void *arg)
 		}
 
 		if (passup) {
+			ifp->if_ipackets++;
 			KERNEL_LOCK(1, NULL);
 			bpf_mtap(ifp, m);
 			ifp->if_input(ifp, m);



CVS commit: src/sys/rump/net/lib/libsockin

2014-07-28 Thread Tyler R. Retzlaff
Module Name:src
Committed By:   rtr
Date:   Mon Jul 28 10:09:51 UTC 2014

Modified Files:
src/sys/rump/net/lib/libsockin: sockin.c

Log Message:
add missing KASSERT()s at the top of sockin_usrreq(), req shall not be
either of these operations.

>   KASSERT(req != PRU_BIND);
>   KASSERT(req != PRU_LISTEN);


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/rump/net/lib/libsockin/sockin.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libsockin/sockin.c
diff -u src/sys/rump/net/lib/libsockin/sockin.c:1.51 src/sys/rump/net/lib/libsockin/sockin.c:1.52
--- src/sys/rump/net/lib/libsockin/sockin.c:1.51	Thu Jul 24 15:12:03 2014
+++ src/sys/rump/net/lib/libsockin/sockin.c	Mon Jul 28 10:09:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockin.c,v 1.51 2014/07/24 15:12:03 rtr Exp $	*/
+/*	$NetBSD: sockin.c,v 1.52 2014/07/28 10:09:51 rtr Exp $	*/
 
 /*
  * Copyright (c) 2008, 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.51 2014/07/24 15:12:03 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.52 2014/07/28 10:09:51 rtr Exp $");
 
 #include 
 #include 
@@ -558,6 +558,8 @@ sockin_usrreq(struct socket *so, int req
 	int error = 0;
 
 	KASSERT(req != PRU_ACCEPT);
+	KASSERT(req != PRU_BIND);
+	KASSERT(req != PRU_LISTEN);
 	KASSERT(req != PRU_CONTROL);
 	KASSERT(req != PRU_SENSE);
 	KASSERT(req != PRU_PEERADDR);



CVS commit: src/sys/rump/net/lib/libsockin

2014-07-09 Thread Tyler R. Retzlaff
Module Name:src
Committed By:   rtr
Date:   Wed Jul  9 15:37:55 UTC 2014

Modified Files:
src/sys/rump/net/lib/libsockin: sockin.c

Log Message:
fix name clash i introduced when adding sockin_accept() pru by renaming
the rump sockin_accept(struct socket *) to sockin_waccept(struct socket *)

not a very creative name the 'w' indicates worker and was chosen to
prefix the word accept to make it not pattern match with _accept. if
someone prefers a different name then please feel free to change it.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/rump/net/lib/libsockin/sockin.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libsockin/sockin.c
diff -u src/sys/rump/net/lib/libsockin/sockin.c:1.48 src/sys/rump/net/lib/libsockin/sockin.c:1.49
--- src/sys/rump/net/lib/libsockin/sockin.c:1.48	Wed Jul  9 14:41:43 2014
+++ src/sys/rump/net/lib/libsockin/sockin.c	Wed Jul  9 15:37:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockin.c,v 1.48 2014/07/09 14:41:43 rtr Exp $	*/
+/*	$NetBSD: sockin.c,v 1.49 2014/07/09 15:37:55 rtr Exp $	*/
 
 /*
  * Copyright (c) 2008, 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.48 2014/07/09 14:41:43 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.49 2014/07/09 15:37:55 rtr Exp $");
 
 #include 
 #include 
@@ -284,7 +284,7 @@ sockin_process(struct socket *so)
 }
 
 static void
-sockin_accept(struct socket *so)
+sockin_waccept(struct socket *so)
 {
 	struct socket *nso;
 	struct sockaddr_in6 sin;
@@ -363,7 +363,7 @@ sockinworker(void *arg)
 		so = su_iter->su_so;
 		mutex_exit(&su_mtx);
 		if(so->so_options&SO_ACCEPTCONN)
-			sockin_accept(so);
+			sockin_waccept(so);
 		else
 			sockin_process(so);
 		mutex_enter(&su_mtx);



CVS commit: src/sys/rump/net/lib/libsockin

2014-07-06 Thread Tyler R. Retzlaff
Module Name:src
Committed By:   rtr
Date:   Sun Jul  6 16:18:46 UTC 2014

Modified Files:
src/sys/rump/net/lib/libsockin: sockin.c

Log Message:
* split PRU_SENSE functionality out of sockin_usrreq() and place into
  separate sockin_stat(struct socket *, struct stat *) function.
* change behavior of function to just return success (like pretty much
  every other implementation) instead of panic()ing due to lack of
  implementation.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/rump/net/lib/libsockin/sockin.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libsockin/sockin.c
diff -u src/sys/rump/net/lib/libsockin/sockin.c:1.42 src/sys/rump/net/lib/libsockin/sockin.c:1.43
--- src/sys/rump/net/lib/libsockin/sockin.c:1.42	Tue Jul  1 05:49:19 2014
+++ src/sys/rump/net/lib/libsockin/sockin.c	Sun Jul  6 16:18:46 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockin.c,v 1.42 2014/07/01 05:49:19 rtr Exp $	*/
+/*	$NetBSD: sockin.c,v 1.43 2014/07/06 16:18:46 rtr Exp $	*/
 
 /*
  * Copyright (c) 2008, 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.42 2014/07/01 05:49:19 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.43 2014/07/06 16:18:46 rtr Exp $");
 
 #include 
 #include 
@@ -69,6 +69,7 @@ static void	sockin_init(void);
 static int	sockin_attach(struct socket *, int);
 static void	sockin_detach(struct socket *);
 static int	sockin_ioctl(struct socket *, u_long, void *, struct ifnet *);
+static int	sockin_stat(struct socket *, struct stat *);
 static int	sockin_usrreq(struct socket *, int, struct mbuf *,
 			  struct mbuf *, struct mbuf *, struct lwp *);
 static int	sockin_ctloutput(int op, struct socket *, struct sockopt *);
@@ -77,6 +78,7 @@ static const struct pr_usrreqs sockin_us
 	.pr_attach = sockin_attach,
 	.pr_detach = sockin_detach,
 	.pr_ioctl = sockin_ioctl,
+	.pr_stat = sockin_stat,
 	.pr_generic = sockin_usrreq,
 };
 
@@ -458,12 +460,19 @@ sockin_ioctl(struct socket *so, u_long c
 }
 
 static int
+sockin_stat(struct socket *so, struct stat *ub)
+{
+	return 0;
+}
+
+static int
 sockin_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
 	struct mbuf *control, struct lwp *l)
 {
 	int error = 0;
 
 	KASSERT(req != PRU_CONTROL);
+	KASSERT(req != PRU_SENSE);
 
 	switch (req) {
 	case PRU_ACCEPT:



CVS commit: src/sys/rump/net/lib/libsockin

2014-05-18 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sun May 18 17:57:44 UTC 2014

Modified Files:
src/sys/rump/net/lib/libsockin: sockin.c

Log Message:
Fix RUMP build.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/rump/net/lib/libsockin/sockin.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libsockin/sockin.c
diff -u src/sys/rump/net/lib/libsockin/sockin.c:1.38 src/sys/rump/net/lib/libsockin/sockin.c:1.39
--- src/sys/rump/net/lib/libsockin/sockin.c:1.38	Fri May  9 06:12:48 2014
+++ src/sys/rump/net/lib/libsockin/sockin.c	Sun May 18 17:57:44 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockin.c,v 1.38 2014/05/09 06:12:48 pooka Exp $	*/
+/*	$NetBSD: sockin.c,v 1.39 2014/05/18 17:57:44 rmind Exp $	*/
 
 /*
  * Copyright (c) 2008, 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.38 2014/05/09 06:12:48 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.39 2014/05/18 17:57:44 rmind Exp $");
 
 #include 
 #include 
@@ -70,13 +70,17 @@ static int	sockin_usrreq(struct socket *
 			  struct mbuf *, struct mbuf *, struct lwp *);
 static int	sockin_ctloutput(int op, struct socket *, struct sockopt *);
 
+static const struct pr_usrreqs sockin_usrreqs = {
+	.pr_generic = sockin_usrreq,
+};
+
 const struct protosw sockinsw[] = {
 {
 	.pr_type = SOCK_DGRAM,
 	.pr_domain = &sockindomain,
 	.pr_protocol = IPPROTO_UDP,
 	.pr_flags = PR_ATOMIC|PR_ADDR,
-	.pr_usrreq = sockin_usrreq,
+	.pr_usrreqs = &sockin_usrreqs,
 	.pr_ctloutput = sockin_ctloutput,
 },
 {
@@ -84,7 +88,7 @@ const struct protosw sockinsw[] = {
 	.pr_domain = &sockindomain,
 	.pr_protocol = IPPROTO_TCP,
 	.pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS,
-	.pr_usrreq = sockin_usrreq,
+	.pr_usrreqs = &sockin_usrreqs,
 	.pr_ctloutput = sockin_ctloutput,
 }};
 const struct protosw sockin6sw[] = {
@@ -93,7 +97,7 @@ const struct protosw sockin6sw[] = {
 	.pr_domain = &sockin6domain,
 	.pr_protocol = IPPROTO_UDP,
 	.pr_flags = PR_ATOMIC|PR_ADDR,
-	.pr_usrreq = sockin_usrreq,
+	.pr_usrreqs = &sockin_usrreqs,
 	.pr_ctloutput = sockin_ctloutput,
 },
 {
@@ -101,7 +105,7 @@ const struct protosw sockin6sw[] = {
 	.pr_domain = &sockin6domain,
 	.pr_protocol = IPPROTO_TCP,
 	.pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS,
-	.pr_usrreq = sockin_usrreq,
+	.pr_usrreqs = &sockin_usrreqs,
 	.pr_ctloutput = sockin_ctloutput,
 }};
 



CVS commit: src/sys/rump/net/lib/libsockin

2014-05-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri May  9 06:12:48 UTC 2014

Modified Files:
src/sys/rump/net/lib/libsockin: sockin.c

Log Message:
comment meets reality


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/rump/net/lib/libsockin/sockin.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libsockin/sockin.c
diff -u src/sys/rump/net/lib/libsockin/sockin.c:1.37 src/sys/rump/net/lib/libsockin/sockin.c:1.38
--- src/sys/rump/net/lib/libsockin/sockin.c:1.37	Sat Apr 26 11:23:03 2014
+++ src/sys/rump/net/lib/libsockin/sockin.c	Fri May  9 06:12:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockin.c,v 1.37 2014/04/26 11:23:03 pooka Exp $	*/
+/*	$NetBSD: sockin.c,v 1.38 2014/05/09 06:12:48 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.37 2014/04/26 11:23:03 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.38 2014/05/09 06:12:48 pooka Exp $");
 
 #include 
 #include 
@@ -58,8 +58,7 @@ __KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1
 
 /*
  * An inet communication domain which uses the socket interface.
- * Currently supports only IPv4 UDP, but could easily be extended to
- * support IPv6 and TCP by adding more stuff to the protosw.
+ * Supports IPv4 & IPv6 UDP/TCP.
  */
 
 DOMAIN_DEFINE(sockindomain);



CVS commit: src/sys/rump/net/lib/libnpf

2014-04-04 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Fri Apr  4 13:57:33 UTC 2014

Modified Files:
src/sys/rump/net/lib/libnpf: Makefile

Log Message:
No lint for rumpnet npf library.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/rump/net/lib/libnpf/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnpf/Makefile
diff -u src/sys/rump/net/lib/libnpf/Makefile:1.12 src/sys/rump/net/lib/libnpf/Makefile:1.13
--- src/sys/rump/net/lib/libnpf/Makefile:1.12	Thu Mar 13 02:07:24 2014
+++ src/sys/rump/net/lib/libnpf/Makefile	Fri Apr  4 13:57:33 2014
@@ -1,8 +1,10 @@
-#	$NetBSD: Makefile,v 1.12 2014/03/13 02:07:24 pooka Exp $
+#	$NetBSD: Makefile,v 1.13 2014/04/04 13:57:33 njoly Exp $
 #
 # Public Domain.
 #
 
+NOLINT=		# defined
+
 .PATH:	${.CURDIR}/../../../../net/npf
 
 LIB=	rumpnet_npf



CVS commit: src/sys/rump/net/lib/libvirtif

2014-04-02 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Apr  2 19:44:15 UTC 2014

Modified Files:
src/sys/rump/net/lib/libvirtif: if_virt.c

Log Message:
use if_initname() instead of homegrown sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/rump/net/lib/libvirtif/if_virt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.46 src/sys/rump/net/lib/libvirtif/if_virt.c:1.47
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.46	Thu Mar 20 20:42:08 2014
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Wed Apr  2 19:44:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.46 2014/03/20 20:42:08 christos Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.47 2014/04/02 19:44:15 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.46 2014/03/20 20:42:08 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.47 2014/04/02 19:44:15 pooka Exp $");
 
 #include 
 #include 
@@ -109,7 +109,8 @@ virtif_clone(struct if_clone *ifc, int n
 	sc = kmem_zalloc(sizeof(*sc), KM_SLEEP);
 	sc->sc_num = num;
 	ifp = &sc->sc_ec.ec_if;
-	snprintf(ifp->if_xname, sizeof(ifp->if_xname), "%s%d", VIF_NAME, num);
+
+	if_initname(ifp, VIF_NAME, num);
 	ifp->if_softc = sc;
 
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;



CVS commit: src/sys/rump/net/lib/libvirtif

2014-03-18 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar 18 18:10:09 UTC 2014

Modified Files:
src/sys/rump/net/lib/libvirtif: if_virt.c

Log Message:
Trim alignment out of packet length before passing it up.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/rump/net/lib/libvirtif/if_virt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.44 src/sys/rump/net/lib/libvirtif/if_virt.c:1.45
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.44	Thu Mar 13 21:11:12 2014
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Tue Mar 18 18:10:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.44 2014/03/13 21:11:12 pooka Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.45 2014/03/18 18:10:08 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.44 2014/03/13 21:11:12 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.45 2014/03/18 18:10:08 pooka Exp $");
 
 #include 
 #include 
@@ -353,8 +353,10 @@ VIF_DELIVERPKT(struct virtif_sc *sc, str
 			return;
 		}
 	}
-
 	m->m_data += align;
+	m->m_pkthdr.len -= align;
+	m->m_len -= align;
+
 	eth = mtod(m, struct ether_header *);
 	if (memcmp(eth->ether_dhost, CLLADDR(ifp->if_sadl),
 	ETHER_ADDR_LEN) == 0) {



CVS commit: src/sys/rump/net/lib/libvirtif

2014-03-14 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Mar 14 10:06:22 UTC 2014

Modified Files:
src/sys/rump/net/lib/libvirtif: virtif_user.c virtif_user.h

Log Message:
Remember to bump revision for the "int my time VIF_DYING" change yesterday.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libvirtif/virtif_user.c \
src/sys/rump/net/lib/libvirtif/virtif_user.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/virtif_user.c
diff -u src/sys/rump/net/lib/libvirtif/virtif_user.c:1.2 src/sys/rump/net/lib/libvirtif/virtif_user.c:1.3
--- src/sys/rump/net/lib/libvirtif/virtif_user.c:1.2	Thu Mar 13 20:55:26 2014
+++ src/sys/rump/net/lib/libvirtif/virtif_user.c	Fri Mar 14 10:06:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtif_user.c,v 1.2 2014/03/13 20:55:26 pooka Exp $	*/
+/*	$NetBSD: virtif_user.c,v 1.3 2014/03/14 10:06:22 pooka Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -51,7 +51,7 @@
 #include "if_virt.h"
 #include "virtif_user.h"
 
-#if VIFHYPER_REVISION != 20140302
+#if VIFHYPER_REVISION != 20140313
 #error VIFHYPER_REVISION mismatch
 #endif
 
Index: src/sys/rump/net/lib/libvirtif/virtif_user.h
diff -u src/sys/rump/net/lib/libvirtif/virtif_user.h:1.2 src/sys/rump/net/lib/libvirtif/virtif_user.h:1.3
--- src/sys/rump/net/lib/libvirtif/virtif_user.h:1.2	Thu Mar 13 20:55:26 2014
+++ src/sys/rump/net/lib/libvirtif/virtif_user.h	Fri Mar 14 10:06:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtif_user.h,v 1.2 2014/03/13 20:55:26 pooka Exp $	*/
+/*	$NetBSD: virtif_user.h,v 1.3 2014/03/14 10:06:22 pooka Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 struct virtif_user;
 
-#define VIFHYPER_REVISION 20140302
+#define VIFHYPER_REVISION 20140313
 
 int 	VIFHYPER_CREATE(const char *, struct virtif_sc *, uint8_t *,
 			struct virtif_user **);



CVS commit: src/sys/rump/net/lib/libvirtif

2014-03-13 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 21:11:12 UTC 2014

Modified Files:
src/sys/rump/net/lib/libvirtif: Makefile.virtif if_virt.c
Removed Files:
src/sys/rump/net/lib/libvirtif: virtif_component.c

Log Message:
No reason to attach if_virt as a RUMP_COMPONENT(), simply use MODULE().


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/net/lib/libvirtif/Makefile.virtif
cvs rdiff -u -r1.43 -r1.44 src/sys/rump/net/lib/libvirtif/if_virt.c
cvs rdiff -u -r1.1 -r0 src/sys/rump/net/lib/libvirtif/virtif_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/Makefile.virtif
diff -u src/sys/rump/net/lib/libvirtif/Makefile.virtif:1.3 src/sys/rump/net/lib/libvirtif/Makefile.virtif:1.4
--- src/sys/rump/net/lib/libvirtif/Makefile.virtif:1.3	Thu Mar 13 20:59:12 2014
+++ src/sys/rump/net/lib/libvirtif/Makefile.virtif	Thu Mar 13 21:11:12 2014
@@ -1,16 +1,14 @@
-#	$NetBSD: Makefile.virtif,v 1.3 2014/03/13 20:59:12 pooka Exp $
+#	$NetBSD: Makefile.virtif,v 1.4 2014/03/13 21:11:12 pooka Exp $
 #
 
 .if !defined(VIRTIF)
 .error Define VIRTIF when including ${.PARSEFILE}
 .endif
 
-SRCS=	if_virt.c virtif_component.c
+SRCS=	if_virt.c
 
 VIRTIFDIR:=	${.PARSEDIR}
 .PATH:		${VIRTIFDIR}
 
-CPPFLAGS+=	-I${VIRTIFDIR}/../../../librump/rumpkern
-
 CPPFLAGS+=		 -DVIRTIF_BASE=${VIRTIF} -I${VIRTIFDIR}
 RUMPCOMP_USER_CPPFLAGS+= -DVIRTIF_BASE=${VIRTIF} -I${VIRTIFDIR}

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.43 src/sys/rump/net/lib/libvirtif/if_virt.c:1.44
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.43	Thu Mar 13 20:59:12 2014
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Thu Mar 13 21:11:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.43 2014/03/13 20:59:12 pooka Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.44 2014/03/13 21:11:12 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,12 +26,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.43 2014/03/13 20:59:12 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.44 2014/03/13 21:11:12 pooka Exp $");
 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -378,3 +379,31 @@ VIF_DELIVERPKT(struct virtif_sc *sc, str
 	}
 	m = NULL;
 }
+
+MODULE(MODULE_CLASS_DRIVER, if_virt, NULL);
+
+static int
+if_virt_modcmd(modcmd_t cmd, void *opaque)
+{
+	int error = 0;
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+		if_clone_attach(&VIF_CLONER);
+		break;
+	case MODULE_CMD_FINI:
+		/*
+		 * not sure if interfaces are refcounted
+		 * and properly protected
+		 */
+#if 0
+		if_clone_detach(&VIF_CLONER);
+#else
+		error = ENOTTY;
+#endif
+		break;
+	default:
+		error = ENOTTY;
+	}
+	return error;
+}



CVS commit: src/sys/rump/net/lib/libvirtif

2014-03-13 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 20:59:12 UTC 2014

Modified Files:
src/sys/rump/net/lib/libvirtif: Makefile.virtif if_virt.c

Log Message:
remove unnecessary header inclusions


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libvirtif/Makefile.virtif
cvs rdiff -u -r1.42 -r1.43 src/sys/rump/net/lib/libvirtif/if_virt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/Makefile.virtif
diff -u src/sys/rump/net/lib/libvirtif/Makefile.virtif:1.2 src/sys/rump/net/lib/libvirtif/Makefile.virtif:1.3
--- src/sys/rump/net/lib/libvirtif/Makefile.virtif:1.2	Wed Mar 12 23:42:33 2014
+++ src/sys/rump/net/lib/libvirtif/Makefile.virtif	Thu Mar 13 20:59:12 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.virtif,v 1.2 2014/03/12 23:42:33 pooka Exp $
+#	$NetBSD: Makefile.virtif,v 1.3 2014/03/13 20:59:12 pooka Exp $
 #
 
 .if !defined(VIRTIF)
@@ -10,7 +10,7 @@ SRCS=	if_virt.c virtif_component.c
 VIRTIFDIR:=	${.PARSEDIR}
 .PATH:		${VIRTIFDIR}
 
-CPPFLAGS+=	-I${VIRTIFDIR}/../../../librump/rumpkern -I${VIRTIFDIR}
-CPPFLAGS+=	-DVIRTIF_BASE=${VIRTIF}
+CPPFLAGS+=	-I${VIRTIFDIR}/../../../librump/rumpkern
 
+CPPFLAGS+=		 -DVIRTIF_BASE=${VIRTIF} -I${VIRTIFDIR}
 RUMPCOMP_USER_CPPFLAGS+= -DVIRTIF_BASE=${VIRTIF} -I${VIRTIFDIR}

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.42 src/sys/rump/net/lib/libvirtif/if_virt.c:1.43
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.42	Thu Mar 13 20:55:26 2014
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Thu Mar 13 20:59:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.42 2014/03/13 20:55:26 pooka Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.43 2014/03/13 20:59:12 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.42 2014/03/13 20:55:26 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.43 2014/03/13 20:59:12 pooka Exp $");
 
 #include 
 #include 
@@ -41,11 +41,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 
 #include 
 #include 
 
-#include 
-
-#include "rump_private.h"
-#include "rump_net_private.h"
-
 #include "if_virt.h"
 #include "virtif_user.h"
 



CVS commit: src/sys/rump/net/lib/libvirtif

2014-03-13 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 20:55:26 UTC 2014

Modified Files:
src/sys/rump/net/lib/libvirtif: if_virt.c virtif_user.c virtif_user.h

Log Message:
allow VIF_DYING() implementation to protest


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/rump/net/lib/libvirtif/if_virt.c
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libvirtif/virtif_user.c \
src/sys/rump/net/lib/libvirtif/virtif_user.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.41 src/sys/rump/net/lib/libvirtif/if_virt.c:1.42
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.41	Thu Mar 13 18:14:13 2014
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Thu Mar 13 20:55:26 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.41 2014/03/13 18:14:13 pooka Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.42 2014/03/13 20:55:26 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.41 2014/03/13 18:14:13 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.42 2014/03/13 20:55:26 pooka Exp $");
 
 #include 
 #include 
@@ -151,11 +151,13 @@ static int
 virtif_unclone(struct ifnet *ifp)
 {
 	struct virtif_sc *sc = ifp->if_softc;
+	int rv;
 
 	if (ifp->if_flags & IFF_UP)
 		return EBUSY;
 
-	VIFHYPER_DYING(sc->sc_viu);
+	if ((rv = VIFHYPER_DYING(sc->sc_viu)) != 0)
+		return rv;
 
 	virtif_stop(ifp, 1);
 	if_down(ifp);

Index: src/sys/rump/net/lib/libvirtif/virtif_user.c
diff -u src/sys/rump/net/lib/libvirtif/virtif_user.c:1.1 src/sys/rump/net/lib/libvirtif/virtif_user.c:1.2
--- src/sys/rump/net/lib/libvirtif/virtif_user.c:1.1	Thu Mar 13 18:14:13 2014
+++ src/sys/rump/net/lib/libvirtif/virtif_user.c	Thu Mar 13 20:55:26 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtif_user.c,v 1.1 2014/03/13 18:14:13 pooka Exp $	*/
+/*	$NetBSD: virtif_user.c,v 1.2 2014/03/13 20:55:26 pooka Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -251,7 +251,7 @@ VIFHYPER_SEND(struct virtif_user *viu,
 	rumpuser_component_schedule(cookie);
 }
 
-void
+int
 VIFHYPER_DYING(struct virtif_user *viu)
 {
 	void *cookie = rumpuser_component_unschedule();
@@ -259,11 +259,17 @@ VIFHYPER_DYING(struct virtif_user *viu)
 	viu->viu_dying = 1;
 	if (write(viu->viu_pipe[1],
 	&viu->viu_dying, sizeof(viu->viu_dying)) == -1) {
+		/*
+		 * this is here mostly to avoid a compiler warning
+		 * about ignoring the return value of write()
+		 */
 		fprintf(stderr, "%s: failed to signal thread\n",
 		VIF_STRING(VIFHYPER_DYING));
 	}
 
 	rumpuser_component_schedule(cookie);
+
+	return 0;
 }
 
 void
Index: src/sys/rump/net/lib/libvirtif/virtif_user.h
diff -u src/sys/rump/net/lib/libvirtif/virtif_user.h:1.1 src/sys/rump/net/lib/libvirtif/virtif_user.h:1.2
--- src/sys/rump/net/lib/libvirtif/virtif_user.h:1.1	Thu Mar 13 18:14:13 2014
+++ src/sys/rump/net/lib/libvirtif/virtif_user.h	Thu Mar 13 20:55:26 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtif_user.h,v 1.1 2014/03/13 18:14:13 pooka Exp $	*/
+/*	$NetBSD: virtif_user.h,v 1.2 2014/03/13 20:55:26 pooka Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@ struct virtif_user;
 
 int 	VIFHYPER_CREATE(const char *, struct virtif_sc *, uint8_t *,
 			struct virtif_user **);
-void	VIFHYPER_DYING(struct virtif_user *);
+int	VIFHYPER_DYING(struct virtif_user *);
 void	VIFHYPER_DESTROY(struct virtif_user *);
 
 void	VIFHYPER_SEND(struct virtif_user *, struct iovec *, size_t);



CVS commit: src/sys/rump/net/lib/libvirtif

2014-03-13 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 18:14:13 UTC 2014

Modified Files:
src/sys/rump/net/lib/libvirtif: Makefile if_virt.c
Added Files:
src/sys/rump/net/lib/libvirtif: virtif_user.c virtif_user.h
Removed Files:
src/sys/rump/net/lib/libvirtif: rumpcomp_user.c rumpcomp_user.h

Log Message:
Rename rumpcomp_user.c -> virtif_user.c
Convert to new-style RUMPCOMP_USER_SRCS in Makefile.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/rump/net/lib/libvirtif/Makefile
cvs rdiff -u -r1.40 -r1.41 src/sys/rump/net/lib/libvirtif/if_virt.c
cvs rdiff -u -r1.12 -r0 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c
cvs rdiff -u -r1.6 -r0 src/sys/rump/net/lib/libvirtif/rumpcomp_user.h
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libvirtif/virtif_user.c \
src/sys/rump/net/lib/libvirtif/virtif_user.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/Makefile
diff -u src/sys/rump/net/lib/libvirtif/Makefile:1.8 src/sys/rump/net/lib/libvirtif/Makefile:1.9
--- src/sys/rump/net/lib/libvirtif/Makefile:1.8	Wed Mar 12 23:40:58 2014
+++ src/sys/rump/net/lib/libvirtif/Makefile	Thu Mar 13 18:14:13 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2014/03/12 23:40:58 pooka Exp $
+#	$NetBSD: Makefile,v 1.9 2014/03/13 18:14:13 pooka Exp $
 #
 
 LIB=	rumpnet_virtif
@@ -6,7 +6,7 @@ VIRTIF=	virt
 
 .include "${.CURDIR}/Makefile.virtif"
 
-RUMPCOMP_USER=	#defined
+RUMPCOMP_USER_SRCS=	virtif_user.c
 
 .include 
 .include 

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.40 src/sys/rump/net/lib/libvirtif/if_virt.c:1.41
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.40	Wed Mar 12 17:49:13 2014
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Thu Mar 13 18:14:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.40 2014/03/12 17:49:13 pooka Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.41 2014/03/13 18:14:13 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.40 2014/03/12 17:49:13 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.41 2014/03/13 18:14:13 pooka Exp $");
 
 #include 
 #include 
@@ -47,7 +47,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 
 #include "rump_net_private.h"
 
 #include "if_virt.h"
-#include "rumpcomp_user.h"
+#include "virtif_user.h"
 
 /*
  * Virtual interface.  Uses hypercalls to shovel packets back

Added files:

Index: src/sys/rump/net/lib/libvirtif/virtif_user.c
diff -u /dev/null src/sys/rump/net/lib/libvirtif/virtif_user.c:1.1
--- /dev/null	Thu Mar 13 18:14:13 2014
+++ src/sys/rump/net/lib/libvirtif/virtif_user.c	Thu Mar 13 18:14:13 2014
@@ -0,0 +1,282 @@
+/*	$NetBSD: virtif_user.c,v 1.1 2014/03/13 18:14:13 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _KERNEL
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifdef __linux__
+#include 
+#include 
+#endif
+
+#include 
+
+#include "if_virt.h"
+#include "virtif_user.h"
+
+#if VIFHYPER_REVISION != 20140302
+#error VIFHYPER_REVISION mismatch
+#endif
+
+struct virtif_user {
+	struct virtif_sc *viu_virtifsc;
+	int viu_devnum;
+
+	int viu_fd;
+	int viu_pipe[2];
+	pthread_t viu_rcvthr;
+
+	int viu_dying;
+
+	char viu_rcvbuf[9018]; /* jumbo frame max len */
+};
+
+static int
+opentapdev(int devnum)
+{
+	int fd = -1;
+
+#if defined(__NetBSD__) || defined(__DragonFly__)
+	char tapdev[64];
+
+	snprintf(tapdev, sizeof(tapdev), "/de

CVS commit: src/sys/rump/net/lib/libbridge

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 02:08:24 UTC 2014

Modified Files:
src/sys/rump/net/lib/libbridge: Makefile
Added Files:
src/sys/rump/net/lib/libbridge: bridge_component.c
Removed Files:
src/sys/rump/net/lib/libbridge: component.c

Log Message:
rename component.c -> bridge_component.c


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libbridge/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libbridge/bridge_component.c
cvs rdiff -u -r1.1 -r0 src/sys/rump/net/lib/libbridge/component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libbridge/Makefile
diff -u src/sys/rump/net/lib/libbridge/Makefile:1.1 src/sys/rump/net/lib/libbridge/Makefile:1.2
--- src/sys/rump/net/lib/libbridge/Makefile:1.1	Wed Dec  8 18:06:43 2010
+++ src/sys/rump/net/lib/libbridge/Makefile	Thu Mar 13 02:08:24 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2010/12/08 18:06:43 pooka Exp $
+#	$NetBSD: Makefile,v 1.2 2014/03/13 02:08:24 pooka Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../net
@@ -7,7 +7,7 @@ LIB=	rumpnet_bridge
 
 SRCS=	if_bridge.c bridgestp.c
 
-SRCS+=	component.c
+SRCS+=	bridge_component.c
 
 CPPFLAGS+=	-I${.CURDIR}/../libnet/opt
 

Added files:

Index: src/sys/rump/net/lib/libbridge/bridge_component.c
diff -u /dev/null src/sys/rump/net/lib/libbridge/bridge_component.c:1.1
--- /dev/null	Thu Mar 13 02:08:24 2014
+++ src/sys/rump/net/lib/libbridge/bridge_component.c	Thu Mar 13 02:08:24 2014
@@ -0,0 +1,42 @@
+/*	$NetBSD: bridge_component.c,v 1.1 2014/03/13 02:08:24 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: bridge_component.c,v 1.1 2014/03/13 02:08:24 pooka Exp $");
+
+#include 
+
+#include "rump_private.h"
+#include "rump_net_private.h"
+
+int bridgeattach(int);
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
+{
+
+	bridgeattach(0);
+}



CVS commit: src/sys/rump/net/lib/libnetinet6

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 02:08:44 UTC 2014

Modified Files:
src/sys/rump/net/lib/libnetinet6: Makefile
Added Files:
src/sys/rump/net/lib/libnetinet6: netinet6_component.c
Removed Files:
src/sys/rump/net/lib/libnetinet6: component.c

Log Message:
rename component.c -> netinet6_component.c


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libnetinet6/Makefile
cvs rdiff -u -r1.4 -r0 src/sys/rump/net/lib/libnetinet6/component.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libnetinet6/netinet6_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnetinet6/Makefile
diff -u src/sys/rump/net/lib/libnetinet6/Makefile:1.1 src/sys/rump/net/lib/libnetinet6/Makefile:1.2
--- src/sys/rump/net/lib/libnetinet6/Makefile:1.1	Wed Aug 14 09:31:42 2013
+++ src/sys/rump/net/lib/libnetinet6/Makefile	Thu Mar 13 02:08:44 2014
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.1 2013/08/14 09:31:42 pooka Exp $
+#	$NetBSD: Makefile,v 1.2 2014/03/13 02:08:44 pooka Exp $
 #
 
 LIB=	rumpnet_netinet6
 
-SRCS=	component.c
+SRCS=	netinet6_component.c
 
 .include 
 .include 

Added files:

Index: src/sys/rump/net/lib/libnetinet6/netinet6_component.c
diff -u /dev/null src/sys/rump/net/lib/libnetinet6/netinet6_component.c:1.1
--- /dev/null	Thu Mar 13 02:08:44 2014
+++ src/sys/rump/net/lib/libnetinet6/netinet6_component.c	Thu Mar 13 02:08:44 2014
@@ -0,0 +1,60 @@
+/*	$NetBSD: netinet6_component.c,v 1.1 2014/03/13 02:08:44 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: netinet6_component.c,v 1.1 2014/03/13 02:08:44 pooka Exp $");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include "rump_private.h"
+#include "rump_net_private.h"
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET)
+{
+	extern struct domain inet6domain;
+
+	DOMAINADD(inet6domain);
+
+	rump_netisr_register(NETISR_IPV6, ip6intr);
+}
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET_IFCFG)
+{
+
+	if_up(lo0ifp);
+}



CVS commit: src/sys/rump/net/lib/libshmif

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 02:08:04 UTC 2014

Modified Files:
src/sys/rump/net/lib/libshmif: Makefile
Added Files:
src/sys/rump/net/lib/libshmif: shmif_component.c
Removed Files:
src/sys/rump/net/lib/libshmif: component.c

Log Message:
rename component.c -> shmif_component.c


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/rump/net/lib/libshmif/Makefile
cvs rdiff -u -r1.2 -r0 src/sys/rump/net/lib/libshmif/component.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libshmif/shmif_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/Makefile
diff -u src/sys/rump/net/lib/libshmif/Makefile:1.5 src/sys/rump/net/lib/libshmif/Makefile:1.6
--- src/sys/rump/net/lib/libshmif/Makefile:1.5	Thu Mar 13 01:42:59 2014
+++ src/sys/rump/net/lib/libshmif/Makefile	Thu Mar 13 02:08:04 2014
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.5 2014/03/13 01:42:59 pooka Exp $
+#	$NetBSD: Makefile,v 1.6 2014/03/13 02:08:04 pooka Exp $
 #
 
 LIB=	rumpnet_shmif
 
 SRCS=	if_shmem.c shmif_busops.c
-SRCS+=	component.c
+SRCS+=	shmif_component.c
 
 CPPFLAGS+=	-I${.CURDIR}/../../../librump/rumpkern
 

Added files:

Index: src/sys/rump/net/lib/libshmif/shmif_component.c
diff -u /dev/null src/sys/rump/net/lib/libshmif/shmif_component.c:1.1
--- /dev/null	Thu Mar 13 02:08:04 2014
+++ src/sys/rump/net/lib/libshmif/shmif_component.c	Thu Mar 13 02:08:04 2014
@@ -0,0 +1,50 @@
+/*	$NetBSD: shmif_component.c,v 1.1 2014/03/13 02:08:04 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: shmif_component.c,v 1.1 2014/03/13 02:08:04 pooka Exp $");
+
+#include 
+#include 
+
+#include 
+
+#include "rump_private.h"
+#include "rump_net_private.h"
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
+{
+	extern struct if_clone shmif_cloner; /* XXX */
+	extern vmem_t *shmif_units; /* XXX */
+
+	shmif_units = vmem_create("shmif", 1, 1<<15, 1, NULL, NULL, NULL, 1, 
+	VM_SLEEP, IPL_NONE);
+	if (shmif_units == NULL)
+		panic("shmif vmem_create failed");
+
+	if_clone_attach(&shmif_cloner);
+}



CVS commit: src/sys/rump/net/lib/libnetinet

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 02:07:42 UTC 2014

Modified Files:
src/sys/rump/net/lib/libnetinet: Makefile
Added Files:
src/sys/rump/net/lib/libnetinet: netinet_component.c
Removed Files:
src/sys/rump/net/lib/libnetinet: component.c

Log Message:
rename component.c -> netinet_component.c


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/net/lib/libnetinet/Makefile
cvs rdiff -u -r1.10 -r0 src/sys/rump/net/lib/libnetinet/component.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libnetinet/netinet_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnetinet/Makefile
diff -u src/sys/rump/net/lib/libnetinet/Makefile:1.4 src/sys/rump/net/lib/libnetinet/Makefile:1.5
--- src/sys/rump/net/lib/libnetinet/Makefile:1.4	Fri Dec 11 16:34:50 2009
+++ src/sys/rump/net/lib/libnetinet/Makefile	Thu Mar 13 02:07:42 2014
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.4 2009/12/11 16:34:50 pooka Exp $
+#	$NetBSD: Makefile,v 1.5 2014/03/13 02:07:42 pooka Exp $
 #
 
 LIB=	rumpnet_netinet
 
-SRCS=	component.c
+SRCS=	netinet_component.c
 
 .include 
 .include 

Added files:

Index: src/sys/rump/net/lib/libnetinet/netinet_component.c
diff -u /dev/null src/sys/rump/net/lib/libnetinet/netinet_component.c:1.1
--- /dev/null	Thu Mar 13 02:07:42 2014
+++ src/sys/rump/net/lib/libnetinet/netinet_component.c	Thu Mar 13 02:07:42 2014
@@ -0,0 +1,94 @@
+/*	$NetBSD: netinet_component.c,v 1.1 2014/03/13 02:07:42 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Development of this software was supported by The Nokia Foundation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: netinet_component.c,v 1.1 2014/03/13 02:07:42 pooka Exp $");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "rump_private.h"
+#include "rump_net_private.h"
+
+int carpattach(int);
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET)
+{
+	extern struct domain arpdomain, inetdomain;
+
+	DOMAINADD(arpdomain);
+	DOMAINADD(inetdomain);
+
+	carpattach(1);
+
+	rump_netisr_register(NETISR_IP, ipintr);
+	rump_netisr_register(NETISR_ARP, arpintr);
+}
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET_IFCFG)
+{
+	struct ifaliasreq ia;
+	struct sockaddr_in *sin;
+	struct socket *so;
+	int error;
+
+	if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0, curlwp, NULL)) != 0)
+		panic("lo0 config: cannot create socket");
+
+	/* configure 127.0.0.1 for lo0 */
+	memset(&ia, 0, sizeof(ia));
+	strcpy(ia.ifra_name, "lo0");
+	sin = (struct sockaddr_in *)&ia.ifra_addr;
+	sin->sin_family = AF_INET;
+	sin->sin_len = sizeof(struct sockaddr_in);
+	sin->sin_addr.s_addr = inet_addr("127.0.0.1");
+
+	sin = (struct sockaddr_in *)&ia.ifra_mask;
+	sin->sin_family = AF_INET;
+	sin->sin_len = sizeof(struct sockaddr_in);
+	sin->sin_addr.s_addr = inet_addr("255.0.0.0");
+
+	sin = (struct sockaddr_in *)&ia.ifra_broadaddr;
+	sin->sin_family = AF_INET;
+	sin->sin_len = sizeof(struct sockaddr_in);
+	sin->sin_addr.s_addr = inet_addr("127.255.255.255");
+
+	in_control(so, SIOCAIFADDR, &ia, lo0ifp, curlwp);
+	if_up(lo0ifp);
+	soclose(so);
+}



CVS commit: src/sys/rump/net/lib/libnpf

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 02:07:24 UTC 2014

Modified Files:
src/sys/rump/net/lib/libnpf: Makefile
Added Files:
src/sys/rump/net/lib/libnpf: npf_component.c
Removed Files:
src/sys/rump/net/lib/libnpf: component.c

Log Message:
rename component.c -> npf_component.c


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/rump/net/lib/libnpf/Makefile
cvs rdiff -u -r1.3 -r0 src/sys/rump/net/lib/libnpf/component.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libnpf/npf_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnpf/Makefile
diff -u src/sys/rump/net/lib/libnpf/Makefile:1.11 src/sys/rump/net/lib/libnpf/Makefile:1.12
--- src/sys/rump/net/lib/libnpf/Makefile:1.11	Mon Mar  3 19:09:52 2014
+++ src/sys/rump/net/lib/libnpf/Makefile	Thu Mar 13 02:07:24 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2014/03/03 19:09:52 pooka Exp $
+#	$NetBSD: Makefile,v 1.12 2014/03/13 02:07:24 pooka Exp $
 #
 # Public Domain.
 #
@@ -17,7 +17,7 @@ SRCS+=	npf_alg_icmp.c
 
 SRCS+=	npf_ext_log.c npf_ext_normalize.c npf_ext_rndblock.c
 
-SRCS+=	component.c
+SRCS+=	npf_component.c
 
 .include 
 

Added files:

Index: src/sys/rump/net/lib/libnpf/npf_component.c
diff -u /dev/null src/sys/rump/net/lib/libnpf/npf_component.c:1.1
--- /dev/null	Thu Mar 13 02:07:24 2014
+++ src/sys/rump/net/lib/libnpf/npf_component.c	Thu Mar 13 02:07:24 2014
@@ -0,0 +1,35 @@
+/*	$NetBSD: npf_component.c,v 1.1 2014/03/13 02:07:24 pooka Exp $	*/
+
+/*
+ * Public Domain.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: npf_component.c,v 1.1 2014/03/13 02:07:24 pooka Exp $");
+
+#include 
+#include 
+#include 
+#include 
+
+#include "rump_private.h"
+#include "rump_vfs_private.h"
+
+extern const struct cdevsw npf_cdevsw;
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET)
+{
+	devmajor_t bmajor = NODEVMAJOR, cmajor = NODEVMAJOR;
+	int error;
+
+	error = devsw_attach("npf", NULL, &bmajor, &npf_cdevsw, &cmajor);
+	if (error) {
+		panic("npf attach failed: %d", error);
+	}
+
+	error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/npf", cmajor, 0);
+	if (error) {
+		panic("npf device node creation failed: %d", error);
+	}
+	devsw_detach(NULL, &npf_cdevsw);
+}



CVS commit: src/sys/rump/net/lib/libnet

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 02:06:33 UTC 2014

Modified Files:
src/sys/rump/net/lib/libnet: Makefile
Added Files:
src/sys/rump/net/lib/libnet: net_component.c
Removed Files:
src/sys/rump/net/lib/libnet: component.c

Log Message:
rename component.c -> net_component.c


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/rump/net/lib/libnet/Makefile
cvs rdiff -u -r1.10 -r0 src/sys/rump/net/lib/libnet/component.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libnet/net_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnet/Makefile
diff -u src/sys/rump/net/lib/libnet/Makefile:1.19 src/sys/rump/net/lib/libnet/Makefile:1.20
--- src/sys/rump/net/lib/libnet/Makefile:1.19	Wed Aug 14 09:31:42 2013
+++ src/sys/rump/net/lib/libnet/Makefile	Thu Mar 13 02:06:32 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.19 2013/08/14 09:31:42 pooka Exp $
+#	$NetBSD: Makefile,v 1.20 2014/03/13 02:06:32 pooka Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../net ${.CURDIR}/../../../../compat/common
@@ -9,7 +9,7 @@ LIB=	rumpnet_net
 SRCS=	if.c if_loop.c route.c rtsock.c rtsock_50.c raw_usrreq.c	\
 	raw_cb.c if_media.c link_proto.c net_stats.c if_ethersubr.c
 SRCS+=	if_43.c pfil.c uipc_syscalls_50.c
-SRCS+=	component.c
+SRCS+=	net_component.c
 
 CPPFLAGS+=	-I${.CURDIR}/opt -I${.CURDIR}/../libnetinet/opt
 CPPFLAGS+=	-DCOMPAT_OIFREQ -DCOMPAT_OIFDATA

Added files:

Index: src/sys/rump/net/lib/libnet/net_component.c
diff -u /dev/null src/sys/rump/net/lib/libnet/net_component.c:1.1
--- /dev/null	Thu Mar 13 02:06:33 2014
+++ src/sys/rump/net/lib/libnet/net_component.c	Thu Mar 13 02:06:32 2014
@@ -0,0 +1,63 @@
+/*	$NetBSD: net_component.c,v 1.1 2014/03/13 02:06:32 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Development of this software was supported by The Nokia Foundation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: net_component.c,v 1.1 2014/03/13 02:06:32 pooka Exp $");
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "rump_private.h"
+#include "rump_net_private.h"
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET)
+{
+
+	ifinit1();
+	ifinit();
+}
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET_ROUTE)
+{
+	extern struct domain routedomain, compat_50_routedomain, linkdomain;
+
+	DOMAINADD(linkdomain);
+	DOMAINADD(routedomain);
+	DOMAINADD(compat_50_routedomain);
+}
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
+{
+
+	loopattach(1);
+}



CVS commit: src/sys/rump/net/lib/libagr

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 02:07:03 UTC 2014

Modified Files:
src/sys/rump/net/lib/libagr: Makefile
Added Files:
src/sys/rump/net/lib/libagr: agr_component.c
Removed Files:
src/sys/rump/net/lib/libagr: component.c

Log Message:
rename component.c -> agr_component.c


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libagr/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libagr/agr_component.c
cvs rdiff -u -r1.1 -r0 src/sys/rump/net/lib/libagr/component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libagr/Makefile
diff -u src/sys/rump/net/lib/libagr/Makefile:1.1 src/sys/rump/net/lib/libagr/Makefile:1.2
--- src/sys/rump/net/lib/libagr/Makefile:1.1	Wed Dec  8 20:20:17 2010
+++ src/sys/rump/net/lib/libagr/Makefile	Thu Mar 13 02:07:03 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2010/12/08 20:20:17 pooka Exp $
+#	$NetBSD: Makefile,v 1.2 2014/03/13 02:07:03 pooka Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../net/agr
@@ -12,7 +12,7 @@ SRCS=	if_agr.c if_agrsoftc.c if_agrsubr.
 	ieee8023ad_lacp_sm_ptx.c ieee8023ad_lacp_sm_tx.c \
 	ieee8023ad_lacp_debug.c ieee8023_tlv.c
 
-SRCS+=	component.c
+SRCS+=	agr_component.c
 
 .include 
 .include 

Added files:

Index: src/sys/rump/net/lib/libagr/agr_component.c
diff -u /dev/null src/sys/rump/net/lib/libagr/agr_component.c:1.1
--- /dev/null	Thu Mar 13 02:07:03 2014
+++ src/sys/rump/net/lib/libagr/agr_component.c	Thu Mar 13 02:07:03 2014
@@ -0,0 +1,42 @@
+/*	$NetBSD: agr_component.c,v 1.1 2014/03/13 02:07:03 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: agr_component.c,v 1.1 2014/03/13 02:07:03 pooka Exp $");
+
+#include 
+
+#include "rump_private.h"
+#include "rump_net_private.h"
+
+int agrattach(int);
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
+{
+
+	agrattach(0);
+}



CVS commit: src/sys/rump/net/lib/libnetbt

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 02:06:16 UTC 2014

Modified Files:
src/sys/rump/net/lib/libnetbt: Makefile
Added Files:
src/sys/rump/net/lib/libnetbt: netbt_component.c
Removed Files:
src/sys/rump/net/lib/libnetbt: component.c

Log Message:
rename component.c -> netbt_component.c


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/net/lib/libnetbt/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/rump/net/lib/libnetbt/component.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libnetbt/netbt_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnetbt/Makefile
diff -u src/sys/rump/net/lib/libnetbt/Makefile:1.3 src/sys/rump/net/lib/libnetbt/Makefile:1.4
--- src/sys/rump/net/lib/libnetbt/Makefile:1.3	Mon Nov 11 00:56:20 2013
+++ src/sys/rump/net/lib/libnetbt/Makefile	Thu Mar 13 02:06:16 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2013/11/11 00:56:20 joerg Exp $
+#	$NetBSD: Makefile,v 1.4 2014/03/13 02:06:16 pooka Exp $
 #
 
 .include 
@@ -20,7 +20,7 @@ SRCS=	bt_proto.c bt_sysctl.c		\
 COPTS.l2cap_signal.c=	-O0
 .endif
 .endif
-SRCS+=	component.c
+SRCS+=	netbt_component.c
 
 .include 
 .include 

Added files:

Index: src/sys/rump/net/lib/libnetbt/netbt_component.c
diff -u /dev/null src/sys/rump/net/lib/libnetbt/netbt_component.c:1.1
--- /dev/null	Thu Mar 13 02:06:16 2014
+++ src/sys/rump/net/lib/libnetbt/netbt_component.c	Thu Mar 13 02:06:16 2014
@@ -0,0 +1,43 @@
+/*	$NetBSD: netbt_component.c,v 1.1 2014/03/13 02:06:16 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: netbt_component.c,v 1.1 2014/03/13 02:06:16 pooka Exp $");
+
+#include 
+#include 
+#include 
+
+#include "rump_private.h"
+#include "rump_net_private.h"
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET)
+{
+	extern struct domain btdomain;
+
+	DOMAINADD(btdomain);
+}



CVS commit: src/sys/rump/net/lib/libsockin

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 02:05:50 UTC 2014

Modified Files:
src/sys/rump/net/lib/libsockin: Makefile
Added Files:
src/sys/rump/net/lib/libsockin: sockin_component.c
Removed Files:
src/sys/rump/net/lib/libsockin: component.c

Log Message:
rename component.c -> sockin_component.c


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/net/lib/libsockin/Makefile
cvs rdiff -u -r1.3 -r0 src/sys/rump/net/lib/libsockin/component.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libsockin/sockin_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libsockin/Makefile
diff -u src/sys/rump/net/lib/libsockin/Makefile:1.7 src/sys/rump/net/lib/libsockin/Makefile:1.8
--- src/sys/rump/net/lib/libsockin/Makefile:1.7	Thu Mar 13 01:40:30 2014
+++ src/sys/rump/net/lib/libsockin/Makefile	Thu Mar 13 02:05:49 2014
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.7 2014/03/13 01:40:30 pooka Exp $
+#	$NetBSD: Makefile,v 1.8 2014/03/13 02:05:49 pooka Exp $
 #
 
 LIB=	rumpnet_sockin
 
 SRCS=	sockin.c
-SRCS+=	component.c
+SRCS+=	sockin_component.c
 
 CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern
 

Added files:

Index: src/sys/rump/net/lib/libsockin/sockin_component.c
diff -u /dev/null src/sys/rump/net/lib/libsockin/sockin_component.c:1.1
--- /dev/null	Thu Mar 13 02:05:50 2014
+++ src/sys/rump/net/lib/libsockin/sockin_component.c	Thu Mar 13 02:05:49 2014
@@ -0,0 +1,47 @@
+/*	$NetBSD: sockin_component.c,v 1.1 2014/03/13 02:05:49 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Development of this software was supported by The Nokia Foundation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: sockin_component.c,v 1.1 2014/03/13 02:05:49 pooka Exp $");
+
+#include 
+#include 
+#include 
+
+#include "rump_private.h"
+#include "rump_net_private.h"
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET)
+{
+	extern struct domain sockindomain;
+	extern struct domain sockin6domain;
+
+	DOMAINADD(sockindomain);
+	DOMAINADD(sockin6domain);
+}



CVS commit: src/sys/rump/net/lib/libnetmpls

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 02:05:29 UTC 2014

Modified Files:
src/sys/rump/net/lib/libnetmpls: Makefile
Added Files:
src/sys/rump/net/lib/libnetmpls: netmpls_component.c
Removed Files:
src/sys/rump/net/lib/libnetmpls: component.c

Log Message:
rename component.c -> netmpls_component.c


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libnetmpls/Makefile
cvs rdiff -u -r1.2 -r0 src/sys/rump/net/lib/libnetmpls/component.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libnetmpls/netmpls_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnetmpls/Makefile
diff -u src/sys/rump/net/lib/libnetmpls/Makefile:1.1 src/sys/rump/net/lib/libnetmpls/Makefile:1.2
--- src/sys/rump/net/lib/libnetmpls/Makefile:1.1	Thu Jul 18 15:59:28 2013
+++ src/sys/rump/net/lib/libnetmpls/Makefile	Thu Mar 13 02:05:29 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2013/07/18 15:59:28 kefren Exp $
+# $NetBSD: Makefile,v 1.2 2014/03/13 02:05:29 pooka Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../net ${.CURDIR}/../../../../netmpls
@@ -6,7 +6,7 @@
 LIB=	rumpnet_netmpls
 
 SRCS=	mpls_ttl.c if_mpls.c
-SRCS+=	component.c
+SRCS+=	netmpls_component.c
 
 CPPFLAGS+=	-I${.CURDIR}/../libnet/opt
 

Added files:

Index: src/sys/rump/net/lib/libnetmpls/netmpls_component.c
diff -u /dev/null src/sys/rump/net/lib/libnetmpls/netmpls_component.c:1.1
--- /dev/null	Thu Mar 13 02:05:29 2014
+++ src/sys/rump/net/lib/libnetmpls/netmpls_component.c	Thu Mar 13 02:05:29 2014
@@ -0,0 +1,64 @@
+/* $NetBSD: netmpls_component.c,v 1.1 2014/03/13 02:05:29 pooka Exp $ */
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Development of this software was supported by The Nokia Foundation
+ *
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: netmpls_component.c,v 1.1 2014/03/13 02:05:29 pooka Exp $");
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include "rump_private.h"
+#include "rump_net_private.h"
+
+void ifmplsattach(int);
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET)
+{
+	extern struct domain mplsdomain;
+
+	DOMAINADD(mplsdomain);
+
+	rump_netisr_register(NETISR_MPLS, mplsintr);
+}
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
+{
+
+	ifmplsattach(0);
+}



CVS commit: src/sys/rump/net/lib/liblocal

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 02:04:59 UTC 2014

Modified Files:
src/sys/rump/net/lib/liblocal: Makefile
Added Files:
src/sys/rump/net/lib/liblocal: local_component.c
Removed Files:
src/sys/rump/net/lib/liblocal: component.c

Log Message:
rename component.c -> local_component.c


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/rump/net/lib/liblocal/Makefile
cvs rdiff -u -r1.2 -r0 src/sys/rump/net/lib/liblocal/component.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/liblocal/local_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/liblocal/Makefile
diff -u src/sys/rump/net/lib/liblocal/Makefile:1.5 src/sys/rump/net/lib/liblocal/Makefile:1.6
--- src/sys/rump/net/lib/liblocal/Makefile:1.5	Tue Feb 16 20:42:47 2010
+++ src/sys/rump/net/lib/liblocal/Makefile	Thu Mar 13 02:04:59 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2010/02/16 20:42:47 pooka Exp $
+#	$NetBSD: Makefile,v 1.6 2014/03/13 02:04:59 pooka Exp $
 #
 
 .PATH:	${.CURDIR}/../../../../kern
@@ -6,7 +6,7 @@
 LIB=	rumpnet_local
 
 SRCS=	uipc_proto.c uipc_usrreq.c
-SRCS+=	component.c
+SRCS+=	local_component.c
 
 .include 
 .include 

Added files:

Index: src/sys/rump/net/lib/liblocal/local_component.c
diff -u /dev/null src/sys/rump/net/lib/liblocal/local_component.c:1.1
--- /dev/null	Thu Mar 13 02:04:59 2014
+++ src/sys/rump/net/lib/liblocal/local_component.c	Thu Mar 13 02:04:59 2014
@@ -0,0 +1,45 @@
+/*	$NetBSD: local_component.c,v 1.1 2014/03/13 02:04:59 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Development of this software was supported by The Nokia Foundation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: local_component.c,v 1.1 2014/03/13 02:04:59 pooka Exp $");
+
+#include 
+#include 
+#include 
+
+#include "rump_private.h"
+#include "rump_net_private.h"
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET)
+{
+	extern struct domain unixdomain;
+
+	DOMAINADD(unixdomain);
+}



CVS commit: src/sys/rump/net/lib/libshmif

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 01:42:59 UTC 2014

Modified Files:
src/sys/rump/net/lib/libshmif: Makefile if_shmem.c
Added Files:
src/sys/rump/net/lib/libshmif: shmif_user.c shmif_user.h
Removed Files:
src/sys/rump/net/lib/libshmif: rumpcomp_user.c rumpcomp_user.h

Log Message:
rename rumpcomp_user.* -> shmif_user.*


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/net/lib/libshmif/Makefile
cvs rdiff -u -r1.58 -r1.59 src/sys/rump/net/lib/libshmif/if_shmem.c
cvs rdiff -u -r1.14 -r0 src/sys/rump/net/lib/libshmif/rumpcomp_user.c
cvs rdiff -u -r1.4 -r0 src/sys/rump/net/lib/libshmif/rumpcomp_user.h
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libshmif/shmif_user.c \
src/sys/rump/net/lib/libshmif/shmif_user.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/Makefile
diff -u src/sys/rump/net/lib/libshmif/Makefile:1.4 src/sys/rump/net/lib/libshmif/Makefile:1.5
--- src/sys/rump/net/lib/libshmif/Makefile:1.4	Sun Apr 28 10:43:45 2013
+++ src/sys/rump/net/lib/libshmif/Makefile	Thu Mar 13 01:42:59 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2013/04/28 10:43:45 pooka Exp $
+#	$NetBSD: Makefile,v 1.5 2014/03/13 01:42:59 pooka Exp $
 #
 
 LIB=	rumpnet_shmif
@@ -8,7 +8,7 @@ SRCS+=	component.c
 
 CPPFLAGS+=	-I${.CURDIR}/../../../librump/rumpkern
 
-RUMPCOMP_USER=	# filewatch
+RUMPCOMP_USER_SRCS=	shmif_user.c
 
 .include 
 .include 

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.58 src/sys/rump/net/lib/libshmif/if_shmem.c:1.59
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.58	Fri Sep 13 20:38:04 2013
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Thu Mar 13 01:42:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.58 2013/09/13 20:38:04 joerg Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.59 2014/03/13 01:42:59 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.58 2013/09/13 20:38:04 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.59 2014/03/13 01:42:59 pooka Exp $");
 
 #include 
 #include 
@@ -52,7 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v
 
 #include "rump_private.h"
 #include "rump_net_private.h"
-#include "rumpcomp_user.h"
+#include "shmif_user.h"
 
 static int shmif_clone(struct if_clone *, int);
 static int shmif_unclone(struct ifnet *);

Added files:

Index: src/sys/rump/net/lib/libshmif/shmif_user.c
diff -u /dev/null src/sys/rump/net/lib/libshmif/shmif_user.c:1.1
--- /dev/null	Thu Mar 13 01:42:59 2014
+++ src/sys/rump/net/lib/libshmif/shmif_user.c	Thu Mar 13 01:42:59 2014
@@ -0,0 +1,230 @@
+/*  $NetBSD: shmif_user.c,v 1.1 2014/03/13 01:42:59 pooka Exp $	*/
+
+/*-
+ * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#ifndef _KERNEL
+#include 
+#include 
+
+#include 
+
+#include 
+
+#include "shmif_user.h"
+
+#define seterr(_v_) if ((_v_) == -1) *error = errno; else *error = 0;
+
+/*
+ * On BSD we use kqueue, on Linux we use inotify.  The underlying
+ * interface requirements aren't quite the same, but we have a very
+ * good chance of doing the fd->path mapping on Linux thanks to dcache,
+ * so just keep the existing interfaces for now.
+ */
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) \
+|| defined(__OpenBSD__)
+#include 
+
+#include 
+
+int
+rumpcomp_shmif_watchsetup(int *kqp, int fd)
+{
+	struct kevent kev;
+	int rv, kq;
+
+	kq = *kqp;
+	if (kq == -1) {
+		kq = kqueue();
+		if (kq == -1) {
+			rv = errno;
+			goto 

CVS commit: src/sys/rump/net/lib/libsockin

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Mar 13 01:40:30 UTC 2014

Modified Files:
src/sys/rump/net/lib/libsockin: Makefile sockin.c
Added Files:
src/sys/rump/net/lib/libsockin: sockin_user.c sockin_user.h
Removed Files:
src/sys/rump/net/lib/libsockin: rumpcomp_user.c rumpcomp_user.h

Log Message:
rename rumpcomp_user.* -> sockin_user.*


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/rump/net/lib/libsockin/Makefile
cvs rdiff -u -r1.8 -r0 src/sys/rump/net/lib/libsockin/rumpcomp_user.c
cvs rdiff -u -r1.3 -r0 src/sys/rump/net/lib/libsockin/rumpcomp_user.h
cvs rdiff -u -r1.35 -r1.36 src/sys/rump/net/lib/libsockin/sockin.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libsockin/sockin_user.c \
src/sys/rump/net/lib/libsockin/sockin_user.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libsockin/Makefile
diff -u src/sys/rump/net/lib/libsockin/Makefile:1.6 src/sys/rump/net/lib/libsockin/Makefile:1.7
--- src/sys/rump/net/lib/libsockin/Makefile:1.6	Mon Mar 18 13:14:11 2013
+++ src/sys/rump/net/lib/libsockin/Makefile	Thu Mar 13 01:40:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2013/03/18 13:14:11 pooka Exp $
+#	$NetBSD: Makefile,v 1.7 2014/03/13 01:40:30 pooka Exp $
 #
 
 LIB=	rumpnet_sockin
@@ -8,7 +8,7 @@ SRCS+=	component.c
 
 CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern
 
-RUMPCOMP_USER=	#defined
+RUMPCOMP_USER_SRCS=	sockin_user.c
 
 .include 
 .include 

Index: src/sys/rump/net/lib/libsockin/sockin.c
diff -u src/sys/rump/net/lib/libsockin/sockin.c:1.35 src/sys/rump/net/lib/libsockin/sockin.c:1.36
--- src/sys/rump/net/lib/libsockin/sockin.c:1.35	Thu Aug 29 17:49:21 2013
+++ src/sys/rump/net/lib/libsockin/sockin.c	Thu Mar 13 01:40:30 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockin.c,v 1.35 2013/08/29 17:49:21 rmind Exp $	*/
+/*	$NetBSD: sockin.c,v 1.36 2014/03/13 01:40:30 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.35 2013/08/29 17:49:21 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.36 2014/03/13 01:40:30 pooka Exp $");
 
 #include 
 #include 
@@ -54,7 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1
 #include 
 
 #include "rump_private.h"
-#include "rumpcomp_user.h"
+#include "sockin_user.h"
 
 /*
  * An inet communication domain which uses the socket interface.

Added files:

Index: src/sys/rump/net/lib/libsockin/sockin_user.c
diff -u /dev/null src/sys/rump/net/lib/libsockin/sockin_user.c:1.1
--- /dev/null	Thu Mar 13 01:40:30 2014
+++ src/sys/rump/net/lib/libsockin/sockin_user.c	Thu Mar 13 01:40:30 2014
@@ -0,0 +1,587 @@
+/*	$NetBSD: sockin_user.c,v 1.1 2014/03/13 01:40:30 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* for struct msghdr content visibility */
+#define _XOPEN_SOURCE 4
+#define _XOPEN_SOURCE_EXTENDED 1
+
+#ifndef _KERNEL
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "sockin_user.h"
+
+#define seterror(_v_) if ((_v_) == -1) rv = errno; else rv = 0;
+
+#ifndef __arraycount
+#define __arraycount(a) (sizeof(a) / sizeof(*a))
+#endif
+
+#ifndef __UNCONST
+#define __UNCONST(a) ((void*)(const void*)a)
+#endif
+
+#include 
+#include 
+#include 
+
+
+static int translate_so_sockopt(int);
+static int translate_ip_sockopt(int);
+static int translate_tcp_sockopt(int);
+static int translate_domain(int);
+
+#define translate(_a_) case RUMP_##_a_: return _a_
+static int
+translate_so_sockopt(int lopt)
+{
+
+	switch (lopt) {
+	translate(S

CVS commit: src/sys/rump/net/lib/libvirtif

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 12 23:42:33 UTC 2014

Modified Files:
src/sys/rump/net/lib/libvirtif: Makefile.virtif
Added Files:
src/sys/rump/net/lib/libvirtif: virtif_component.c
Removed Files:
src/sys/rump/net/lib/libvirtif: component.c

Log Message:
component.c -> virtif_component.c, just to decrease risk of conflicts.
No runtime change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libvirtif/Makefile.virtif
cvs rdiff -u -r1.4 -r0 src/sys/rump/net/lib/libvirtif/component.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libvirtif/virtif_component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/Makefile.virtif
diff -u src/sys/rump/net/lib/libvirtif/Makefile.virtif:1.1 src/sys/rump/net/lib/libvirtif/Makefile.virtif:1.2
--- src/sys/rump/net/lib/libvirtif/Makefile.virtif:1.1	Wed Mar 12 23:40:58 2014
+++ src/sys/rump/net/lib/libvirtif/Makefile.virtif	Wed Mar 12 23:42:33 2014
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile.virtif,v 1.1 2014/03/12 23:40:58 pooka Exp $
+#	$NetBSD: Makefile.virtif,v 1.2 2014/03/12 23:42:33 pooka Exp $
 #
 
 .if !defined(VIRTIF)
 .error Define VIRTIF when including ${.PARSEFILE}
 .endif
 
-SRCS=	if_virt.c component.c
+SRCS=	if_virt.c virtif_component.c
 
 VIRTIFDIR:=	${.PARSEDIR}
 .PATH:		${VIRTIFDIR}

Added files:

Index: src/sys/rump/net/lib/libvirtif/virtif_component.c
diff -u /dev/null src/sys/rump/net/lib/libvirtif/virtif_component.c:1.1
--- /dev/null	Wed Mar 12 23:42:33 2014
+++ src/sys/rump/net/lib/libvirtif/virtif_component.c	Wed Mar 12 23:42:33 2014
@@ -0,0 +1,47 @@
+/*	$NetBSD: virtif_component.c,v 1.1 2014/03/12 23:42:33 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Development of this software was supported by The Nokia Foundation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: virtif_component.c,v 1.1 2014/03/12 23:42:33 pooka Exp $");
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include "rump_private.h"
+#include "if_virt.h"
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
+{
+	extern struct if_clone VIF_CLONER; /* XXX */
+
+	if_clone_attach(&VIF_CLONER);
+}



CVS commit: src/sys/rump/net/lib/libvirtif

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 12 23:40:58 UTC 2014

Modified Files:
src/sys/rump/net/lib/libvirtif: Makefile
Added Files:
src/sys/rump/net/lib/libvirtif: Makefile.virtif

Log Message:
Separate common bits for all interfaces implementing virtif hypercalls
from Makefile to Makefile.virtif.  The latter is meant to be .included.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/net/lib/libvirtif/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libvirtif/Makefile.virtif

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/Makefile
diff -u src/sys/rump/net/lib/libvirtif/Makefile:1.7 src/sys/rump/net/lib/libvirtif/Makefile:1.8
--- src/sys/rump/net/lib/libvirtif/Makefile:1.7	Thu Jul  4 11:46:51 2013
+++ src/sys/rump/net/lib/libvirtif/Makefile	Wed Mar 12 23:40:58 2014
@@ -1,16 +1,12 @@
-#	$NetBSD: Makefile,v 1.7 2013/07/04 11:46:51 pooka Exp $
+#	$NetBSD: Makefile,v 1.8 2014/03/12 23:40:58 pooka Exp $
 #
 
 LIB=	rumpnet_virtif
+VIRTIF=	virt
 
-SRCS=	if_virt.c
-SRCS+=	component.c
-
-CPPFLAGS+=	-I${.CURDIR}/../../../librump/rumpkern -I${.CURDIR}
-CPPFLAGS+=	-DVIRTIF_BASE=virt
+.include "${.CURDIR}/Makefile.virtif"
 
 RUMPCOMP_USER=	#defined
-RUMPCOMP_USER_CPPFLAGS+= -DVIRTIF_BASE=virt
 
 .include 
 .include 

Added files:

Index: src/sys/rump/net/lib/libvirtif/Makefile.virtif
diff -u /dev/null src/sys/rump/net/lib/libvirtif/Makefile.virtif:1.1
--- /dev/null	Wed Mar 12 23:40:58 2014
+++ src/sys/rump/net/lib/libvirtif/Makefile.virtif	Wed Mar 12 23:40:58 2014
@@ -0,0 +1,16 @@
+#	$NetBSD: Makefile.virtif,v 1.1 2014/03/12 23:40:58 pooka Exp $
+#
+
+.if !defined(VIRTIF)
+.error Define VIRTIF when including ${.PARSEFILE}
+.endif
+
+SRCS=	if_virt.c component.c
+
+VIRTIFDIR:=	${.PARSEDIR}
+.PATH:		${VIRTIFDIR}
+
+CPPFLAGS+=	-I${VIRTIFDIR}/../../../librump/rumpkern -I${VIRTIFDIR}
+CPPFLAGS+=	-DVIRTIF_BASE=${VIRTIF}
+
+RUMPCOMP_USER_CPPFLAGS+= -DVIRTIF_BASE=${VIRTIF} -I${VIRTIFDIR}



CVS commit: src/sys/rump/net/lib/libvirtif

2014-03-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 12 17:49:13 UTC 2014

Modified Files:
src/sys/rump/net/lib/libvirtif: if_virt.c

Log Message:
When sending, only load mbufs which have a length.  This is especially
useful for fragmented datagrams where the tail of the first packet is
full of nothing.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/rump/net/lib/libvirtif/if_virt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.39 src/sys/rump/net/lib/libvirtif/if_virt.c:1.40
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.39	Mon Mar  3 13:56:40 2014
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Wed Mar 12 17:49:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.39 2014/03/03 13:56:40 pooka Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.40 2014/03/12 17:49:13 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.39 2014/03/03 13:56:40 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.40 2014/03/12 17:49:13 pooka Exp $");
 
 #include 
 #include 
@@ -296,12 +296,15 @@ virtif_start(struct ifnet *ifp)
 		}
 
 		m = m0;
-		for (i = 0; i < LB_SH && m; i++) {
-			io[i].iov_base = mtod(m, void *);
-			io[i].iov_len = m->m_len;
+		for (i = 0; i < LB_SH && m; ) {
+			if (m->m_len) {
+io[i].iov_base = mtod(m, void *);
+io[i].iov_len = m->m_len;
+i++;
+			}
 			m = m->m_next;
 		}
-		if (i == LB_SH)
+		if (i == LB_SH && m)
 			panic("lazy bum");
 		bpf_mtap(ifp, m0);
 



CVS commit: src/sys/rump/net/lib/libnpf

2014-03-03 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Mar  3 19:09:52 UTC 2014

Modified Files:
src/sys/rump/net/lib/libnpf: Makefile

Log Message:
also include bsd.own.mk, so value for RUMP_NPF_TESTING can come from mk.conf


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/rump/net/lib/libnpf/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnpf/Makefile
diff -u src/sys/rump/net/lib/libnpf/Makefile:1.10 src/sys/rump/net/lib/libnpf/Makefile:1.11
--- src/sys/rump/net/lib/libnpf/Makefile:1.10	Mon Mar  3 14:01:30 2014
+++ src/sys/rump/net/lib/libnpf/Makefile	Mon Mar  3 19:09:52 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.10 2014/03/03 14:01:30 pooka Exp $
+#	$NetBSD: Makefile,v 1.11 2014/03/03 19:09:52 pooka Exp $
 #
 # Public Domain.
 #
@@ -19,6 +19,8 @@ SRCS+=	npf_ext_log.c npf_ext_normalize.c
 
 SRCS+=	component.c
 
+.include 
+
 .if ${RUMP_NPF_TESTING:Uyes} == "yes"
 CPPFLAGS+=	-D_NPF_TESTING
 .endif



CVS commit: src/sys/rump/net/lib/libnpf

2014-03-03 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Mar  3 14:01:30 UTC 2014

Modified Files:
src/sys/rump/net/lib/libnpf: Makefile

Log Message:
For now, make it possible to not specify -D_NPF_TESTING by compiling
with RUMP_NPF_TESTING_=no.  This in turn makes it possible to use npf
in a rump kernel for real packet filtering instead of just testing.

no change to default


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/net/lib/libnpf/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnpf/Makefile
diff -u src/sys/rump/net/lib/libnpf/Makefile:1.9 src/sys/rump/net/lib/libnpf/Makefile:1.10
--- src/sys/rump/net/lib/libnpf/Makefile:1.9	Fri Nov  8 00:38:27 2013
+++ src/sys/rump/net/lib/libnpf/Makefile	Mon Mar  3 14:01:30 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.9 2013/11/08 00:38:27 rmind Exp $
+#	$NetBSD: Makefile,v 1.10 2014/03/03 14:01:30 pooka Exp $
 #
 # Public Domain.
 #
@@ -19,7 +19,9 @@ SRCS+=	npf_ext_log.c npf_ext_normalize.c
 
 SRCS+=	component.c
 
+.if ${RUMP_NPF_TESTING:Uyes} == "yes"
 CPPFLAGS+=	-D_NPF_TESTING
+.endif
 CPPFLAGS+=	-I${.CURDIR}/../../../librump/rumpvfs
 
 .include 



CVS commit: src/sys/rump/net/lib/libvirtif

2014-03-03 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Mar  3 13:56:41 UTC 2014

Modified Files:
src/sys/rump/net/lib/libvirtif: if_virt.c if_virt.h rumpcomp_user.c
rumpcomp_user.h

Log Message:
Pull in the changes from the dpdk, netmap and snabb switch repos.
There are two major changes:

1) All thread context policy is pushed down to the hypercalls.
   This is meant to help performance-mongering implementations be
   able to control packet scheduling better (e.g. pin down packet
   reception to certain physical cores).
2) Generalize linkstr, meaning that the interface can now take an
   arbitrary string which is passed to the create() hypercall.  This can
   be used to map backend device characteristics to the rump kernel
   interface instance.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/rump/net/lib/libvirtif/if_virt.c
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libvirtif/if_virt.h
cvs rdiff -u -r1.11 -r1.12 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c
cvs rdiff -u -r1.5 -r1.6 src/sys/rump/net/lib/libvirtif/rumpcomp_user.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.38 src/sys/rump/net/lib/libvirtif/if_virt.c:1.39
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.38	Fri Feb 21 08:33:51 2014
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Mon Mar  3 13:56:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.38 2014/02/21 08:33:51 skrll Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.39 2014/03/03 13:56:40 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,24 +26,17 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.38 2014/02/21 08:33:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.39 2014/03/03 13:56:40 pooka Exp $");
 
 #include 
-#include 
-#include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
 
 #include 
 #include 
+#include 
 #include 
-#include 
 
 #include 
 #include 
@@ -70,14 +63,11 @@ static void	virtif_stop(struct ifnet *, 
 struct virtif_sc {
 	struct ethercom sc_ec;
 	struct virtif_user *sc_viu;
-	bool sc_dying;
-	struct lwp *sc_l_snd, *sc_l_rcv;
-	kmutex_t sc_mtx;
-	kcondvar_t sc_cv;
+
+	int sc_num;
+	char *sc_linkstr;
 };
 
-static void virtif_receiver(void *);
-static void virtif_sender(void *);
 static int  virtif_clone(struct if_clone *, int);
 static int  virtif_unclone(struct ifnet *);
 
@@ -85,60 +75,74 @@ struct if_clone VIF_CLONER =
 IF_CLONE_INITIALIZER(VIF_NAME, virtif_clone, virtif_unclone);
 
 static int
-virtif_clone(struct if_clone *ifc, int num)
+virtif_create(struct ifnet *ifp)
 {
-	struct virtif_sc *sc;
-	struct virtif_user *viu;
-	struct ifnet *ifp;
 	uint8_t enaddr[ETHER_ADDR_LEN] = { 0xb2, 0x0a, 0x00, 0x0b, 0x0e, 0x01 };
-	int error = 0;
+	char enaddrstr[3*ETHER_ADDR_LEN];
+	struct virtif_sc *sc = ifp->if_softc;
+	int error;
 
-	if (num >= 0x100)
-		return E2BIG;
+	if (sc->sc_viu)
+		panic("%s: already created", ifp->if_xname);
 
-	if ((error = VIFHYPER_CREATE(num, &viu)) != 0)
+	enaddr[2] = cprng_fast32() & 0xff;
+	enaddr[5] = sc->sc_num & 0xff;
+
+	if ((error = VIFHYPER_CREATE(sc->sc_linkstr,
+	sc, enaddr, &sc->sc_viu)) != 0) {
+		printf("VIFHYPER_CREATE failed: %d\n", error);
 		return error;
+	}
 
-	enaddr[2] = cprng_fast32() & 0xff;
-	enaddr[5] = num;
+	ether_ifattach(ifp, enaddr);
+	ether_snprintf(enaddrstr, sizeof(enaddrstr), enaddr);
+	aprint_normal_ifnet(ifp, "Ethernet address %s\n", enaddrstr);
 
-	sc = kmem_zalloc(sizeof(*sc), KM_SLEEP);
-	sc->sc_dying = false;
-	sc->sc_viu = viu;
+	IFQ_SET_READY(&ifp->if_snd);
 
-	mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_NONE);
-	cv_init(&sc->sc_cv, VIF_NAME "snd");
+	return 0;
+}
+
+static int
+virtif_clone(struct if_clone *ifc, int num)
+{
+	struct virtif_sc *sc;
+	struct ifnet *ifp;
+	int error = 0;
+
+	sc = kmem_zalloc(sizeof(*sc), KM_SLEEP);
+	sc->sc_num = num;
 	ifp = &sc->sc_ec.ec_if;
 	sprintf(ifp->if_xname, "%s%d", VIF_NAME, num);
 	ifp->if_softc = sc;
 
-	if (rump_threads) {
-		if ((error = kthread_create(PRI_NONE, KTHREAD_MUSTJOIN, NULL,
-		virtif_receiver, ifp, &sc->sc_l_rcv, VIF_NAME "ifr")) != 0)
-			goto out;
-
-		if ((error = kthread_create(PRI_NONE,
-		KTHREAD_MUSTJOIN | KTHREAD_MPSAFE, NULL,
-		virtif_sender, ifp, &sc->sc_l_snd, VIF_NAME "ifs")) != 0)
-			goto out;
-	} else {
-		printf("WARNING: threads not enabled, receive NOT working\n");
-	}
-
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 	ifp->if_init = virtif_init;
 	ifp->if_ioctl = virtif_ioctl;
 	ifp->if_start = virtif_start;
 	ifp->if_stop = virtif_stop;
-	IFQ_SET_READY(&ifp->if_snd);
+	ifp->if_mtu = ETHERMTU;
+	ifp->if_dlt = DLT_EN10MB;
 
 	if_attach(ifp);
-	ether_ifattach(ifp, enaddr);
 
- out:
+#ifndef RUMP_VIF_LINKSTR
+	/*
+	 * if the underlying interface does not expect link

CVS commit: src/sys/rump/net/lib/libnpf

2014-02-25 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Feb 26 02:39:29 UTC 2014

Modified Files:
src/sys/rump/net/lib/libnpf: component.c

Log Message:
Run constructor as part of network faction bootstrap, not device
(rumpdev no longer necessary)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libnpf/component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnpf/component.c
diff -u src/sys/rump/net/lib/libnpf/component.c:1.2 src/sys/rump/net/lib/libnpf/component.c:1.3
--- src/sys/rump/net/lib/libnpf/component.c:1.2	Sun Mar 10 21:01:19 2013
+++ src/sys/rump/net/lib/libnpf/component.c	Wed Feb 26 02:39:29 2014
@@ -1,11 +1,11 @@
-/*	$NetBSD: component.c,v 1.2 2013/03/10 21:01:19 christos Exp $	*/
+/*	$NetBSD: component.c,v 1.3 2014/02/26 02:39:29 pooka Exp $	*/
 
 /*
  * Public Domain.
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: component.c,v 1.2 2013/03/10 21:01:19 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: component.c,v 1.3 2014/02/26 02:39:29 pooka Exp $");
 
 #include 
 #include 
@@ -17,7 +17,7 @@ __KERNEL_RCSID(0, "$NetBSD: component.c,
 
 extern const struct cdevsw npf_cdevsw;
 
-RUMP_COMPONENT(RUMP_COMPONENT_DEV)
+RUMP_COMPONENT(RUMP_COMPONENT_NET)
 {
 	devmajor_t bmajor = NODEVMAJOR, cmajor = NODEVMAJOR;
 	int error;



CVS commit: src/sys/rump/net/lib/libvirtif

2014-02-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Feb 21 08:33:51 UTC 2014

Modified Files:
src/sys/rump/net/lib/libvirtif: if_virt.c

Log Message:
Fix typo in fix for PR/48606


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/rump/net/lib/libvirtif/if_virt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.37 src/sys/rump/net/lib/libvirtif/if_virt.c:1.38
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.37	Fri Feb 21 02:10:40 2014
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Fri Feb 21 08:33:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.37 2014/02/21 02:10:40 christos Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.38 2014/02/21 08:33:51 skrll Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.37 2014/02/21 02:10:40 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.38 2014/02/21 08:33:51 skrll Exp $");
 
 #include 
 #include 
@@ -278,7 +278,7 @@ virtif_receiver(void *arg)
 		m->m_len = m->m_pkthdr.len = n;
 		m->m_pkthdr.rcvif = ifp;
 		bpf_mtap(ifp, m);
-		(*ipf->if_input)(ifp, m);
+		(*ifp->if_input)(ifp, m);
 	}
 
 	kthread_exit(0);



CVS commit: src/sys/rump/net/lib/libshmif

2014-01-08 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jan  8 11:06:33 UTC 2014

Modified Files:
src/sys/rump/net/lib/libshmif: rumpcomp_user.c

Log Message:
OpenBSD has kqueue


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/rump/net/lib/libshmif/rumpcomp_user.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/rumpcomp_user.c
diff -u src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.13 src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.14
--- src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.13	Thu Jul  4 17:46:14 2013
+++ src/sys/rump/net/lib/libshmif/rumpcomp_user.c	Wed Jan  8 11:06:33 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpcomp_user.c,v 1.13 2013/07/04 17:46:14 pooka Exp $	*/
+/*  $NetBSD: rumpcomp_user.c,v 1.14 2014/01/08 11:06:33 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -42,7 +42,8 @@
  * good chance of doing the fd->path mapping on Linux thanks to dcache,
  * so just keep the existing interfaces for now.
  */
-#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) \
+|| defined(__OpenBSD__)
 #include 
 
 #include 



CVS commit: src/sys/rump/net/lib/libshmif

2013-12-20 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Dec 20 10:00:59 UTC 2013

Modified Files:
src/sys/rump/net/lib/libshmif: shmif_busops.c

Log Message:
use _KERNEL_RCSID only in _KERNEL, _RCSID elsewhere


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/rump/net/lib/libshmif/shmif_busops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/shmif_busops.c
diff -u src/sys/rump/net/lib/libshmif/shmif_busops.c:1.10 src/sys/rump/net/lib/libshmif/shmif_busops.c:1.11
--- src/sys/rump/net/lib/libshmif/shmif_busops.c:1.10	Fri Dec 20 09:06:35 2013
+++ src/sys/rump/net/lib/libshmif/shmif_busops.c	Fri Dec 20 10:00:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: shmif_busops.c,v 1.10 2013/12/20 09:06:35 pooka Exp $	*/
+/*	$NetBSD: shmif_busops.c,v 1.11 2013/12/20 10:00:59 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -27,8 +27,13 @@
  * SUCH DAMAGE.
  */
 
+#ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: shmif_busops.c,v 1.10 2013/12/20 09:06:35 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: shmif_busops.c,v 1.11 2013/12/20 10:00:59 pooka Exp $");
+#else
+#include 
+__RCSID("$NetBSD: shmif_busops.c,v 1.11 2013/12/20 10:00:59 pooka Exp $");
+#endif
 
 #include 
 



CVS commit: src/sys/rump/net/lib/libshmif

2013-12-20 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Dec 20 09:06:35 UTC 2013

Modified Files:
src/sys/rump/net/lib/libshmif: shmif_busops.c shmifvar.h

Log Message:
header massage, mostly improves portability


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/net/lib/libshmif/shmif_busops.c
cvs rdiff -u -r1.6 -r1.7 src/sys/rump/net/lib/libshmif/shmifvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/shmif_busops.c
diff -u src/sys/rump/net/lib/libshmif/shmif_busops.c:1.9 src/sys/rump/net/lib/libshmif/shmif_busops.c:1.10
--- src/sys/rump/net/lib/libshmif/shmif_busops.c:1.9	Mon Mar 21 16:41:09 2011
+++ src/sys/rump/net/lib/libshmif/shmif_busops.c	Fri Dec 20 09:06:35 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: shmif_busops.c,v 1.9 2011/03/21 16:41:09 pooka Exp $	*/
+/*	$NetBSD: shmif_busops.c,v 1.10 2013/12/20 09:06:35 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,19 +28,17 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: shmif_busops.c,v 1.9 2011/03/21 16:41:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: shmif_busops.c,v 1.10 2013/12/20 09:06:35 pooka Exp $");
 
 #include 
-#include 
 
 #ifndef _KERNEL
 #include 
+#include 
 #include 
 #include 
 
 #define KASSERT(a) assert(a)
-#else
-#include 
 #endif
 
 #include "shmifvar.h"

Index: src/sys/rump/net/lib/libshmif/shmifvar.h
diff -u src/sys/rump/net/lib/libshmif/shmifvar.h:1.6 src/sys/rump/net/lib/libshmif/shmifvar.h:1.7
--- src/sys/rump/net/lib/libshmif/shmifvar.h:1.6	Mon Mar 21 16:41:09 2011
+++ src/sys/rump/net/lib/libshmif/shmifvar.h	Fri Dec 20 09:06:35 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: shmifvar.h,v 1.6 2011/03/21 16:41:09 pooka Exp $	*/
+/*	$NetBSD: shmifvar.h,v 1.7 2013/12/20 09:06:35 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -63,6 +63,7 @@ struct shmif_pkthdr {
 
 #if 0
 #ifdef _KERNEL
+#include 
 #define DPRINTF(x) rumpuser_dprintf x
 #else
 #define DPRINTF(x) printf x



CVS commit: src/sys/rump/net/lib/libnetbt

2013-11-10 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Nov 11 00:56:20 UTC 2013

Modified Files:
src/sys/rump/net/lib/libnetbt: Makefile

Log Message:
Fix syntax for undefined HAVE_GCC.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libnetbt/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnetbt/Makefile
diff -u src/sys/rump/net/lib/libnetbt/Makefile:1.2 src/sys/rump/net/lib/libnetbt/Makefile:1.3
--- src/sys/rump/net/lib/libnetbt/Makefile:1.2	Thu Nov  7 21:30:58 2013
+++ src/sys/rump/net/lib/libnetbt/Makefile	Mon Nov 11 00:56:20 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2013/11/07 21:30:58 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2013/11/11 00:56:20 joerg Exp $
 #
 
 .include 
@@ -15,7 +15,7 @@ SRCS=	bt_proto.c bt_sysctl.c		\
 	rfcomm_dlc.c rfcomm_session.c rfcomm_socket.c rfcomm_upper.c	\
 	sco_socket.c sco_upper.c
 
-.if ${HAVE_GCC} && ${HAVE_GCC} == 48
+.if ${HAVE_GCC:U} == "48"
 .if ${MACHINE_ARCH} == "sh3eb" || ${MACHINE_ARCH} == "sh3el"
 COPTS.l2cap_signal.c=	-O0
 .endif



CVS commit: src/sys/rump/net/lib/libnetbt

2013-11-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov  7 21:30:58 UTC 2013

Modified Files:
src/sys/rump/net/lib/libnetbt: Makefile

Log Message:
avoid gcc bug on sh3


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libnetbt/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnetbt/Makefile
diff -u src/sys/rump/net/lib/libnetbt/Makefile:1.1 src/sys/rump/net/lib/libnetbt/Makefile:1.2
--- src/sys/rump/net/lib/libnetbt/Makefile:1.1	Mon Mar 22 08:08:44 2010
+++ src/sys/rump/net/lib/libnetbt/Makefile	Thu Nov  7 16:30:58 2013
@@ -1,6 +1,8 @@
-#	$NetBSD: Makefile,v 1.1 2010/03/22 12:08:44 pooka Exp $
+#	$NetBSD: Makefile,v 1.2 2013/11/07 21:30:58 christos Exp $
 #
 
+.include 
+
 .PATH:	${.CURDIR}/../../../../netbt
 
 LIB=	rumpnet_netbt
@@ -13,6 +15,11 @@ SRCS=	bt_proto.c bt_sysctl.c		\
 	rfcomm_dlc.c rfcomm_session.c rfcomm_socket.c rfcomm_upper.c	\
 	sco_socket.c sco_upper.c
 
+.if ${HAVE_GCC} && ${HAVE_GCC} == 48
+.if ${MACHINE_ARCH} == "sh3eb" || ${MACHINE_ARCH} == "sh3el"
+COPTS.l2cap_signal.c=	-O0
+.endif
+.endif
 SRCS+=	component.c
 
 .include 



CVS commit: src/sys/rump/net/lib/libvirtif

2013-10-27 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Oct 27 16:03:20 UTC 2013

Modified Files:
src/sys/rump/net/lib/libvirtif: rumpcomp_user.c rumpcomp_user.h

Log Message:
Give the hypercall interface a version number.  This is for
implementations outside of the tree.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/net/lib/libvirtif/rumpcomp_user.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/rumpcomp_user.c
diff -u src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.10 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.11
--- src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.10	Tue Jul 16 21:14:42 2013
+++ src/sys/rump/net/lib/libvirtif/rumpcomp_user.c	Sun Oct 27 16:03:19 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpcomp_user.c,v 1.10 2013/07/16 21:14:42 pooka Exp $	*/
+/*	$NetBSD: rumpcomp_user.c,v 1.11 2013/10/27 16:03:19 pooka Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -48,6 +48,10 @@
 #include "if_virt.h"
 #include "rumpcomp_user.h"
 
+#if VIFHYPER_REVISION != 20130704
+#error VIFHYPER_REVISION mismatch
+#endif
+
 struct virtif_user {
 	int viu_fd;
 	int viu_dying;

Index: src/sys/rump/net/lib/libvirtif/rumpcomp_user.h
diff -u src/sys/rump/net/lib/libvirtif/rumpcomp_user.h:1.4 src/sys/rump/net/lib/libvirtif/rumpcomp_user.h:1.5
--- src/sys/rump/net/lib/libvirtif/rumpcomp_user.h:1.4	Thu Jul  4 11:46:51 2013
+++ src/sys/rump/net/lib/libvirtif/rumpcomp_user.h	Sun Oct 27 16:03:19 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpcomp_user.h,v 1.4 2013/07/04 11:46:51 pooka Exp $	*/
+/*	$NetBSD: rumpcomp_user.h,v 1.5 2013/10/27 16:03:19 pooka Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -27,6 +27,8 @@
 
 struct virtif_user;
 
+#define VIFHYPER_REVISION 20130704
+
 int 	VIFHYPER_CREATE(int, struct virtif_user **);
 void	VIFHYPER_DYING(struct virtif_user *);
 void	VIFHYPER_DESTROY(struct virtif_user *);



CVS commit: src/sys/rump/net/lib/libshmif

2013-09-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Sep 13 20:38:04 UTC 2013

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
Remove busversion.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/rump/net/lib/libshmif/if_shmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.57 src/sys/rump/net/lib/libshmif/if_shmem.c:1.58
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.57	Mon Jul 22 21:12:03 2013
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Fri Sep 13 20:38:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.57 2013/07/22 21:12:03 pooka Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.58 2013/09/13 20:38:04 joerg Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.57 2013/07/22 21:12:03 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.58 2013/09/13 20:38:04 joerg Exp $");
 
 #include 
 #include 
@@ -99,8 +99,6 @@ struct shmif_sc {
 	bool sc_dying;
 };
 
-static const uint32_t busversion = SHMIF_VERSION;
-
 static void shmif_rcv(void *);
 
 #define LOCK_UNLOCKED	0



CVS commit: src/sys/rump/net/lib

2013-08-14 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Aug 14 09:55:05 UTC 2013

Modified Files:
src/sys/rump/net/lib/libnetinet: component.c
src/sys/rump/net/lib/libnetinet6: component.c

Log Message:
Partially revert previous, there are still a few gotchas in
running ipv4/ipv6-only (too many dependencies on ifdefs).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/net/lib/libnetinet/component.c
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libnetinet6/component.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libnetinet/component.c
diff -u src/sys/rump/net/lib/libnetinet/component.c:1.7 src/sys/rump/net/lib/libnetinet/component.c:1.8
--- src/sys/rump/net/lib/libnetinet/component.c:1.7	Wed Aug 14 09:31:42 2013
+++ src/sys/rump/net/lib/libnetinet/component.c	Wed Aug 14 09:55:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: component.c,v 1.7 2013/08/14 09:31:42 pooka Exp $	*/
+/*	$NetBSD: component.c,v 1.8 2013/08/14 09:55:05 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: component.c,v 1.7 2013/08/14 09:31:42 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: component.c,v 1.8 2013/08/14 09:55:05 pooka Exp $");
 
 #include 
 #include 
@@ -46,10 +46,11 @@ int carpattach(int);
 
 RUMP_COMPONENT(RUMP_COMPONENT_NET)
 {
-	extern struct domain arpdomain, inetdomain;
+	extern struct domain arpdomain, inetdomain, inet6domain;
 
 	DOMAINADD(arpdomain);
 	DOMAINADD(inetdomain);
+	DOMAINADD(inet6domain);
 
 	carpattach(1);
 }

Index: src/sys/rump/net/lib/libnetinet6/component.c
diff -u src/sys/rump/net/lib/libnetinet6/component.c:1.1 src/sys/rump/net/lib/libnetinet6/component.c:1.2
--- src/sys/rump/net/lib/libnetinet6/component.c:1.1	Wed Aug 14 09:31:42 2013
+++ src/sys/rump/net/lib/libnetinet6/component.c	Wed Aug 14 09:55:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: component.c,v 1.1 2013/08/14 09:31:42 pooka Exp $	*/
+/*	$NetBSD: component.c,v 1.2 2013/08/14 09:55:05 pooka Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: component.c,v 1.1 2013/08/14 09:31:42 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: component.c,v 1.2 2013/08/14 09:55:05 pooka Exp $");
 
 #include 
 #include 
@@ -38,12 +38,14 @@ __KERNEL_RCSID(0, "$NetBSD: component.c,
 #include "rump_private.h"
 #include "rump_net_private.h"
 
+#ifdef notyet
 RUMP_COMPONENT(RUMP_COMPONENT_NET)
 {
 	extern struct domain inet6domain;
 
 	DOMAINADD(inet6domain);
 }
+#endif
 
 RUMP_COMPONENT(RUMP_COMPONENT_NET_IFCFG)
 {



CVS commit: src/sys/rump/net/lib/libshmif

2013-07-22 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Jul 22 21:12:03 UTC 2013

Modified Files:
src/sys/rump/net/lib/libshmif: if_shmem.c

Log Message:
In recv, align data after ether_header at _ALIGN_BYTES.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/rump/net/lib/libshmif/if_shmem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/if_shmem.c
diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.56 src/sys/rump/net/lib/libshmif/if_shmem.c:1.57
--- src/sys/rump/net/lib/libshmif/if_shmem.c:1.56	Fri Jun 14 05:59:50 2013
+++ src/sys/rump/net/lib/libshmif/if_shmem.c	Mon Jul 22 21:12:03 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_shmem.c,v 1.56 2013/06/14 05:59:50 pooka Exp $	*/
+/*	$NetBSD: if_shmem.c,v 1.57 2013/07/22 21:12:03 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.56 2013/06/14 05:59:50 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.57 2013/07/22 21:12:03 pooka Exp $");
 
 #include 
 #include 
@@ -647,6 +647,8 @@ shmif_rcv(void *arg)
 	uint32_t nextpkt;
 	bool wrap, passup;
 	int error;
+	const int align
+	= ALIGN(sizeof(struct ether_header)) - sizeof(struct ether_header);
 
  reup:
 	mutex_enter(&sc->sc_mtx);
@@ -662,6 +664,7 @@ shmif_rcv(void *arg)
 		if (m == NULL) {
 			m = m_gethdr(M_WAIT, MT_DATA);
 			MCLGET(m, M_WAIT);
+			m->m_data += align;
 		}
 
 		DPRINTF(("waiting %d/%" PRIu64 "\n",



CVS commit: src/sys/rump/net/lib/libvirtif

2013-07-16 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Jul 16 21:14:42 UTC 2013

Modified Files:
src/sys/rump/net/lib/libvirtif: rumpcomp_user.c

Log Message:
A simple (void) is apparently too easy and traditional to make
Wunused-result STFU, so let's invent something a bit more verbose to
try to achieve the desired result of "ccg xnaht I really don't care if
you think I should check the return value".


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/rumpcomp_user.c
diff -u src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.9 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.10
--- src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.9	Tue Jul 16 19:44:31 2013
+++ src/sys/rump/net/lib/libvirtif/rumpcomp_user.c	Tue Jul 16 21:14:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpcomp_user.c,v 1.9 2013/07/16 19:44:31 pooka Exp $	*/
+/*	$NetBSD: rumpcomp_user.c,v 1.10 2013/07/16 21:14:42 pooka Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -132,9 +132,19 @@ VIFHYPER_SEND(struct virtif_user *viu,
 	struct iovec *iov, size_t iovlen)
 {
 	void *cookie = rumpuser_component_unschedule();
+	ssize_t idontcare __attribute__((__unused__));
 
-	/* no need to check for return value; packets may be dropped */
-	(void)writev(viu->viu_fd, iov, iovlen);
+	/*
+	 * no need to check for return value; packets may be dropped
+	 *
+	 * ... sorry, I spoke too soon.  We need to check it because
+	 * apparently gcc reinvented const poisoning and it's very
+	 * hard to say "thanks, I know I'm not using the result,
+	 * but please STFU and let's get on with something useful".
+	 * So let's trick gcc into letting us share the compiler
+	 * experience.
+	 */
+	idontcare = writev(viu->viu_fd, iov, iovlen);
 
 	rumpuser_component_schedule(cookie);
 }



CVS commit: src/sys/rump/net/lib/libvirtif

2013-07-16 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Jul 16 19:44:31 UTC 2013

Modified Files:
src/sys/rump/net/lib/libvirtif: rumpcomp_user.c

Log Message:
Explicitly ignore return value of writev() for sending a packet.

Otherwise you get the following with some compilers:
warning: ignoring return value of 'writev', declared with attribute 
warn_unused_result [-Wunused-result]


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/rumpcomp_user.c
diff -u src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.8 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.9
--- src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.8	Thu Jul  4 11:46:51 2013
+++ src/sys/rump/net/lib/libvirtif/rumpcomp_user.c	Tue Jul 16 19:44:31 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpcomp_user.c,v 1.8 2013/07/04 11:46:51 pooka Exp $	*/
+/*	$NetBSD: rumpcomp_user.c,v 1.9 2013/07/16 19:44:31 pooka Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -134,7 +134,7 @@ VIFHYPER_SEND(struct virtif_user *viu,
 	void *cookie = rumpuser_component_unschedule();
 
 	/* no need to check for return value; packets may be dropped */
-	writev(viu->viu_fd, iov, iovlen);
+	(void)writev(viu->viu_fd, iov, iovlen);
 
 	rumpuser_component_schedule(cookie);
 }



CVS commit: src/sys/rump/net/lib/libshmif

2013-07-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jul  4 17:46:14 UTC 2013

Modified Files:
src/sys/rump/net/lib/libshmif: rumpcomp_user.c

Log Message:
Use kqueue on *BSD, not just NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/rump/net/lib/libshmif/rumpcomp_user.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libshmif/rumpcomp_user.c
diff -u src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.12 src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.13
--- src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.12	Tue Jun  4 14:54:34 2013
+++ src/sys/rump/net/lib/libshmif/rumpcomp_user.c	Thu Jul  4 17:46:14 2013
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpcomp_user.c,v 1.12 2013/06/04 14:54:34 pooka Exp $	*/
+/*  $NetBSD: rumpcomp_user.c,v 1.13 2013/07/04 17:46:14 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -37,14 +37,16 @@
 #define seterr(_v_) if ((_v_) == -1) *error = errno; else *error = 0;
 
 /*
- * On NetBSD we use kqueue, on Linux we use inotify.  The underlying
+ * On BSD we use kqueue, on Linux we use inotify.  The underlying
  * interface requirements aren't quite the same, but we have a very
  * good chance of doing the fd->path mapping on Linux thanks to dcache,
  * so just keep the existing interfaces for now.
  */
-#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
 #include 
 
+#include 
+
 int
 rumpcomp_shmif_watchsetup(int *kqp, int fd)
 {



CVS commit: src/sys/rump/net/lib/libvirtif

2013-07-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jul  4 11:58:11 UTC 2013

Modified Files:
src/sys/rump/net/lib/libvirtif: if_virt.h

Log Message:
Add a note explaining why there's a homegrown __STRING, __CONCAT, etc.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libvirtif/if_virt.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.h
diff -u src/sys/rump/net/lib/libvirtif/if_virt.h:1.1 src/sys/rump/net/lib/libvirtif/if_virt.h:1.2
--- src/sys/rump/net/lib/libvirtif/if_virt.h:1.1	Thu Jul  4 11:46:51 2013
+++ src/sys/rump/net/lib/libvirtif/if_virt.h	Thu Jul  4 11:58:11 2013
@@ -1,4 +1,8 @@
-/*	$NetBSD: if_virt.h,v 1.1 2013/07/04 11:46:51 pooka Exp $	*/
+/*	$NetBSD: if_virt.h,v 1.2 2013/07/04 11:58:11 pooka Exp $	*/
+
+/*
+ * NOTE!  This file is supposed to work on !NetBSD platforms.
+ */
 
 #ifndef VIRTIF_BASE
 #error Define VIRTIF_BASE



CVS commit: src/sys/rump/net/lib/libvirtif

2013-07-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jul  4 11:46:51 UTC 2013

Modified Files:
src/sys/rump/net/lib/libvirtif: Makefile component.c if_virt.c
rumpcomp_user.c rumpcomp_user.h
Added Files:
src/sys/rump/net/lib/libvirtif: if_virt.h

Log Message:
Determine the interface name and the names of exported symbols based
on VIRTIF_BASE.  This allows using various different packet-shoveling
backends in the same rump kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/rump/net/lib/libvirtif/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/net/lib/libvirtif/component.c \
src/sys/rump/net/lib/libvirtif/rumpcomp_user.h
cvs rdiff -u -r1.35 -r1.36 src/sys/rump/net/lib/libvirtif/if_virt.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libvirtif/if_virt.h
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/Makefile
diff -u src/sys/rump/net/lib/libvirtif/Makefile:1.6 src/sys/rump/net/lib/libvirtif/Makefile:1.7
--- src/sys/rump/net/lib/libvirtif/Makefile:1.6	Fri Mar 15 11:30:23 2013
+++ src/sys/rump/net/lib/libvirtif/Makefile	Thu Jul  4 11:46:51 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2013/03/15 11:30:23 pooka Exp $
+#	$NetBSD: Makefile,v 1.7 2013/07/04 11:46:51 pooka Exp $
 #
 
 LIB=	rumpnet_virtif
@@ -7,8 +7,10 @@ SRCS=	if_virt.c
 SRCS+=	component.c
 
 CPPFLAGS+=	-I${.CURDIR}/../../../librump/rumpkern -I${.CURDIR}
+CPPFLAGS+=	-DVIRTIF_BASE=virt
 
 RUMPCOMP_USER=	#defined
+RUMPCOMP_USER_CPPFLAGS+= -DVIRTIF_BASE=virt
 
 .include 
 .include 

Index: src/sys/rump/net/lib/libvirtif/component.c
diff -u src/sys/rump/net/lib/libvirtif/component.c:1.3 src/sys/rump/net/lib/libvirtif/component.c:1.4
--- src/sys/rump/net/lib/libvirtif/component.c:1.3	Tue Oct 19 19:19:41 2010
+++ src/sys/rump/net/lib/libvirtif/component.c	Thu Jul  4 11:46:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: component.c,v 1.3 2010/10/19 19:19:41 pooka Exp $	*/
+/*	$NetBSD: component.c,v 1.4 2013/07/04 11:46:51 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: component.c,v 1.3 2010/10/19 19:19:41 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: component.c,v 1.4 2013/07/04 11:46:51 pooka Exp $");
 
 #include 
 #include 
@@ -38,10 +38,11 @@ __KERNEL_RCSID(0, "$NetBSD: component.c,
 
 #include "rump_private.h"
 #include "rump_net_private.h"
+#include "if_virt.h"
 
 RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
 {
-	extern struct if_clone virtif_cloner; /* XXX */
+	extern struct if_clone VIF_CLONER; /* XXX */
 
-	if_clone_attach(&virtif_cloner);
+	if_clone_attach(&VIF_CLONER);
 }
Index: src/sys/rump/net/lib/libvirtif/rumpcomp_user.h
diff -u src/sys/rump/net/lib/libvirtif/rumpcomp_user.h:1.3 src/sys/rump/net/lib/libvirtif/rumpcomp_user.h:1.4
--- src/sys/rump/net/lib/libvirtif/rumpcomp_user.h:1.3	Tue Apr 30 00:03:54 2013
+++ src/sys/rump/net/lib/libvirtif/rumpcomp_user.h	Thu Jul  4 11:46:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpcomp_user.h,v 1.3 2013/04/30 00:03:54 pooka Exp $	*/
+/*	$NetBSD: rumpcomp_user.h,v 1.4 2013/07/04 11:46:51 pooka Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -27,9 +27,9 @@
 
 struct virtif_user;
 
-int 	rumpcomp_virtif_create(int, struct virtif_user **);
-void	rumpcomp_virtif_dying(struct virtif_user *);
-void	rumpcomp_virtif_destroy(struct virtif_user *);
+int 	VIFHYPER_CREATE(int, struct virtif_user **);
+void	VIFHYPER_DYING(struct virtif_user *);
+void	VIFHYPER_DESTROY(struct virtif_user *);
 
-void	rumpcomp_virtif_send(struct virtif_user *, struct iovec *, size_t);
-int	rumpcomp_virtif_recv(struct virtif_user *, void *, size_t, size_t *);
+void	VIFHYPER_SEND(struct virtif_user *, struct iovec *, size_t);
+int	VIFHYPER_RECV(struct virtif_user *, void *, size_t, size_t *);

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.35 src/sys/rump/net/lib/libvirtif/if_virt.c:1.36
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.35	Wed Jul  3 20:17:07 2013
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Thu Jul  4 11:46:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.35 2013/07/03 20:17:07 pooka Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.36 2013/07/04 11:46:51 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.35 2013/07/03 20:17:07 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.36 2013/07/04 11:46:51 pooka Exp $");
 
 #include 
 #include 
@@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 
 #include "rump_private.h"
 #include "rump_net_private.h"
 
+#include "if_virt.h"
 #include "rumpcomp_user.h"
 
 /*
@@ -61,10 +62,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 
  * hypercall implementation.
  */
 
-#ifndef V

CVS commit: src/sys/rump/net/lib/libsockin

2013-07-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jul  4 09:58:28 UTC 2013

Modified Files:
src/sys/rump/net/lib/libsockin: rumpcomp_user.c

Log Message:
Avoid not-used warning on NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/net/lib/libsockin/rumpcomp_user.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libsockin/rumpcomp_user.c
diff -u src/sys/rump/net/lib/libsockin/rumpcomp_user.c:1.7 src/sys/rump/net/lib/libsockin/rumpcomp_user.c:1.8
--- src/sys/rump/net/lib/libsockin/rumpcomp_user.c:1.7	Sat Jun  1 11:46:14 2013
+++ src/sys/rump/net/lib/libsockin/rumpcomp_user.c	Thu Jul  4 09:58:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpcomp_user.c,v 1.7 2013/06/01 11:46:14 pooka Exp $	*/
+/*	$NetBSD: rumpcomp_user.c,v 1.8 2013/07/04 09:58:28 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -129,20 +129,6 @@ translate_domain(int domain)
 }
 
 #undef translate
-#define translate_back(_a_) case _a_: return RUMP_##_a_
-static int translate_domain_back(int);
-static int
-translate_domain_back(int domain)
-{
-
-	switch (domain) {
-	translate_back(AF_INET);
-	translate_back(AF_INET6);
-	default: return RUMP_AF_UNSPEC;
-	}
-}
-
-#undef translate_back
 
 static void
 translate_sockopt(int *levelp, int *namep)
@@ -326,6 +312,20 @@ translate_sockaddr(const struct sockaddr
 	return laddr;
 }
 
+#define translate_back(_a_) case _a_: return RUMP_##_a_
+static int translate_domain_back(int);
+static int
+translate_domain_back(int domain)
+{
+
+	switch (domain) {
+	translate_back(AF_INET);
+	translate_back(AF_INET6);
+	default: return RUMP_AF_UNSPEC;
+	}
+}
+#undef translate_back
+
 static void
 translate_sockaddr_back(const struct sockaddr *laddr,
 		struct rump_sockaddr *baddr,



CVS commit: src/sys/rump/net/lib/libvirtif

2013-07-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jul  4 09:48:01 UTC 2013

Modified Files:
src/sys/rump/net/lib/libvirtif: rumpcomp_user.c

Log Message:
fix warnings


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/rumpcomp_user.c
diff -u src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.6 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.7
--- src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.6	Mon May 20 10:24:26 2013
+++ src/sys/rump/net/lib/libvirtif/rumpcomp_user.c	Thu Jul  4 09:48:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpcomp_user.c,v 1.6 2013/05/20 10:24:26 pooka Exp $	*/
+/*	$NetBSD: rumpcomp_user.c,v 1.7 2013/07/04 09:48:01 pooka Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef __linux__
 #include 
@@ -44,6 +45,8 @@
 
 #include 
 
+#include "rumpcomp_user.h"
+
 struct virtif_user {
 	int viu_fd;
 	int viu_dying;
@@ -150,8 +153,11 @@ rumpcomp_virtif_recv(struct virtif_user 
 	pfd.events = POLLIN;
 
 	for (;;) {
-		if (viu->viu_dying)
+		if (viu->viu_dying) {
+			rv = 0;
+			*rcv = 0;
 			break;
+		}
 
 		prv = poll(&pfd, 1, POLLTIMO_MS);
 		if (prv == 0)



CVS commit: src/sys/rump/net/lib/libvirtif

2013-07-03 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jul  3 20:17:07 UTC 2013

Modified Files:
src/sys/rump/net/lib/libvirtif: if_virt.c

Log Message:
fix parameter name


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/rump/net/lib/libvirtif/if_virt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.34 src/sys/rump/net/lib/libvirtif/if_virt.c:1.35
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.34	Wed Jul  3 19:23:46 2013
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Wed Jul  3 20:17:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.34 2013/07/03 19:23:46 pooka Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.35 2013/07/03 20:17:07 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.34 2013/07/03 19:23:46 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.35 2013/07/03 20:17:07 pooka Exp $");
 
 #include 
 #include 
@@ -88,7 +88,7 @@ struct if_clone virtif_cloner =
 IF_CLONE_INITIALIZER(VIRTIF_BASE, virtif_clone, virtif_unclone);
 
 static int
-virtif_clone(struct if_clone *ifc, int unit)
+virtif_clone(struct if_clone *ifc, int num)
 {
 	struct virtif_sc *sc;
 	struct virtif_user *viu;



CVS commit: src/sys/rump/net/lib/libvirtif

2013-07-03 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jul  3 19:23:46 UTC 2013

Modified Files:
src/sys/rump/net/lib/libvirtif: if_virt.c

Log Message:
Adjust for rump_virtif_create() removal.  Incidentally, this reduces
the number of exported symbols by one (which is useful for phase 2).


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/rump/net/lib/libvirtif/if_virt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/net/lib/libvirtif/if_virt.c
diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.33 src/sys/rump/net/lib/libvirtif/if_virt.c:1.34
--- src/sys/rump/net/lib/libvirtif/if_virt.c:1.33	Wed Jul  3 15:08:01 2013
+++ src/sys/rump/net/lib/libvirtif/if_virt.c	Wed Jul  3 19:23:46 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_virt.c,v 1.33 2013/07/03 15:08:01 pooka Exp $	*/
+/*	$NetBSD: if_virt.c,v 1.34 2013/07/03 19:23:46 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.33 2013/07/03 15:08:01 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.34 2013/07/03 19:23:46 pooka Exp $");
 
 #include 
 #include 
@@ -87,8 +87,8 @@ static int  virtif_unclone(struct ifnet 
 struct if_clone virtif_cloner =
 IF_CLONE_INITIALIZER(VIRTIF_BASE, virtif_clone, virtif_unclone);
 
-int
-rump_virtif_create(int num)
+static int
+virtif_clone(struct if_clone *ifc, int unit)
 {
 	struct virtif_sc *sc;
 	struct virtif_user *viu;
@@ -148,13 +148,6 @@ rump_virtif_create(int num)
 }
 
 static int
-virtif_clone(struct if_clone *ifc, int unit)
-{
-
-	return rump_virtif_create(unit);
-}
-
-static int
 virtif_unclone(struct ifnet *ifp)
 {
 	struct virtif_sc *sc = ifp->if_softc;



  1   2   3   >