svn commit: r301539 - in head/sys: dev/gpio kern sys

2016-06-06 Thread Michal Meloun
Author: mmel
Date: Tue Jun  7 05:08:24 2016
New Revision: 301539
URL: https://svnweb.freebsd.org/changeset/base/301539

Log:
  INTRNG: As follow up of r301451, implement mapping and configuration
  of gpio pin interrupts by new way.
  
  Note: This removes last consumer of intr_ddata machinery and we remove it
  in separate commit.

Modified:
  head/sys/dev/gpio/gpiobus.c
  head/sys/dev/gpio/gpiobusvar.h
  head/sys/kern/subr_intr.c
  head/sys/sys/intr.h

Modified: head/sys/dev/gpio/gpiobus.c
==
--- head/sys/dev/gpio/gpiobus.c Tue Jun  7 04:51:50 2016(r301538)
+++ head/sys/dev/gpio/gpiobus.c Tue Jun  7 05:08:24 2016(r301539)
@@ -79,22 +79,47 @@ static int gpiobus_pin_toggle(device_t, 
  * data will be moved into struct resource.
  */
 #ifdef INTRNG
+static void
+gpio_destruct_map_data(struct intr_map_data *map_data)
+{
+
+   KASSERT(map_data->type == INTR_MAP_DATA_GPIO,
+   ("%s: bad map_data type %d", __func__, map_data->type));
+
+   free(map_data, M_DEVBUF);
+}
+
 struct resource *
 gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags,
 gpio_pin_t pin, uint32_t intr_mode)
 {
-   u_int irqnum;
-
-   /*
-* Allocate new fictitious interrupt number and store configuration
-* into it.
-*/
-   irqnum = intr_gpio_map_irq(pin->dev, pin->pin, pin->flags, intr_mode);
-   if (irqnum == INTR_IRQ_INVALID)
+   int rv;
+   u_int irq;
+   struct intr_map_data_gpio *gpio_data;
+   struct resource *res;
+
+   gpio_data = malloc(sizeof(*gpio_data), M_DEVBUF, M_WAITOK | M_ZERO);
+   gpio_data->hdr.type = INTR_MAP_DATA_GPIO;
+   gpio_data->hdr.destruct = gpio_destruct_map_data;
+   gpio_data->gpio_pin_num = pin->pin;
+   gpio_data->gpio_pin_flags = pin->flags;
+   gpio_data->gpio_intr_mode = intr_mode;
+
+   rv = intr_map_irq(pin->dev, 0, (struct intr_map_data *)gpio_data,
+   );
+   if (rv != 0) {
+   gpio_destruct_map_data((struct intr_map_data *)gpio_data);
return (NULL);
+   }
 
-   return (bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid,
-   irqnum, irqnum, 1, alloc_flags));
+   res = bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid, irq, irq, 1,
+   alloc_flags);
+   if (res == NULL) {
+   gpio_destruct_map_data((struct intr_map_data *)gpio_data);
+   return (NULL);
+   }
+   rman_set_virtual(res, gpio_data);
+   return (res);
 }
 #else
 struct resource *

Modified: head/sys/dev/gpio/gpiobusvar.h
==
--- head/sys/dev/gpio/gpiobusvar.h  Tue Jun  7 04:51:50 2016
(r301538)
+++ head/sys/dev/gpio/gpiobusvar.h  Tue Jun  7 05:08:24 2016
(r301539)
@@ -70,6 +70,13 @@ struct gpiobus_pin_data
char*name;  /* pin name. */
 };
 
+struct intr_map_data_gpio {
+   struct intr_map_datahdr;
+   u_int   gpio_pin_num;
+   u_int   gpio_pin_flags;
+   u_int   gpio_intr_mode;
+};
+
 struct gpiobus_softc
 {
struct mtx  sc_mtx; /* bus mutex */

Modified: head/sys/kern/subr_intr.c
==
--- head/sys/kern/subr_intr.c   Tue Jun  7 04:51:50 2016(r301538)
+++ head/sys/kern/subr_intr.c   Tue Jun  7 05:08:24 2016(r301539)
@@ -147,7 +147,9 @@ struct intr_dev_data {
 };
 
 static struct intr_dev_data *intr_ddata_tab[2 * NIRQ];
+#if 0
 static u_int intr_ddata_first_unused;
+#endif
 
 #define IRQ_DDATA_BASE 1
 CTASSERT(IRQ_DDATA_BASE > nitems(irq_sources));
@@ -534,6 +536,7 @@ intr_isrc_init_on_cpu(struct intr_irqsrc
 }
 #endif
 
+#if 0
 static struct intr_dev_data *
 intr_ddata_alloc(u_int extsize)
 {
@@ -556,6 +559,7 @@ intr_ddata_alloc(u_int extsize)
ddata->idd_data = (struct intr_map_data *)((uintptr_t)ddata + size);
return (ddata);
 }
+#endif
 
 static struct intr_irqsrc *
 intr_ddata_lookup(u_int irq, struct intr_map_data **datap)
@@ -620,30 +624,6 @@ intr_acpi_map_irq(device_t dev, u_int ir
 }
 #endif
 
-/*
- *  Store GPIO interrupt decription in framework and return unique interrupt
- *  number (resource handle) associated with it.
- */
-u_int
-intr_gpio_map_irq(device_t dev, u_int pin_num, u_int pin_flags, u_int 
intr_mode)
-{
-   struct intr_dev_data *ddata;
-   struct intr_map_data_gpio *dag;
-
-   ddata = intr_ddata_alloc(sizeof(struct intr_map_data_gpio));
-   if (ddata == NULL)
-   return (INTR_IRQ_INVALID);  /* no space left */
-
-   ddata->idd_dev = dev;
-   ddata->idd_data->type = INTR_MAP_DATA_GPIO;
-
-   dag = (struct intr_map_data_gpio *)ddata->idd_data;
-   dag->gpio_pin_num = pin_num;
-   dag->gpio_pin_flags = pin_flags;
-   

svn commit: r301538 - in head/sys: dev/cxgb dev/e1000 dev/hyperv/netvsc dev/ixgbe dev/ixl dev/mlx5/mlx5_en dev/qlxgbe dev/qlxge net netinet ofed/drivers/net/mlx4

2016-06-06 Thread Sepherosa Ziehau
Author: sephe
Date: Tue Jun  7 04:51:50 2016
New Revision: 301538
URL: https://svnweb.freebsd.org/changeset/base/301538

Log:
  net: Use M_HASHTYPE_OPAQUE_HASH if the mbuf flowid has hash properties
  
  Reviewed by:  hps, erj, tuexen
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D6688

Modified:
  head/sys/dev/cxgb/cxgb_sge.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  head/sys/dev/ixgbe/ix_txrx.c
  head/sys/dev/ixl/ixl_txrx.c
  head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
  head/sys/dev/qlxgbe/ql_isr.c
  head/sys/dev/qlxge/qls_isr.c
  head/sys/net/flowtable.c
  head/sys/net/if_vxlan.c
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctp_pcb.c
  head/sys/ofed/drivers/net/mlx4/en_rx.c

Modified: head/sys/dev/cxgb/cxgb_sge.c
==
--- head/sys/dev/cxgb/cxgb_sge.cTue Jun  7 04:22:18 2016
(r301537)
+++ head/sys/dev/cxgb/cxgb_sge.cTue Jun  7 04:51:50 2016
(r301538)
@@ -2900,7 +2900,8 @@ process_responses(adapter_t *adap, struc
eop = get_packet(adap, drop_thresh, qs, mh, r);
if (eop) {
if (r->rss_hdr.hash_type && !adap->timestamp) {
-   M_HASHTYPE_SET(mh->mh_head, 
M_HASHTYPE_OPAQUE);
+   M_HASHTYPE_SET(mh->mh_head,
+   M_HASHTYPE_OPAQUE_HASH);
mh->mh_head->m_pkthdr.flowid = rss_hash;
}
}

Modified: head/sys/dev/e1000/if_igb.c
==
--- head/sys/dev/e1000/if_igb.c Tue Jun  7 04:22:18 2016(r301537)
+++ head/sys/dev/e1000/if_igb.c Tue Jun  7 04:51:50 2016(r301538)
@@ -5154,7 +5154,7 @@ igb_rxeof(struct igb_queue *que, int cou
default:
/* XXX fallthrough */
M_HASHTYPE_SET(rxr->fmp,
-   M_HASHTYPE_OPAQUE);
+   M_HASHTYPE_OPAQUE_HASH);
}
} else {
 #ifndef IGB_LEGACY_TX

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Tue Jun  7 04:22:18 
2016(r301537)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Tue Jun  7 04:51:50 
2016(r301538)
@@ -1300,6 +1300,7 @@ netvsc_recv(struct hv_vmbus_channel *cha
struct ifnet *ifp = rxr->hn_ifp;
struct mbuf *m_new;
int size, do_lro = 0, do_csum = 1;
+   int hash_type = M_HASHTYPE_OPAQUE_HASH;
 
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
return (0);
@@ -1430,8 +1431,6 @@ skip:
}
 
if (hash_info != NULL && hash_value != NULL) {
-   int hash_type = M_HASHTYPE_OPAQUE;
-
rxr->hn_rss_pkts++;
m_new->m_pkthdr.flowid = hash_value->hash_value;
if ((hash_info->hash_info & NDIS_HASH_FUNCTION_MASK) ==
@@ -1465,14 +1464,15 @@ skip:
break;
}
}
-   M_HASHTYPE_SET(m_new, hash_type);
} else {
-   if (hash_value != NULL)
+   if (hash_value != NULL) {
m_new->m_pkthdr.flowid = hash_value->hash_value;
-   else
+   } else {
m_new->m_pkthdr.flowid = rxr->hn_rx_idx;
-   M_HASHTYPE_SET(m_new, M_HASHTYPE_OPAQUE);
+   hash_type = M_HASHTYPE_OPAQUE;
+   }
}
+   M_HASHTYPE_SET(m_new, hash_type);
 
/*
 * Note:  Moved RX completion back to hv_nv_on_receive() so all

Modified: head/sys/dev/ixgbe/ix_txrx.c
==
--- head/sys/dev/ixgbe/ix_txrx.cTue Jun  7 04:22:18 2016
(r301537)
+++ head/sys/dev/ixgbe/ix_txrx.cTue Jun  7 04:51:50 2016
(r301538)
@@ -1964,7 +1964,7 @@ ixgbe_rxeof(struct ix_queue *que)
 #endif
 default:
 M_HASHTYPE_SET(sendmp,
-M_HASHTYPE_OPAQUE);
+M_HASHTYPE_OPAQUE_HASH);
 }
 } else {
 sendmp->m_pkthdr.flowid = que->msix;

Modified: head/sys/dev/ixl/ixl_txrx.c
==
--- 

svn commit: r301537 - head/usr.sbin/bluetooth/ath3kfw

2016-06-06 Thread Adrian Chadd
Author: adrian
Date: Tue Jun  7 04:22:18 2016
New Revision: 301537
URL: https://svnweb.freebsd.org/changeset/base/301537

Log:
  [ath3k] add a replacement ath3k firmware loading tool.
  
  This is influenced by the ath3k driver from linux (circa 2013, this is
  how long I've been sitting on this.)
  
  It handles loading in firmware using the newer model, where it assembles
  the right set of firmware blobs and board configuration based on the
  device list and querying the device.
  
  The older utility could only load in a single image - which sometimes
  was ath3k-1.fw and sometimes was ath3k-2.fw.  However, the ath3k maintainers
  didn't want to keep adding in binaries that were just derivatives with a
  separate board config, so they deleted ath3k-2.fw from the Linux firmware
  repository and instead, well, did this.
  
  Now, this has been tested against AR3011 and AR3012 NICs from the AR9285+BT
  combo up through to the QCA9565+BT combo.  It doesn't yet work with the
  QCAFN222 NIC as that is some newer chip.
  
  The firmware can be grabbed from https://github.com/erikarn/ath3kfw/ in
  the share/firmware/ath3k directory.  I'll update this utility over time
  to support the newer firmware drops (newer than mid-2013) which should
  pull in the QCNFA222 and subsequent chips.
  
  Tested:
  
  * AR9285 + BT
  * AR9287 + BT
  * AR9485 + BT
  * AR9462 + BT
  * QCA9565 + BT

Added:
  head/usr.sbin/bluetooth/ath3kfw/ath3k_dbg.h   (contents, props changed)
  head/usr.sbin/bluetooth/ath3kfw/ath3k_fw.c   (contents, props changed)
  head/usr.sbin/bluetooth/ath3kfw/ath3k_fw.h   (contents, props changed)
  head/usr.sbin/bluetooth/ath3kfw/ath3k_hw.c   (contents, props changed)
  head/usr.sbin/bluetooth/ath3kfw/ath3k_hw.h   (contents, props changed)
  head/usr.sbin/bluetooth/ath3kfw/main.c   (contents, props changed)
Deleted:
  head/usr.sbin/bluetooth/ath3kfw/ath3kfw.c
Modified:
  head/usr.sbin/bluetooth/ath3kfw/Makefile
  head/usr.sbin/bluetooth/ath3kfw/ath3kfw.8

Modified: head/usr.sbin/bluetooth/ath3kfw/Makefile
==
--- head/usr.sbin/bluetooth/ath3kfw/MakefileTue Jun  7 01:00:08 2016
(r301536)
+++ head/usr.sbin/bluetooth/ath3kfw/MakefileTue Jun  7 04:22:18 2016
(r301537)
@@ -3,5 +3,6 @@
 PROG=  ath3kfw
 MAN=   ath3kfw.8
 LIBADD+=   usb
+SRCS=  main.c ath3k_fw.c ath3k_hw.c
 
 .include 

Added: head/usr.sbin/bluetooth/ath3kfw/ath3k_dbg.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/bluetooth/ath3kfw/ath3k_dbg.h Tue Jun  7 04:22:18 2016
(r301537)
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2013 Adrian Chadd 
+ * 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,
+ *without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+ *redistribution must be conditioned upon including a substantially
+ *similar Disclaimer requirement for further binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
+ *
+ * $FreeBSD$
+ */
+#ifndef__ATH3K_DEBUG_H__
+#define__ATH3K_DEBUG_H__
+
+extern int ath3k_do_debug;
+extern int ath3k_do_info;
+
+#defineath3k_debug(...)if (ath3k_do_debug) fprintf(stderr, 
__VA_ARGS__)
+#defineath3k_err(...)  fprintf(stderr, __VA_ARGS__)
+#defineath3k_info(...) if (ath3k_do_info) fprintf(stdout, 
__VA_ARGS__)
+
+#endif

