From 7cd5cfd4efed99577656351f7d967c685a22c6d0 Mon Sep 17 00:00:00 2001 From: ngie Date: Thu, 1 Jun 2017 07:08:26 +0000 Subject: [PATCH] MFC r314579,r314785: r314579 (by np): Add cxgbetool(8) to the base system. Move cxgbetool from tools/tools to usr.sbin. Compile and install it on platforms where cxgbe(4) is built by default. Knobs (WITH_CXGBETOOL and WITHOUT_CXGBETOOL) have been added so that the user can override the default setting. r314785: Fix some trivial manlint warnings Sentences should begin on new lines, per manlint. Bump .Dd for the change git-svn-id: svn://svn.freebsd.org/base/stable/10@319390 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- share/mk/bsd.own.mk | 6 ++++++ tools/build/options/WITHOUT_CXGBETOOL | 3 +++ tools/build/options/WITH_CXGBETOOL | 3 +++ tools/tools/cxgbetool/Makefile | 9 --------- usr.sbin/Makefile | 4 ++++ usr.sbin/cxgbetool/Makefile | 8 ++++++++ usr.sbin/cxgbetool/Makefile.depend | 19 +++++++++++++++++++ .../tools => usr.sbin}/cxgbetool/cxgbetool.8 | 14 +++++++++----- .../tools => usr.sbin}/cxgbetool/cxgbetool.c | 0 .../cxgbetool/reg_defs_t4.c | 0 .../cxgbetool/reg_defs_t4vf.c | 0 .../cxgbetool/reg_defs_t5.c | 0 .../cxgbetool/reg_defs_t6.c | 0 13 files changed, 52 insertions(+), 14 deletions(-) create mode 100644 tools/build/options/WITHOUT_CXGBETOOL create mode 100644 tools/build/options/WITH_CXGBETOOL delete mode 100644 tools/tools/cxgbetool/Makefile create mode 100644 usr.sbin/cxgbetool/Makefile create mode 100644 usr.sbin/cxgbetool/Makefile.depend rename {tools/tools => usr.sbin}/cxgbetool/cxgbetool.8 (97%) rename {tools/tools => usr.sbin}/cxgbetool/cxgbetool.c (100%) rename {tools/tools => usr.sbin}/cxgbetool/reg_defs_t4.c (100%) rename {tools/tools => usr.sbin}/cxgbetool/reg_defs_t4vf.c (100%) rename {tools/tools => usr.sbin}/cxgbetool/reg_defs_t5.c (100%) rename {tools/tools => usr.sbin}/cxgbetool/reg_defs_t6.c (100%) diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 2a745a915..3ccb01a75 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -463,6 +463,12 @@ __DEFAULT_NO_OPTIONS+=GNUCXX __DEFAULT_YES_OPTIONS+=GNUCXX .endif .endif +.if ${__T} == "amd64" || ${__T} == "i386" || \ + ${__T} == "powerpc64" || ${__T} == "sparc64" +__DEFAULT_YES_OPTIONS+=CXGBETOOL +.else +__DEFAULT_NO_OPTIONS+=CXGBETOOL +.endif # FDT is needed only for arm, mips and powerpc .if ${__T:Marm*} || ${__T:Mpowerpc*} || ${__T:Mmips*} __DEFAULT_YES_OPTIONS+=FDT diff --git a/tools/build/options/WITHOUT_CXGBETOOL b/tools/build/options/WITHOUT_CXGBETOOL new file mode 100644 index 000000000..d7aef3863 --- /dev/null +++ b/tools/build/options/WITHOUT_CXGBETOOL @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not build +.Xr cxgbetool 8 diff --git a/tools/build/options/WITH_CXGBETOOL b/tools/build/options/WITH_CXGBETOOL new file mode 100644 index 000000000..b9c26a09c --- /dev/null +++ b/tools/build/options/WITH_CXGBETOOL @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build +.Xr cxgbetool 8 diff --git a/tools/tools/cxgbetool/Makefile b/tools/tools/cxgbetool/Makefile deleted file mode 100644 index 1430a5a09..000000000 --- a/tools/tools/cxgbetool/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# $FreeBSD$ - -PROG= cxgbetool -SRCS= cxgbetool.c -MAN= cxgbetool.8 -CFLAGS+= -I${.CURDIR}/../../../sys/dev/cxgbe -I${.CURDIR}/../../../sys -I. -BINDIR?= /usr/sbin - -.include diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index f76bb018a..48d728651 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -148,6 +148,10 @@ SUBDIR+= bsnmpd SUBDIR+= ctm .endif +.if ${MK_CXGBETOOL} != "no" +SUBDIR+= cxgbetool +.endif + .if ${MK_FLOPPY} != "no" SUBDIR+= fdcontrol SUBDIR+= fdformat diff --git a/usr.sbin/cxgbetool/Makefile b/usr.sbin/cxgbetool/Makefile new file mode 100644 index 000000000..f8291aff0 --- /dev/null +++ b/usr.sbin/cxgbetool/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= cxgbetool +MAN= cxgbetool.8 +CFLAGS+= -I${SRCTOP}/sys/dev/cxgbe -I${SRCTOP}/sys -I. +WARNS?= 2 + +.include diff --git a/usr.sbin/cxgbetool/Makefile.depend b/usr.sbin/cxgbetool/Makefile.depend new file mode 100644 index 000000000..54c1f6f14 --- /dev/null +++ b/usr.sbin/cxgbetool/Makefile.depend @@ -0,0 +1,19 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + include \ + include/arpa \ + include/xlocale \ + lib/${CSU_DIR} \ + lib/libc \ + lib/libcompiler_rt \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/tools/tools/cxgbetool/cxgbetool.8 b/usr.sbin/cxgbetool/cxgbetool.8 similarity index 97% rename from tools/tools/cxgbetool/cxgbetool.8 rename to usr.sbin/cxgbetool/cxgbetool.8 index bdc4eb7ea..81affe139 100644 --- a/tools/tools/cxgbetool/cxgbetool.8 +++ b/usr.sbin/cxgbetool/cxgbetool.8 @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 1, 2013 +.Dd March 6, 2017 .Dt CXGBETOOL 8 .Os .Sh NAME @@ -133,7 +133,8 @@ or .Va dev.cxgbe.%d.ofld_rxq.%d.fl.cntxt_id Ns . Note that freelists are egress queues too. .It Ar flm_cntxt_id -context id of a freelist manager. The FLM context id is displayed in the +context id of a freelist manager. +The FLM context id is displayed in the egress context dump of a freelist as FLMcontextID. .El .It Cm filter mode Op Ar match-criteria ... @@ -379,7 +380,8 @@ The card's memory map is available in .Va dev.t4nex.%d.misc.meminfo Ns . .It Bro Cm reg | reg64 Brc Ar addr Ns Op Ar =val .It Cm regdump Op Ar register-block ... -Display contents of device registers. One or more +Display contents of device registers. +One or more .Ar register-block can be specified to limit the registers displayed. The default is to display registers for all blocks. @@ -400,7 +402,8 @@ A non-zero value will enable "minmax" mode; a zero value will disable "minmax" m .Pp NOTE: Many (most) of the parameters and constraints are adapter-specific - for instance the number of channels and classes which are available -whether various modes are implemented, etc. Consult the adapter documentation for specific information on any limitations. +whether various modes are implemented, etc. +Consult the adapter documentation for specific information on any limitations. .El .It Cm sched-class params Op Ar param Ar value Configure parameters for a scheduling class. @@ -471,7 +474,8 @@ The weight to be used for a weighted-round-robin scheduling hierarchy. The average packet size will be used to compute scheduler constraints for a rate-limited scheduler class hierarchy. .Pp NOTE: Many (most) of the parameters and constraints are adapter-specific - for instance the number of channels and classes which are available, -whether various modes are implemented, etc. Consult the adapter documentation for specific information on any limitations. +whether various modes are implemented, etc. +Consult the adapter documentation for specific information on any limitations. .El .It Cm sched-queue Ar port queue class Bind the indicated port's NIC TX diff --git a/tools/tools/cxgbetool/cxgbetool.c b/usr.sbin/cxgbetool/cxgbetool.c similarity index 100% rename from tools/tools/cxgbetool/cxgbetool.c rename to usr.sbin/cxgbetool/cxgbetool.c diff --git a/tools/tools/cxgbetool/reg_defs_t4.c b/usr.sbin/cxgbetool/reg_defs_t4.c similarity index 100% rename from tools/tools/cxgbetool/reg_defs_t4.c rename to usr.sbin/cxgbetool/reg_defs_t4.c diff --git a/tools/tools/cxgbetool/reg_defs_t4vf.c b/usr.sbin/cxgbetool/reg_defs_t4vf.c similarity index 100% rename from tools/tools/cxgbetool/reg_defs_t4vf.c rename to usr.sbin/cxgbetool/reg_defs_t4vf.c diff --git a/tools/tools/cxgbetool/reg_defs_t5.c b/usr.sbin/cxgbetool/reg_defs_t5.c similarity index 100% rename from tools/tools/cxgbetool/reg_defs_t5.c rename to usr.sbin/cxgbetool/reg_defs_t5.c diff --git a/tools/tools/cxgbetool/reg_defs_t6.c b/usr.sbin/cxgbetool/reg_defs_t6.c similarity index 100% rename from tools/tools/cxgbetool/reg_defs_t6.c rename to usr.sbin/cxgbetool/reg_defs_t6.c -- 2.42.0