From owner-svn-src-all@freebsd.org Thu Oct 31 21:01:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9407166953; Thu, 31 Oct 2019 21:01:36 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473yRh5s0Mz3M0n; Thu, 31 Oct 2019 21:01:36 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC5297C9; Thu, 31 Oct 2019 21:01:36 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VL1a5l043281; Thu, 31 Oct 2019 21:01:36 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VL1YhC043270; Thu, 31 Oct 2019 21:01:34 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201910312101.x9VL1YhC043270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 31 Oct 2019 21:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354229 - in head: share/man/man4 sys/dev/netmap sys/net tools/tools/netmap usr.sbin usr.sbin/valectl X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/netmap sys/net tools/tools/netmap usr.sbin usr.sbin/valectl X-SVN-Commit-Revision: 354229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Oct 2019 21:01:37 -0000 Author: vmaffione Date: Thu Oct 31 21:01:34 2019 New Revision: 354229 URL: https://svnweb.freebsd.org/changeset/base/354229 Log: add valectl to the system commands The valectl(4) program is used to manage vale(4) switches. Add it to the system commands so that it can be used right away. This program was previously called vale-ctl, and stored in tools/tools/netmap Reviewed by: hrs, bcr, lwhsu, kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22146 Added: head/usr.sbin/valectl/ head/usr.sbin/valectl/Makefile (contents, props changed) head/usr.sbin/valectl/valectl.8 - copied, changed from r354228, head/tools/tools/netmap/vale-ctl.4 head/usr.sbin/valectl/valectl.c - copied, changed from r354228, head/tools/tools/netmap/vale-ctl.c Deleted: head/tools/tools/netmap/vale-ctl.4 head/tools/tools/netmap/vale-ctl.c Modified: head/share/man/man4/netmap.4 head/sys/dev/netmap/netmap_bdg.c head/sys/net/netmap_legacy.h head/tools/tools/netmap/Makefile head/tools/tools/netmap/README head/tools/tools/netmap/lb.8 head/usr.sbin/Makefile Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Thu Oct 31 20:42:36 2019 (r354228) +++ head/share/man/man4/netmap.4 Thu Oct 31 21:01:34 2019 (r354229) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2018 +.Dd October 26, 2019 .Dt NETMAP 4 .Os .Sh NAME @@ -1087,14 +1087,14 @@ changing port names, e.g., .Pp The following command attaches an interface and the host stack to a switch: -.Dl vale-ctl -h vale2:em0 +.Dl valectl -h vale2:em0 Other .Nm clients attached to the same switch can now communicate with the network card or the host. .Sh SEE ALSO .Xr vale 4 , -.Xr vale-ctl 4 , +.Xr valectl 8 , .Xr bridge 8 , .Xr lb 8 , .Xr nmreplay 8 , Modified: head/sys/dev/netmap/netmap_bdg.c ============================================================================== --- head/sys/dev/netmap/netmap_bdg.c Thu Oct 31 20:42:36 2019 (r354228) +++ head/sys/dev/netmap/netmap_bdg.c Thu Oct 31 21:01:34 2019 (r354229) @@ -1442,7 +1442,7 @@ put_out: /* nm_bdg_ctl callback for the bwrap. - * Called on bridge-attach and detach, as an effect of vale-ctl -[ahd]. + * Called on bridge-attach and detach, as an effect of valectl -[ahd]. * On attach, it needs to provide a fake netmap_priv_d structure and * perform a netmap_do_regif() on the bwrap. This will put both the * bwrap and the hwna in netmap mode, with the netmap rings shared Modified: head/sys/net/netmap_legacy.h ============================================================================== --- head/sys/net/netmap_legacy.h Thu Oct 31 20:42:36 2019 (r354228) +++ head/sys/net/netmap_legacy.h Thu Oct 31 21:01:34 2019 (r354229) @@ -116,13 +116,13 @@ * nr_cmd (in) if non-zero indicates a special command: * NETMAP_BDG_ATTACH and nr_name = vale*:ifname * attaches the NIC to the switch; nr_ringid specifies - * which rings to use. Used by vale-ctl -a ... + * which rings to use. Used by valectl -a ... * nr_arg1 = NETMAP_BDG_HOST also attaches the host port - * as in vale-ctl -h ... + * as in valectl -h ... * * NETMAP_BDG_DETACH and nr_name = vale*:ifname * disconnects a previously attached NIC. - * Used by vale-ctl -d ... + * Used by valectl -d ... * * NETMAP_BDG_LIST * list the configuration of VALE switches. @@ -133,10 +133,10 @@ * * NETMAP_BDG_NEWIF * create a persistent VALE port with name nr_name. - * Used by vale-ctl -n ... + * Used by valectl -n ... * * NETMAP_BDG_DELIF - * delete a persistent VALE port. Used by vale-ctl -d ... + * delete a persistent VALE port. Used by valectl -d ... * * nr_arg1, nr_arg2, nr_arg3 (in/out) command specific * Modified: head/tools/tools/netmap/Makefile ============================================================================== --- head/tools/tools/netmap/Makefile Thu Oct 31 20:42:36 2019 (r354228) +++ head/tools/tools/netmap/Makefile Thu Oct 31 21:01:34 2019 (r354229) @@ -3,7 +3,7 @@ # # For multiple programs using a single source file each, # we can just define 'progs' and create custom targets. -PROGS = pkt-gen nmreplay bridge vale-ctl lb +PROGS = pkt-gen nmreplay bridge lb CLEANFILES = $(PROGS) *.o MAN= @@ -31,9 +31,6 @@ bridge: bridge.o nmreplay: nmreplay.o $(CC) $(CFLAGS) -o nmreplay nmreplay.o $(LDFLAGS) - -vale-ctl: vale-ctl.o - $(CC) $(CFLAGS) -o vale-ctl vale-ctl.o lb: lb.o pkt_hash.o $(CC) $(CFLAGS) -o lb lb.o pkt_hash.o $(LDFLAGS) Modified: head/tools/tools/netmap/README ============================================================================== --- head/tools/tools/netmap/README Thu Oct 31 20:42:36 2019 (r354228) +++ head/tools/tools/netmap/README Thu Oct 31 21:01:34 2019 (r354229) @@ -6,8 +6,6 @@ This directory contains applications that use the netm bridge a two-port jumper wire, also using the netmap API - vale-ctl the program to control and inspect VALE switches - lb an L3/L4 load balancer nmreplay a tool to playback a pcap file to a netmap port Modified: head/tools/tools/netmap/lb.8 ============================================================================== --- head/tools/tools/netmap/lb.8 Thu Oct 31 20:42:36 2019 (r354228) +++ head/tools/tools/netmap/lb.8 Thu Oct 31 21:01:34 2019 (r354229) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2018 +.Dd October 26, 2019 .Dt LB 8 .Os .Sh NAME @@ -111,7 +111,7 @@ If .Nm does not exit cleanly the ports will not be removed. Please use -.Xr vale-ctl 4 +.Xr valectl 8 to remove any stale persistent VALE port. .Sh SEE ALSO .Xr netmap 4 , Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Oct 31 20:42:36 2019 (r354228) +++ head/usr.sbin/Makefile Thu Oct 31 21:01:34 2019 (r354229) @@ -96,6 +96,7 @@ SUBDIR= adduser \ trpt \ tzsetup \ ugidfw \ + valectl \ vigr \ vipw \ wake \ Added: head/usr.sbin/valectl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/valectl/Makefile Thu Oct 31 21:01:34 2019 (r354229) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= valectl +MAN= valectl.8 + +WARNS?= 3 + +.include Copied and modified: head/usr.sbin/valectl/valectl.8 (from r354228, head/tools/tools/netmap/vale-ctl.4) ============================================================================== --- head/tools/tools/netmap/vale-ctl.4 Thu Oct 31 20:42:36 2019 (r354228, copy source) +++ head/usr.sbin/valectl/valectl.8 Thu Oct 31 21:01:34 2019 (r354229) @@ -24,15 +24,15 @@ .\" .\" $FreeBSD$ .\" -.Dd October 24, 2018 -.Dt VALE-CTL 4 +.Dd October 26, 2019 +.Dt VALECTL 8 .Os .Sh NAME -.Nm vale-ctl +.Nm valectl .Nd manage VALE switches provided by netmap .Sh SYNOPSIS .Bk -words -.Bl -tag -width "vale-ctl" +.Bl -tag -width "valectl" .It Nm .Op Fl g Ar valeSSS:PPP .Op Fl a Ar valeSSS:interface @@ -158,6 +158,6 @@ harware netmap ports. .Sh AUTHORS .An -nosplit .Nm -has been written by +was written by .An Michio Honda at NetApp. Copied and modified: head/usr.sbin/valectl/valectl.c (from r354228, head/tools/tools/netmap/vale-ctl.c) ============================================================================== --- head/tools/tools/netmap/vale-ctl.c Thu Oct 31 20:42:36 2019 (r354228, copy source) +++ head/usr.sbin/valectl/valectl.c Thu Oct 31 21:01:34 2019 (r354229) @@ -42,10 +42,8 @@ #include /* basename */ #include /* atoi, free */ -/* XXX cut and paste from pkt-gen.c because I'm not sure whether this - * program may include nm_util.h - */ -void parse_nmr_config(const char* conf, struct nmreq *nmr) +static void +parse_nmr_config(const char* conf, struct nmreq *nmr) { char *w, *tok; int i, v; @@ -201,7 +199,7 @@ usage(int errcode) { fprintf(stderr, "Usage:\n" - "vale-ctl arguments\n" + "valectl arguments\n" "\t-g interface interface name to get info\n" "\t-d interface interface name to be detached\n" "\t-a interface interface name to be attached\n"