Added: head/usr.sbin/bluetooth/ath3kfw/ath3k_fw.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.sbin/bluetooth/ath3kfw/ath3k_fw.c  Tue Jun  7 04:22:18 2016
(r301537)
@@ -0,0 +1,114 @@
+/*-
+ 

Re: svn commit: r301522 - in head: share/man/man4 sys/kern

2016-06-06 Thread Ngie Cooper

> On Jun 6, 2016, at 13:57, Bjoern A. Zeeb  wrote:
> 
> Author: bz
> Date: Mon Jun  6 20:57:24 2016
> New Revision: 301522
> URL: https://svnweb.freebsd.org/changeset/base/301522

Awesome -- thanks bz!!!

> Log:
>  Implement a `show panic` command to DDB which will helpfully print the
>  panic string again if set, in case it scrolled out of the active
>  window.  This avoids having to remember the symbol name.
> 
>  Also add a show callout  command to DDB in order to inspect
>  some struct callout fields in case of panics in the callout code.
>  This may help to see if there was memory corruption or to further
>  ease debugging problems.
> 
>  Obtained from:projects/vnet
>  MFC after:2 weeks
>  Sponsored by:The FreeBSD Foundation
>  Reviewed by:jhb (comment only on the show panic initally)
>  Differential Revision:https://reviews.freebsd.org/D4527
> 
> Modified:
>  head/share/man/man4/ddb.4
>  head/sys/kern/kern_shutdown.c
>  head/sys/kern/kern_timeout.c
> 
> Modified: head/share/man/man4/ddb.4
> ==
> --- head/share/man/man4/ddb.4Mon Jun  6 20:42:54 2016(r301521)
> +++ head/share/man/man4/ddb.4Mon Jun  6 20:57:24 2016(r301522)
> @@ -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: head/sys/kern/kern_shutdown.c
> ==
> --- head/sys/kern/kern_shutdown.cMon Jun  6 20:42:54 2016(r301521)
> +++ head/sys/kern/kern_shutdown.cMon Jun  6 20:57:24 2016(r301522)
> @@ -929,3 +929,14 @@ mkdumpheader(struct kerneldumpheader *kd
>strlcpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring));
>kdh->parity = kerneldump_parity(kdh);
> }
> +
> +#ifdef DDB
> +DB_SHOW_COMMAND(panic, db_show_panic)
> +{
> +
> +if (panicstr == NULL)
> +db_printf("panicstr not set\n");
> +else
> +db_printf("panic: %s\n", panicstr);
> +}
> +#endif
> 
> Modified: head/sys/kern/kern_timeout.c
> ==
> --- head/sys/kern/kern_timeout.cMon Jun  6 20:42:54 2016(r301521)
> +++ head/sys/kern/kern_timeout.cMon Jun  6 20:57:24 2016(r301522)
> @@ -38,6 +38,7 @@
> __FBSDID("$FreeBSD$");
> 
> #include "opt_callout_profiling.h"
> +#include "opt_ddb.h"
> #if defined(__arm__)
> #include "opt_timer.h"
> #endif
> @@ -60,6 +61,11 @@ __FBSDID("$FreeBSD$");
> #include 
> #include 
> 
> +#ifdef DDB
> +#include 
> +#include 
> +#endif
> +
> #ifdef SMP
> #include 
> #endif
> @@ -1615,3 +1621,34 @@ SYSCTL_PROC(_kern, OID_AUTO, callout_sta
> CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE,
> 0, 0, sysctl_kern_callout_stat, "I",
> "Dump immediate statistic snapshot of the scheduled callouts");
> +
> +#ifdef DDB
> +static void
> +_show_callout(struct callout *c)
> +{
> +
> +db_printf("callout %p\n", c);
> +#defineC_DB_PRINTF(f, e)db_printf("   %s = " f "\n", #e, c->e);
> +db_printf("   _links = %p\n", &(c->c_links));
> +C_DB_PRINTF("%" PRId64,c_time);
> +C_DB_PRINTF("%" PRId64,c_precision);
> +C_DB_PRINTF("%p",c_arg);
> +C_DB_PRINTF("%p",c_func);
> +C_DB_PRINTF("%p",c_lock);
> +C_DB_PRINTF("%#x",c_flags);
> +C_DB_PRINTF("%#x",c_iflags);
> +C_DB_PRINTF("%d",c_cpu);
> +#undefC_DB_PRINTF
> +}
> +
> +DB_SHOW_COMMAND(callout, db_show_callout)
> +{
> +
> +if (!have_addr) {
> +db_printf("usage: show callout \n");
> +return;
> +}
> +
> +_show_callout((struct callout *)addr);
> +}
> +#endif /* DDB */
> 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301496 - in head: sbin/ifconfig share/man/man4 sys/net sys/sys

2016-06-06 Thread Marcelo Araujo
Hi,

Because 802.1p is Layer 2 and on its specification it sets video to 4, what
DSCP does is convert those 3-bits to use on Layer 3 and try to do the CoS
as close as possible with 802.1p.

Best,

2016-06-07 0:54 GMT+08:00 Slawa Olhovchenkov :

> On Mon, Jun 06, 2016 at 09:51:58AM +, Marcelo Araujo wrote:
>
> > Author: araujo
> > Date: Mon Jun  6 09:51:58 2016
> > New Revision: 301496
> > URL: https://svnweb.freebsd.org/changeset/base/301496
> >
> > Log:
> >   Add support to priority code point (PCP) that is an 3-bit field
> >   which refers to IEEE 802.1p class of service and maps to the frame
> >   priority level.
> >
> >   Values in order of priority are: 1 (Background (lowest)),
> >   0 (Best effort (default)), 2 (Excellent effort),
> >   3 (Critical applications), 4 (Video, < 100ms latency),
> >   5 (Video, < 10ms latency), 6 (Internetwork control) and
> >   7 (Network control (highest)).
>
> What purpose to use 4 for video?
>
> http://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus1000/sw/4_0/qos/configuration/guide/nexus1000v_qos/qos_6dscp_val.pdf
> point video is 3.
>
> >   Example of usage:
> >   root# ifconfig em0.1 create
> >   root# ifconfig em0.1 vlanpcp 3
> >
> >   Note:
> >   The review D801 includes the pf(4) part, but as discussed with kristof,
> >   we won't commit the pf(4) bits for now.
> >   The credits of the original code is from rwatson.
> >
> >   Differential Revision:  https://reviews.freebsd.org/D801
> >   Reviewed by:gnn, adrian, loos
> >   Discussed with: rwatson, glebius, kristof
> >   Tested by:  many including Matthew Grooms 
> >   Obtained from:  pfSense
> >   Relnotes:   Yes
> >
> > Modified:
> >   head/sbin/ifconfig/ifconfig.8
> >   head/sbin/ifconfig/ifvlan.c
> >   head/share/man/man4/vlan.4
> >   head/sys/net/if.h
> >   head/sys/net/if_vlan.c
> >   head/sys/net/if_vlan_var.h
> >   head/sys/sys/priv.h
> >
> > Modified: head/sbin/ifconfig/ifconfig.8
> >
> ==
> > --- head/sbin/ifconfig/ifconfig.8 Mon Jun  6 09:30:31 2016
> (r301495)
> > +++ head/sbin/ifconfig/ifconfig.8 Mon Jun  6 09:51:58 2016
> (r301496)
> > @@ -2614,6 +2614,29 @@ Note that
> >  and
> >  .Cm vlandev
> >  must both be set at the same time.
> > +.It Cm vlanpcp Ar priority_code_point
> > +Priority code point
> > +.Pq Dv PCP
> > +is an 3-bit field which refers to the IEEE 802.1p
> > +class of service and maps to the frame priority level.
> > +.Pp
> > +Values in order of priority are:
> > +.Cm 1
> > +.Pq Dv Background (lowest) ,
> > +.Cm 0
> > +.Pq Dv Best effort (default) ,
> > +.Cm 2
> > +.Pq Dv Excellent effort ,
> > +.Cm 3
> > +.Pq Dv Critical applications ,
> > +.Cm 4
> > +.Pq Dv Video, < 100ms latency ,
> > +.Cm 5
> > +.Pq Dv Video, < 10ms latency ,
> > +.Cm 6
> > +.Pq Dv Internetwork control ,
> > +.Cm 7
> > +.Pq Dv Network control (highest) .
> >  .It Cm vlandev Ar iface
> >  Associate the physical interface
> >  .Ar iface
> >
> > Modified: head/sbin/ifconfig/ifvlan.c
> >
> ==
> > --- head/sbin/ifconfig/ifvlan.c   Mon Jun  6 09:30:31 2016
> (r301495)
> > +++ head/sbin/ifconfig/ifvlan.c   Mon Jun  6 09:51:58 2016
> (r301496)
> > @@ -1,6 +1,10 @@
> >  /*
> > - * Copyright (c) 1999
> > - *   Bill Paul .  All rights reserved.
> > + * Copyright (c) 1999 Bill Paul 
> > + * Copyright (c) 2012 ADARA Networks, Inc.
> > + * All rights reserved.
> > +  *
> > + * Portions of this software were developed by Robert N. M. Watson under
> > + * contract to ADARA Networks, Inc.
> >   *
> >   * Redistribution and use in source and binary forms, with or without
> >   * modification, are permitted provided that the following conditions
> > @@ -78,10 +82,14 @@ vlan_status(int s)
> >  {
> >   struct vlanreq  vreq;
> >
> > - if (getvlan(s, , ) != -1)
> > - printf("\tvlan: %d parent interface: %s\n",
> > - vreq.vlr_tag, vreq.vlr_parent[0] == '\0' ?
> > - "" : vreq.vlr_parent);
> > + if (getvlan(s, , ) == -1)
> > + return;
> > + printf("\tvlan: %d", vreq.vlr_tag);
> > + if (ioctl(s, SIOCGVLANPCP, (caddr_t)) != -1)
> > + printf(" vlanpcp: %u", ifr.ifr_vlan_pcp);
> > + printf(" parent interface: %s", vreq.vlr_parent[0] == '\0' ?
> > + "" : vreq.vlr_parent);
> > + printf("\n");
> >  }
> >
> >  static void
> > @@ -149,6 +157,22 @@ DECL_CMD_FUNC(setvlandev, val, d)
> >  }
> >
> >  static
> > +DECL_CMD_FUNC(setvlanpcp, val, d)
> > +{
> > + u_long ul;
> > + char *endp;
> > +
> > + ul = strtoul(val, , 0);
> > + if (*endp != '\0')
> > + errx(1, "invalid value for vlanpcp");
> > + if (ul > 7)
> > + errx(1, "value for vlanpcp out of range");
> > + ifr.ifr_vlan_pcp = ul;
> > + if (ioctl(s, SIOCSVLANPCP, (caddr_t)) == -1)

svn commit: r301536 - in head: share/man/man5 usr.sbin/ypldap

2016-06-06 Thread Marcelo Araujo
Author: araujo
Date: Tue Jun  7 01:00:08 2016
New Revision: 301536
URL: https://svnweb.freebsd.org/changeset/base/301536

Log:
  Add an entry on rc.conf(5) explaining the new options
  nis_ypldap_enable and nis_ypldap_flags.
  
  Also add an entry on ypldap(8) that it is a feature ready and
  appears on FreeBSD 11.0.
  
  Requested by: rodrigc
  Relnotes: Yes

Modified:
  head/share/man/man5/rc.conf.5
  head/usr.sbin/ypldap/ypldap.8

Modified: head/share/man/man5/rc.conf.5
==
--- head/share/man/man5/rc.conf.5   Tue Jun  7 00:27:55 2016
(r301535)
+++ head/share/man/man5/rc.conf.5   Tue Jun  7 01:00:08 2016
(r301536)
@@ -2559,6 +2559,22 @@ is set to
 these are the flags to pass to the
 .Xr ypbind 8
 service.
+.It Va nis_ypldap_enable
+.Pq Vt bool
+If set to
+.Dq Li YES ,
+run the
+.Xr ypldap 8
+daemon at system boot time.
+.It Va nis_ypldap_flags
+.Pq Vt str
+If
+.Va nis.ypldap_enable
+is set to
+.Dq Li YES ,
+these are the flags to pass to the
+.Xr ypldap 8
+daemon.
 .It Va nis_ypset_enable
 .Pq Vt bool
 If set to

Modified: head/usr.sbin/ypldap/ypldap.8
==
--- head/usr.sbin/ypldap/ypldap.8   Tue Jun  7 00:27:55 2016
(r301535)
+++ head/usr.sbin/ypldap/ypldap.8   Tue Jun  7 01:00:08 2016
(r301536)
@@ -74,7 +74,9 @@ configuration file.
 The
 .Nm
 program first appeared in
-.Ox 4.4 .
+.Ox 4.4
+and then
+.Fx 11.0 .
 .Sh AUTHORS
 The
 .Nm
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301535 - head/sys/dev/cxgbe

2016-06-06 Thread Navdeep Parhar
Author: np
Date: Tue Jun  7 00:27:55 2016
New Revision: 301535
URL: https://svnweb.freebsd.org/changeset/base/301535

Log:
  cxgbe(4): Track the state of the hardware traffic schedulers in the
  driver.  This works as long as everyone uses set_sched_class_params
  to program them.
  
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hMon Jun  6 23:00:42 2016
(r301534)
+++ head/sys/dev/cxgbe/adapter.hTue Jun  7 00:27:55 2016
(r301535)
@@ -54,6 +54,7 @@
 #include 
 
 #include "offload.h"
+#include "t4_ioctl.h"
 #include "common/t4_msg.h"
 #include "firmware/t4fw_interface.h"
 
@@ -264,6 +265,17 @@ struct vi_info {
uint8_t hw_addr[ETHER_ADDR_LEN]; /* factory MAC address, won't change */
 };
 
