svn commit: r301523 - in projects/vnet: etc/defaults libexec/ftpd share/man/man4 sys/dev/acpica sys/dev/cxgbe sys/dev/xen/netfront sys/kern sys/xen tools/tools/cxgbetool usr.bin/indent
Bjoern A. Zeeb
bz at FreeBSD.org
Mon Jun 6 21:04:32 UTC 2016
Author: bz
Date: Mon Jun 6 21:04:29 2016
New Revision: 301523
URL: https://svnweb.freebsd.org/changeset/base/301523
Log:
MfH
After upstreaming more ddb bits and removing some whitespace noise
from the diff.
Sponsored by: The FreeBSD Foundation
Modified:
projects/vnet/etc/defaults/rc.conf
projects/vnet/libexec/ftpd/blacklist.c
projects/vnet/libexec/ftpd/ftpd.c
projects/vnet/share/man/man4/ddb.4
projects/vnet/sys/dev/acpica/acpi_thermal.c
projects/vnet/sys/dev/cxgbe/t4_ioctl.h
projects/vnet/sys/dev/xen/netfront/netfront.c
projects/vnet/sys/kern/kern_shutdown.c
projects/vnet/sys/kern/kern_timeout.c
projects/vnet/sys/xen/xen-os.h
projects/vnet/tools/tools/cxgbetool/cxgbetool.c
projects/vnet/usr.bin/indent/lexi.c
Directory Properties:
projects/vnet/ (props changed)
Modified: projects/vnet/etc/defaults/rc.conf
==============================================================================
--- projects/vnet/etc/defaults/rc.conf Mon Jun 6 20:57:24 2016 (r301522)
+++ projects/vnet/etc/defaults/rc.conf Mon Jun 6 21:04:29 2016 (r301523)
@@ -270,7 +270,7 @@ hastd_program="/sbin/hastd" # path to ha
hastd_flags="" # Optional flags to hastd.
ctld_enable="NO" # CAM Target Layer / iSCSI target daemon.
local_unbound_enable="NO" # local caching resolver
-blacklistd_enable="YES" # Run blacklistd daemon (YES/NO).
+blacklistd_enable="NO" # Run blacklistd daemon (YES/NO).
blacklistd_flags="" # Optional flags for blacklistd(8).
#
Modified: projects/vnet/libexec/ftpd/blacklist.c
==============================================================================
--- projects/vnet/libexec/ftpd/blacklist.c Mon Jun 6 20:57:24 2016 (r301522)
+++ projects/vnet/libexec/ftpd/blacklist.c Mon Jun 6 21:04:29 2016 (r301523)
@@ -48,8 +48,6 @@ void
blacklist_notify(int action, int fd, char *msg)
{
if (blstate == NULL)
- blacklist_init();
- if (blstate == NULL)
return;
(void)blacklist_r(blstate, action, fd, msg);
}
Modified: projects/vnet/libexec/ftpd/ftpd.c
==============================================================================
--- projects/vnet/libexec/ftpd/ftpd.c Mon Jun 6 20:57:24 2016 (r301522)
+++ projects/vnet/libexec/ftpd/ftpd.c Mon Jun 6 21:04:29 2016 (r301523)
@@ -268,7 +268,7 @@ int
main(int argc, char *argv[], char **envp)
{
socklen_t addrlen;
- int ch, on = 1, tos;
+ int ch, on = 1, tos, s = STDIN_FILENO;
char *cp, line[LINE_MAX];
FILE *fd;
char *bindname = NULL;
@@ -504,8 +504,8 @@ main(int argc, char *argv[], char **envp
switch (pid = fork()) {
case 0:
/* child */
- (void) dup2(fd, 0);
- (void) dup2(fd, 1);
+ (void) dup2(fd, s);
+ (void) dup2(fd, STDOUT_FILENO);
(void) close(fd);
for (i = 1; i <= *ctl_sock; i++)
close(ctl_sock[i]);
@@ -522,7 +522,7 @@ main(int argc, char *argv[], char **envp
}
} else {
addrlen = sizeof(his_addr);
- if (getpeername(0, (struct sockaddr *)&his_addr, &addrlen) < 0) {
+ if (getpeername(s, (struct sockaddr *)&his_addr, &addrlen) < 0) {
syslog(LOG_ERR, "getpeername (%s): %m",argv[0]);
exit(1);
}
@@ -557,7 +557,7 @@ gotchild:
(void)sigaction(SIGPIPE, &sa, NULL);
addrlen = sizeof(ctrl_addr);
- if (getsockname(0, (struct sockaddr *)&ctrl_addr, &addrlen) < 0) {
+ if (getsockname(s, (struct sockaddr *)&ctrl_addr, &addrlen) < 0) {
syslog(LOG_ERR, "getsockname (%s): %m",argv[0]);
exit(1);
}
@@ -570,7 +570,7 @@ gotchild:
if (ctrl_addr.su_family == AF_INET)
{
tos = IPTOS_LOWDELAY;
- if (setsockopt(0, IPPROTO_IP, IP_TOS, &tos, sizeof(int)) < 0)
+ if (setsockopt(s, IPPROTO_IP, IP_TOS, &tos, sizeof(int)) < 0)
syslog(LOG_WARNING, "control setsockopt (IP_TOS): %m");
}
#endif
@@ -578,7 +578,7 @@ gotchild:
* Disable Nagle on the control channel so that we don't have to wait
* for peer's ACK before issuing our next reply.
*/
- if (setsockopt(0, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) < 0)
+ if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) < 0)
syslog(LOG_WARNING, "control setsockopt (TCP_NODELAY): %m");
data_source.su_port = htons(ntohs(ctrl_addr.su_port) - 1);
@@ -587,12 +587,12 @@ gotchild:
/* Try to handle urgent data inline */
#ifdef SO_OOBINLINE
- if (setsockopt(0, SOL_SOCKET, SO_OOBINLINE, &on, sizeof(on)) < 0)
+ if (setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &on, sizeof(on)) < 0)
syslog(LOG_WARNING, "control setsockopt (SO_OOBINLINE): %m");
#endif
#ifdef F_SETOWN
- if (fcntl(fileno(stdin), F_SETOWN, getpid()) == -1)
+ if (fcntl(s, F_SETOWN, getpid()) == -1)
syslog(LOG_ERR, "fcntl F_SETOWN: %m");
#endif
dolog((struct sockaddr *)&his_addr);
@@ -1423,7 +1423,7 @@ skip:
if (rval) {
reply(530, "Login incorrect.");
#ifdef USE_BLACKLIST
- blacklist_notify(1, 0, "Login incorrect");
+ blacklist_notify(1, STDIN_FILENO, "Login incorrect");
#endif
if (logging) {
syslog(LOG_NOTICE,
@@ -1444,7 +1444,7 @@ skip:
}
#ifdef USE_BLACKLIST
else {
- blacklist_notify(0, 0, "Login successful");
+ blacklist_notify(0, STDIN_FILENO, "Login successful");
}
#endif
}
Modified: projects/vnet/share/man/man4/ddb.4
==============================================================================
--- projects/vnet/share/man/man4/ddb.4 Mon Jun 6 20:57:24 2016 (r301522)
+++ projects/vnet/share/man/man4/ddb.4 Mon Jun 6 21:04:29 2016 (r301523)
@@ -60,7 +60,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 18, 2016
+.Dd June 6, 2016
.Dt DDB 4
.Os
.Sh NAME
@@ -599,6 +599,13 @@ See the
header file for more details on the exact meaning of the structure fields.
.\"
.Pp
+.It Ic show Cm callout Ar addr
+Show information about the callout structure
+.Vt struct callout
+present at
+.Ar addr .
+.\"
+.Pp
.It Ic show Cm cbstat
Show brief information about the TTY subsystem.
.\"
@@ -834,6 +841,10 @@ option is specified the
complete object is printed.
.\"
.Pp
+.It Ic show Cm panic
+Print the panic message if set.
+.\"
+.Pp
.It Ic show Cm page
Show statistics on VM pages.
.\"
Modified: projects/vnet/sys/dev/acpica/acpi_thermal.c
==============================================================================
--- projects/vnet/sys/dev/acpica/acpi_thermal.c Mon Jun 6 20:57:24 2016 (r301522)
+++ projects/vnet/sys/dev/acpica/acpi_thermal.c Mon Jun 6 21:04:29 2016 (r301523)
@@ -311,19 +311,40 @@ acpi_tz_attach(device_t dev)
"thermal sampling period for passive cooling");
/*
- * Create thread to service all of the thermal zones. Register
- * our power profile event handler.
+ * Register our power profile event handler.
*/
sc->tz_event = EVENTHANDLER_REGISTER(power_profile_change,
acpi_tz_power_profile, sc, 0);
- if (acpi_tz_proc == NULL) {
- error = kproc_create(acpi_tz_thread, NULL, &acpi_tz_proc,
- RFHIGHPID, 0, "acpi_thermal");
- if (error != 0) {
- device_printf(sc->tz_dev, "could not create thread - %d", error);
- goto out;
- }
- }
+
+ /*
+ * Flag the event handler for a manual invocation by our timeout.
+ * We defer it like this so that the rest of the subsystem has time
+ * to come up. Don't bother evaluating/printing the temperature at
+ * this point; on many systems it'll be bogus until the EC is running.
+ */
+ sc->tz_flags |= TZ_FLAG_GETPROFILE;
+
+ return_VALUE (0);
+}
+
+static void
+acpi_tz_startup(void *arg __unused)
+{
+ struct acpi_tz_softc *sc;
+ device_t *devs;
+ int devcount, error, i;
+
+ devclass_get_devices(acpi_tz_devclass, &devs, &devcount);
+ if (devcount == 0)
+ return;
+
+ /*
+ * Create thread to service all of the thermal zones.
+ */
+ error = kproc_create(acpi_tz_thread, NULL, &acpi_tz_proc, RFHIGHPID, 0,
+ "acpi_thermal");
+ if (error != 0)
+ printf("acpi_tz: could not create thread - %d", error);
/*
* Create a thread to handle passive cooling for 1st zone which
@@ -335,34 +356,22 @@ acpi_tz_attach(device_t dev)
* given frequency whereas it's possible for different thermal
* zones to specify independent settings for multiple CPUs.
*/
- if (acpi_tz_cooling_unit < 0 && acpi_tz_cooling_is_available(sc))
- sc->tz_cooling_enabled = TRUE;
- if (sc->tz_cooling_enabled) {
- error = acpi_tz_cooling_thread_start(sc);
- if (error != 0) {
- sc->tz_cooling_enabled = FALSE;
- goto out;
+ for (i = 0; i < devcount; i++) {
+ sc = device_get_softc(devs[i]);
+ if (acpi_tz_cooling_is_available(sc)) {
+ sc->tz_cooling_enabled = TRUE;
+ error = acpi_tz_cooling_thread_start(sc);
+ if (error != 0) {
+ sc->tz_cooling_enabled = FALSE;
+ break;
+ }
+ acpi_tz_cooling_unit = device_get_unit(devs[i]);
+ break;
}
- acpi_tz_cooling_unit = device_get_unit(dev);
- }
-
- /*
- * Flag the event handler for a manual invocation by our timeout.
- * We defer it like this so that the rest of the subsystem has time
- * to come up. Don't bother evaluating/printing the temperature at
- * this point; on many systems it'll be bogus until the EC is running.
- */
- sc->tz_flags |= TZ_FLAG_GETPROFILE;
-
-out:
- if (error != 0) {
- EVENTHANDLER_DEREGISTER(power_profile_change, sc->tz_event);
- AcpiRemoveNotifyHandler(sc->tz_handle, ACPI_DEVICE_NOTIFY,
- acpi_tz_notify_handler);
- sysctl_ctx_free(&sc->tz_sysctl_ctx);
}
- return_VALUE (error);
+ free(devs, M_TEMP);
}
+SYSINIT(acpi_tz, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, acpi_tz_startup, NULL);
/*
* Parse the current state of this thermal zone and set up to use it.
Modified: projects/vnet/sys/dev/cxgbe/t4_ioctl.h
==============================================================================
--- projects/vnet/sys/dev/cxgbe/t4_ioctl.h Mon Jun 6 20:57:24 2016 (r301522)
+++ projects/vnet/sys/dev/cxgbe/t4_ioctl.h Mon Jun 6 21:04:29 2016 (r301523)
@@ -215,6 +215,20 @@ struct t4_filter {
struct t4_filter_specification fs;
};
+/* Tx Scheduling Class parameters */
+struct t4_sched_class_params {
+ int8_t level; /* scheduler hierarchy level */
+ int8_t mode; /* per-class or per-flow */
+ int8_t rateunit; /* bit or packet rate */
+ int8_t ratemode; /* %port relative or kbps absolute */
+ int8_t channel; /* scheduler channel [0..N] */
+ int8_t cl; /* scheduler class [0..N] */
+ int32_t minrate; /* minimum rate */
+ int32_t maxrate; /* maximum rate */
+ int16_t weight; /* percent weight */
+ int16_t pktsize; /* average packet size */
+};
+
/*
* Support for "sched-class" command to allow a TX Scheduling Class to be
* programmed with various parameters.
@@ -226,19 +240,7 @@ struct t4_sched_params {
struct { /* sub-command SCHED_CLASS_CONFIG */
int8_t minmax; /* minmax enable */
} config;
- struct { /* sub-command SCHED_CLASS_PARAMS */
- int8_t level; /* scheduler hierarchy level */
- int8_t mode; /* per-class or per-flow */
- int8_t rateunit; /* bit or packet rate */
- int8_t ratemode; /* %port relative or kbps
- absolute */
- int8_t channel; /* scheduler channel [0..N] */
- int8_t cl; /* scheduler class [0..N] */
- int32_t minrate; /* minimum rate */
- int32_t maxrate; /* maximum rate */
- int16_t weight; /* percent weight */
- int16_t pktsize; /* average packet size */
- } params;
+ struct t4_sched_class_params params;
uint8_t reserved[6 + 8 * 8];
} u;
};
Modified: projects/vnet/sys/dev/xen/netfront/netfront.c
==============================================================================
--- projects/vnet/sys/dev/xen/netfront/netfront.c Mon Jun 6 20:57:24 2016 (r301522)
+++ projects/vnet/sys/dev/xen/netfront/netfront.c Mon Jun 6 21:04:29 2016 (r301523)
@@ -146,7 +146,8 @@ static int setup_device(device_t dev, st
static int xn_ifmedia_upd(struct ifnet *ifp);
static void xn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr);
-int xn_connect(struct netfront_info *);
+static int xn_connect(struct netfront_info *);
+static void xn_kick_rings(struct netfront_info *);
static int xn_get_responses(struct netfront_rxq *,
struct netfront_rx_info *, RING_IDX, RING_IDX *,
@@ -976,7 +977,9 @@ netfront_backend_changed(device_t dev, X
break;
if (xn_connect(sc) != 0)
break;
- xenbus_set_state(dev, XenbusStateConnected);
+ /* Switch to connected state before kicking the rings. */
+ xenbus_set_state(sc->xbdev, XenbusStateConnected);
+ xn_kick_rings(sc);
break;
case XenbusStateClosing:
xenbus_set_state(dev, XenbusStateClosed);
@@ -1924,7 +1927,7 @@ xn_rebuild_rx_bufs(struct netfront_rxq *
}
/* START of Xenolinux helper functions adapted to FreeBSD */
-int
+static int
xn_connect(struct netfront_info *np)
{
int i, error;
@@ -1968,8 +1971,20 @@ xn_connect(struct netfront_info *np)
* packets.
*/
netfront_carrier_on(np);
+
+ return (0);
+}
+
+static void
+xn_kick_rings(struct netfront_info *np)
+{
+ struct netfront_rxq *rxq;
+ struct netfront_txq *txq;
+ int i;
+
for (i = 0; i < np->num_queues; i++) {
txq = &np->txq[i];
+ rxq = &np->rxq[i];
xen_intr_signal(txq->xen_intr_handle);
XN_TX_LOCK(txq);
xn_txeof(txq);
@@ -1978,8 +1993,6 @@ xn_connect(struct netfront_info *np)
xn_alloc_rx_buffers(rxq);
XN_RX_UNLOCK(rxq);
}
-
- return (0);
}
static void
Modified: projects/vnet/sys/kern/kern_shutdown.c
==============================================================================
--- projects/vnet/sys/kern/kern_shutdown.c Mon Jun 6 20:57:24 2016 (r301522)
+++ projects/vnet/sys/kern/kern_shutdown.c Mon Jun 6 21:04:29 2016 (r301523)
@@ -935,7 +935,7 @@ DB_SHOW_COMMAND(panic, db_show_panic)
{
if (panicstr == NULL)
- db_printf("Not paniced\n");
+ db_printf("panicstr not set\n");
else
db_printf("panic: %s\n", panicstr);
}
Modified: projects/vnet/sys/kern/kern_timeout.c
==============================================================================
--- projects/vnet/sys/kern/kern_timeout.c Mon Jun 6 20:57:24 2016 (r301522)
+++ projects/vnet/sys/kern/kern_timeout.c Mon Jun 6 21:04:29 2016 (r301523)
@@ -1623,7 +1623,6 @@ SYSCTL_PROC(_kern, OID_AUTO, callout_sta
"Dump immediate statistic snapshot of the scheduled callouts");
#ifdef DDB
-
static void
_show_callout(struct callout *c)
{
Modified: projects/vnet/sys/xen/xen-os.h
==============================================================================
--- projects/vnet/sys/xen/xen-os.h Mon Jun 6 20:57:24 2016 (r301522)
+++ projects/vnet/sys/xen/xen-os.h Mon Jun 6 21:04:29 2016 (r301523)
@@ -118,7 +118,7 @@ xen_clear_bit(int bit, volatile long *ad
atomic_clear_long(&addr[bit / NBPL], 1UL << (bit % NBPL));
}
-#undef NPBL
+#undef NBPL
/*
* Functions to allocate/free unused memory in order
Modified: projects/vnet/tools/tools/cxgbetool/cxgbetool.c
==============================================================================
--- projects/vnet/tools/tools/cxgbetool/cxgbetool.c Mon Jun 6 20:57:24 2016 (r301522)
+++ projects/vnet/tools/tools/cxgbetool/cxgbetool.c Mon Jun 6 21:04:29 2016 (r301523)
@@ -2526,9 +2526,9 @@ sched_class(int argc, const char *argv[]
errs++;
}
if (op.u.params.ratemode == SCHED_CLASS_RATEMODE_ABS &&
- !in_range(op.u.params.maxrate, 1, 10000000)) {
+ !in_range(op.u.params.maxrate, 1, 100000000)) {
warnx("sched params \"max-rate\" takes "
- "value(1-10000000) for rate-mode absolute");
+ "value(1-100000000) for rate-mode absolute");
errs++;
}
if (op.u.params.maxrate > 0 &&
Modified: projects/vnet/usr.bin/indent/lexi.c
==============================================================================
--- projects/vnet/usr.bin/indent/lexi.c Mon Jun 6 20:57:24 2016 (r301522)
+++ projects/vnet/usr.bin/indent/lexi.c Mon Jun 6 21:04:29 2016 (r301523)
@@ -79,7 +79,7 @@ struct templ specials[1000] =
{"double", 4},
{"long", 4},
{"short", 4},
- {"typdef", 4},
+ {"typedef", 4},
{"unsigned", 4},
{"register", 4},
{"static", 4},
More information about the svn-src-projects
mailing list