+enum {
+   /* tx_sched_class flags */
+   TX_SC_OK= (1 << 0), /* Set up in hardware, active. */
+};
+
+struct tx_sched_class {
+   int refcount;
+   int flags;
+   struct t4_sched_class_params params;
+};
+
 struct port_info {
device_t dev;
struct adapter *adapter;
@@ -273,6 +285,8 @@ struct port_info {
int up_vis;
int uld_vis;
 
+   struct tx_sched_class *tc;  /* traffic classes for this channel */
+
struct mtx pi_lock;
char lockname[16];
unsigned long flags;

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cMon Jun  6 23:00:42 2016
(r301534)
+++ head/sys/dev/cxgbe/t4_main.cTue Jun  7 00:27:55 2016
(r301535)
@@ -875,6 +875,9 @@ t4_attach(device_t dev)
mtx_init(>pi_lock, pi->lockname, 0, MTX_DEF);
sc->chan_map[pi->tx_chan] = i;
 
+   pi->tc = malloc(sizeof(struct tx_sched_class) *
+   sc->chip_params->nsched_cls, M_CXGBE, M_ZERO | M_WAITOK);
+
if (is_10G_port(pi) || is_40G_port(pi)) {
n10g++;
for_each_vi(pi, j, vi) {
@@ -1131,6 +1134,7 @@ t4_detach(device_t dev)
 
mtx_destroy(>pi_lock);
free(pi->vi, M_CXGBE);
+   free(pi->tc, M_CXGBE);
free(pi, M_CXGBE);
}
}
@@ -8319,6 +8323,7 @@ set_sched_class_params(struct adapter *s
 {
int rc, top_speed, fw_level, fw_mode, fw_rateunit, fw_ratemode;
struct port_info *pi;
+   struct tx_sched_class *tc;
 
if (p->level == SCHED_CLASS_LEVEL_CL_RL)
fw_level = FW_SCHED_PARAMS_LEVEL_CL_RL;
@@ -8401,9 +8406,20 @@ set_sched_class_params(struct adapter *s
sleep_ok ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4sscp");
if (rc)
return (rc);
+   tc = >tc[p->cl];
+   tc->params = *p;
rc = -t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, fw_level, fw_mode,
fw_rateunit, fw_ratemode, p->channel, p->cl, p->minrate, p->maxrate,
p->weight, p->pktsize, sleep_ok);
+   if (rc == 0)
+   tc->flags |= TX_SC_OK;
+   else {
+   /*
+* Unknown state at this point, see tc->params for what was
+* attempted.
+*/
+   tc->flags &= ~TX_SC_OK;
+   }
end_synchronized_op(sc, sleep_ok ? 0 : LOCK_HELD);
 
return (rc);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301533 - head/sys/net

2016-06-06 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Jun  6 22:59:58 2016
New Revision: 301533
URL: https://svnweb.freebsd.org/changeset/base/301533

Log:
  After tearing down the interface per-"domain" bits, set the data area
  to NULL to avoid it being mis-treated on a possible re-attach but also
  to get a clean NULL pointer derefence in case of errors due to
  unexpected race conditions elsewhere in the code, e.g., callouts.
  
  Obtained from:projects/vnet
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Mon Jun  6 22:54:08 2016(r301532)
+++ head/sys/net/if.c   Mon Jun  6 22:59:58 2016(r301533)
@@ -1030,9 +1030,11 @@ if_detach_internal(struct ifnet *ifp, in
ifp->if_afdata_initialized = 0;
IF_AFDATA_UNLOCK(ifp);
for (dp = domains; i > 0 && dp; dp = dp->dom_next) {
-   if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family])
+   if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family]) {
(*dp->dom_ifdetach)(ifp,
ifp->if_afdata[dp->dom_family]);
+   ifp->if_afdata[dp->dom_family] = NULL;
+   }
}
 
return (0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301532 - head/usr.sbin/newsyslog

2016-06-06 Thread Eric van Gyzen
Author: vangyzen
Date: Mon Jun  6 22:54:08 2016
New Revision: 301532
URL: https://svnweb.freebsd.org/changeset/base/301532

Log:
  newsyslog: Eliminate unnecessary sleep(10) when -R and -s are specified
  
  After going through the signal work list, during which do_sigwork()
  is called and essentially does nothing because -s and -R were
  specified on the command line, newsyslog will sleep for 10 seconds
  as the (verbose) code says: "Pause 10 seconds to allow daemon(s)
  to close log file(s)".
  
  However, the man page verbiage for -R (and -s) seems quite clear
  that this sleep() is unnecessary because the daemon was expected
  to have already closed the log file before calling newsyslog.
  
  PR:   210020
  Submitted by: David A. Bright 
  MFC after:1 week
  Sponsored by: Dell Inc.
  Differential Revision:https://reviews.freebsd.org/D6727

Modified:
  head/usr.sbin/newsyslog/newsyslog.c

Modified: head/usr.sbin/newsyslog/newsyslog.c
==
--- head/usr.sbin/newsyslog/newsyslog.c Mon Jun  6 22:51:44 2016
(r301531)
+++ head/usr.sbin/newsyslog/newsyslog.c Mon Jun  6 22:54:08 2016
(r301532)
@@ -333,13 +333,15 @@ main(int argc, char **argv)
printf("Signal all daemon process(es)...\n");
SLIST_FOREACH(stmp, , sw_nextp)
do_sigwork(stmp);
-   if (noaction)
-   printf("\tsleep 10\n");
-   else {
-   if (verbose)
-   printf("Pause 10 seconds to allow daemon(s)"
-   " to close log file(s)\n");
-   sleep(10);
+   if (!(rotatereq && nosignal)) {
+   if (noaction)
+   printf("\tsleep 10\n");
+   else {
+   if (verbose)
+   printf("Pause 10 seconds to allow "
+   "daemon(s) to close log file(s)\n");
+   sleep(10);
+   }
}
}
/*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301531 - head/sys/dev/cxgbe

2016-06-06 Thread Navdeep Parhar
Author: np
Date: Mon Jun  6 22:51:44 2016
New Revision: 301531
URL: https://svnweb.freebsd.org/changeset/base/301531

Log:
  cxgbe(4): Break up set_sched_class.  Validate the channel number and
  min/max rates against their actual limits (which are chip and port
  specific) instead of hardcoded constants.
  
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cMon Jun  6 22:39:32 2016
(r301530)
+++ head/sys/dev/cxgbe/t4_main.cMon Jun  6 22:51:44 2016
(r301531)
@@ -8297,152 +8297,132 @@ in_range(int val, int lo, int hi)
 }
 
 static int
-set_sched_class(struct adapter *sc, struct t4_sched_params *p)
+set_sched_class_config(struct adapter *sc, int minmax)
 {
-   int fw_subcmd, fw_type, rc;
+   int rc;
 
-   rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4setsc");
+   if (minmax < 0)
+   return (EINVAL);
+
+   rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4sscc");
if (rc)
return (rc);
+   rc = -t4_sched_config(sc, FW_SCHED_TYPE_PKTSCHED, minmax, 1);
+   end_synchronized_op(sc, 0);
 
-   if (!(sc->flags & FULL_INIT_DONE)) {
-   rc = EAGAIN;
-   goto done;
-   }
+   return (rc);
+}
+
+static int
+set_sched_class_params(struct adapter *sc, struct t4_sched_class_params *p,
+int sleep_ok)
+{
+   int rc, top_speed, fw_level, fw_mode, fw_rateunit, fw_ratemode;
+   struct port_info *pi;
+
+   if (p->level == SCHED_CLASS_LEVEL_CL_RL)
+   fw_level = FW_SCHED_PARAMS_LEVEL_CL_RL;
+   else if (p->level == SCHED_CLASS_LEVEL_CL_WRR)
+   fw_level = FW_SCHED_PARAMS_LEVEL_CL_WRR;
+   else if (p->level == SCHED_CLASS_LEVEL_CH_RL)
+   fw_level = FW_SCHED_PARAMS_LEVEL_CH_RL;
+   else
+   return (EINVAL);
+
+   if (p->mode == SCHED_CLASS_MODE_CLASS)
+   fw_mode = FW_SCHED_PARAMS_MODE_CLASS;
+   else if (p->mode == SCHED_CLASS_MODE_FLOW)
+   fw_mode = FW_SCHED_PARAMS_MODE_FLOW;
+   else
+   return (EINVAL);
+
+   if (p->rateunit == SCHED_CLASS_RATEUNIT_BITS)
+   fw_rateunit = FW_SCHED_PARAMS_UNIT_BITRATE;
+   else if (p->rateunit == SCHED_CLASS_RATEUNIT_PKTS)
+   fw_rateunit = FW_SCHED_PARAMS_UNIT_PKTRATE;
+   else
+   return (EINVAL);
+
+   if (p->ratemode == SCHED_CLASS_RATEMODE_REL)
+   fw_ratemode = FW_SCHED_PARAMS_RATE_REL;
+   else if (p->ratemode == SCHED_CLASS_RATEMODE_ABS)
+   fw_ratemode = FW_SCHED_PARAMS_RATE_ABS;
+   else
+   return (EINVAL);
+
+   /* Vet our parameters ... */
+   if (!in_range(p->channel, 0, sc->chip_params->nchan - 1))
+   return (ERANGE);
+
+   pi = sc->port[sc->chan_map[p->channel]];
+   if (pi == NULL)
+   return (ENXIO);
+   MPASS(pi->tx_chan == p->channel);
+   top_speed = port_top_speed(pi) * 100; /* Gbps -> Kbps */
+
+   if (!in_range(p->cl, 0, sc->chip_params->nsched_cls) ||
+   !in_range(p->minrate, 0, top_speed) ||
+   !in_range(p->maxrate, 0, top_speed) ||
+   !in_range(p->weight, 0, 100))
+   return (ERANGE);
 
/*
-* Translate the cxgbetool parameters into T4 firmware parameters.  (The
-* sub-command and type are in common locations.)
+* Translate any unset parameters into the firmware's
+* nomenclature and/or fail the call if the parameters
+* are required ...
 */
-   if (p->subcmd == SCHED_CLASS_SUBCMD_CONFIG)
-   fw_subcmd = FW_SCHED_SC_CONFIG;
-   else if (p->subcmd == SCHED_CLASS_SUBCMD_PARAMS)
-   fw_subcmd = FW_SCHED_SC_PARAMS;
-   else {
-   rc = EINVAL;
-   goto done;
+   if (p->rateunit < 0 || p->ratemode < 0 || p->channel < 0 || p->cl < 0)
+   return (EINVAL);
+
+   if (p->minrate < 0)
+   p->minrate = 0;
+   if (p->maxrate < 0) {
+   if (p->level == SCHED_CLASS_LEVEL_CL_RL ||
+   p->level == SCHED_CLASS_LEVEL_CH_RL)
+   return (EINVAL);
+   else
+   p->maxrate = 0;
}
-   if (p->type == SCHED_CLASS_TYPE_PACKET)
-   fw_type = FW_SCHED_TYPE_PKTSCHED;
-   else {
-   rc = EINVAL;
-   goto done;
+   if (p->weight < 0) {
+   if (p->level == SCHED_CLASS_LEVEL_CL_WRR)
+   return (EINVAL);
+   else
+   p->weight = 0;
}
-
-   if (fw_subcmd == FW_SCHED_SC_CONFIG) {
-   /* Vet our parameters ..*/
-   if (p->u.config.minmax < 0) {
-   rc = EINVAL;
-   

svn commit: r301528 - head/sys/netinet6

2016-06-06 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Jun  6 22:34:12 2016
New Revision: 301528
URL: https://svnweb.freebsd.org/changeset/base/301528

Log:
  Make KASSERT message more useful by printing the variables on which
  we assert.
  
  Obtained from:projects/vnet
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/netinet6/mld6.c

Modified: head/sys/netinet6/mld6.c
==
--- head/sys/netinet6/mld6.cMon Jun  6 22:26:18 2016(r301527)
+++ head/sys/netinet6/mld6.cMon Jun  6 22:34:12 2016(r301528)
@@ -300,7 +300,8 @@ mld_restore_context(struct mbuf *m)
 
 #if defined(VIMAGE) && defined(INVARIANTS)
KASSERT(curvnet == m->m_pkthdr.PH_loc.ptr,
-   ("%s: called when curvnet was not restored", __func__));
+   ("%s: called when curvnet was not restored: cuvnet %p m ptr %p",
+   __func__, curvnet, m->m_pkthdr.PH_loc.ptr));
 #endif
return (m->m_pkthdr.flowid);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301527 - in head: share/man/man4 sys/netinet

2016-06-06 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Jun  6 22:26:18 2016
New Revision: 301527
URL: https://svnweb.freebsd.org/changeset/base/301527

Log:
  Add a `show igi_list` command to DDB to debug IGMP state.
  
  Obtained from:projects/vnet
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/man/man4/ddb.4
  head/sys/netinet/igmp.c

Modified: head/share/man/man4/ddb.4
==
--- head/share/man/man4/ddb.4   Mon Jun  6 22:09:22 2016(r301526)
+++ head/share/man/man4/ddb.4   Mon Jun  6 22:26:18 2016(r301527)
@@ -688,6 +688,13 @@ The second one is the name of the interr
 Those functions are machine dependent.
 .\"
 .Pp
+.It Ic show Cm igi_list Ar addr
+Show information about the IGMP structure
+.Vt struct igmp_ifsoftc
+present at
+.Ar addr .
+.\"
+.Pp
 .It Ic show Cm inodedeps Op Ar addr
 Show brief information about each inodedep structure.
 If

Modified: head/sys/netinet/igmp.c
==
--- head/sys/netinet/igmp.c Mon Jun  6 22:09:22 2016(r301526)
+++ head/sys/netinet/igmp.c Mon Jun  6 22:26:18 2016(r301527)
@@ -50,6 +50,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_ddb.h"
+
 #include 
 #include 
 #include 
@@ -64,6 +66,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef DDB
+#include 
+#endif
+
 #include 
 #include 
 #include 
@@ -3641,6 +3647,37 @@ vnet_igmp_uninit(const void *unused __un
 VNET_SYSUNINIT(vnet_igmp_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY,
 vnet_igmp_uninit, NULL);
 
+#ifdef DDB
+DB_SHOW_COMMAND(igi_list, db_show_igi_list)
+{
+   struct igmp_ifsoftc *igi, *tigi;
+   LIST_HEAD(_igi_list, igmp_ifsoftc) *igi_head;
+
+   if (!have_addr) {
+   db_printf("usage: show igi_list \n");
+   return;
+   }
+   igi_head = (struct _igi_list *)addr;
+
+   LIST_FOREACH_SAFE(igi, igi_head, igi_link, tigi) {
+   db_printf("igmp_ifsoftc %p:\n", igi);
+   db_printf("ifp %p\n", igi->igi_ifp);
+   db_printf("version %u\n", igi->igi_version);
+   db_printf("v1_timer %u\n", igi->igi_v1_timer);
+   db_printf("v2_timer %u\n", igi->igi_v2_timer);
+   db_printf("v3_timer %u\n", igi->igi_v3_timer);
+   db_printf("flags %#x\n", igi->igi_flags);
+   db_printf("rv %u\n", igi->igi_rv);
+   db_printf("qi %u\n", igi->igi_qi);
+   db_printf("qri %u\n", igi->igi_qri);
+   db_printf("uri %u\n", igi->igi_uri);
+   /* SLIST_HEAD(,in_multi)   igi_relinmhead */
+   /* struct mbufqigi_gq; */
+   db_printf("\n");
+   }
+}
+#endif
+
 static int
 igmp_modevent(module_t mod, int type, void *unused __unused)
 {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301522 - in head: share/man/man4 sys/kern

2016-06-06 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Jun  6 20:57:24 2016
New Revision: 301522
URL: https://svnweb.freebsd.org/changeset/base/301522

Log:
  Implement a `show panic` command to DDB which will helpfully print the
  panic string again if set, in case it scrolled out of the active
  window.  This avoids having to remember the symbol name.
  
  Also add a show callout  command to DDB in order to inspect
  some struct callout fields in case of panics in the callout code.
  This may help to see if there was memory corruption or to further
  ease debugging problems.
  
  Obtained from:projects/vnet
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Reviewed by:  jhb (comment only on the show panic initally)
  Differential Revision:https://reviews.freebsd.org/D4527

Modified:
  head/share/man/man4/ddb.4
  head/sys/kern/kern_shutdown.c
  head/sys/kern/kern_timeout.c

Modified: head/share/man/man4/ddb.4
==
--- head/share/man/man4/ddb.4   Mon Jun  6 20:42:54 2016(r301521)
+++ head/share/man/man4/ddb.4   Mon Jun  6 20:57:24 2016(r301522)
@@ -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: head/sys/kern/kern_shutdown.c
==
--- head/sys/kern/kern_shutdown.c   Mon Jun  6 20:42:54 2016
(r301521)
+++ head/sys/kern/kern_shutdown.c   Mon Jun  6 20:57:24 2016
(r301522)
@@ -929,3 +929,14 @@ mkdumpheader(struct kerneldumpheader *kd
strlcpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring));
kdh->parity = kerneldump_parity(kdh);
 }
+
+#ifdef DDB
+DB_SHOW_COMMAND(panic, db_show_panic)
+{
+
+   if (panicstr == NULL)
+   db_printf("panicstr not set\n");
+   else
+   db_printf("panic: %s\n", panicstr);
+}
+#endif

Modified: head/sys/kern/kern_timeout.c
==
--- head/sys/kern/kern_timeout.cMon Jun  6 20:42:54 2016
(r301521)
+++ head/sys/kern/kern_timeout.cMon Jun  6 20:57:24 2016
(r301522)
@@ -38,6 +38,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_callout_profiling.h"
+#include "opt_ddb.h"
 #if defined(__arm__)
 #include "opt_timer.h"
 #endif
@@ -60,6 +61,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef DDB
+#include 
+#include 
+#endif
+
 #ifdef SMP
 #include 
 #endif
@@ -1615,3 +1621,34 @@ SYSCTL_PROC(_kern, OID_AUTO, callout_sta
 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE,
 0, 0, sysctl_kern_callout_stat, "I",
 "Dump immediate statistic snapshot of the scheduled callouts");
+
+#ifdef DDB
+static void
+_show_callout(struct callout *c)
+{
+
+   db_printf("callout %p\n", c);
+#defineC_DB_PRINTF(f, e)   db_printf("   %s = " f "\n", #e, c->e);
+   db_printf("   _links = %p\n", &(c->c_links));
+   C_DB_PRINTF("%" PRId64, c_time);
+   C_DB_PRINTF("%" PRId64, c_precision);
+   C_DB_PRINTF("%p",   c_arg);
+   C_DB_PRINTF("%p",   c_func);
+   C_DB_PRINTF("%p",   c_lock);
+   C_DB_PRINTF("%#x",  c_flags);
+   C_DB_PRINTF("%#x",  c_iflags);
+   C_DB_PRINTF("%d",   c_cpu);
+#undef C_DB_PRINTF
+}
+
+DB_SHOW_COMMAND(callout, db_show_callout)
+{
+
+   if (!have_addr) {
+   db_printf("usage: show callout \n");
+   return;
+   }
+
+   _show_callout((struct callout *)addr);
+}
+#endif /* DDB */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301520 - head/sys/dev/cxgbe

2016-06-06 Thread Navdeep Parhar
Author: np
Date: Mon Jun  6 20:42:46 2016
New Revision: 301520
URL: https://svnweb.freebsd.org/changeset/base/301520

Log:
  cxgbe(4): Create a reusable struct type for scheduling class parameters.
  
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_ioctl.h

Modified: head/sys/dev/cxgbe/t4_ioctl.h
==
--- head/sys/dev/cxgbe/t4_ioctl.h   Mon Jun  6 20:38:34 2016
(r301519)
+++ head/sys/dev/cxgbe/t4_ioctl.h   Mon Jun  6 20:42:46 2016
(r301520)
@@ -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;
 };
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301518 - head/sys/dev/acpica

2016-06-06 Thread John Baldwin
Author: jhb
Date: Mon Jun  6 20:28:53 2016
New Revision: 301518
URL: https://svnweb.freebsd.org/changeset/base/301518

Log:
  Defer the creation of ACPI thermal kthreads to a startup sysinit.
  
  The SYSINIT runs at SI_SUB_KICK_SCHEDULER after the scheduler is fully
  initialized and timers are working.  This fixes booting in the
  EARLY_AP_STARTUP case.

Modified:
  head/sys/dev/acpica/acpi_thermal.c

Modified: head/sys/dev/acpica/acpi_thermal.c
==
--- head/sys/dev/acpica/acpi_thermal.c  Mon Jun  6 20:00:13 2016
(r301517)
+++ head/sys/dev/acpica/acpi_thermal.c  Mon Jun  6 20:28:53 2016
(r301518)
@@ -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, _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, , );
+if (devcount == 0)
+   return;
+
+/*
+ * Create thread to service all of the thermal zones.
+ */
+error = kproc_create(acpi_tz_thread, NULL, _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(>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.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301517 - head/libexec/ftpd

2016-06-06 Thread Kurt Lidl
Author: lidl
Date: Mon Jun  6 20:00:13 2016
New Revision: 301517
URL: https://svnweb.freebsd.org/changeset/base/301517

Log:
  Update blacklist support in ftpd to clarify fd usage
  
  The ftp daemon dups the control socket to stdin and uses that fd
  throughout the code.  Clarify this usage slightly by changing from
  explicit use of "0" for the fd to a variable, to make it clear what
  the zero represents in the non-blacklist code. Make the
  blacklist_notify routine use STDIN_FILENO so as to have less of a
  "magic number" feel to the code.
  
  Reviewed by:  cem
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D6716

Modified:
  head/libexec/ftpd/blacklist.c
  head/libexec/ftpd/ftpd.c

Modified: head/libexec/ftpd/blacklist.c
==
--- head/libexec/ftpd/blacklist.c   Mon Jun  6 18:45:09 2016
(r301516)
+++ head/libexec/ftpd/blacklist.c   Mon Jun  6 20:00:13 2016
(r301517)
@@ -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: head/libexec/ftpd/ftpd.c
==
--- head/libexec/ftpd/ftpd.cMon Jun  6 18:45:09 2016(r301516)
+++ head/libexec/ftpd/ftpd.cMon Jun  6 20:00:13 2016(r301517)
@@ -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 *)_addr, ) < 0) 
{
+   if (getpeername(s, (struct sockaddr *)_addr, ) < 0) 
{
syslog(LOG_ERR, "getpeername (%s): %m",argv[0]);
exit(1);
}
@@ -557,7 +557,7 @@ gotchild:
(void)sigaction(SIGPIPE, , NULL);
 
addrlen = sizeof(ctrl_addr);
-   if (getsockname(0, (struct sockaddr *)_addr, ) < 0) {
+   if (getsockname(s, (struct sockaddr *)_addr, ) < 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, , sizeof(int)) < 0)
+   if (setsockopt(s, IPPROTO_IP, IP_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, , sizeof(on)) < 0)
+   if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, , 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, , sizeof(on)) < 0)
+   if (setsockopt(s, SOL_SOCKET, SO_OOBINLINE, , 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 *)_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) {
 

Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbi

2016-06-06 Thread Andrey Chernov
On 06.06.2016 20:52, Slawa Olhovchenkov wrote:
>> BTW, it is good idea: to check first, is supported firewall enabled, and
>> only then enable blacklistd by default.
> 
> What purpose? SUDDENLY lockout access to own host after some mistake
> in password?

I agree that default 1 day locking is too restricting. I prefer floating
scale of fail2ban which have several 15min locks (which is not big
lockout for yourself) before one big lock after them, but currently
blacklistd can't do that.

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301418 - head/sys/dev/acpica

2016-06-06 Thread John Baldwin
On Sunday, June 05, 2016 02:02:51 AM Adrian Chadd wrote:
> Author: adrian
> Date: Sun Jun  5 02:02:51 2016
> New Revision: 301418
> URL: https://svnweb.freebsd.org/changeset/base/301418
> 
> Log:
>   [acpi] graphics drivers want access to acpi lid handle
>   
>   the graphics drivers can benefit from access to the lid handle for querying 
> and getting notifications
>   
>   Submitted by:   kmacy
>   Differential Revision:  https://reviews.freebsd.org/D6643

One could have done this without exposing a global variable:

device_t dev;

dev = devclass_get_device(devclass_find("acpi_lid"), 0);
handle = acpi_get_handle(dev);

Alternatively, we could provide a function locate an ACPI handle
by _HID similar to pci_get_class().

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301451 - in head/sys: kern sys

2016-06-06 Thread John Baldwin
On Sunday, June 05, 2016 04:07:57 PM Svatopluk Kraus wrote:
> Author: skra
> Date: Sun Jun  5 16:07:57 2016
> New Revision: 301451
> URL: https://svnweb.freebsd.org/changeset/base/301451
> 
> Log:
>   (1) Add a new bus method to get a mapping data for an interrupt.
>   
>   BUS_MAP_INTR() is used to get an interrupt mapping data according
>   to provided hints. The hints could be modified afterwards, but only
>   if mapping data was allocated. This method is intended to be called
>   before BUS_ALLOC_RESOURCE().
>   
>   An interrupt mapping data describes an interrupt - hardware number,
>   type, configuration, cpu binding, and whatever is needed to setup it.
>   
>   (2) Introduce a method which allows storing of an additional data
>   in struct resource to be available for bus drivers. This method is
>   convenient in two ways:
>- there is no need to rework existing bus drivers as they can simply
>  be extended to provide an additional data,
>- there is no need to modify any existing bus methods as struct
>  resource is already passed to them as argument and thus stored data
>  is simply accessible by other bus drivers.
>   For now, implement this method only for INTRNG.
>   
>   This is motivated by needs of modern SOCs where hardware initialization
>   is not straightforward and resources descriptions are complex, opaque
>   for everyone but provider, and may vary from SOC to SOC. Typical
>   situation is that one bus driver can fetch a resource description for
>   its child device, but it's opaque for this driver. Another bus driver
>   knows a provider for this kind of resource and can pass this resource
>   description to it. In fact, something like device IVARS would be
>   perfect for that if implemented generally enough. Unfortunatelly, IVARS
>   are usable only by their owners now. Only owner knows its IVARS layout,
>   thus other bus drivers are not able to use them.
>   
>   Differential Revision:  https://reviews.freebsd.org/D6632

Does anything need to query this data besides the "nexus" or similar
driver at the top of bus_alloc_resource()?  If so, I'd much rather do
this by having an optional args structure passed to bus_alloc_resource
that is extensible ala make_dev_s() and bus_map_resource().  Previously
I had mentioned passing this as part of bus_setup_intr() rather than
bus_alloc_resource(), but it would actually work better for ACPI if
we did it for bus_alloc_resource() instead.

I guess my question is do you need access to this beyond the lifetime
of the call to bus_alloc_resource().  On x86 for example the state that
would needed to be passed up from ACPI (currently via bus_config_intr())
is stored in the interrupt source structure, so it doesn't need to be
attached to the resource directly, it just needs to be passed up with it
so it can be saved in the interrupt source structure.

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301516 - head/tools/tools/cxgbetool

2016-06-06 Thread Navdeep Parhar
Author: np
Date: Mon Jun  6 18:45:09 2016
New Revision: 301516
URL: https://svnweb.freebsd.org/changeset/base/301516

Log:
  cxgbetool: Allow max-rate > 10Gbps for rate-limited traffic.
  
  Sponsored by: Chelsio Communications

Modified:
  head/tools/tools/cxgbetool/cxgbetool.c

Modified: head/tools/tools/cxgbetool/cxgbetool.c
==
--- head/tools/tools/cxgbetool/cxgbetool.c  Mon Jun  6 17:01:35 2016
(r301515)
+++ head/tools/tools/cxgbetool/cxgbetool.c  Mon Jun  6 18:45:09 2016
(r301516)
@@ -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, 1000)) {
+   !in_range(op.u.params.maxrate, 1, 1)) {
 warnx("sched params \"max-rate\" takes "
-   "value(1-1000) for rate-mode absolute");
+   "value(1-1) for rate-mode absolute");
 errs++;
 }
 if (op.u.params.maxrate > 0 &&
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbi

2016-06-06 Thread Allan Jude
On 2016-06-06 13:50, Nathan Whitehorn wrote:
> 
> 
> On 06/06/16 10:25, Andrey Chernov wrote:
>> On 06.06.2016 20:22, Ian Lepore wrote:
>>> On Mon, 2016-06-06 at 20:06 +0300, Andrey Chernov wrote:
 As variant, I keep hope blacklist sh helper will teach about ipfw
 soon,
 it looks possible. Then it can be re-enabled by default.
>>> No, it should still not be enabled by default.  Maybe it should be
>>> enabled in response to some question in the installer, or maybe even
>>> better, enabled only if some firewall software that understands it is
>>> also enabled.  But afaik, all the available firewalls are disabled by
>>> default in defaults/rc.conf, and this should be too.
>> BTW, it is good idea: to check first, is supported firewall enabled, and
>> only then enable blacklistd by default.
>>
>>
> 
> Like many others, I think it shouldn't be enabled by default ever, even
> though it is a useful thing and a service that should be in the small
> checklist in the installer. FreeBSD has *no* daemons enabled by default
> except devd and a local sendmail and, since this particular feature is
> one that many people don't want, this is the wrong time for an expansion
> of that list.
> 
> (Thanks for adding this to the system, though, and thanks for changing
> the setting!)
> -Nathan
> 

I will add it to the list of services in the installer @ BSDCan.

-- 
Allan Jude
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbi

2016-06-06 Thread Slawa Olhovchenkov
On Mon, Jun 06, 2016 at 08:25:01PM +0300, Andrey Chernov wrote:

> On 06.06.2016 20:22, Ian Lepore wrote:
> > On Mon, 2016-06-06 at 20:06 +0300, Andrey Chernov wrote:
> >> As variant, I keep hope blacklist sh helper will teach about ipfw
> >> soon,
> >> it looks possible. Then it can be re-enabled by default.
> > 
> > No, it should still not be enabled by default.  Maybe it should be
> > enabled in response to some question in the installer, or maybe even
> > better, enabled only if some firewall software that understands it is
> > also enabled.  But afaik, all the available firewalls are disabled by
> > default in defaults/rc.conf, and this should be too.
> 
> BTW, it is good idea: to check first, is supported firewall enabled, and
> only then enable blacklistd by default.

What purpose? SUDDENLY lockout access to own host after some mistake
in password?
I am already touch issuse with default enforcing DNSSEC in unbound and
broken date in CMOS -- inposible to do any DNS queries and imposible
to automatic time sync.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbi

2016-06-06 Thread Nathan Whitehorn



On 06/06/16 10:25, Andrey Chernov wrote:

On 06.06.2016 20:22, Ian Lepore wrote:

On Mon, 2016-06-06 at 20:06 +0300, Andrey Chernov wrote:

As variant, I keep hope blacklist sh helper will teach about ipfw
soon,
it looks possible. Then it can be re-enabled by default.

No, it should still not be enabled by default.  Maybe it should be
enabled in response to some question in the installer, or maybe even
better, enabled only if some firewall software that understands it is
also enabled.  But afaik, all the available firewalls are disabled by
default in defaults/rc.conf, and this should be too.

BTW, it is good idea: to check first, is supported firewall enabled, and
only then enable blacklistd by default.




Like many others, I think it shouldn't be enabled by default ever, even 
though it is a useful thing and a service that should be in the small 
checklist in the installer. FreeBSD has *no* daemons enabled by default 
except devd and a local sendmail and, since this particular feature is 
one that many people don't want, this is the wrong time for an expansion 
of that list.


(Thanks for adding this to the system, though, and thanks for changing 
the setting!)

-Nathan
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbi

2016-06-06 Thread Larry Rosenman

On 2016-06-06 12:25, Ian Lepore wrote:

On Mon, 2016-06-06 at 13:24 -0400, Kurt Lidl wrote:

On 6/6/16 1:22 PM, Ian Lepore wrote:
> No, it should still not be enabled by default.  Maybe it should be
> enabled in response to some question in the installer, or maybe
> even
> better, enabled only if some firewall software that understands it
> is
> also enabled.  But afaik, all the available firewalls are disabled
> by
> default in defaults/rc.conf, and this should be too.

I have already committed a change to turn it off by default.

-Kurt



Yeah, I saw that, thanks.  I was just repsonding to the notion that it
should be re-enabled by default some day.

-- Ian

as an example adding to Ian, my Firewall is a pfSense box NOT on the 
same physical box.


I do NOT need nor want blacklistd running, as NOTHING local can be done.

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 214-642-9640 E-Mail: l...@lerctr.org
US Mail: 17716 Limpia Crk, Round Rock, TX 78664-7281
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbi

2016-06-06 Thread Ian Lepore
On Mon, 2016-06-06 at 13:24 -0400, Kurt Lidl wrote:
> On 6/6/16 1:22 PM, Ian Lepore wrote:
> > No, it should still not be enabled by default.  Maybe it should be
> > enabled in response to some question in the installer, or maybe
> > even
> > better, enabled only if some firewall software that understands it
> > is
> > also enabled.  But afaik, all the available firewalls are disabled
> > by
> > default in defaults/rc.conf, and this should be too.
> 
> I have already committed a change to turn it off by default.
> 
> -Kurt
> 

Yeah, I saw that, thanks.  I was just repsonding to the notion that it
should be re-enabled by default some day.

-- Ian

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbi

2016-06-06 Thread Kurt Lidl

On 6/6/16 1:22 PM, Ian Lepore wrote:

No, it should still not be enabled by default.  Maybe it should be
enabled in response to some question in the installer, or maybe even
better, enabled only if some firewall software that understands it is
also enabled.  But afaik, all the available firewalls are disabled by
default in defaults/rc.conf, and this should be too.


I have already committed a change to turn it off by default.

-Kurt


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbi

2016-06-06 Thread Andrey Chernov
On 06.06.2016 20:22, Ian Lepore wrote:
> On Mon, 2016-06-06 at 20:06 +0300, Andrey Chernov wrote:
>> As variant, I keep hope blacklist sh helper will teach about ipfw
>> soon,
>> it looks possible. Then it can be re-enabled by default.
> 
> No, it should still not be enabled by default.  Maybe it should be
> enabled in response to some question in the installer, or maybe even
> better, enabled only if some firewall software that understands it is
> also enabled.  But afaik, all the available firewalls are disabled by
> default in defaults/rc.conf, and this should be too.

BTW, it is good idea: to check first, is supported firewall enabled, and
only then enable blacklistd by default.

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbi

2016-06-06 Thread Ian Lepore
On Mon, 2016-06-06 at 20:06 +0300, Andrey Chernov wrote:
> On 06.06.2016 20:00, Ian Lepore wrote:
> > Probably everyone assumed (like I did) that it would be disabled by
> > default, and didn't notice that wasn't the case.  Your response
> > indicates the problem with "default enabled"... you mention
> > enabling
> > packet filtering in pf.conf, my response is:  WTF is pf.conf and
> > why
> > are you assuming I do any kind of packet filtering?
> > 
> > I have literally dozens of systems here running freebsd, only one
> > of
> > them runs ipfw, and most of them are systems with small memory and
> > wimpy processors, so why would I want extra do-nothing network
> > daemons
> > running on them by default?
> 
> As variant, I keep hope blacklist sh helper will teach about ipfw
> soon,
> it looks possible. Then it can be re-enabled by default.

No, it should still not be enabled by default.  Maybe it should be
enabled in response to some question in the installer, or maybe even
better, enabled only if some firewall software that understands it is
also enabled.  But afaik, all the available firewalls are disabled by
default in defaults/rc.conf, and this should be too.

-- Ian
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbi

2016-06-06 Thread Andrey Chernov
On 06.06.2016 20:00, Ian Lepore wrote:
> Probably everyone assumed (like I did) that it would be disabled by
> default, and didn't notice that wasn't the case.  Your response
> indicates the problem with "default enabled"... you mention enabling
> packet filtering in pf.conf, my response is:  WTF is pf.conf and why
> are you assuming I do any kind of packet filtering?
> 
> I have literally dozens of systems here running freebsd, only one of
> them runs ipfw, and most of them are systems with small memory and
> wimpy processors, so why would I want extra do-nothing network daemons
> running on them by default?

As variant, I keep hope blacklist sh helper will teach about ipfw soon,
it looks possible. Then it can be re-enabled by default.


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301515 - head/etc/defaults

2016-06-06 Thread Matteo Riondato

> On Jun 6, 2016, at 1:01 PM, Kurt Lidl  wrote:
> 
> Author: lidl
> Date: Mon Jun  6 17:01:35 2016
> New Revision: 301515
> URL: https://svnweb.freebsd.org/changeset/base/301515
> 
> Log:
>  Turn off blacklistd daemon in defaults

Thanks,
Matteo



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r301515 - head/etc/defaults

2016-06-06 Thread Kurt Lidl
Author: lidl
Date: Mon Jun  6 17:01:35 2016
New Revision: 301515
URL: https://svnweb.freebsd.org/changeset/base/301515

Log:
  Turn off blacklistd daemon in defaults
  
  Reported by:  Matteo Riondato ( matteo @ FreeBSD.org )
  Reviewed by:  rpaulo
  Approved by:  rpaulo
  Relnotes: YES
  Sponsored by: The FreeBSD Foundation

Modified:
  head/etc/defaults/rc.conf

Modified: head/etc/defaults/rc.conf
==
--- head/etc/defaults/rc.conf   Mon Jun  6 16:23:02 2016(r301514)
+++ head/etc/defaults/rc.conf   Mon Jun  6 17:01:35 2016(r301515)
@@ -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).
 
 #
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbi

2016-06-06 Thread Ian Lepore
On Mon, 2016-06-06 at 12:38 -0400, Kurt Lidl wrote:
> On 6/5/16 2:39 PM, Matteo Riondato wrote:
> > 
> > > On Jun 2, 2016, at 3:06 PM, Kurt Lidl  wrote:
> > > 
> > > Author: lidl
> > > Date: Thu Jun  2 19:06:04 2016
> > > New Revision: 301226
> > > URL: https://svnweb.freebsd.org/changeset/base/301226
> > > 
> > > Log:
> > >  Add basic blacklist build support
> > > 
> > [snip]
> > > Modified: head/etc/defaults/rc.conf
> > > =
> > > =
> > > --- head/etc/defaults/rc.conf Thu Jun  2 18:41:33 2016
> > > (r301225)
> > > +++ head/etc/defaults/rc.conf Thu Jun  2 19:06:04 2016
> > > (r301226)
> > > @@ -270,6 +270,8 @@ 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_flags=""  # Optional flags for
> > > blacklistd(8).
> > 
> > What is the rationale for having this enabled by default?
> 
> Well, from a certain standpoint, it will encourage more people to
> enable
> the packet filtering it in their pf.conf and get the benefit of
> having
> a system-wide blacklist notification system running.
> 
> Without a one-line change to enable the blocking in the pf.conf file,
> it won't do any blocking.
> 
> > Is any of the services that use it (in their default config)
> > enabled by default?
> 
> I suppose, technically speaking, no there are no daemons with
> blacklist
> support enabled by default. I am planning to commit the sshd support
> tomorrow morning, and even *that* daemon isn't enabled by default.
> 
> I am happy enough to turn off the blacklist daemon by default. You
> are 
> the first person to question this since I posted the review back near
> the beginning of April.
> 
> -Kurt

Probably everyone assumed (like I did) that it would be disabled by
default, and didn't notice that wasn't the case.  Your response
indicates the problem with "default enabled"... you mention enabling
packet filtering in pf.conf, my response is:  WTF is pf.conf and why
are you assuming I do any kind of packet filtering?

I have literally dozens of systems here running freebsd, only one of
them runs ipfw, and most of them are systems with small memory and
wimpy processors, so why would I want extra do-nothing network daemons
running on them by default?

-- Ian

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301217 - in head/sys: net netinet netinet6

2016-06-06 Thread Qing Li
On Sun, Jun 5, 2016 at 11:06 PM, Alexander V. Chernikov <
melif...@freebsd.org> wrote:

> 06.06.2016, 04:40, "George Neville-Neil" :
> > On 4 Jun 2016, at 15:05, Alexander V. Chernikov wrote:
> >
> >>  02.06.2016, 20:51, "George V. Neville-Neil" :
> >>>  Author: gnn
> >>>  Date: Thu Jun 2 17:51:29 2016
> >>>  New Revision: 301217
> >>>  URL: https://svnweb.freebsd.org/changeset/base/301217
> >>>
> >>>  Log:
> >>>This change re-adds L2 caching for TCP and UDP, as originally
> >>>  added in D4306
> >>>but removed due to other changes in the system. Restore the
> >>>  llentry pointer
> >>>to the "struct route", and use it to cache the L2 lookup (ARP or
> >>>  ND6) as
> >>>appropriate.
> >>
> >>  I have several comments regarding this commit.
> >>
> >>  1 Architecturally, there was quite a lot of efforts to eliminate
> >>  layering violation between lltable and other places in network stack.
> >>  It ended by committing D4102, which allowed both to cleanup lower
> >>  level, provide abstract “prepend” framework which could be used to
> >>  provide cached data to _otuput() functions.
> >>  This change brings these violations back in a really invasive way.
> >>
> >>  Additionally, implementing L2 PCB caching at the other subsystem
> >>  expense is really a bad idea.
> >>  If one wants caching in some subsystem, it should be implemented in
> >>  that subsystem not polluting other things.
> >>  Current implementation permits this by filling in “ro_prepend” /
> >>  ro_plen fields.
> >>
> >>  In general, this change looks more like a local hack and not like the
> >>  code that should be included in the tree.
> >>
> >>  2 There was no benchmarks proving the effectiveness of this change.
> >>  (For example, it is not obvious if it could significantly improve TCP
> >>  since we still have per-session TCP wlock + (typically) per-ring
> >>  mutex, so removing lltable rock might not help things here). Given
> >>  that the patch complicates existing code, there should be adequate
> >>  benefits to consider whether this change is worth implementing.
> >>
> >>  3 The “network” group was not included to the review despite the
> >>  fact that most of the changes were related to the L2 layer which is
> >>  not “transport”, so some people might have missed this review.
> >>
> >>  4 This change DOES NOT WORK. really.
> >>  (which raises questions on both review and benchmarking process).
> >>
> >>  The reason is that “plle” argument is filled only in “heavy”
> >>  lltable lookup functions (e.g. when we don’t have neighbour
> >>  adjacency). 99.9% of the time arpresolve/nd6_resolve() returns the
> >>  result w/o calling their heavy versions, and the returned “plle”
> >>  is NULL.
> >>
> >>  This can be easily verified by calling something like
> >>  dtrace -n 'fbt:kernel:ether_output:entry /arg3!=NULL&&((struct route
> >>  *)arg3)->ro_lle != NULL/ { stack(); }'
> >>
> >>  Given that, I kindly ask you to backout this change.
> >
> > Hi,
> >
> > I'm going to limit the scope of this reply to just you, me and Mike
> > Karels, from whom this originated.
> No, please keep the discussion open. The decision on having that
> particular L2 caching implementation (and L2 caching in general) is quite
> important, so it would be great if all technical arguments were saved so
> other people can (now or later) understand the decision details.
>
> Thanks for understanding.
> >
> > Best,
> > George
>
> This commit does seem to undo the non-trivial layer separation efforts
invested previously.
The flow-table construction was meant to help accelerate TCP/UDP route
lookups. The various
aspects of the routing code took flow-table into consideration, and those
code are still present
even after this change.
--Qing
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r301496 - in head: sbin/ifconfig share/man/man4 sys/net sys/sys

2016-06-06 Thread Slawa Olhovchenkov
On Mon, Jun 06, 2016 at 09:51:58AM +, Marcelo Araujo wrote:

> Author: araujo
> Date: Mon Jun  6 09:51:58 2016
> New Revision: 301496
> URL: https://svnweb.freebsd.org/changeset/base/301496
> 
> Log:
>   Add support to priority code point (PCP) that is an 3-bit field
>   which refers to IEEE 802.1p class of service and maps to the frame
>   priority level.
>   
>   Values in order of priority are: 1 (Background (lowest)),
>   0 (Best effort (default)), 2 (Excellent effort),
>   3 (Critical applications), 4 (Video, < 100ms latency),
>   5 (Video, < 10ms latency), 6 (Internetwork control) and
>   7 (Network control (highest)).

What purpose to use 4 for video?
http://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus1000/sw/4_0/qos/configuration/guide/nexus1000v_qos/qos_6dscp_val.pdf
point video is 3.

>   Example of usage:
>   root# ifconfig em0.1 create
>   root# ifconfig em0.1 vlanpcp 3
>   
>   Note:
>   The review D801 includes the pf(4) part, but as discussed with kristof,
>   we won't commit the pf(4) bits for now.
>   The credits of the original code is from rwatson.
>   
>   Differential Revision:  https://reviews.freebsd.org/D801
>   Reviewed by:gnn, adrian, loos
>   Discussed with: rwatson, glebius, kristof
>   Tested by:  many including Matthew Grooms 
>   Obtained from:  pfSense
>   Relnotes:   Yes
> 
> Modified:
>   head/sbin/ifconfig/ifconfig.8
>   head/sbin/ifconfig/ifvlan.c
>   head/share/man/man4/vlan.4
>   head/sys/net/if.h
>   head/sys/net/if_vlan.c
>   head/sys/net/if_vlan_var.h
>   head/sys/sys/priv.h
> 
> Modified: head/sbin/ifconfig/ifconfig.8
> ==
> --- head/sbin/ifconfig/ifconfig.8 Mon Jun  6 09:30:31 2016
> (r301495)
> +++ head/sbin/ifconfig/ifconfig.8 Mon Jun  6 09:51:58 2016
> (r301496)
> @@ -2614,6 +2614,29 @@ Note that
>  and
>  .Cm vlandev
>  must both be set at the same time.
> +.It Cm vlanpcp Ar priority_code_point
> +Priority code point 
> +.Pq Dv PCP
> +is an 3-bit field which refers to the IEEE 802.1p
> +class of service and maps to the frame priority level.
> +.Pp
> +Values in order of priority are:
> +.Cm 1 
> +.Pq Dv Background (lowest) ,
> +.Cm 0
> +.Pq Dv Best effort (default) ,
> +.Cm 2
> +.Pq Dv Excellent effort ,
> +.Cm 3
> +.Pq Dv Critical applications ,
> +.Cm 4
> +.Pq Dv Video, < 100ms latency ,
> +.Cm 5
> +.Pq Dv Video, < 10ms latency ,
> +.Cm 6
> +.Pq Dv Internetwork control ,
> +.Cm 7
> +.Pq Dv Network control (highest) .
>  .It Cm vlandev Ar iface
>  Associate the physical interface
>  .Ar iface
> 
> Modified: head/sbin/ifconfig/ifvlan.c
> ==
> --- head/sbin/ifconfig/ifvlan.c   Mon Jun  6 09:30:31 2016
> (r301495)
> +++ head/sbin/ifconfig/ifvlan.c   Mon Jun  6 09:51:58 2016
> (r301496)
> @@ -1,6 +1,10 @@
>  /*
> - * Copyright (c) 1999
> - *   Bill Paul .  All rights reserved.
> + * Copyright (c) 1999 Bill Paul 
> + * Copyright (c) 2012 ADARA Networks, Inc.
> + * All rights reserved.
> +  *
> + * Portions of this software were developed by Robert N. M. Watson under
> + * contract to ADARA Networks, Inc.
>   *
>   * Redistribution and use in source and binary forms, with or without
>   * modification, are permitted provided that the following conditions
> @@ -78,10 +82,14 @@ vlan_status(int s)
>  {
>   struct vlanreq  vreq;
>  
> - if (getvlan(s, , ) != -1)
> - printf("\tvlan: %d parent interface: %s\n",
> - vreq.vlr_tag, vreq.vlr_parent[0] == '\0' ?
> - "" : vreq.vlr_parent);
> + if (getvlan(s, , ) == -1)
> + return;
> + printf("\tvlan: %d", vreq.vlr_tag);
> + if (ioctl(s, SIOCGVLANPCP, (caddr_t)) != -1)
> + printf(" vlanpcp: %u", ifr.ifr_vlan_pcp);
> + printf(" parent interface: %s", vreq.vlr_parent[0] == '\0' ?
> + "" : vreq.vlr_parent);
> + printf("\n");
>  }
>  
>  static void
> @@ -149,6 +157,22 @@ DECL_CMD_FUNC(setvlandev, val, d)
>  }
>  
>  static
> +DECL_CMD_FUNC(setvlanpcp, val, d)
> +{
> + u_long ul;
> + char *endp;
> +
> + ul = strtoul(val, , 0);
> + if (*endp != '\0')
> + errx(1, "invalid value for vlanpcp");
> + if (ul > 7)
> + errx(1, "value for vlanpcp out of range");
> + ifr.ifr_vlan_pcp = ul;
> + if (ioctl(s, SIOCSVLANPCP, (caddr_t)) == -1)
> + err(1, "SIOCSVLANPCP");
> +}
> +
> +static
>  DECL_CMD_FUNC(unsetvlandev, val, d)
>  {
>   struct vlanreq  vreq;
> @@ -169,6 +193,7 @@ DECL_CMD_FUNC(unsetvlandev, val, d)
>  static struct cmd vlan_cmds[] = {
>   DEF_CLONE_CMD_ARG("vlan",   setvlantag),
>   DEF_CLONE_CMD_ARG("vlandev",setvlandev),
> + DEF_CMD_ARG("vlanpcp",  setvlanpcp),
>   /* NB: non-clone cmds */
>   

Re: svn commit: r301226 - in head: etc etc/defaults etc/periodic/security etc/rc.d lib lib/libblacklist libexec libexec/blacklistd-helper share/mk tools/build/mk usr.sbin usr.sbin/blacklistctl usr.sbi

2016-06-06 Thread Kurt Lidl

On 6/5/16 2:39 PM, Matteo Riondato wrote:



On Jun 2, 2016, at 3:06 PM, Kurt Lidl  wrote:

Author: lidl
Date: Thu Jun  2 19:06:04 2016
New Revision: 301226
URL: https://svnweb.freebsd.org/changeset/base/301226

Log:
 Add basic blacklist build support


[snip]

Modified: head/etc/defaults/rc.conf
==
--- head/etc/defaults/rc.conf   Thu Jun  2 18:41:33 2016(r301225)
+++ head/etc/defaults/rc.conf   Thu Jun  2 19:06:04 2016(r301226)
@@ -270,6 +270,8 @@ 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_flags=""  # Optional flags for blacklistd(8).


What is the rationale for having this enabled by default?


Well, from a certain standpoint, it will encourage more people to enable
the packet filtering it in their pf.conf and get the benefit of having
a system-wide blacklist notification system running.

Without a one-line change to enable the blocking in the pf.conf file,
it won't do any blocking.


Is any of the services that use it (in their default config) enabled by default?


I suppose, technically speaking, no there are no daemons with blacklist
support enabled by default. I am planning to commit the sshd support
tomorrow morning, and even *that* daemon isn't enabled by default.

I am happy enough to turn off the blacklist daemon by default. You are 
the first person to question this since I posted the review back near 
the beginning of April.


-Kurt






___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


RE: svn commit: r301217 - in head/sys: net netinet netinet6

2016-06-06 Thread Qing

-Original Message-
From: owner-src-committ...@freebsd.org 
[mailto:owner-src-committ...@freebsd.org] On Behalf Of Alexander V. Chernikov
Sent: Sunday, June 05, 2016 11:07 PM
To: George Neville-Neil 
Cc: Mike Karels ; src-committers ; 
svn-src-all ; svn-src-head 
Subject: Re: svn commit: r301217 - in head/sys: net netinet netinet6

06.06.2016, 04:40, "George Neville-Neil" :
> On 4 Jun 2016, at 15:05, Alexander V. Chernikov wrote:
>
>>  02.06.2016, 20:51, "George V. Neville-Neil" :
>>>  Author: gnn
>>>  Date: Thu Jun 2 17:51:29 2016
>>>  New Revision: 301217
>>>  URL: https://svnweb.freebsd.org/changeset/base/301217
>>>
>>>  Log:
>>>This change re-adds L2 caching for TCP and UDP, as originally
>>>  added in D4306
>>>but removed due to other changes in the system. Restore the
>>>  llentry pointer
>>>to the "struct route", and use it to cache the L2 lookup (ARP or
>>>  ND6) as
>>>appropriate.
>>
>>  I have several comments regarding this commit.
>>
>>  1 Architecturally, there was quite a lot of efforts to eliminate
>>  layering violation between lltable and other places in network stack.
>>  It ended by committing D4102, which allowed both to cleanup lower
>>  level, provide abstract “prepend” framework which could be used to
>>  provide cached data to _otuput() functions.
>>  This change brings these violations back in a really invasive way.
>>
>>  Additionally, implementing L2 PCB caching at the other subsystem
>>  expense is really a bad idea.
>>  If one wants caching in some subsystem, it should be implemented in
>>  that subsystem not polluting other things.
>>  Current implementation permits this by filling in “ro_prepend” /
>>  ro_plen fields.
>>
>>  In general, this change looks more like a local hack and not like 
>> the
>>  code that should be included in the tree.
>>
>>  2 There was no benchmarks proving the effectiveness of this change.
>>  (For example, it is not obvious if it could significantly improve 
>> TCP
>>  since we still have per-session TCP wlock + (typically) per-ring
>>  mutex, so removing lltable rock might not help things here). Given
>>  that the patch complicates existing code, there should be adequate
>>  benefits to consider whether this change is worth implementing.
>>
>>  3 The “network” group was not included to the review despite the
>>  fact that most of the changes were related to the L2 layer which is
>>  not “transport”, so some people might have missed this review.
>>
>>  4 This change DOES NOT WORK. really.
>>  (which raises questions on both review and benchmarking process).
>>
>>  The reason is that “plle” argument is filled only in “heavy”
>>  lltable lookup functions (e.g. when we don’t have neighbour
>>  adjacency). 99.9% of the time arpresolve/nd6_resolve() returns the
>>  result w/o calling their heavy versions, and the returned “plle”
>>  is NULL.
>>
>>  This can be easily verified by calling something like
>>  dtrace -n 'fbt:kernel:ether_output:entry /arg3!=NULL&&((struct route
>>  *)arg3)->ro_lle != NULL/ { stack(); }'
>>
>>  Given that, I kindly ask you to backout this change.
>
> Hi,
>
> I'm going to limit the scope of this reply to just you, me and Mike 
> Karels, from whom this originated.

>>No, please keep the discussion open. The decision on having that particular 
>>L2 caching 
>>implementation (and L2 caching in general) is quite important, so it would be 
>>great if 
>>all technical arguments were saved so other people can 
>>(now or later) understand the decision details.
>>Thanks for understanding.

This commit does seem to undo the non-trivial layer separation efforts invested 
previously. 
The flow-table construction was meant to help accelerate TCP/UDP route lookups. 
The various
aspects of the routing code took flow-table into consideration, and those code 
are still present
even after this change.

--Qing




___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r301514 - head/sys/net

2016-06-06 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Jun  6 16:23:02 2016
New Revision: 301514
URL: https://svnweb.freebsd.org/changeset/base/301514

Log:
  Similarly to r301505 protect the removal of the ifa from the if_addrhead
  by a lock (as well as the check that the list is not empty).
  
  Obtained from:projects/vnet
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Mon Jun  6 16:10:52 2016(r301513)
+++ head/sys/net/if.c   Mon Jun  6 16:23:02 2016(r301514)
@@ -1007,11 +1007,14 @@ if_detach_internal(struct ifnet *ifp, in
ifp->if_addr = NULL;
 
/* We can now free link ifaddr. */
+   IF_ADDR_WLOCK(ifp);
if (!TAILQ_EMPTY(>if_addrhead)) {
ifa = TAILQ_FIRST(>if_addrhead);
TAILQ_REMOVE(>if_addrhead, ifa, ifa_link);
+   IF_ADDR_WUNLOCK(ifp);
ifa_free(ifa);
-   }
+   } else
+   IF_ADDR_WUNLOCK(ifp);
}
 
rt_flushifroutes(ifp);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301513 - head/usr.bin/indent

2016-06-06 Thread Pedro F. Giffuni
Author: pfg
Date: Mon Jun  6 16:10:52 2016
New Revision: 301513
URL: https://svnweb.freebsd.org/changeset/base/301513

Log:
  indent(1): Fix typo.
  
  It's typedef, not typdef.
  
  Obtained from:OpenBSD (CVS rev. 1.20)
  MFC after:3 days

Modified:
  head/usr.bin/indent/lexi.c

Modified: head/usr.bin/indent/lexi.c
==
--- head/usr.bin/indent/lexi.c  Mon Jun  6 15:01:24 2016(r301512)
+++ head/usr.bin/indent/lexi.c  Mon Jun  6 16:10:52 2016(r301513)
@@ -79,7 +79,7 @@ struct templ specials[1000] =
 {"double", 4},
 {"long", 4},
 {"short", 4},
-{"typdef", 4},
+{"typedef", 4},
 {"unsigned", 4},
 {"register", 4},
 {"static", 4},
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301512 - head/sys/dev/xen/netfront

2016-06-06 Thread Roger Pau Monné
Author: royger
Date: Mon Jun  6 15:01:24 2016
New Revision: 301512
URL: https://svnweb.freebsd.org/changeset/base/301512

Log:
  xen-netfront: fix initialization
  
  A couple of mostly cosmetic fixes for the final initialization of netfront:
  
   - Switch to "connected" state before starting to kick the rings.
   - Correctly use "rxq" in the initialization loop (previously rxq was not
 updated in the loop, and netfront would kick np->rxq[N] several times).
   - Declare and define xn_connect as static, it's not used outside of this
 file.
  
  Reviewed by:  Wei Liu 
  Sponsored by: Citrix Systems R
  Differential revision:https://reviews.freebsd.org/D6657

Modified:
  head/sys/dev/xen/netfront/netfront.c

Modified: head/sys/dev/xen/netfront/netfront.c
==
--- head/sys/dev/xen/netfront/netfront.cMon Jun  6 14:55:46 2016
(r301511)
+++ head/sys/dev/xen/netfront/netfront.cMon Jun  6 15:01:24 2016
(r301512)
@@ -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 = >txq[i];
+   rxq = >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
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301511 - head/sys/xen

2016-06-06 Thread Roger Pau Monné
Author: royger
Date: Mon Jun  6 14:55:46 2016
New Revision: 301511
URL: https://svnweb.freebsd.org/changeset/base/301511

Log:
  xen: Correct typo in #undef for symbol NBPL
  
  Submitted by: Akshay Jaggi 
  Reviewed by:  royger

Modified:
  head/sys/xen/xen-os.h

Modified: head/sys/xen/xen-os.h
==
--- head/sys/xen/xen-os.h   Mon Jun  6 14:24:01 2016(r301510)
+++ head/sys/xen/xen-os.h   Mon Jun  6 14:55:46 2016(r301511)
@@ -118,7 +118,7 @@ xen_clear_bit(int bit, volatile long *ad
atomic_clear_long([bit / NBPL], 1UL << (bit % NBPL));
 }
 
-#undef NPBL
+#undef NBPL
 
 /*
  * Functions to allocate/free unused memory in order
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301508 - head/sys/netinet6

2016-06-06 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Jun  6 14:01:09 2016
New Revision: 301508
URL: https://svnweb.freebsd.org/changeset/base/301508

Log:
  Move the callout_reset() to the end of the work not having it stick
  before we do anything.
  
  Obtained from:projects/vnet
  MFC after:2 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/nd6.c
==
--- head/sys/netinet6/nd6.c Mon Jun  6 13:32:15 2016(r301507)
+++ head/sys/netinet6/nd6.c Mon Jun  6 14:01:09 2016(r301508)
@@ -896,9 +896,6 @@ nd6_timer(void *arg)
struct nd_prefix *pr, *npr;
struct in6_ifaddr *ia6, *nia6;
 
-   callout_reset(_nd6_timer_ch, V_nd6_prune * hz,
-   nd6_timer, curvnet);
-
TAILQ_INIT();
 
/* expire default router list */
@@ -1025,6 +1022,10 @@ nd6_timer(void *arg)
prelist_remove(pr);
}
}
+
+   callout_reset(_nd6_timer_ch, V_nd6_prune * hz,
+   nd6_timer, curvnet);
+
CURVNET_RESTORE();
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301461 - in head/lib/libc: gen locale regex

2016-06-06 Thread Pedro Giffuni



On 06/05/16 14:49, Andrey Chernov wrote:

On 05.06.2016 22:12, Pedro F. Giffuni wrote:

--- head/lib/libc/regex/regcomp.c   Sun Jun  5 18:16:33 2016
(r301460)
+++ head/lib/libc/regex/regcomp.c   Sun Jun  5 19:12:52 2016
(r301461)
@@ -821,10 +821,10 @@ p_b_term(struct parse *p, cset *cs)
(void)REQUIRE((uch)start <= (uch)finish, 
REG_ERANGE);
CHaddrange(p, cs, start, finish);
} else {
-   (void)REQUIRE(__collate_range_cmp(table, start, 
finish) <= 0, REG_ERANGE);
+   (void)REQUIRE(__wcollate_range_cmp(table, start, 
finish) <= 0, REG_ERANGE);
for (i = 0; i <= UCHAR_MAX; i++) {
-   if (   __collate_range_cmp(table, start, 
i) <= 0
-   && __collate_range_cmp(table, i, 
finish) <= 0
+   if (   __wcollate_range_cmp(table, start, 
i) <= 0
+   && __wcollate_range_cmp(table, i, 
finish) <= 0
   )
CHadd(p, cs, i);
}



As I already mention in PR, we have broken regcomp after someone adds
wchar_t support there. Now regcomp ranges works only for the first 256
wchars of the current locale, notice that loop upper limit:
for (i = 0; i <= UCHAR_MAX; i++) {
In general, ranges are either broken in regcomp now or are memory
eating. We have bitmask only for the first 256 wchars, all other added
to the range literally. Imagine what happens if someone specify full
Unicode range in regexp.

Proper fix will be adding bitmask for the whole Unicode range, and even
in that case regcomp attempting to use collation in ranges will be
_very_slow_ since needs to check all Unicode chars in its
for (i = 0; i <= Max_Unicode_wchar; i++) {
loop.

Better stop pretending that we are able to do collation support in the
ranges, since POSIX cares about its own locale only here:
"In the POSIX locale, a range expression represents the set of collating
elements that fall between two elements in the collation sequence,
inclusive. In other locales, a range expression has unspecified
behavior: strictly conforming applications shall not rely on whether the
range expression is valid, or on the set of collating elements matched."

Until whole Unicode range bitmask will be implemented (if ever), better
stop pretending to honor collation order, we just can't do it with
wchars now and do what NetBSD/OpenBSD does (using wchar_t) instead. It
does not prevent memory eating on big ranges (bitmask is needed, see
above), but at least fix the thing that only first 256 wchars are
considered.



Sadly regex is one part of the system that could use a maintainer :(,
I have been forced to look at it more than I'd like to but I don't
really use the collation support at all.

Pedro.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301505 - head/sys/net

2016-06-06 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Jun  6 13:17:25 2016
New Revision: 301505
URL: https://svnweb.freebsd.org/changeset/base/301505

Log:
  In if_purgeaddrs() we cannot hold the lock over the entire loop
  due to called functions (as in other parts of the stack, leave a comment).
  Put around a lock the removal of the ifa from the list however to
  reduce the possible race with other places.
  
  Obtained from:projects/vnet
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Mon Jun  6 13:04:22 2016(r301504)
+++ head/sys/net/if.c   Mon Jun  6 13:17:25 2016(r301505)
@@ -848,6 +848,7 @@ if_purgeaddrs(struct ifnet *ifp)
 {
struct ifaddr *ifa, *next;
 
+   /* XXX cannot hold IF_ADDR_WLOCK over called functions. */
TAILQ_FOREACH_SAFE(ifa, >if_addrhead, ifa_link, next) {
if (ifa->ifa_addr->sa_family == AF_LINK)
continue;
@@ -872,7 +873,9 @@ if_purgeaddrs(struct ifnet *ifp)
continue;
}
 #endif /* INET6 */
+   IF_ADDR_WLOCK(ifp);
TAILQ_REMOVE(>if_addrhead, ifa, ifa_link);
+   IF_ADDR_WUNLOCK(ifp);
ifa_free(ifa);
}
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301504 - head/sys/netinet

2016-06-06 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Jun  6 13:04:22 2016
New Revision: 301504
URL: https://svnweb.freebsd.org/changeset/base/301504

Log:
  Destroy the mutex last.   In this case it should not matter, but
  generally cleanup code might still acquire it thus try to be
  consistent destroying locks late.
  
  Obtained from:projects/vnet
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/netinet/ip_id.c

Modified: head/sys/netinet/ip_id.c
==
--- head/sys/netinet/ip_id.cMon Jun  6 13:01:57 2016(r301503)
+++ head/sys/netinet/ip_id.cMon Jun  6 13:04:22 2016(r301504)
@@ -287,11 +287,11 @@ static void
 ipid_sysuninit(void)
 {
 
-   mtx_destroy(_ip_id_mtx);
if (V_id_array != NULL) {
free(V_id_array, M_IPID);
free(V_id_bits, M_IPID);
}
counter_u64_free(V_ip_id);
+   mtx_destroy(_ip_id_mtx);
 }
 VNET_SYSUNINIT(ip_id, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, ipid_sysuninit, NULL);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301503 - head/sys/net

2016-06-06 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Jun  6 13:01:57 2016
New Revision: 301503
URL: https://svnweb.freebsd.org/changeset/base/301503

Log:
  SYSINIT functions do not return a value; switch to void, remove
  the return value, and mark the unused argument __unused.
  
  Obtained from:projects/vnet
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/net/pfil.c

Modified: head/sys/net/pfil.c
==
--- head/sys/net/pfil.c Mon Jun  6 12:49:47 2016(r301502)
+++ head/sys/net/pfil.c Mon Jun  6 13:01:57 2016(r301503)
@@ -363,26 +363,24 @@ pfil_chain_remove(pfil_chain_t *chain, p
  * Stuff that must be initialized for every instance (including the first of
  * course).
  */
-static int
-vnet_pfil_init(const void *unused)
+static void
+vnet_pfil_init(const void *unused __unused)
 {
 
LIST_INIT(_pfil_head_list);
PFIL_LOCK_INIT_REAL(_pfil_lock, "shared");
-   return (0);
 }
 
 /*
  * Called for the removal of each instance.
  */
-static int
-vnet_pfil_uninit(const void *unused)
+static void
+vnet_pfil_uninit(const void *unused __unused)
 {
 
KASSERT(LIST_EMPTY(_pfil_head_list),
("%s: pfil_head_list %p not empty", __func__, _pfil_head_list));
PFIL_LOCK_DESTROY_REAL(_pfil_lock);
-   return (0);
 }
 
 /* Define startup order. */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301496 - in head: sbin/ifconfig share/man/man4 sys/net sys/sys

2016-06-06 Thread Bruce Simpson

On 06/06/16 13:48, Marcelo Araujo wrote:

We have on ipfw(8) support for DSCP[1], I'm not sure if this is the
same/similar case you mentioned for IP DS(DiffServices?).


Background: I introduced the code to process VLAN 0 tags inline as 
normal traffic several years ago for 802.1p.


I'm referring to a mapping between IP DS bits and priority bits in the 
802.1p header. We have that for 802.11 to some extent already, IIRC.


Data point: OS X allows applications to request LEDBAT style congestion 
control (i.e. BitTorrent-style background traffic) for arbitrary TCP 
sockets through the priority/DS API there.



About the MPLS, the main problem for me is: I have no "network link"
with MPLS that I could even make a test, back in 2008 I was looking for
options that I could reuse on FreeBSD to have a MPLS router support,
nowadays I'm not that keen on MPLS anymore.


Yes, it has downsides but there are still potential use cases for it.

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301502 - head/sys/net

2016-06-06 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Jun  6 12:49:47 2016
New Revision: 301502
URL: https://svnweb.freebsd.org/changeset/base/301502

Log:
  Provide a public interface to rt_flushifroutes which takes the address
  family as an argument as well.
  This will be used to cleanup individual protocols during VNET teardown.
  
  Obtained from:projects/vnet
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/net/route.c
  head/sys/net/route.h

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cMon Jun  6 11:10:37 2016(r301501)
+++ head/sys/net/route.cMon Jun  6 12:49:47 2016(r301502)
@@ -1141,6 +1141,15 @@ rt_ifdelroute(const struct rtentry *rt, 
  * to this interface...oh well...
  */
 void
+rt_flushifroutes_af(struct ifnet *ifp, int af)
+{
+   KASSERT((af >= 1 && af <= AF_MAX), ("%s: af %d not >= 1 and <= %d",
+   __func__, af, AF_MAX));
+
+   rt_foreach_fib_walk_del(af, rt_ifdelroute, ifp);
+}
+
+void
 rt_flushifroutes(struct ifnet *ifp)
 {
 

Modified: head/sys/net/route.h
==
--- head/sys/net/route.hMon Jun  6 11:10:37 2016(r301501)
+++ head/sys/net/route.hMon Jun  6 12:49:47 2016(r301502)
@@ -468,6 +468,7 @@ typedef int rt_walktree_f_t(struct rtent
 typedef void rt_setwarg_t(struct rib_head *, uint32_t, int, void *);
 void   rt_foreach_fib_walk(int af, rt_setwarg_t *, rt_walktree_f_t *, void *);
 void   rt_foreach_fib_walk_del(int af, rt_filter_f_t *filter_f, void *arg);
+void   rt_flushifroutes_af(struct ifnet *, int);
 void   rt_flushifroutes(struct ifnet *ifp);
 
 /* XXX MRT COMPAT VERSIONS THAT SET UNIVERSE to 0 */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301496 - in head: sbin/ifconfig share/man/man4 sys/net sys/sys

2016-06-06 Thread Marcelo Araujo
Hi Bruce,

Thanks for the email.

We have on ipfw(8) support for DSCP[1], I'm not sure if this is the
same/similar case you mentioned for IP DS(DiffServices?).
About the MPLS, the main problem for me is: I have no "network link" with
MPLS that I could even make a test, back in 2008 I was looking for options
that I could reuse on FreeBSD to have a MPLS router support, nowadays I'm
not that keen on MPLS anymore.

2016-06-06 20:03 GMT+08:00 Bruce Simpson :

> It's good to see this patch being aired out and going into mainline
> finally. However, what about IP DS mapping and/or application layer
> mapping? We may not need full-on MPLS style classification, unless we plan
> to take that code later on. (I'm looking at you, NetBSD.)
>



[1] http://svnweb.freebsd.org/base?view=revision=248552


Best,
-- 

-- 
Marcelo Araujo(__)ara...@freebsd.org
\\\'',)http://www.FreeBSD.org    \/  \ ^
Power To Server. .\. /_)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r301496 - in head: sbin/ifconfig share/man/man4 sys/net sys/sys

2016-06-06 Thread Bruce Simpson
It's good to see this patch being aired out and going into mainline 
finally. However, what about IP DS mapping and/or application layer 
mapping? We may not need full-on MPLS style classification, unless we 
plan to take that code later on. (I'm looking at you, NetBSD.)

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301498 - head/sys/net

2016-06-06 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Jun  6 10:13:48 2016
New Revision: 301498
URL: https://svnweb.freebsd.org/changeset/base/301498

Log:
  Make the KASSERT message more helpful by also printing the ifp information
  which we are asserting.
  
  Obtained from:projects/vnet
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/net/if_ethersubr.c

Modified: head/sys/net/if_ethersubr.c
==
--- head/sys/net/if_ethersubr.c Mon Jun  6 10:07:57 2016(r301497)
+++ head/sys/net/if_ethersubr.c Mon Jun  6 10:13:48 2016(r301498)
@@ -753,7 +753,8 @@ ether_input(struct ifnet *ifp, struct mb
 * We will rely on rcvif being set properly in the deferred 
context,
 * so assert it is correct here.
 */
-   KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", 
__func__));
+   KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch m %p "
+   "rcvif %p ifp %p", __func__, m, m->m_pkthdr.rcvif, ifp));
CURVNET_SET_QUIET(ifp->if_vnet);
netisr_dispatch(NETISR_ETHER, m);
CURVNET_RESTORE();
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301497 - head/sys/dev/etherswitch/mtkswitch

2016-06-06 Thread Stanislav Galabov
Author: sgalabov
Date: Mon Jun  6 10:07:57 2016
New Revision: 301497
URL: https://svnweb.freebsd.org/changeset/base/301497

Log:
  Remove erroneous lock assertions
  
  In mediatek etherswitch support, functions mtkswitch_reg_write32_mt7621
  and mtkswitch_reg_read32_mt7621 are called without locks held, so
  lock assertions fail. Remove the lock assertions.
  
  Sponsored by: Smartcom - Bulgaria AD

Modified:
  head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c

Modified: head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c
==
--- head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c   Mon Jun  6 
09:51:58 2016(r301496)
+++ head/sys/dev/etherswitch/mtkswitch/mtkswitch_mt7620.c   Mon Jun  6 
10:07:57 2016(r301497)
@@ -135,7 +135,6 @@ mtkswitch_reg_read32_mt7621(struct mtksw
 {
uint32_t low, hi;
 
-   MTKSWITCH_LOCK_ASSERT(sc, MA_OWNED);
mtkswitch_phy_write_locked(sc, MTKSWITCH_GLOBAL_PHY,
MTKSWITCH_GLOBAL_REG, MTKSWITCH_REG_ADDR(reg));
low = mtkswitch_phy_read_locked(sc, MTKSWITCH_GLOBAL_PHY,
@@ -149,7 +148,6 @@ static uint32_t
 mtkswitch_reg_write32_mt7621(struct mtkswitch_softc *sc, int reg, uint32_t val)
 {
 
-   MTKSWITCH_LOCK_ASSERT(sc, MA_OWNED);
mtkswitch_phy_write_locked(sc, MTKSWITCH_GLOBAL_PHY,
MTKSWITCH_GLOBAL_REG, MTKSWITCH_REG_ADDR(reg));
mtkswitch_phy_write_locked(sc, MTKSWITCH_GLOBAL_PHY,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301496 - in head: sbin/ifconfig share/man/man4 sys/net sys/sys

2016-06-06 Thread Marcelo Araujo
Author: araujo
Date: Mon Jun  6 09:51:58 2016
New Revision: 301496
URL: https://svnweb.freebsd.org/changeset/base/301496

Log:
  Add support to priority code point (PCP) that is an 3-bit field
  which refers to IEEE 802.1p class of service and maps to the frame
  priority level.
  
  Values in order of priority are: 1 (Background (lowest)),
  0 (Best effort (default)), 2 (Excellent effort),
  3 (Critical applications), 4 (Video, < 100ms latency),
  5 (Video, < 10ms latency), 6 (Internetwork control) and
  7 (Network control (highest)).
  
  Example of usage:
  root# ifconfig em0.1 create
  root# ifconfig em0.1 vlanpcp 3
  
  Note:
  The review D801 includes the pf(4) part, but as discussed with kristof,
  we won't commit the pf(4) bits for now.
  The credits of the original code is from rwatson.
  
  Differential Revision:https://reviews.freebsd.org/D801
  Reviewed by:  gnn, adrian, loos
  Discussed with: rwatson, glebius, kristof
  Tested by:many including Matthew Grooms 
  Obtained from:pfSense
  Relnotes: Yes

Modified:
  head/sbin/ifconfig/ifconfig.8
  head/sbin/ifconfig/ifvlan.c
  head/share/man/man4/vlan.4
  head/sys/net/if.h
  head/sys/net/if_vlan.c
  head/sys/net/if_vlan_var.h
  head/sys/sys/priv.h

Modified: head/sbin/ifconfig/ifconfig.8
==
--- head/sbin/ifconfig/ifconfig.8   Mon Jun  6 09:30:31 2016
(r301495)
+++ head/sbin/ifconfig/ifconfig.8   Mon Jun  6 09:51:58 2016
(r301496)
@@ -2614,6 +2614,29 @@ Note that
 and
 .Cm vlandev
 must both be set at the same time.
+.It Cm vlanpcp Ar priority_code_point
+Priority code point 
+.Pq Dv PCP
+is an 3-bit field which refers to the IEEE 802.1p
+class of service and maps to the frame priority level.
+.Pp
+Values in order of priority are:
+.Cm 1 
+.Pq Dv Background (lowest) ,
+.Cm 0
+.Pq Dv Best effort (default) ,
+.Cm 2
+.Pq Dv Excellent effort ,
+.Cm 3
+.Pq Dv Critical applications ,
+.Cm 4
+.Pq Dv Video, < 100ms latency ,
+.Cm 5
+.Pq Dv Video, < 10ms latency ,
+.Cm 6
+.Pq Dv Internetwork control ,
+.Cm 7
+.Pq Dv Network control (highest) .
 .It Cm vlandev Ar iface
 Associate the physical interface
 .Ar iface

Modified: head/sbin/ifconfig/ifvlan.c
==
--- head/sbin/ifconfig/ifvlan.c Mon Jun  6 09:30:31 2016(r301495)
+++ head/sbin/ifconfig/ifvlan.c Mon Jun  6 09:51:58 2016(r301496)
@@ -1,6 +1,10 @@
 /*
- * Copyright (c) 1999
- * Bill Paul .  All rights reserved.
+ * Copyright (c) 1999 Bill Paul 
+ * Copyright (c) 2012 ADARA Networks, Inc.
+ * All rights reserved.
+  *
+ * Portions of this software were developed by Robert N. M. Watson under
+ * contract to ADARA Networks, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -78,10 +82,14 @@ vlan_status(int s)
 {
struct vlanreq  vreq;
 
-   if (getvlan(s, , ) != -1)
-   printf("\tvlan: %d parent interface: %s\n",
-   vreq.vlr_tag, vreq.vlr_parent[0] == '\0' ?
-   "" : vreq.vlr_parent);
+   if (getvlan(s, , ) == -1)
+   return;
+   printf("\tvlan: %d", vreq.vlr_tag);
+   if (ioctl(s, SIOCGVLANPCP, (caddr_t)) != -1)
+   printf(" vlanpcp: %u", ifr.ifr_vlan_pcp);
+   printf(" parent interface: %s", vreq.vlr_parent[0] == '\0' ?
+   "" : vreq.vlr_parent);
+   printf("\n");
 }
 
 static void
@@ -149,6 +157,22 @@ DECL_CMD_FUNC(setvlandev, val, d)
 }
 
 static
+DECL_CMD_FUNC(setvlanpcp, val, d)
+{
+   u_long ul;
+   char *endp;
+
+   ul = strtoul(val, , 0);
+   if (*endp != '\0')
+   errx(1, "invalid value for vlanpcp");
+   if (ul > 7)
+   errx(1, "value for vlanpcp out of range");
+   ifr.ifr_vlan_pcp = ul;
+   if (ioctl(s, SIOCSVLANPCP, (caddr_t)) == -1)
+   err(1, "SIOCSVLANPCP");
+}
+
+static
 DECL_CMD_FUNC(unsetvlandev, val, d)
 {
struct vlanreq  vreq;
@@ -169,6 +193,7 @@ DECL_CMD_FUNC(unsetvlandev, val, d)
 static struct cmd vlan_cmds[] = {
DEF_CLONE_CMD_ARG("vlan",   setvlantag),
DEF_CLONE_CMD_ARG("vlandev",setvlandev),
+   DEF_CMD_ARG("vlanpcp",  setvlanpcp),
/* NB: non-clone cmds */
DEF_CMD_ARG("vlan", setvlantag),
DEF_CMD_ARG("vlandev",  setvlandev),

Modified: head/share/man/man4/vlan.4
==
--- head/share/man/man4/vlan.4  Mon Jun  6 09:30:31 2016(r301495)
+++ head/share/man/man4/vlan.4  Mon Jun  6 09:51:58 2016(r301496)
@@ -203,5 +203,3 @@ can be corrected manually if used in con
 .Sh SEE ALSO
 .Xr 

svn commit: r301495 - head/sys/dev/sfxge/common

2016-06-06 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jun  6 09:30:31 2016
New Revision: 301495
URL: https://svnweb.freebsd.org/changeset/base/301495

Log:
  sfxge(4): update TX vFIFO ULL tag location to avoid merge conflict
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  1 week

Modified:
  head/sys/dev/sfxge/common/ef10_tlv_layout.h

Modified: head/sys/dev/sfxge/common/ef10_tlv_layout.h
==
--- head/sys/dev/sfxge/common/ef10_tlv_layout.h Mon Jun  6 09:08:16 2016
(r301494)
+++ head/sys/dev/sfxge/common/ef10_tlv_layout.h Mon Jun  6 09:30:31 2016
(r301495)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2012-2015 Solarflare Communications Inc.
+ * Copyright (c) 2012-2016 Solarflare Communications Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -801,7 +801,7 @@ struct tlv_tx_event_merging_config {
  * know if the low latency mode is enabled.
  */
 
-#define TLV_TAG_TX_VFIFO_ULL_MODE  (0x1022)
+#define TLV_TAG_TX_VFIFO_ULL_MODE  (0x1027)
 struct tlv_tx_vfifo_ull_mode {
   uint32_t tag;
   uint32_t length;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301494 - head/sys/dev/sfxge

2016-06-06 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jun  6 09:08:16 2016
New Revision: 301494
URL: https://svnweb.freebsd.org/changeset/base/301494

Log:
  sfxge(4): pick an RSS bucket for the packet enqueued and select TXQ 
accordingly
  
  Submitted by:   Ivan Malov 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D6723

Modified:
  head/sys/dev/sfxge/sfxge_tx.c

Modified: head/sys/dev/sfxge/sfxge_tx.c
==
--- head/sys/dev/sfxge/sfxge_tx.c   Mon Jun  6 09:07:26 2016
(r301493)
+++ head/sys/dev/sfxge/sfxge_tx.c   Mon Jun  6 09:08:16 2016
(r301494)
@@ -49,6 +49,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_rss.h"
+
 #include 
 #include 
 #include 
@@ -68,6 +70,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef RSS
+#include 
+#endif
+
 #include "common/efx.h"
 
 #include "sfxge.h"
@@ -818,12 +824,24 @@ sfxge_if_transmit(struct ifnet *ifp, str
(CSUM_DELAY_DATA | CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_TSO)) {
int index = 0;
 
+#ifdef RSS
+   uint32_t bucket_id;
+
+   /*
+* Select a TX queue which matches the corresponding
+* RX queue for the hash in order to assign both
+* TX and RX parts of the flow to the same CPU
+*/
+   if (rss_m2bucket(m, _id) == 0)
+   index = bucket_id % (sc->txq_count - (SFXGE_TXQ_NTYPES 
- 1));
+#else
/* check if flowid is set */
if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) {
uint32_t hash = m->m_pkthdr.flowid;
 
index = sc->rx_indir_table[hash % SFXGE_RX_SCALE_MAX];
}
+#endif
 #if SFXGE_TX_PARSE_EARLY
if (m->m_pkthdr.csum_flags & CSUM_TSO)
sfxge_parse_tx_packet(m);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301492 - head/sys/dev/sfxge

2016-06-06 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jun  6 09:06:38 2016
New Revision: 301492
URL: https://svnweb.freebsd.org/changeset/base/301492

Log:
  sfxge(4): bind interrupts to CPUs in accordance with bucket to CPU map
  
  Submitted by:   Ivan Malov 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D6721

Modified:
  head/sys/dev/sfxge/sfxge_intr.c

Modified: head/sys/dev/sfxge/sfxge_intr.c
==
--- head/sys/dev/sfxge/sfxge_intr.c Mon Jun  6 09:05:52 2016
(r301491)
+++ head/sys/dev/sfxge/sfxge_intr.c Mon Jun  6 09:06:38 2016
(r301492)
@@ -34,6 +34,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_rss.h"
+
 #include 
 #include 
 #include 
@@ -49,6 +51,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef RSS
+#include 
+#endif
+
 #include "common/efx.h"
 
 #include "sfxge.h"
@@ -192,7 +198,12 @@ sfxge_intr_bus_enable(struct sfxge_softc
bus_describe_intr(sc->dev, table[index].eih_res,
table[index].eih_tag, "%d", index);
 #endif
+#ifdef RSS
+   bus_bind_intr(sc->dev, table[index].eih_res,
+ rss_getcpu(index));
+#else
bus_bind_intr(sc->dev, table[index].eih_res, index);
+#endif
 
}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301493 - head/sys/dev/sfxge

2016-06-06 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jun  6 09:07:26 2016
New Revision: 301493
URL: https://svnweb.freebsd.org/changeset/base/301493

Log:
  sfxge(4): set up the indirection table using the kernel-driven RSS bucket ids
  
  Submitted by:   Ivan Malov 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D6722

Modified:
  head/sys/dev/sfxge/sfxge_rx.c

Modified: head/sys/dev/sfxge/sfxge_rx.c
==
--- head/sys/dev/sfxge/sfxge_rx.c   Mon Jun  6 09:06:38 2016
(r301492)
+++ head/sys/dev/sfxge/sfxge_rx.c   Mon Jun  6 09:07:26 2016
(r301493)
@@ -1129,7 +1129,12 @@ sfxge_rx_start(struct sfxge_softc *sc)
 * Set up the scale table.  Enable all hash types and hash insertion.
 */
for (index = 0; index < SFXGE_RX_SCALE_MAX; index++)
+#ifdef RSS
+   sc->rx_indir_table[index] =
+   rss_get_indirection_to_bucket(index) % sc->rxq_count;
+#else
sc->rx_indir_table[index] = index % sc->rxq_count;
+#endif
if ((rc = efx_rx_scale_tbl_set(sc->enp, sc->rx_indir_table,
   SFXGE_RX_SCALE_MAX)) != 0)
goto fail;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301491 - head/sys/dev/sfxge

2016-06-06 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jun  6 09:05:52 2016
New Revision: 301491
URL: https://svnweb.freebsd.org/changeset/base/301491

Log:
  sfxge(4): restrict the maximum number of RSS channels by the number of RSS 
buckets
  
  This is done because one has no point to have more channels since they
  will be unused.
  
  Submitted by:   Ivan Malov 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D6720

Modified:
  head/sys/dev/sfxge/sfxge.c

Modified: head/sys/dev/sfxge/sfxge.c
==
--- head/sys/dev/sfxge/sfxge.c  Mon Jun  6 09:05:06 2016(r301490)
+++ head/sys/dev/sfxge/sfxge.c  Mon Jun  6 09:05:52 2016(r301491)
@@ -34,6 +34,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_rss.h"
+
 #include 
 #include 
 #include 
@@ -58,6 +60,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef RSS
+#include 
+#endif
+
 #include "common/efx.h"
 
 #include "sfxge.h"
@@ -127,7 +133,15 @@ sfxge_estimate_rsrc_limits(struct sfxge_
 *  - hardwire maximum RSS channels
 *  - administratively specified maximum RSS channels
 */
+#ifdef RSS
+   /*
+* Avoid extra limitations so that the number of queues
+* may be configured at administrator's will
+*/
+   evq_max = MIN(MAX(rss_getnumbuckets(), 1), EFX_MAXRSS);
+#else
evq_max = MIN(mp_ncpus, EFX_MAXRSS);
+#endif
if (sc->max_rss_channels > 0)
evq_max = MIN(evq_max, sc->max_rss_channels);
 
@@ -163,6 +177,14 @@ sfxge_estimate_rsrc_limits(struct sfxge_
KASSERT(sc->evq_max <= evq_max,
("allocated more than maximum requested"));
 
+#ifdef RSS
+   if (sc->evq_max < rss_getnumbuckets())
+   device_printf(sc->dev, "The number of allocated queues (%u) "
+ "is less than the number of RSS buckets (%u); "
+ "performance degradation might be observed",
+ sc->evq_max, rss_getnumbuckets());
+#endif
+
/*
 * NIC is kept initialized in the case of success to be able to
 * initialize port to find out media types.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301490 - head/sys/dev/sfxge

2016-06-06 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jun  6 09:05:06 2016
New Revision: 301490
URL: https://svnweb.freebsd.org/changeset/base/301490

Log:
  sfxge(4): get RSS key to be programmed into NIC from the kernel
  
  Submitted by:   Ivan Malov 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D6719

Modified:
  head/sys/dev/sfxge/sfxge_rx.c

Modified: head/sys/dev/sfxge/sfxge_rx.c
==
--- head/sys/dev/sfxge/sfxge_rx.c   Mon Jun  6 09:04:20 2016
(r301489)
+++ head/sys/dev/sfxge/sfxge_rx.c   Mon Jun  6 09:05:06 2016
(r301490)
@@ -34,6 +34,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_rss.h"
+
 #include 
 #include 
 #include 
@@ -55,6 +57,10 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#ifdef RSS
+#include 
+#endif
+
 #include "common/efx.h"
 
 
@@ -160,6 +166,9 @@ sfxge_rx_qflush_failed(struct sfxge_rxq 
rxq->flush_state = SFXGE_FLUSH_FAILED;
 }
 
+#ifdef RSS
+static uint8_t toep_key[RSS_KEYSIZE];
+#else
 static uint8_t toep_key[] = {
0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
@@ -167,6 +176,7 @@ static uint8_t toep_key[] = {
0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c,
0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa
 };
+#endif
 
 static void
 sfxge_rx_post_refill(void *arg)
@@ -1127,6 +1137,9 @@ sfxge_rx_start(struct sfxge_softc *sc)
(1 << EFX_RX_HASH_IPV4) | (1 << EFX_RX_HASH_TCPIPV4) |
(1 << EFX_RX_HASH_IPV6) | (1 << EFX_RX_HASH_TCPIPV6), B_TRUE);
 
+#ifdef RSS
+   rss_getkey(toep_key);
+#endif
if ((rc = efx_rx_scale_key_set(sc->enp, toep_key,
   sizeof(toep_key))) != 0)
goto fail;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301489 - head/sys/modules/sfxge

2016-06-06 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jun  6 09:04:20 2016
New Revision: 301489
URL: https://svnweb.freebsd.org/changeset/base/301489

Log:
  sfxge(4): prepare sfxge to be RSS API aware
  
  This change is needed because 'opt_rss.h' is included by multiple source
  files and RSS macro is defined as 1 within the file during build process
  if option RSS is enabled in the kernel.
  
  Submitted by:   Ivan Malov 
  Reviewed by:gnn
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D6718

Modified:
  head/sys/modules/sfxge/Makefile

Modified: head/sys/modules/sfxge/Makefile
==
--- head/sys/modules/sfxge/Makefile Mon Jun  6 07:39:44 2016
(r301488)
+++ head/sys/modules/sfxge/Makefile Mon Jun  6 09:04:20 2016
(r301489)
@@ -5,7 +5,7 @@ KMOD=   sfxge
 SFXGE= ${.CURDIR}/../../dev/sfxge
 
 SRCS=  device_if.h bus_if.h pci_if.h
-SRCS+= opt_inet.h opt_inet6.h opt_sched.h
+SRCS+= opt_inet.h opt_inet6.h opt_sched.h opt_rss.h
 
 .PATH: ${.CURDIR}/../../dev/sfxge
 SRCS+= sfxge.c sfxge_dma.c sfxge_ev.c
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r301488 - head/sys/dev/hyperv/vmbus

2016-06-06 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Jun  6 07:39:44 2016
New Revision: 301488
URL: https://svnweb.freebsd.org/changeset/base/301488

Log:
  hyperv/vmbus: Constify channel message
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D6708

Modified:
  head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
  head/sys/dev/hyperv/vmbus/vmbus.c
  head/sys/dev/hyperv/vmbus/vmbus_var.h

Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Jun  6 07:27:57 2016
(r301487)
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Jun  6 07:39:44 2016
(r301488)
@@ -40,23 +40,29 @@
  * Internal functions
  */
 
-typedef void (*vmbus_msg_handler)(hv_vmbus_channel_msg_header *msg);
+typedef void (*vmbus_msg_handler)(const hv_vmbus_channel_msg_header *msg);
 
 typedef struct hv_vmbus_channel_msg_table_entry {
hv_vmbus_channel_msg_typemessageType;
-
vmbus_msg_handler   messageHandler;
 } hv_vmbus_channel_msg_table_entry;
 
-static void vmbus_channel_on_offer(hv_vmbus_channel_msg_header* hdr);
-static void vmbus_channel_on_offer_internal(void* context);
-static void vmbus_channel_on_open_result(hv_vmbus_channel_msg_header* hdr);
-static void vmbus_channel_on_offer_rescind(hv_vmbus_channel_msg_header* hdr);
-static void vmbus_channel_on_offer_rescind_internal(void* context);
-static void vmbus_channel_on_gpadl_created(hv_vmbus_channel_msg_header* hdr);
-static void vmbus_channel_on_gpadl_torndown(hv_vmbus_channel_msg_header* hdr);
-static void vmbus_channel_on_offers_delivered(hv_vmbus_channel_msg_header* 
hdr);
-static void vmbus_channel_on_version_response(hv_vmbus_channel_msg_header* 
hdr);
+static voidvmbus_channel_on_offer_internal(void *context);
+static voidvmbus_channel_on_offer_rescind_internal(void *context);
+
+static voidvmbus_channel_on_offer(const hv_vmbus_channel_msg_header *hdr);
+static voidvmbus_channel_on_open_result(
+   const hv_vmbus_channel_msg_header *hdr);
+static voidvmbus_channel_on_offer_rescind(
+   const hv_vmbus_channel_msg_header *hdr);
+static voidvmbus_channel_on_gpadl_created(
+   const hv_vmbus_channel_msg_header *hdr);
+static voidvmbus_channel_on_gpadl_torndown(
+   const hv_vmbus_channel_msg_header *hdr);
+static voidvmbus_channel_on_offers_delivered(
+   const hv_vmbus_channel_msg_header *hdr);
+static voidvmbus_channel_on_version_response(
+   const hv_vmbus_channel_msg_header *hdr);
 
 /**
  * Channel message dispatch table
@@ -392,12 +398,12 @@ vmbus_channel_select_defcpu(struct hv_vm
  * object to process the offer synchronously
  */
 static void
-vmbus_channel_on_offer(hv_vmbus_channel_msg_header* hdr)
+vmbus_channel_on_offer(const hv_vmbus_channel_msg_header *hdr)
 {
-   hv_vmbus_channel_offer_channel* offer;
-   hv_vmbus_channel_offer_channel* copied;
+   const hv_vmbus_channel_offer_channel *offer;
+   hv_vmbus_channel_offer_channel *copied;
 
-   offer = (hv_vmbus_channel_offer_channel*) hdr;
+   offer = (const hv_vmbus_channel_offer_channel *)hdr;
 
// copy offer data
copied = malloc(sizeof(*copied), M_DEVBUF, M_NOWAIT);
@@ -470,12 +476,12 @@ vmbus_channel_on_offer_internal(void* co
  * synchronously
  */
 static void
-vmbus_channel_on_offer_rescind(hv_vmbus_channel_msg_header* hdr)
+vmbus_channel_on_offer_rescind(const hv_vmbus_channel_msg_header *hdr)
 {
-   hv_vmbus_channel_rescind_offer* rescind;
+   const hv_vmbus_channel_rescind_offer *rescind;
hv_vmbus_channel*   channel;
 
-   rescind = (hv_vmbus_channel_rescind_offer*) hdr;
+   rescind = (const hv_vmbus_channel_rescind_offer *)hdr;
 
channel = hv_vmbus_g_connection.channels[rescind->child_rel_id];
if (channel == NULL)
@@ -502,7 +508,8 @@ vmbus_channel_on_offer_rescind_internal(
  * @brief Invoked when all offers have been delivered.
  */
 static void
-vmbus_channel_on_offers_delivered(hv_vmbus_channel_msg_header* hdr)
+vmbus_channel_on_offers_delivered(
+const hv_vmbus_channel_msg_header *hdr __unused)
 {
 
mtx_lock(_chwait_lock);
@@ -519,14 +526,14 @@ vmbus_channel_on_offers_delivered(hv_vmb
  * response and signal the requesting thread.
  */
 static void
-vmbus_channel_on_open_result(hv_vmbus_channel_msg_header* hdr)
+vmbus_channel_on_open_result(const hv_vmbus_channel_msg_header *hdr)
 {
-   hv_vmbus_channel_open_result*   result;
+   const hv_vmbus_channel_open_result *result;
hv_vmbus_channel_msg_info*  msg_info;
hv_vmbus_channel_msg_header*requestHeader;
hv_vmbus_channel_open_channel*  openMsg;
 
-   result = (hv_vmbus_channel_open_result*) hdr;
+   result = (const hv_vmbus_channel_open_result *)hdr;
 
/*
 * Find the 

svn commit: r301487 - head/sys/dev/hyperv/vmbus

2016-06-06 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Jun  6 07:27:57 2016
New Revision: 301487
URL: https://svnweb.freebsd.org/changeset/base/301487

Log:
  hyperv/vmbus: Factor out channel message processing
  
  This paves the way for further cleanup.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D6707

Modified:
  head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
  head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
  head/sys/dev/hyperv/vmbus/vmbus.c
  head/sys/dev/hyperv/vmbus/vmbus_var.h

Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
==
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Jun  6 07:10:38 2016
(r301486)
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Jun  6 07:27:57 2016
(r301487)
@@ -40,6 +40,14 @@
  * Internal functions
  */
 
+typedef void (*vmbus_msg_handler)(hv_vmbus_channel_msg_header *msg);
+
+typedef struct hv_vmbus_channel_msg_table_entry {
+   hv_vmbus_channel_msg_typemessageType;
+
+   vmbus_msg_handler   messageHandler;
+} hv_vmbus_channel_msg_table_entry;
+
 static void vmbus_channel_on_offer(hv_vmbus_channel_msg_header* hdr);
 static void vmbus_channel_on_offer_internal(void* context);
 static void vmbus_channel_on_open_result(hv_vmbus_channel_msg_header* hdr);
@@ -53,7 +61,7 @@ static void vmbus_channel_on_version_res
 /**
  * Channel message dispatch table
  */
-hv_vmbus_channel_msg_table_entry
+static const hv_vmbus_channel_msg_table_entry
 g_channel_message_table[HV_CHANNEL_MESSAGE_COUNT] = {
{ HV_CHANNEL_MESSAGE_INVALID,
NULL },
@@ -831,3 +839,25 @@ vmbus_rel_subchan(struct hv_vmbus_channe
 
free(subchan, M_TEMP);
 }
+
+void
+vmbus_chan_msgproc(struct vmbus_softc *sc, volatile struct vmbus_message *msg)
+{
+   const hv_vmbus_channel_msg_table_entry *entry;
+   hv_vmbus_channel_msg_header *hdr;
+   hv_vmbus_channel_msg_type msg_type;
+
+   /* XXX: update messageHandler interface */
+   hdr = __DEVOLATILE(hv_vmbus_channel_msg_header *, msg->msg_data);
+   msg_type = hdr->message_type;
+
+   if (msg_type >= HV_CHANNEL_MESSAGE_COUNT) {
+   device_printf(sc->vmbus_dev, "unknown message type 0x%x\n",
+   msg_type);
+   return;
+   }
+
+   entry = _channel_message_table[msg_type];
+   if (entry->messageHandler)
+   entry->messageHandler(hdr);
+}

Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
==
--- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h   Mon Jun  6 07:10:38 2016
(r301486)
+++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h   Mon Jun  6 07:27:57 2016
(r301487)
@@ -364,16 +364,6 @@ typedef enum {
 
 extern hv_vmbus_connection hv_vmbus_g_connection;
 
-typedef void (*vmbus_msg_handler)(hv_vmbus_channel_msg_header *msg);
-
-typedef struct hv_vmbus_channel_msg_table_entry {
-   hv_vmbus_channel_msg_typemessageType;
-
-   vmbus_msg_handler   messageHandler;
-} hv_vmbus_channel_msg_table_entry;
-
-extern hv_vmbus_channel_msg_table_entryg_channel_message_table[];
-
 /*
  * Private, VM Bus functions
  */

Modified: head/sys/dev/hyperv/vmbus/vmbus.c
==
--- head/sys/dev/hyperv/vmbus/vmbus.c   Mon Jun  6 07:10:38 2016
(r301486)
+++ head/sys/dev/hyperv/vmbus/vmbus.c   Mon Jun  6 07:27:57 2016
(r301487)
@@ -81,32 +81,14 @@ vmbus_msg_task(void *xsc, int pending __
 
msg = VMBUS_PCPU_GET(sc, message, curcpu) + VMBUS_SINT_MESSAGE;
for (;;) {
-   const hv_vmbus_channel_msg_table_entry *entry;
-   hv_vmbus_channel_msg_header *hdr;
-   hv_vmbus_channel_msg_type msg_type;
-
if (msg->msg_type == VMBUS_MSGTYPE_NONE) {
/* No message */
break;
-   } else if (msg->msg_type != VMBUS_MSGTYPE_CHANNEL) {
-   /* Not a channel message */
-   goto handled;
-   }
-
-   /* XXX: update messageHandler interface */
-   hdr = __DEVOLATILE(hv_vmbus_channel_msg_header *,
-   msg->msg_data);
-   msg_type = hdr->message_type;
-
-   if (msg_type >= HV_CHANNEL_MESSAGE_COUNT) {
-   printf("VMBUS: unknown message type = %d\n", msg_type);
-   goto handled;
+   } else if (msg->msg_type == VMBUS_MSGTYPE_CHANNEL) {
+   /* Channel message */
+   vmbus_chan_msgproc(sc, msg);
}
 
-   entry = _channel_message_table[msg_type];
-   if (entry->messageHandler)
-   entry->messageHandler(hdr);
-handled:
msg->msg_type = VMBUS_MSGTYPE_NONE;