svn commit: r275354 - in head/tools/tools/shlib-compat: . test

2014-12-01 Thread Gleb Kurtsou
Author: gleb
Date: Mon Dec  1 08:14:25 2014
New Revision: 275354
URL: https://svnweb.freebsd.org/changeset/base/275354

Log:
  Update tools/shlib-compat.
  
  - Update dwarfdump / compiler support.
Use hex instead of decimal for integers.
Add boolean and restrict type definitions.
Add options for specifing dwarfdump and objdump executables.
  
  - Fix reporting missing symbol definitions as matching.
  
  - Compare external variable definitions.
  
  - Exclude special symbols like _init, _end by default.
  
  - Fix test build.

Modified:
  head/tools/tools/shlib-compat/shlib-compat.py
  head/tools/tools/shlib-compat/test/Makefile.inc
  head/tools/tools/shlib-compat/test/regress.sh

Modified: head/tools/tools/shlib-compat/shlib-compat.py
==
--- head/tools/tools/shlib-compat/shlib-compat.py   Mon Dec  1 07:37:29 
2014(r275353)
+++ head/tools/tools/shlib-compat/shlib-compat.py   Mon Dec  1 08:14:25 
2014(r275354)
@@ -60,6 +60,14 @@ class Config(object):
 origfile = FileConfig()
 newfile = FileConfig()
 
+exclude_sym_default = [
+'^__bss_start$',
+'^_edata$',
+'^_end$',
+'^_fini$',
+'^_init$',
+]
+
 @classmethod
 def init(cls):
 cls.version_filter = StrFilter()
@@ -338,15 +346,17 @@ class BaseTypeDef(Def):
 def _pp(self, pp):
 if self.encoding in self.inttypes:
 sign = '' if self.encoding == 'DW_ATE_signed' else 'u'
-bits = int(self.byte_size) * 8
+bits = int(self.byte_size, 0) * 8
 return '%sint%s_t' % (sign, bits)
-elif self.encoding == 'DW_ATE_signed_char' and int(self.byte_size) == 
1:
+elif self.encoding == 'DW_ATE_signed_char' and int(self.byte_size, 0) 
== 1:
 return 'char';
+elif self.encoding == 'DW_ATE_boolean' and int(self.byte_size, 0) == 1:
+return 'bool';
 elif self.encoding == 'DW_ATE_float':
-return self._mapval(self.byte_size, {
-'16': 'long double',
-'8': 'double',
-'4': 'float',
+return self._mapval(int(self.byte_size, 0), {
+16: 'long double',
+8: 'double',
+4: 'float',
 })
 raise NotImplementedError('Invalid encoding: %s' % self)
 
@@ -374,6 +384,11 @@ class VolatileTypeDef(AnonymousDef):
 def _pp(self, pp):
 return 'volatile ' + self.type._pp(pp)
 
+class RestrictTypeDef(AnonymousDef):
+_is_alias = True
+def _pp(self, pp):
+return 'restrict ' + self.type._pp(pp)
+
 class ArrayDef(AnonymousDef):
 def _pp(self, pp):
 t = pp.run(self.type)
@@ -411,6 +426,11 @@ class ParameterDef(Def):
 t = pp.run(self.type)
 return "%s %s" % (t, self._name_opt())
 
+class VariableDef(Def):
+def _pp(self, pp):
+t = pp.run(self.type)
+return "%s %s" % (t, self._name_opt())
+
 # TODO
 class StructForwardDef(Def):
 pass
@@ -485,6 +505,10 @@ class Dwarf(object):
 result = self._build_optarg_type(raw)
 return FunctionDef(raw.id, raw.name, params=params, result=result)
 
+def build_variable(self, raw):
+type = self._build_optarg_type(raw)
+return VariableDef(raw.id, raw.optname, type=type)
+
 def build_subroutine_type(self, raw):
 params = [ self.build(x) for x in raw.nested ]
 result = self._build_optarg_type(raw)
@@ -547,6 +571,10 @@ class Dwarf(object):
 type = self._build_optarg_type(raw)
 return VolatileTypeDef(raw.id, type=type)
 
+def build_restrict_type(self, raw):
+type = self._build_optarg_type(raw)
+return RestrictTypeDef(raw.id, type=type)
+
 def build_enumeration_type(self, raw):
 # TODO handle DW_TAG_enumerator ???
 return EnumerationTypeDef(raw.id, name=raw.optname,
@@ -574,7 +602,7 @@ class Dwarf(object):
 return int(id)
 except ValueError:
 if (id.startswith('<') and id.endswith('>')):
-return int(id[1:-1])
+return int(id[1:-1], 0)
 else:
 raise ValueError("Invalid dwarf id: %s" % id)
 
@@ -782,7 +810,7 @@ class DwarfdumpParser(Parser):
 class Tag(object):
 def __init__(self, unit, data):
 self.unit = unit
-self.id = int(data['id'])
+self.id = int(data['id'], 0)
 self.level = int(data['level'])
 self.tag = data['tag']
 self.args = {}
@@ -816,7 +844,7 @@ class DwarfdumpParser(Parser):
 def __repr__(self):
 return "Tag(%d, %d, %s)" % (self.level, self.id, self.tag)
 
-re_header = re.compile('<(?P\d+)><(?P\d+\+*\d*)><(?P\w+)>')
+re_header = 
re.compile('<(?P\d+)><(?P[0xX0-9a-fA-F]+(?:\+(0[xX])?[0-9a-fA-F]+)?)><(?P\w+)>')
 re_argname = re.compile('(?P

svn commit: r275355 - head/tools/tools/sysbuild

2014-12-01 Thread Poul-Henning Kamp
Author: phk
Date: Mon Dec  1 10:17:23 2014
New Revision: 275355
URL: https://svnweb.freebsd.org/changeset/base/275355

Log:
  Face the fact that we have no idea where the ports tree really lives.

Modified:
  head/tools/tools/sysbuild/sysbuild.sh

Modified: head/tools/tools/sysbuild/sysbuild.sh
==
--- head/tools/tools/sysbuild/sysbuild.sh   Mon Dec  1 08:14:25 2014
(r275354)
+++ head/tools/tools/sysbuild/sysbuild.sh   Mon Dec  1 10:17:23 2014
(r275355)
@@ -226,8 +226,7 @@ ports_build() (
t=`echo $p | sed 's,/usr/ports/,,'`
pn=`cd $p && make package-name`
 
-   if [ "x$p" == "x/usr/ports/ports-mgmt/pkg" -o \
-"x$p" == "x/freebsd/ports/ports-mgmt/pkg" ] ; then
+   if [ "x`basename $p`" == "xpkg" ] ; then
log_it "Very Special: $t ($pn)"
 
(
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275358 - in head/sys: dev/bxe dev/cxgb dev/cxgbe dev/e1000 dev/ixgbe dev/ixl dev/mxge dev/netmap dev/oce dev/qlxgbe dev/qlxge dev/sfxge dev/virtio/network dev/vmware/vmxnet3 dev/vxge n...

2014-12-01 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Dec  1 11:45:24 2014
New Revision: 275358
URL: https://svnweb.freebsd.org/changeset/base/275358

Log:
  Start process of removing the use of the deprecated "M_FLOWID" flag
  from the FreeBSD network code. The flag is still kept around in the
  "sys/mbuf.h" header file, but does no longer have any users. Instead
  the "m_pkthdr.rsstype" field in the mbuf structure is now used to
  decide the meaning of the "m_pkthdr.flowid" field. To modify the
  "m_pkthdr.rsstype" field please use the existing "M_HASHTYPE_XXX"
  macros as defined in the "sys/mbuf.h" header file.
  
  This patch introduces new behaviour in the transmit direction.
  Previously network drivers checked if "M_FLOWID" was set in "m_flags"
  before using the "m_pkthdr.flowid" field. This check has now now been
  replaced by checking if "M_HASHTYPE_GET(m)" is different from
  "M_HASHTYPE_NONE". In the future more hashtypes will be added, for
  example hashtypes for hardware dedicated flows.
  
  "M_HASHTYPE_OPAQUE" indicates that the "m_pkthdr.flowid" value is
  valid and has no particular type. This change removes the need for an
  "if" statement in TCP transmit code checking for the presence of a
  valid flowid value. The "if" statement mentioned above is now a direct
  variable assignment which is then later checked by the respective
  network drivers like before.
  
  Additional notes:
  - The SCTP code changes will be committed as a separate patch.
  - Removal of the "M_FLOWID" flag will also be done separately.
  - The FreeBSD version has been bumped.
  
  MFC after:1 month
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/bxe/bxe.c
  head/sys/dev/cxgb/cxgb_sge.c
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/ixgbe/ixgbe.c
  head/sys/dev/ixgbe/ixv.c
  head/sys/dev/ixl/ixl_txrx.c
  head/sys/dev/mxge/if_mxge.c
  head/sys/dev/netmap/netmap_freebsd.c
  head/sys/dev/oce/oce_if.c
  head/sys/dev/qlxgbe/ql_isr.c
  head/sys/dev/qlxgbe/ql_os.c
  head/sys/dev/qlxge/qls_isr.c
  head/sys/dev/qlxge/qls_os.c
  head/sys/dev/sfxge/sfxge_rx.c
  head/sys/dev/sfxge/sfxge_tx.c
  head/sys/dev/virtio/network/if_vtnet.c
  head/sys/dev/vmware/vmxnet3/if_vmx.c
  head/sys/dev/vxge/vxge.c
  head/sys/net/flowtable.c
  head/sys/net/ieee8023ad_lacp.c
  head/sys/net/if_lagg.c
  head/sys/net/if_lagg.h
  head/sys/net/if_vxlan.c
  head/sys/net/netisr.c
  head/sys/netinet/in_pcb.h
  head/sys/netinet/in_rss.c
  head/sys/netinet/ip_input.c
  head/sys/netinet/ip_output.c
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_syncache.c
  head/sys/netinet/udp_usrreq.c
  head/sys/netinet6/in6_pcb.c
  head/sys/netinet6/ip6_output.c
  head/sys/netinet6/udp6_usrreq.c
  head/sys/ofed/drivers/net/mlx4/en_rx.c
  head/sys/ofed/drivers/net/mlx4/en_tx.c
  head/sys/sys/param.h

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Mon Dec  1 11:34:44 2014(r275357)
+++ head/sys/dev/bxe/bxe.c  Mon Dec  1 11:45:24 2014(r275358)
@@ -3219,7 +3219,7 @@ bxe_tpa_stop(struct bxe_softc  *
 #if __FreeBSD_version >= 80
 /* specify what RSS queue was used for this flow */
 m->m_pkthdr.flowid = fp->index;
-m->m_flags |= M_FLOWID;
+M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE);
 #endif
 
 if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
@@ -3454,7 +3454,7 @@ bxe_rxeof(struct bxe_softc*sc,
 #if __FreeBSD_version >= 80
 /* specify what RSS queue was used for this flow */
 m->m_pkthdr.flowid = fp->index;
-m->m_flags |= M_FLOWID;
+M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE);
 #endif
 
 next_rx:
@@ -6037,10 +6037,9 @@ bxe_tx_mq_start(struct ifnet *ifp,
 
 fp_index = 0; /* default is the first queue */
 
-/* change the queue if using flow ID */
-if ((m->m_flags & M_FLOWID) != 0) {
+/* check if flowid is set */
+if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE)
 fp_index = (m->m_pkthdr.flowid % sc->num_queues);
-}
 
 fp = &sc->fp[fp_index];
 

Modified: head/sys/dev/cxgb/cxgb_sge.c
==
--- head/sys/dev/cxgb/cxgb_sge.cMon Dec  1 11:34:44 2014
(r275357)
+++ head/sys/dev/cxgb/cxgb_sge.cMon Dec  1 11:45:24 2014
(r275358)
@@ -1733,8 +1733,9 @@ cxgb_transmit(struct ifnet *ifp, struct 
m_freem(m);
return (0);
}
-   
-   if (m->m_flags & M_FLOWID)
+
+   /* check if flowid is set */
+   if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE)   
qidx = (m->m_pkthdr.flowid % pi->nqsets) + pi->first_qset;
 
qs = &pi->adapter->sge.qs[qidx];
@@ -2899,9 +2900,10 @@ process_responses(adapter_t *adap, struc

eop = get_packet(adap, drop_thresh, qs, mh, r);
if (eop) {
-

svn commit: r275359 - head/etc

2014-12-01 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Dec  1 12:17:42 2014
New Revision: 275359
URL: https://svnweb.freebsd.org/changeset/base/275359

Log:
  Allow load_rc_config to be called without a service name.
  
  MFC after:1 week

Modified:
  head/etc/rc.subr

Modified: head/etc/rc.subr
==
--- head/etc/rc.subrMon Dec  1 11:45:24 2014(r275358)
+++ head/etc/rc.subrMon Dec  1 12:17:42 2014(r275359)
@@ -1315,9 +1315,6 @@ load_rc_config()
 {
local _name _rcvar_val _var _defval _v _msg _new _d
_name=$1
-   if [ -z "$_name" ]; then
-   err 3 'USAGE: load_rc_config name'
-   fi
 
if ${_rc_conf_loaded:-false}; then
:
@@ -1333,20 +1330,24 @@ load_rc_config()
_rc_conf_loaded=true
fi
 
-   for _d in /etc ${local_startup%*/rc.d}; do
-   if [ -f ${_d}/rc.conf.d/"$_name" ]; then
-   debug "Sourcing ${_d}/rc.conf.d/$_name"
-   . ${_d}/rc.conf.d/"$_name"
-   elif [ -d ${_d}/rc.conf.d/"$_name" ] ; then
-   local _rc
-   for _rc in ${_d}/rc.conf.d/"$_name"/* ; do
-   if [ -f "$_rc" ] ; then
-   debug "Sourcing $_rc"
-   . "$_rc"
-   fi
-   done
-   fi
-   done
+   # If a service name was specified, attempt to load
+   # service-specific configuration
+   if [ -n "$_name" ] ; then
+   for _d in /etc ${local_startup%*/rc.d}; do
+   if [ -f ${_d}/rc.conf.d/"$_name" ]; then
+   debug "Sourcing ${_d}/rc.conf.d/$_name"
+   . ${_d}/rc.conf.d/"$_name"
+   elif [ -d ${_d}/rc.conf.d/"$_name" ] ; then
+   local _rc
+   for _rc in ${_d}/rc.conf.d/"$_name"/* ; do
+   if [ -f "$_rc" ] ; then
+   debug "Sourcing $_rc"
+   . "$_rc"
+   fi
+   done
+   fi
+   done
+   fi
 
# Set defaults if defined.
for _var in $rcvar $rcvars; do
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275360 - head/etc

2014-12-01 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Dec  1 12:29:59 2014
New Revision: 275360
URL: https://svnweb.freebsd.org/changeset/base/275360

Log:
  The early-late divider was originally set to mountcritlocal.  Since that
  service does not run in jails, it was necessary to change it to something
  else when jailed, and NETWORKING was arbitrarily chosen.  The divider was
  later moved to FILESYSTEMS when it was introduced, but the logic to change
  it to NETWORKING when jailed remained.  Remove it, as it no longer serves
  any purpose.
  
  PR:   194975
  MFC after:1 week

Modified:
  head/etc/rc

Modified: head/etc/rc
==
--- head/etc/rc Mon Dec  1 12:17:42 2014(r275359)
+++ head/etc/rc Mon Dec  1 12:29:59 2014(r275360)
@@ -69,19 +69,16 @@ fi
 # and to make the configuration file variables available to rc itself.
 #
 . /etc/rc.subr
-load_rc_config 'XXX'
+load_rc_config
 
 # If we receive a SIGALRM, re-source /etc/rc.conf; this allows rc.d
 # scripts to perform "boot-time configuration" including enabling and
 # disabling rc.d scripts which appear later in the boot order.
-trap "_rc_conf_loaded=false; load_rc_config 'XXX'" ALRM
+trap "_rc_conf_loaded=false; load_rc_config" ALRM
 
 skip="-s nostart"
 if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then
skip="$skip -s nojail"
-   if [ "$early_late_divider" = "FILESYSTEMS" ]; then
-   early_late_divider=NETWORKING
-   fi
if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then
skip="$skip -s nojailvnet"
fi
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r273331 - in head: sbin/ifconfig share/man/man4 sys/conf sys/modules sys/modules/if_vxlan sys/net sys/sys

2014-12-01 Thread Dag-Erling Smørgrav
Bryan Venteicher  writes:
> Log:
>   Add vxlan interface
>   [...]

This breaks the existing "group" command, which means I now have
machines that won't boot without manual intervention because their
firewall rulesets rely on interface groups.

Did you even bother to search for "group" in the code, or even in the
man page, before deciding to add a command by that name?

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r275361 - head/sbin/ifconfig

2014-12-01 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Dec  1 12:59:16 2014
New Revision: 275361
URL: https://svnweb.freebsd.org/changeset/base/275361

Log:
  Disable the vxlan code until the people reponsible for it can come up with
  new command names that don't conflict with existing commands.
  
  Pointy hat to:bryanv

Modified:
  head/sbin/ifconfig/Makefile

Modified: head/sbin/ifconfig/Makefile
==
--- head/sbin/ifconfig/Makefile Mon Dec  1 12:29:59 2014(r275360)
+++ head/sbin/ifconfig/Makefile Mon Dec  1 12:59:16 2014(r275361)
@@ -30,7 +30,7 @@ SRCS+=ifmac.c # MAC support
 SRCS+= ifmedia.c   # SIOC[GS]IFMEDIA support
 SRCS+= iffib.c # non-default FIB support
 SRCS+= ifvlan.c# SIOC[GS]ETVLAN support
-SRCS+= ifvxlan.c   # VXLAN support
+#SRCS+=ifvxlan.c   # VXLAN support
 SRCS+= ifgre.c # GRE keys etc
 SRCS+= ifgif.c # GIF reversed header workaround
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r273331 - in head: sbin/ifconfig share/man/man4 sys/conf sys/modules sys/modules/if_vxlan sys/net sys/sys

2014-12-01 Thread Dag-Erling Smørgrav
Dag-Erling Smørgrav  writes:
> Bryan Venteicher  writes:
> > Log:
> >   Add vxlan interface
> >   [...]
> This breaks the existing "group" command, which means I now have
> machines that won't boot without manual intervention because their
> firewall rulesets rely on interface groups.

I added code to cmd_register() in ifconfig.c to warn about duplicate
commands.  Here is a complete list of pre-existing commands which the
vxlan code shadows:

ifconfig: duplicate command: group
ifconfig: duplicate command: timeout
ifconfig: duplicate command: maxaddr
ifconfig: duplicate command: learn
ifconfig: duplicate command: -learn
ifconfig: duplicate command: flush
ifconfig: duplicate command: flushall

so, in addition to breaking interface groups, it breaks bridge
interfaces.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r275365 - head/sys/cam/ctl

2014-12-01 Thread Alexander Motin
Author: mav
Date: Mon Dec  1 13:55:45 2014
New Revision: 275365
URL: https://svnweb.freebsd.org/changeset/base/275365

Log:
  Move ctlfe_onoffline() out of lock to let it sleep when needed.
  
  Do some more other polishing while there.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/ctl/scsi_ctl.c

Modified: head/sys/cam/ctl/scsi_ctl.c
==
--- head/sys/cam/ctl/scsi_ctl.c Mon Dec  1 13:14:39 2014(r275364)
+++ head/sys/cam/ctl/scsi_ctl.c Mon Dec  1 13:55:45 2014(r275365)
@@ -622,6 +622,9 @@ ctlferegister(struct cam_periph *periph,
  "notify CCBs, status 0x%x\n", __func__, status);
return (CAM_REQ_CMP_ERR);
}
+   mtx_lock(&bus_softc->lun_softc_mtx);
+   STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links);
+   mtx_unlock(&bus_softc->lun_softc_mtx);
return (CAM_REQ_CMP);
 }
 
@@ -1573,12 +1576,7 @@ ctlfe_onoffline(void *arg, int online)
printf("%s: unable to create path!\n", __func__);
return;
}
-   ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_NOWAIT | M_ZERO);
-   if (ccb == NULL) {
-   printf("%s: unable to malloc CCB!\n", __func__);
-   xpt_free_path(path);
-   return;
-   }
+   ccb = xpt_alloc_ccb();
xpt_setup_ccb(&ccb->ccb_h, path, CAM_PRIORITY_NONE);
 
/*
@@ -1711,10 +1709,7 @@ ctlfe_onoffline(void *arg, int online)
}
 
xpt_free_path(path);
-
-   free(ccb, M_TEMP);
-
-   return;
+   xpt_free_ccb(ccb);
 }
 
 static void
@@ -1740,14 +1735,7 @@ ctlfe_online(void *arg)
return;
}
 
-   lun_softc = malloc(sizeof(*lun_softc), M_CTLFE,
-   M_NOWAIT | M_ZERO);
-   if (lun_softc == NULL) {
-   xpt_print(path, "%s: unable to allocate softc for "
-   "wildcard periph\n", __func__);
-   xpt_free_path(path);
-   return;
-   }
+   lun_softc = malloc(sizeof(*lun_softc), M_CTLFE, M_WAITOK | M_ZERO);
 
xpt_path_lock(path);
periph = cam_periph_find(path, "ctl");
@@ -1780,14 +1768,10 @@ ctlfe_online(void *arg)
   "cam_periph_alloc()\n", __func__, (entry != NULL) ?
   entry->status_text : "Unknown", status);
free(lun_softc, M_CTLFE);
-   } else {
-   mtx_lock(&bus_softc->lun_softc_mtx);
-   STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, lun_softc, 
links);
-   mtx_unlock(&bus_softc->lun_softc_mtx);
-   ctlfe_onoffline(arg, /*online*/ 1);
}
 
xpt_path_unlock(path);
+   ctlfe_onoffline(arg, /*online*/ 1);
xpt_free_path(path);
 }
 
@@ -1801,6 +1785,8 @@ ctlfe_offline(void *arg)
 
bus_softc = (struct ctlfe_softc *)arg;
 
+   ctlfe_onoffline(arg, /*online*/ 0);
+
/*
 * Disable the wildcard LUN for this port now that we have taken
 * the port offline.
@@ -1813,14 +1799,9 @@ ctlfe_offline(void *arg)
   __func__);
return;
}
-
xpt_path_lock(path);
-
-   ctlfe_onoffline(arg, /*online*/ 0);
-
if ((periph = cam_periph_find(path, "ctl")) != NULL)
cam_periph_invalidate(periph);
-
xpt_path_unlock(path);
xpt_free_path(path);
 }
@@ -1881,10 +1862,6 @@ ctlfe_lun_enable(void *arg, struct ctl_i
   "cam_periph_alloc()\n", __func__, (entry != NULL) ?
   entry->status_text : "Unknown", status);
free(softc, M_CTLFE);
-   } else {
-   mtx_lock(&bus_softc->lun_softc_mtx);
-   STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links);
-   mtx_unlock(&bus_softc->lun_softc_mtx);
}
 
xpt_path_unlock(path);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r273331 - in head: sbin/ifconfig share/man/man4 sys/conf sys/modules sys/modules/if_vxlan sys/net sys/sys

2014-12-01 Thread Adrian Chadd
On 1 December 2014 at 05:07, Dag-Erling Smørgrav  wrote:
> Dag-Erling Smørgrav  writes:
>> Bryan Venteicher  writes:
>> > Log:
>> >   Add vxlan interface
>> >   [...]
>> This breaks the existing "group" command, which means I now have
>> machines that won't boot without manual intervention because their
>> firewall rulesets rely on interface groups.
>
> I added code to cmd_register() in ifconfig.c to warn about duplicate
> commands.  Here is a complete list of pre-existing commands which the
> vxlan code shadows:
>
> ifconfig: duplicate command: group
> ifconfig: duplicate command: timeout
> ifconfig: duplicate command: maxaddr
> ifconfig: duplicate command: learn
> ifconfig: duplicate command: -learn
> ifconfig: duplicate command: flush
> ifconfig: duplicate command: flushall
>
> so, in addition to breaking interface groups, it breaks bridge
> interfaces.

Would you mind committing that code, so we at least get warned about
it when we try?



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

Re: svn commit: r273331 - in head: sbin/ifconfig share/man/man4 sys/conf sys/modules sys/modules/if_vxlan sys/net sys/sys

2014-12-01 Thread Dag-Erling Smørgrav
Adrian Chadd  writes:
> Dag-Erling Smørgrav  writes:
> > I added code to cmd_register() in ifconfig.c to warn about duplicate
> > commands.  [...]
> Would you mind committing that code, so we at least get warned about
> it when we try?

It's quadratic and runs every time a set of commands is added, which
means the total running time is closer to n! than n^2.  I can add it
with an #ifdef, but that's not very useful.  It would be better to
rewrite ifconfig to use a hash table instead of a linked list.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r275358 - in head/sys: dev/bxe dev/cxgb dev/cxgbe dev/e1000 dev/ixgbe dev/ixl dev/mxge dev/netmap dev/oce dev/qlxgbe dev/qlxge dev/sfxge dev/virtio/network dev/vmware/vmxnet3 dev/vxge

2014-12-01 Thread John Baldwin
On Monday, December 01, 2014 11:45:25 AM Hans Petter Selasky wrote:
> Author: hselasky
> Date: Mon Dec  1 11:45:24 2014
> New Revision: 275358
> URL: https://svnweb.freebsd.org/changeset/base/275358
> 
> Log:
>   Start process of removing the use of the deprecated "M_FLOWID" flag
>   from the FreeBSD network code. The flag is still kept around in the
>   "sys/mbuf.h" header file, but does no longer have any users. Instead
>   the "m_pkthdr.rsstype" field in the mbuf structure is now used to
>   decide the meaning of the "m_pkthdr.flowid" field. To modify the
>   "m_pkthdr.rsstype" field please use the existing "M_HASHTYPE_XXX"
>   macros as defined in the "sys/mbuf.h" header file.
> 
>   This patch introduces new behaviour in the transmit direction.
>   Previously network drivers checked if "M_FLOWID" was set in "m_flags"
>   before using the "m_pkthdr.flowid" field. This check has now now been
>   replaced by checking if "M_HASHTYPE_GET(m)" is different from
>   "M_HASHTYPE_NONE". In the future more hashtypes will be added, for
>   example hashtypes for hardware dedicated flows.
> 
>   "M_HASHTYPE_OPAQUE" indicates that the "m_pkthdr.flowid" value is
>   valid and has no particular type. This change removes the need for an
>   "if" statement in TCP transmit code checking for the presence of a
>   valid flowid value. The "if" statement mentioned above is now a direct
>   variable assignment which is then later checked by the respective
>   network drivers like before.
> 
>   Additional notes:
>   - The SCTP code changes will be committed as a separate patch.
>   - Removal of the "M_FLOWID" flag will also be done separately.
>   - The FreeBSD version has been bumped.
> 
>   MFC after:  1 month
>   Sponsored by:   Mellanox Technologies

Was this reviewed by anyone?  I know I saw at least one thread on reworking 
M_FLOWID on one list, but it's not clear to me that anyone reviewed these 
specific changes.  If someone did, please be sure to include that type of 
detail in future commits.  If not, I would strongly encourage to still seek 
review even if changes have been agreed upon in the abstract.  Phabricator 
makes this a lot easier to do than previously.

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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread John Baldwin
On Wednesday, November 26, 2014 08:19:36 PM Alfred Perlstein wrote:
> Author: alfred
> Date: Wed Nov 26 20:19:36 2014
> New Revision: 275136
> URL: https://svnweb.freebsd.org/changeset/base/275136
> 
> Log:
>   Make igb and ixgbe check tunables at probe time.
> 
>   This allows one to make a kernel module to tune the
>   number of queues before the driver loads.
> 
>   This is needed so that a module at SI_SUB_CPU can set
>   tunables for these drivers to take.  Otherwise getenv
>   is called too early by the TUNABLE macros.
> 
>   Reviewed by: smh
>   Phabric: https://reviews.freebsd.org/D1149

The explicit TUNABLE_INT_FETCH strikes me as the wrong approach and hackish.  
That is, each time you want to frob a tunable like this you will have to go 
add a bunch of code to explicitly re-read the tunable, etc.  Instead, you 
could have simply changed your helper module to use kernel_sysctlbyname() to 
set hw.igb.num_queues.  That would have required only a single character 
change to make the SYSCTL read/write instead of read/only for each tunable in 
question.  To be completely future proof (i.e. to handle loading the module in 
question post-boot), your module could both do setenv() and 
kernel_sysctlbyname().  That seems to be a more extensible approach in terms 
of allowing more of these to be changed in the future without having to do a 
manual bypass of the existing tunable infrastructure for each tunable.  I 
would much prefer that you revert this part and change the relevant tunables 
to CTLFLAG_RWTUN and update your out-of-tree module to use 
kernel_sysctlbyname().

Also, if you didn't run this by the Intel folks (e.g. jfv@) that might have 
been nice as a courtesy.

Also, please use the existing resource_int_value() that uses 'hint.igb.0.foo'
instead of inventing a different wheel (device_get_int()).  This is what all 
the other drivers in the tree that provide per-instance tunables use.  You
could perhaps have device_get_int() as a wrapper around resource_int_value(),
but we should use the existing convention, not invent a conflicting one.

> Modified:
>   head/sys/dev/e1000/if_igb.c
>   head/sys/dev/ixgbe/ixgbe.c
>   head/sys/kern/subr_bus.c
>   head/sys/sys/bus.h
> 
> Modified: head/sys/dev/e1000/if_igb.c
> 
> == --- head/sys/dev/e1000/if_igb.cWed Nov 26 18:03:25 2014
> (r275135) 
+++
> head/sys/dev/e1000/if_igb.c   Wed Nov 26 20:19:36 2014(r275136) @@ 
-188,6
> +188,7 @@ static char *igb_strings[] = {
>  /*
>   *  Function prototypes
>   */
> +static int   igb_per_unit_num_queues(SYSCTL_HANDLER_ARGS);
>  static int   igb_probe(device_t);
>  static int   igb_attach(device_t);
>  static int   igb_detach(device_t);
> @@ -493,6 +494,11 @@ igb_attach(device_t dev)
>   OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0,
>   igb_sysctl_nvm_info, "I", "NVM Information");
> 
> +SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
> +SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
> + OID_AUTO, "num_queues", CTLTYPE_INT | CTLFLAG_RD,
> + adapter, 0, igb_per_unit_num_queues, "I", "Number of 
> Queues");
> +

You don't need igb_per_unit_num_queues().
SYSCTL_ADD_INT(..., &adapter->num_queues) should have been used instead.

> @@ -2831,6 +2837,7 @@ igb_setup_msix(struct adapter *adapter)
>  {
>   device_tdev = adapter->dev;
>   int bar, want, queues, msgs, maxqueues;
> + int n_queues;
> 
>   /* tuneable override */
>   if (igb_enable_msix == 0)
> @@ -2858,8 +2865,18 @@ igb_setup_msix(struct adapter *adapter)
>   goto msi;
>   }
> 
> - /* Figure out a reasonable auto config value */
> - queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus;
> + n_queues = 0;
> + /* try more specific tunable, then global, then finally default to boot
> time tunable if set. */ + if (device_getenv_int(dev, "num_queues",
> &n_queues) != 0) {
> + device_printf(dev, "using specific tunable num_queues=%d", 
> n_queues);
> + } else if (TUNABLE_INT_FETCH("hw.igb.num_queues", &n_queues) != 0) {
> + if (igb_num_queues != n_queues) {
> + device_printf(dev, "using global tunable 
> hw.igb.num_queues=%d",
> n_queues); +  igb_num_queues = n_queues;
> + }
> + } else {
> + n_queues = igb_num_queues;
> + }
> 
>  #ifdef   RSS
>   /* If we're doing RSS, clamp at the number of RSS buckets */
> @@ -2867,10 +2884,12 @@ igb_setup_msix(struct adapter *adapter)
>   queues = rss_getnumbuckets();
>  #endif
> 
> -
> - /* Manual override */
> - if (igb_num_queues != 0)
> - queues = igb_num_queues;
> + if (n_queues != 0) {
> +

svn commit: r275366 - head/contrib/libc++/include

2014-12-01 Thread Dimitry Andric
Author: dim
Date: Mon Dec  1 15:02:49 2014
New Revision: 275366
URL: https://svnweb.freebsd.org/changeset/base/275366

Log:
  Pull in r209785 from upstream libc++ trunk (by Marshall Clow):
  
Fix a problem exposed by r208825, which caused bind (and other bits of
libc++) to stop working. And tests
  
  This fix is needed to support clang 3.5.0 and higher, which are more
  strict about forming pointer-to-function types with cv-qualifiers or
  ref-qualifiers.  See also the upstream PR  and
  
  
  Reported by:  amdmi3
  MFC after:3 days

Modified:
  head/contrib/libc++/include/type_traits

Modified: head/contrib/libc++/include/type_traits
==
--- head/contrib/libc++/include/type_traits Mon Dec  1 13:55:45 2014
(r275365)
+++ head/contrib/libc++/include/type_traits Mon Dec  1 15:02:49 2014
(r275366)
@@ -439,8 +439,26 @@ template  struct _LIBCPP_TYPE
 
 // is_member_function_pointer
 
-template  struct__libcpp_is_member_function_pointer 
: public false_type {};
-template  struct __libcpp_is_member_function_pointer<_Tp 
_Up::*> : public is_function<_Tp> {};
+// template  struct__libcpp_is_member_function_pointer  
   : public false_type {};
+// template  struct 
__libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {};
+// 
+
+template 
+struct __member_pointer_traits_imp
+{  // forward declaration; specializations later
+};
+
+
+namespace __libcpp_is_member_function_pointer_imp {
+   template 
+   char __test(typename std::__member_pointer_traits_imp<_Tp, true, 
false>::_FnType *);
+
+   template 
+   std::__two __test(...);
+};
+   
+template  struct __libcpp_is_member_function_pointer
+: public integral_constant(nullptr)) == 1> {};
 
 template  struct _LIBCPP_TYPE_VIS_ONLY is_member_function_pointer
 : public __libcpp_is_member_function_pointer::type> {};
@@ -1593,11 +1611,6 @@ __decay_copy(const _Tp& __t)
 
 #endif
 
-template 
-struct __member_pointer_traits_imp
-{
-};
-
 #ifndef _LIBCPP_HAS_NO_VARIADICS
 
 template 
@@ -1605,6 +1618,7 @@ struct __member_pointer_traits_imp<_Rp (
 {
 typedef _Class _ClassType;
 typedef _Rp _ReturnType;
+typedef _Rp (_FnType) (_Param...);
 };
 
 template 
@@ -1612,6 +1626,7 @@ struct __member_pointer_traits_imp<_Rp (
 {
 typedef _Class const _ClassType;
 typedef _Rp _ReturnType;
+typedef _Rp (_FnType) (_Param...);
 };
 
 template 
@@ -1619,6 +1634,7 @@ struct __member_pointer_traits_imp<_Rp (
 {
 typedef _Class volatile _ClassType;
 typedef _Rp _ReturnType;
+typedef _Rp (_FnType) (_Param...);
 };
 
 template 
@@ -1626,6 +1642,7 @@ struct __member_pointer_traits_imp<_Rp (
 {
 typedef _Class const volatile _ClassType;
 typedef _Rp _ReturnType;
+typedef _Rp (_FnType) (_Param...);
 };
 
 #if __has_feature(cxx_reference_qualified_functions)
@@ -1635,6 +1652,7 @@ struct __member_pointer_traits_imp<_Rp (
 {
 typedef _Class& _ClassType;
 typedef _Rp _ReturnType;
+typedef _Rp (_FnType) (_Param...);
 };
 
 template 
@@ -1642,6 +1660,7 @@ struct __member_pointer_traits_imp<_Rp (
 {
 typedef _Class const& _ClassType;
 typedef _Rp _ReturnType;
+typedef _Rp (_FnType) (_Param...);
 };
 
 template 
@@ -1649,6 +1668,7 @@ struct __member_pointer_traits_imp<_Rp (
 {
 typedef _Class volatile& _ClassType;
 typedef _Rp _ReturnType;
+typedef _Rp (_FnType) (_Param...);
 };
 
 template 
@@ -1656,6 +1676,7 @@ struct __member_pointer_traits_imp<_Rp (
 {
 typedef _Class const volatile& _ClassType;
 typedef _Rp _ReturnType;
+typedef _Rp (_FnType) (_Param...);
 };
 
 template 
@@ -1663,6 +1684,7 @@ struct __member_pointer_traits_imp<_Rp (
 {
 typedef _Class&& _ClassType;
 typedef _Rp _ReturnType;
+typedef _Rp (_FnType) (_Param...);
 };
 
 template 
@@ -1670,6 +1692,7 @@ struct __member_pointer_traits_imp<_Rp (
 {
 typedef _Class const&& _ClassType;
 typedef _Rp _ReturnType;
+typedef _Rp (_FnType) (_Param...);
 };
 
 template 
@@ -1677,6 +1700,7 @@ struct __member_pointer_traits_imp<_Rp (
 {
 typedef _Class volatile&& _ClassType;
 typedef _Rp _ReturnType;
+typedef _Rp (_FnType) (_Param...);
 };
 
 template 
@@ -1684,6 +1708,7 @@ struct __member_pointer_traits_imp<_Rp (
 {
 typedef _Class const volatile&& _ClassType;
 typedef _Rp _ReturnType;
+typedef _Rp (_FnType) (_Param...);
 };
 
 #endif  // __has_feature(cxx_reference_qualified_functions)
@@ -1695,6 +1720,7 @@ struct __member_pointer_traits_imp<_Rp (
 {
 typedef _Class _ClassType;
 typedef _Rp _ReturnType;
+typedef _Rp (_FnType) ();
 };
 
 template 
@@ -1702,6 +1728,7 @@ struct __member_pointer_traits_imp<_Rp (
 {
 typedef _Class _ClassType;
 typedef _Rp _ReturnType;
+typedef _Rp (_FnType) (_P0);
 };
 
 templ

Re: svn commit: r273331 - in head: sbin/ifconfig share/man/man4 sys/conf sys/modules sys/modules/if_vxlan sys/net sys/sys

2014-12-01 Thread Bryan Venteicher
On Mon, Dec 1, 2014 at 6:57 AM, Dag-Erling Smørgrav  wrote:

> Bryan Venteicher  writes:
> > Log:
> >   Add vxlan interface
> >   [...]
>
> This breaks the existing "group" command, which means I now have
> machines that won't boot without manual intervention because their
> firewall rulesets rely on interface groups.
>
> Did you even bother to search for "group" in the code, or even in the
> man page, before deciding to add a command by that name?
>
>

This stems from my misunderstanding that these commands were scoped. I'll
work on fix shortly.



> DES
> --
> Dag-Erling Smørgrav - d...@des.no
>
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r275358 - in head/sys: dev/bxe dev/cxgb dev/cxgbe dev/e1000 dev/ixgbe dev/ixl dev/mxge dev/netmap dev/oce dev/qlxgbe dev/qlxge dev/sfxge dev/virtio/network dev/vmware/vmxnet3 dev/vxge

2014-12-01 Thread Hans Petter Selasky

Hi John,

These patches were sent to the -current mailing list for review for 12 
days. No big issues were mentioned.


Also a review has been made at "reviews.freebsd.org":
https://reviews.freebsd.org/D1243

No response yet.

If I missed someone for the review process please let me know.

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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Alfred Perlstein
John,

Will work on a new revision based on feedback. 

Two things to note however:

Already explored the idea of using kernel_sysctlbyname but rejected due to 
following:

It makes little sense to have a rw sysctl that only takes effect "some times". 
This violates POLA at the expense of making code appear cleaner. Expectation is 
that writable sysctls take effect or are read only. They are not to be "write 
sometimes" unless we are to introduce a new flag. Instead of going to a 
confusing model we consider some form of rw sysctl that can set itself ro 
somehow. Otherwise people will be confused as to why nic queues says N while 
actually M.  What the rw->ro api would look like I have no idea. Suggestions?

Btw the review was cc'd to jvf and smh and gleb in phabricator.  Smh responded. 
Jvf + gleb timed out after 2+ weeks for a relatively trivial change.  

Will look at the device_get_int stuff soon. Wasn't aware that function existed. 

Sent from my iPhone

>> On Dec 1, 2014, at 6:32 AM, John Baldwin  wrote:
>> 
>> On Wednesday, November 26, 2014 08:19:36 PM Alfred Perlstein wrote:
>> Author: alfred
>> Date: Wed Nov 26 20:19:36 2014
>> New Revision: 275136
>> URL: https://svnweb.freebsd.org/changeset/base/275136
>> 
>> Log:
>>  Make igb and ixgbe check tunables at probe time.
>> 
>>  This allows one to make a kernel module to tune the
>>  number of queues before the driver loads.
>> 
>>  This is needed so that a module at SI_SUB_CPU can set
>>  tunables for these drivers to take.  Otherwise getenv
>>  is called too early by the TUNABLE macros.
>> 
>>  Reviewed by: smh
>>  Phabric: https://reviews.freebsd.org/D1149
> 
> The explicit TUNABLE_INT_FETCH strikes me as the wrong approach and hackish.  
> That is, each time you want to frob a tunable like this you will have to go 
> add a bunch of code to explicitly re-read the tunable, etc.  Instead, you 
> could have simply changed your helper module to use kernel_sysctlbyname() to 
> set hw.igb.num_queues.  That would have required only a single character 
> change to make the SYSCTL read/write instead of read/only for each tunable in 
> question.  To be completely future proof (i.e. to handle loading the module 
> in 
> question post-boot), your module could both do setenv() and 
> kernel_sysctlbyname().  That seems to be a more extensible approach in terms 
> of allowing more of these to be changed in the future without having to do a 
> manual bypass of the existing tunable infrastructure for each tunable.  I 
> would much prefer that you revert this part and change the relevant tunables 
> to CTLFLAG_RWTUN and update your out-of-tree module to use 
> kernel_sysctlbyname().
> 
> Also, if you didn't run this by the Intel folks (e.g. jfv@) that might have 
> been nice as a courtesy.
> 
> Also, please use the existing resource_int_value() that uses 'hint.igb.0.foo'
> instead of inventing a different wheel (device_get_int()).  This is what all 
> the other drivers in the tree that provide per-instance tunables use.  You
> could perhaps have device_get_int() as a wrapper around resource_int_value(),
> but we should use the existing convention, not invent a conflicting one.
> 
>> Modified:
>>  head/sys/dev/e1000/if_igb.c
>>  head/sys/dev/ixgbe/ixgbe.c
>>  head/sys/kern/subr_bus.c
>>  head/sys/sys/bus.h
>> 
>> Modified: head/sys/dev/e1000/if_igb.c
>> 
>> == --- head/sys/dev/e1000/if_igb.cWed Nov 26 18:03:25 2014(r275135)
> +++
>> head/sys/dev/e1000/if_igb.cWed Nov 26 20:19:36 2014(r275136) @@
> -188,6
>> +188,7 @@ static char *igb_strings[] = {
>> /*
>>  *  Function prototypes
>>  */
>> +static intigb_per_unit_num_queues(SYSCTL_HANDLER_ARGS);
>> static intigb_probe(device_t);
>> static intigb_attach(device_t);
>> static intigb_detach(device_t);
>> @@ -493,6 +494,11 @@ igb_attach(device_t dev)
>>OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0,
>>igb_sysctl_nvm_info, "I", "NVM Information");
>> 
>> +SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
>> +SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
>> +OID_AUTO, "num_queues", CTLTYPE_INT | CTLFLAG_RD,
>> +adapter, 0, igb_per_unit_num_queues, "I", "Number of Queues");
>> +
> 
> You don't need igb_per_unit_num_queues().
> SYSCTL_ADD_INT(..., &adapter->num_queues) should have been used instead.
> 
>> @@ -2831,6 +2837,7 @@ igb_setup_msix(struct adapter *adapter)
>> {
>>device_tdev = adapter->dev;
>>intbar, want, queues, msgs, maxqueues;
>> +intn_queues;
>> 
>>/* tuneable override */
>>if (igb_enable_msix == 0)
>> @@ -2858,8 +2865,18 @@ igb_setup_msix(struct adapter *adapter)
>>goto msi;
>>}
>> 
>> -/* Figure out a reasonable auto config value */
>> -qu

svn commit: r275368 - head/sys/cam

2014-12-01 Thread Alexander Motin
Author: mav
Date: Mon Dec  1 15:21:54 2014
New Revision: 275368
URL: https://svnweb.freebsd.org/changeset/base/275368

Log:
  When passing LUN IDs through treat ASCII values as fixed-length, not
  interpreating NULLs as EOLs, but converting them to spaces.
  
  SPC-4 does not tell that T10-based IDs should be NULL-terminated/padded.
  And while it tells that it should include only ASCII chars (0x20-0x7F),
  there are some USB sticks (SanDisk Ultra Fit), that have NULLs inside
  the value.  Treating NULLs as EOLs there made those LUN IDs non-unique.
  
  MFC after:1 week

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Mon Dec  1 15:11:29 2014(r275367)
+++ head/sys/cam/cam_xpt.c  Mon Dec  1 15:21:54 2014(r275368)
@@ -1136,8 +1136,15 @@ xpt_getattr(char *buf, size_t len, const
if (idd == NULL)
goto out;
ret = 0;
-   if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == 
SVPD_ID_CODESET_ASCII ||
-   (idd->proto_codeset & SVPD_ID_CODESET_MASK) == 
SVPD_ID_CODESET_UTF8) {
+   if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == 
SVPD_ID_CODESET_ASCII) {
+   if (idd->length < len) {
+   for (l = 0; l < idd->length; l++)
+   buf[l] = idd->identifier[l] ?
+   idd->identifier[l] : ' ';
+   buf[l] = 0;
+   } else
+   ret = EFAULT;
+   } else if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == 
SVPD_ID_CODESET_UTF8) {
l = strnlen(idd->identifier, idd->length);
if (l < len) {
bcopy(idd->identifier, buf, l);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Hans Petter Selasky

On 12/01/14 16:19, Alfred Perlstein wrote:

It makes little sense to have a rw sysctl that only takes effect "some times". 
This violates POLA at the expense of making code appear cleaner. Expectation is that 
writable sysctls take


Hi,

I think you are missing a new feature in 11-current, that if you add 
"CTLFLAG_TUN" to even dynamic sysctls, they get initialized from the 
enviroment, if any. That way you can just skip the TUNABLE_INT_FETCH() 
stuff!


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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Alfred Perlstein


> On Dec 1, 2014, at 7:26 AM, Hans Petter Selasky  wrote:
> 
>> On 12/01/14 16:19, Alfred Perlstein wrote:
>> It makes little sense to have a rw sysctl that only takes effect "some 
>> times". This violates POLA at the expense of making code appear cleaner. 
>> Expectation is that writable sysctls take
> 
> Hi,
> 
> I think you are missing a new feature in 11-current, that if you add 
> "CTLFLAG_TUN" to even dynamic sysctls, they get initialized from the 
> enviroment, if any. That way you can just skip the TUNABLE_INT_FETCH() stuff!
> 

Ok I can probably switch to that. 

Any objection if I mfc this feature to -stable if it does what I need?




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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Hans Petter Selasky

On 12/01/14 16:29, Alfred Perlstein wrote:




On Dec 1, 2014, at 7:26 AM, Hans Petter Selasky  wrote:


On 12/01/14 16:19, Alfred Perlstein wrote:
It makes little sense to have a rw sysctl that only takes effect "some times". 
This violates POLA at the expense of making code appear cleaner. Expectation is that 
writable sysctls take


Hi,

I think you are missing a new feature in 11-current, that if you add 
"CTLFLAG_TUN" to even dynamic sysctls, they get initialized from the 
enviroment, if any. That way you can just skip the TUNABLE_INT_FETCH() stuff!



Ok I can probably switch to that.

Any objection if I mfc this feature to -stable if it does what I need?



Hi,

No objections from me at least, but it might require some work from your 
side, because there was a lot of cleanup about removing duplicate 
definitions, like static SYSCTLS which have already CTLFLAG_TUN and a 
TUNABLE fetch statement, which makes the variable init twice. Just look 
at the revision history for "kern/kern_sysctl.c" in 11-current.


--HPS

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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Alfred Perlstein


> On Dec 1, 2014, at 7:34 AM, Hans Petter Selasky  wrote:
> 
>> On 12/01/14 16:29, Alfred Perlstein wrote:
>> 
>> 
 On Dec 1, 2014, at 7:26 AM, Hans Petter Selasky  wrote:
 
 On 12/01/14 16:19, Alfred Perlstein wrote:
 It makes little sense to have a rw sysctl that only takes effect "some 
 times". This violates POLA at the expense of making code appear cleaner. 
 Expectation is that writable sysctls take
>>> 
>>> Hi,
>>> 
>>> I think you are missing a new feature in 11-current, that if you add 
>>> "CTLFLAG_TUN" to even dynamic sysctls, they get initialized from the 
>>> enviroment, if any. That way you can just skip the TUNABLE_INT_FETCH() 
>>> stuff!
>> 
>> Ok I can probably switch to that.
>> 
>> Any objection if I mfc this feature to -stable if it does what I need?
> 
> Hi,
> 
> No objections from me at least, but it might require some work from your 
> side, because there was a lot of cleanup about removing duplicate 
> definitions, like static SYSCTLS which have already CTLFLAG_TUN and a TUNABLE 
> fetch statement, which makes the variable init twice. Just look at the 
> revision history for "kern/kern_sysctl.c" in 11-current.
> 
> --HPS
> 
> 

One question though... For the global sysctl for all nodes

When is the var fetched?  If it's before SI_SUB_CPU it is not useful.  
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Hans Petter Selasky

On 12/01/14 16:39, Alfred Perlstein wrote:




On Dec 1, 2014, at 7:34 AM, Hans Petter Selasky  wrote:


On 12/01/14 16:29, Alfred Perlstein wrote:



On Dec 1, 2014, at 7:26 AM, Hans Petter Selasky  wrote:

On 12/01/14 16:19, Alfred Perlstein wrote:
It makes little sense to have a rw sysctl that only takes effect "some times". 
This violates POLA at the expense of making code appear cleaner. Expectation is that 
writable sysctls take


Hi,

I think you are missing a new feature in 11-current, that if you add 
"CTLFLAG_TUN" to even dynamic sysctls, they get initialized from the 
enviroment, if any. That way you can just skip the TUNABLE_INT_FETCH() stuff!


Ok I can probably switch to that.

Any objection if I mfc this feature to -stable if it does what I need?


Hi,

No objections from me at least, but it might require some work from your side, because 
there was a lot of cleanup about removing duplicate definitions, like static SYSCTLS 
which have already CTLFLAG_TUN and a TUNABLE fetch statement, which makes the variable 
init twice. Just look at the revision history for "kern/kern_sysctl.c" in 
11-current.

--HPS




One question though... For the global sysctl for all nodes

When is the var fetched?  If it's before SI_SUB_CPU it is not useful.



Hi,

It is quite early, actually:

SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0);

In some parts of the machine independent, MI, code you neee to keep the 
TUNABLE_FETCH'es, because its run before SI_SUB_KMEM !


--HPS


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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Alfred Perlstein


> On Dec 1, 2014, at 7:43 AM, Hans Petter Selasky  wrote:
> 
>> On 12/01/14 16:39, Alfred Perlstein wrote:
>> 
>> 
 On Dec 1, 2014, at 7:34 AM, Hans Petter Selasky  wrote:
 
 On 12/01/14 16:29, Alfred Perlstein wrote:
 
 
>> On Dec 1, 2014, at 7:26 AM, Hans Petter Selasky  wrote:
>> 
>> On 12/01/14 16:19, Alfred Perlstein wrote:
>> It makes little sense to have a rw sysctl that only takes effect "some 
>> times". This violates POLA at the expense of making code appear cleaner. 
>> Expectation is that writable sysctls take
> 
> Hi,
> 
> I think you are missing a new feature in 11-current, that if you add 
> "CTLFLAG_TUN" to even dynamic sysctls, they get initialized from the 
> enviroment, if any. That way you can just skip the TUNABLE_INT_FETCH() 
> stuff!
 
 Ok I can probably switch to that.
 
 Any objection if I mfc this feature to -stable if it does what I need?
>>> 
>>> Hi,
>>> 
>>> No objections from me at least, but it might require some work from your 
>>> side, because there was a lot of cleanup about removing duplicate 
>>> definitions, like static SYSCTLS which have already CTLFLAG_TUN and a 
>>> TUNABLE fetch statement, which makes the variable init twice. Just look at 
>>> the revision history for "kern/kern_sysctl.c" in 11-current.
>>> 
>>> --HPS
>> 
>> One question though... For the global sysctl for all nodes
>> 
>> When is the var fetched?  If it's before SI_SUB_CPU it is not useful.
> 
> Hi,
> 
> It is quite early, actually:
> 
> SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0);
> 
> In some parts of the machine independent, MI, code you neee to keep the 
> TUNABLE_FETCH'es, because its run before SI_SUB_KMEM !

Then it will not work unless I move the global n_queues sysctl creation into 
the driver's mod load function. 

Is that ok?



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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Hans Petter Selasky

On 12/01/14 16:45, Alfred Perlstein wrote:


> Hi,


It is quite early, actually:

SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0);

In some parts of the machine independent, MI, code you neee to keep the 
TUNABLE_FETCH'es, because its run before SI_SUB_KMEM !


Then it will not work unless I move the global n_queues sysctl creation into 
the driver's mod load function.

Is that ok?


Are you asking me?

--HPS

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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread John Baldwin
On Monday, December 01, 2014 07:19:13 AM Alfred Perlstein wrote:
> John,
> 
> Will work on a new revision based on feedback.
> 
> Two things to note however:
> 
> Already explored the idea of using kernel_sysctlbyname but rejected due to
> following:
> 
> It makes little sense to have a rw sysctl that only takes effect "some
> times". This violates POLA at the expense of making code appear cleaner.
> Expectation is that writable sysctls take effect or are read only. They are
> not to be "write sometimes" unless we are to introduce a new flag. Instead
> of going to a confusing model we consider some form of rw sysctl that can
> set itself ro somehow. Otherwise people will be confused as to why nic
> queues says N while actually M.  What the rw->ro api would look like I have
> no idea. Suggestions?

This is only somewhat true.  In the near distant future we will have a devctl 
tool which would let you do 'devctl detach igb0 && devctl attach igb0' which 
would honor your post-boot setting of hw.igb.num_queues.  Instead what is 
important to understand about this particular sysctl node is that it only 
takes affect when a device is attached.  However, there are other control 
knobs that also only affect future operations and not existing instances of 
objects, so I don't think this is that big of a leap.

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


Re: svn commit: r275358 - in head/sys: dev/bxe dev/cxgb dev/cxgbe dev/e1000 dev/ixgbe dev/ixl dev/mxge dev/netmap dev/oce dev/qlxgbe dev/qlxge dev/sfxge dev/virtio/network dev/vmware/vmxnet3 dev/vxge

2014-12-01 Thread John Baldwin
On Monday, December 01, 2014 04:15:49 PM Hans Petter Selasky wrote:
> Hi John,
> 
> These patches were sent to the -current mailing list for review for 12
> days. No big issues were mentioned.
> 
> Also a review has been made at "reviews.freebsd.org":
> https://reviews.freebsd.org/D1243
> 
> No response yet.
> 
> If I missed someone for the review process please let me know.

Even if no one comments, please include the review URL in the "Differential 
Review" field.  Also, I think you could probably have put 'Discussed with:  
adrian, kmacy' in the commit.  Arguably from the followups in that thread you 
might have been able to put "Reviewed by: adrian" as well if this is just the 
cleanup patches that he said were ok.

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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Alfred Perlstein


> On Dec 1, 2014, at 7:49 AM, John Baldwin  wrote:
> 
>> On Monday, December 01, 2014 07:19:13 AM Alfred Perlstein wrote:
>> John,
>> 
>> Will work on a new revision based on feedback.
>> 
>> Two things to note however:
>> 
>> Already explored the idea of using kernel_sysctlbyname but rejected due to
>> following:
>> 
>> It makes little sense to have a rw sysctl that only takes effect "some
>> times". This violates POLA at the expense of making code appear cleaner.
>> Expectation is that writable sysctls take effect or are read only. They are
>> not to be "write sometimes" unless we are to introduce a new flag. Instead
>> of going to a confusing model we consider some form of rw sysctl that can
>> set itself ro somehow. Otherwise people will be confused as to why nic
>> queues says N while actually M.  What the rw->ro api would look like I have
>> no idea. Suggestions?
> 
> This is only somewhat true.  In the near distant future we will have a devctl 
> tool which would let you do 'devctl detach igb0 && devctl attach igb0' which 
> would honor your post-boot setting of hw.igb.num_queues.  Instead what is 
> important to understand about this particular sysctl node is that it only 
> takes affect when a device is attached.  However, there are other control 
> knobs that also only affect future operations and not existing instances of 
> objects, so I don't think this is that big of a leap.
> 

Strongly disagree here.  If I were not able to grok the c code I would be very 
confused by such a thing. In fact even with the fact that I do grok c code I 
would be very discouraged to find such behavior and strongly object to writable 
sysctls that do nothing. 

The ux is that the user has a bunch of dials on their dashboard that function 
as a busybox as opposed to doing what they are advertised to do. Sort of like 
those crossing light buttons in New York City that aren't actually hooked to 
anything. 

So: No. Frankly would rather back out the change entirely and keep this change 
local to us than expose users to such a UX. 

I will however like to discuss the possibility of a tunable/sysctl system that 
makes sense. 

-Alfred. 



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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Alfred Perlstein


> On Dec 1, 2014, at 7:49 AM, Hans Petter Selasky  wrote:
> 
>> On 12/01/14 16:45, Alfred Perlstein wrote:
>> 
>> > Hi,
>>> 
>>> It is quite early, actually:
>>> 
>>> SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0);
>>> 
>>> In some parts of the machine independent, MI, code you neee to keep the 
>>> TUNABLE_FETCH'es, because its run before SI_SUB_KMEM !
>> 
>> Then it will not work unless I move the global n_queues sysctl creation into 
>> the driver's mod load function.
>> 
>> Is that ok?
> 
> Are you asking me?

In soviet russia no one is ever sure whom to ask for permission to proceed. 

(Also you have significant commits to the driver so it makes sense. )


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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Jack Vogel
There is no mystery about who's drivers these are, and its not like it would
take a lot of effort to figure out ownership and ask us for review.

Remove this commit until I have had time to look it over!

Jack


On Mon, Dec 1, 2014 at 7:56 AM, Alfred Perlstein  wrote:

>
>
> > On Dec 1, 2014, at 7:49 AM, Hans Petter Selasky  wrote:
> >
> >> On 12/01/14 16:45, Alfred Perlstein wrote:
> >>
> >> > Hi,
> >>>
> >>> It is quite early, actually:
> >>>
> >>> SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0);
> >>>
> >>> In some parts of the machine independent, MI, code you neee to keep
> the TUNABLE_FETCH'es, because its run before SI_SUB_KMEM !
> >>
> >> Then it will not work unless I move the global n_queues sysctl creation
> into the driver's mod load function.
> >>
> >> Is that ok?
> >
> > Are you asking me?
>
> In soviet russia no one is ever sure whom to ask for permission to proceed.
>
> (Also you have significant commits to the driver so it makes sense. )
>
>
> >
> > --HPS
> >
> >
>
>
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275369 - in head/contrib/elftoolchain: elfcopy libelftc nm strings

2014-12-01 Thread Ed Maste
Author: emaste
Date: Mon Dec  1 16:07:31 2014
New Revision: 275369
URL: https://svnweb.freebsd.org/changeset/base/275369

Log:
  Fix elftoolchain tools in-tree build
  
   * make variables static
   * add header for uint*_t typedefs

Modified:
  head/contrib/elftoolchain/elfcopy/ascii.c
  head/contrib/elftoolchain/elfcopy/segments.c
  head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c
  head/contrib/elftoolchain/nm/nm.c
  head/contrib/elftoolchain/strings/strings.c

Modified: head/contrib/elftoolchain/elfcopy/ascii.c
==
--- head/contrib/elftoolchain/elfcopy/ascii.c   Mon Dec  1 15:21:54 2014
(r275368)
+++ head/contrib/elftoolchain/elfcopy/ascii.c   Mon Dec  1 16:07:31 2014
(r275369)
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: head/contrib/elftoolchain/elfcopy/segments.c
==
--- head/contrib/elftoolchain/elfcopy/segments.cMon Dec  1 15:21:54 
2014(r275368)
+++ head/contrib/elftoolchain/elfcopy/segments.cMon Dec  1 16:07:31 
2014(r275369)
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c
==
--- head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c  Mon Dec  1 
15:21:54 2014(r275368)
+++ head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c  Mon Dec  1 
16:07:31 2014(r275369)
@@ -156,7 +156,7 @@ static int  vector_type_qualifier_init(st
 static int vector_type_qualifier_push(struct vector_type_qualifier *,
enum type_qualifier);
 
-int cpp_demangle_gnu3_push_head;
+static int cpp_demangle_gnu3_push_head;
 
 /**
  * @brief Decode the input string by IA-64 C++ ABI style.

Modified: head/contrib/elftoolchain/nm/nm.c
==
--- head/contrib/elftoolchain/nm/nm.c   Mon Dec  1 15:21:54 2014
(r275368)
+++ head/contrib/elftoolchain/nm/nm.c   Mon Dec  1 16:07:31 2014
(r275369)
@@ -65,7 +65,7 @@ typedef void (*fn_sym_print)(const GElf_
 typedef int (*fn_filter)(char, const GElf_Sym *, const char *);
 
 /* output filter list */
-SLIST_HEAD(filter_head, filter_entry) nm_out_filter =
+static SLIST_HEAD(filter_head, filter_entry) nm_out_filter =
 SLIST_HEAD_INITIALIZER(nm_out_filter);
 
 struct filter_entry {

Modified: head/contrib/elftoolchain/strings/strings.c
==
--- head/contrib/elftoolchain/strings/strings.c Mon Dec  1 15:21:54 2014
(r275368)
+++ head/contrib/elftoolchain/strings/strings.c Mon Dec  1 16:07:31 2014
(r275369)
@@ -75,9 +75,9 @@ enum encoding_style {
  (encoding == ENCODING_8BIT && (c) > 127)))
 
 
-int encoding_size, entire_file, min_len, show_filename, show_loc;
-enum encoding_style encoding;
-enum radix_style radix;
+static int encoding_size, entire_file, min_len, show_filename, show_loc;
+static enum encoding_style encoding;
+static enum radix_style radix;
 
 static struct option strings_longopts[] = {
{ "all",no_argument,NULL,   'a'},
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Alfred Perlstein
Jack you were asked.   Please see the review system. 

Sent from my iPhone

> On Dec 1, 2014, at 8:05 AM, Jack Vogel  wrote:
> 
> There is no mystery about who's drivers these are, and its not like it would
> take a lot of effort to figure out ownership and ask us for review. 
> 
> Remove this commit until I have had time to look it over!
> 
> Jack
> 
> 
>> On Mon, Dec 1, 2014 at 7:56 AM, Alfred Perlstein  wrote:
>> 
>> 
>> > On Dec 1, 2014, at 7:49 AM, Hans Petter Selasky  wrote:
>> >
>> >> On 12/01/14 16:45, Alfred Perlstein wrote:
>> >>
>> >> > Hi,
>> >>>
>> >>> It is quite early, actually:
>> >>>
>> >>> SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0);
>> >>>
>> >>> In some parts of the machine independent, MI, code you neee to keep the 
>> >>> TUNABLE_FETCH'es, because its run before SI_SUB_KMEM !
>> >>
>> >> Then it will not work unless I move the global n_queues sysctl creation 
>> >> into the driver's mod load function.
>> >>
>> >> Is that ok?
>> >
>> > Are you asking me?
>> 
>> In soviet russia no one is ever sure whom to ask for permission to proceed.
>> 
>> (Also you have significant commits to the driver so it makes sense. )
>> 
>> 
>> >
>> > --HPS
>> >
>> >
> 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275370 - head/contrib/elftoolchain/size

2014-12-01 Thread Ed Maste
Author: emaste
Date: Mon Dec  1 16:10:03 2014
New Revision: 275370
URL: https://svnweb.freebsd.org/changeset/base/275370

Log:
  Temporarily disable non-FreeBSD NT_ note types

Modified:
  head/contrib/elftoolchain/size/size.c

Modified: head/contrib/elftoolchain/size/size.c
==
--- head/contrib/elftoolchain/size/size.c   Mon Dec  1 16:07:31 2014
(r275369)
+++ head/contrib/elftoolchain/size/size.c   Mon Dec  1 16:10:03 2014
(r275370)
@@ -269,7 +269,7 @@ handle_core_note(Elf *elf, GElf_Ehdr *el
static pid_t pid;
uintptr_t ver;
Elf32_Nhdr *nhdr, nhdr_l;
-   static int reg_pseudo = 0, reg2_pseudo = 0, regxfp_pseudo = 0;
+   static int reg_pseudo = 0, reg2_pseudo = 0 /*, regxfp_pseudo = 0*/;
char buf[BUF_SIZE], *data, *name;
 
if (elf == NULL || elfhdr == NULL || phdr == NULL)
@@ -360,6 +360,7 @@ handle_core_note(Elf *elf, GElf_Ehdr *el
text_size_total += nhdr_l.n_descsz;
}
break;
+#if 0
case NT_AUXV:
if (style == STYLE_SYSV) {
tbl_append();
@@ -390,6 +391,7 @@ handle_core_note(Elf *elf, GElf_Ehdr *el
}
break;
case NT_PSINFO:
+#endif
case NT_PRPSINFO: {
/* FreeBSD 64-bit */
if (nhdr_l.n_descsz == 0x78 &&
@@ -415,8 +417,10 @@ handle_core_note(Elf *elf, GElf_Ehdr *el
}
break;
}
+#if 0
case NT_PSTATUS:
case NT_LWPSTATUS:
+#endif
default:
break;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275371 - head/contrib/elftoolchain/elfcopy

2014-12-01 Thread Ed Maste
Author: emaste
Date: Mon Dec  1 16:10:44 2014
New Revision: 275371
URL: https://svnweb.freebsd.org/changeset/base/275371

Log:
  Track libarchive API change

Modified:
  head/contrib/elftoolchain/elfcopy/archive.c

Modified: head/contrib/elftoolchain/elfcopy/archive.c
==
--- head/contrib/elftoolchain/elfcopy/archive.c Mon Dec  1 16:10:03 2014
(r275370)
+++ head/contrib/elftoolchain/elfcopy/archive.c Mon Dec  1 16:10:44 2014
(r275371)
@@ -350,12 +350,12 @@ ac_detect_ar(int ifd)
r = -1;
if ((a = archive_read_new()) == NULL)
return (0);
-   archive_read_support_compression_none(a);
+   archive_read_support_filter_none(a);
archive_read_support_format_ar(a);
if (archive_read_open_fd(a, ifd, 10240) == ARCHIVE_OK)
r = archive_read_next_header(a, &entry);
archive_read_close(a);
-   archive_read_finish(a);
+   archive_read_free(a);
 
return (r == ARCHIVE_OK);
 }
@@ -386,7 +386,7 @@ ac_read_objs(struct elfcopy *ecp, int if
err(EXIT_FAILURE, "lseek failed");
if ((a = archive_read_new()) == NULL)
errx(EXIT_FAILURE, "%s", archive_error_string(a));
-   archive_read_support_compression_none(a);
+   archive_read_support_filter_none(a);
archive_read_support_format_ar(a);
AC(archive_read_open_fd(a, ifd, 10240));
for(;;) {
@@ -435,7 +435,7 @@ ac_read_objs(struct elfcopy *ecp, int if
}
}
AC(archive_read_close(a));
-   ACV(archive_read_finish(a));
+   ACV(archive_read_free(a));
 }
 
 static void
@@ -449,7 +449,7 @@ ac_write_objs(struct elfcopy *ecp, int o
if ((a = archive_write_new()) == NULL)
errx(EXIT_FAILURE, "%s", archive_error_string(a));
archive_write_set_format_ar_svr4(a);
-   archive_write_set_compression_none(a);
+   archive_write_add_filter_none(a);
AC(archive_write_open_fd(a, ofd));
 
/* Write the archive symbol table, even if it's empty. */
@@ -491,7 +491,7 @@ ac_write_objs(struct elfcopy *ecp, int o
}
 
AC(archive_write_close(a));
-   ACV(archive_write_finish(a));
+   ACV(archive_write_free(a));
 }
 
 static void
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Jack Vogel
Really, and did I say that I approved, because I do not recall the event?

Jack


On Mon, Dec 1, 2014 at 8:08 AM, Alfred Perlstein  wrote:

> Jack you were asked.   Please see the review system.
>
> Sent from my iPhone
>
> On Dec 1, 2014, at 8:05 AM, Jack Vogel  wrote:
>
> There is no mystery about who's drivers these are, and its not like it
> would
> take a lot of effort to figure out ownership and ask us for review.
>
> Remove this commit until I have had time to look it over!
>
> Jack
>
>
> On Mon, Dec 1, 2014 at 7:56 AM, Alfred Perlstein  wrote:
>
>>
>>
>> > On Dec 1, 2014, at 7:49 AM, Hans Petter Selasky 
>> wrote:
>> >
>> >> On 12/01/14 16:45, Alfred Perlstein wrote:
>> >>
>> >> > Hi,
>> >>>
>> >>> It is quite early, actually:
>> >>>
>> >>> SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0);
>> >>>
>> >>> In some parts of the machine independent, MI, code you neee to keep
>> the TUNABLE_FETCH'es, because its run before SI_SUB_KMEM !
>> >>
>> >> Then it will not work unless I move the global n_queues sysctl
>> creation into the driver's mod load function.
>> >>
>> >> Is that ok?
>> >
>> > Are you asking me?
>>
>> In soviet russia no one is ever sure whom to ask for permission to
>> proceed.
>>
>> (Also you have significant commits to the driver so it makes sense. )
>>
>>
>> >
>> > --HPS
>> >
>> >
>>
>>
>
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Hans Petter Selasky

On 12/01/14 16:56, Alfred Perlstein wrote:




On Dec 1, 2014, at 7:49 AM, Hans Petter Selasky  wrote:


On 12/01/14 16:45, Alfred Perlstein wrote:


Hi,

It is quite early, actually:

SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0);

In some parts of the machine independent, MI, code you neee to keep the 
TUNABLE_FETCH'es, because its run before SI_SUB_KMEM !


Then it will not work unless I move the global n_queues sysctl creation into 
the driver's mod load function.

Is that ok?


Are you asking me?


In soviet russia no one is ever sure whom to ask for permission to proceed.

(Also you have significant commits to the driver so it makes sense. )



Ok,

You need to check "sys/sys/kernel.h" for the full init order and figure 
out where exactly your driver code is running and make sure that is 
running after the SYSCTL/TUNABLE gets init.


--HPS

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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Alfred Perlstein


> On Dec 1, 2014, at 8:28 AM, Hans Petter Selasky  wrote:
> 
>> On 12/01/14 16:56, Alfred Perlstein wrote:
>> 
>> 
 On Dec 1, 2014, at 7:49 AM, Hans Petter Selasky  wrote:
 
> On 12/01/14 16:45, Alfred Perlstein wrote:
> 
> Hi,
> 
> It is quite early, actually:
> 
> SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0);
> 
> In some parts of the machine independent, MI, code you neee to keep the 
> TUNABLE_FETCH'es, because its run before SI_SUB_KMEM !
 
 Then it will not work unless I move the global n_queues sysctl creation 
 into the driver's mod load function.
 
 Is that ok?
>>> 
>>> Are you asking me?
>> 
>> In soviet russia no one is ever sure whom to ask for permission to proceed.
>> 
>> (Also you have significant commits to the driver so it makes sense. )
> 
> Ok,
> 
> You need to check "sys/sys/kernel.h" for the full init order and figure out 
> where exactly your driver code is running and make sure that is running after 
> the SYSCTL/TUNABLE gets init.

Yes that is why it is being done by hand in the probe routine. I think proper 
thing might be a way to sort out how to get tunables to run at a driver load 
event?  Is that possible?

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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Hans Petter Selasky

Hi,

I think you maybe missed a point 

On 12/01/14 17:31, Alfred Perlstein wrote:


Yes that is why it is being done by hand in the probe routine. I think proper 
thing might be a way to sort out how to get tunables to run at a driver load 
event?  Is that possible?


All sysctls are tried init when they are created, both so-called 
"static" and "dynamic" ones.


If the sysctl is created inside the probe routine and has the tunable 
flag set, it will get init before the creation is complete, if present 
in the boot environment.


If the sysctl is of a "static" kind, it will be created and initialized 
when SI_SUB_KMEM is executing!


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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread John Baldwin
On Monday, December 01, 2014 07:55:57 AM Alfred Perlstein wrote:
> > On Dec 1, 2014, at 7:49 AM, John Baldwin  wrote:
> >> On Monday, December 01, 2014 07:19:13 AM Alfred Perlstein wrote:
> >> John,
> >> 
> >> Will work on a new revision based on feedback.
> >> 
> >> Two things to note however:
> >> 
> >> Already explored the idea of using kernel_sysctlbyname but rejected due
> >> to
> >> following:
> >> 
> >> It makes little sense to have a rw sysctl that only takes effect "some
> >> times". This violates POLA at the expense of making code appear cleaner.
> >> Expectation is that writable sysctls take effect or are read only. They
> >> are
> >> not to be "write sometimes" unless we are to introduce a new flag.
> >> Instead
> >> of going to a confusing model we consider some form of rw sysctl that can
> >> set itself ro somehow. Otherwise people will be confused as to why nic
> >> queues says N while actually M.  What the rw->ro api would look like I
> >> have
> >> no idea. Suggestions?
> > 
> > This is only somewhat true.  In the near distant future we will have a
> > devctl tool which would let you do 'devctl detach igb0 && devctl attach
> > igb0' which would honor your post-boot setting of hw.igb.num_queues. 
> > Instead what is important to understand about this particular sysctl node
> > is that it only takes affect when a device is attached.  However, there
> > are other control knobs that also only affect future operations and not
> > existing instances of objects, so I don't think this is that big of a
> > leap.
> 
> Strongly disagree here.  If I were not able to grok the c code I would be
> very confused by such a thing. In fact even with the fact that I do grok c
> code I would be very discouraged to find such behavior and strongly object
> to writable sysctls that do nothing.

It's not hard to document this in the way that that sysctls are documented:

Index: if_igb.c
===
--- if_igb.c(revision 275032)
+++ if_igb.c(working copy)
@@ -390,7 +390,7 @@ SYSCTL_INT(_hw_igb, OID_AUTO, header_split, CTLFLA
 */
 static int igb_num_queues = 0;
 SYSCTL_INT(_hw_igb, OID_AUTO, num_queues, CTLFLAG_RDTUN, &igb_num_queues, 0,
-"Number of queues to configure, 0 indicates autoconfigure");
+"Number of queues to configure during attach, 0 indicates autoconfigure");
 
 /*
 ** Global variable to store last used CPU when binding queues

That is fairly clear from 'sysctl -D' (what I'd use first to discern what a
sysctl does).  The fact that the newly added 'dev.igb.0.num_queues' (which I
think is fine to add would be read-only) would make it clear you can't change
this at runtime on an existing interface.

On the other hand, I do think it makes sense to figure out what meta thing you
are trying to do.  I assume you simply want a way to disable multiqueue at
runtime and you don't want to do this in the loader?  (Given you are using an
in-house module for this, adding a change to the loader to set the tunable
might be even less work and would require no kernel changes at all, even for
future drivers for which you may want to set a tunable.)

The other option you have for your use case of course is to simply wait to load
igb.ko until after you've booted.  If you aren't using an NFS root over your
igb interfaces, then that seems far simpler than any of the suggested changes.
You can even do the work in userland with an rc.d script that uses kenv to set
tunables before you load igb.ko.  Actually, you can handle even NFS root for
this case.  Simply load igb from the loader using igb.ko.  You can then have
the SYSINIT in your special module run at SI_SUB_TUNABLES, SI_ORDER_FIRST.  It
won't actually run until closer to SI_SUB_KLD, but what happens is that after
SI_SUB_KLD runs linker_preload(), all the SYSINITs in the various modules
are sorted into the global list and then run in the resulting order.  So you
can insert a sysinit in your module that runs at SI_SUB_TUNABLES,
SI_ORDER_FIRST (the one you currently have at SI_SUB_CPU) and it will run
before igb.ko fetches any of its tunables.  This will work for any driver so
long as you ship it as a module without needing any code changes to any driver,
and works for any tunable.

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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Alfred Perlstein


> On Dec 1, 2014, at 8:37 AM, Hans Petter Selasky  wrote:
> 
> Hi,
> 
> I think you maybe missed a point 
> 
>> On 12/01/14 17:31, Alfred Perlstein wrote:
>> 
>> Yes that is why it is being done by hand in the probe routine. I think 
>> proper thing might be a way to sort out how to get tunables to run at a 
>> driver load event?  Is that possible?
> 
> All sysctls are tried init when they are created, both so-called "static" and 
> "dynamic" ones.
> 
> If the sysctl is created inside the probe routine and has the tunable flag 
> set, it will get init before the creation is complete, if present in the boot 
> environment.
> 
> If the sysctl is of a "static" kind, it will be created and initialized when 
> SI_SUB_KMEM is executing!

I totally understand this. It is in the phabricator review. :)

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


svn commit: r275372 - head/sys/kern

2014-12-01 Thread Konstantin Belousov
Author: kib
Date: Mon Dec  1 17:36:10 2014
New Revision: 275372
URL: https://svnweb.freebsd.org/changeset/base/275372

Log:
  Disable recursion for the process spinlock.
  
  Tested by:pho
  Discussed with:   jhb
  Sponsored by: The FreeBSD Foundation
  MFC after:1 month

Modified:
  head/sys/kern/kern_mutex.c
  head/sys/kern/kern_proc.c

Modified: head/sys/kern/kern_mutex.c
==
--- head/sys/kern/kern_mutex.c  Mon Dec  1 16:10:44 2014(r275371)
+++ head/sys/kern/kern_mutex.c  Mon Dec  1 17:36:10 2014(r275372)
@@ -968,7 +968,7 @@ mutex_init(void)
mtx_init(&blocked_lock, "blocked lock", NULL, MTX_SPIN);
blocked_lock.mtx_lock = 0xdeadc0de; /* Always blocked. */
mtx_init(&proc0.p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);
-   mtx_init(&proc0.p_slock, "process slock", NULL, MTX_SPIN | MTX_RECURSE);
+   mtx_init(&proc0.p_slock, "process slock", NULL, MTX_SPIN);
mtx_init(&proc0.p_statmtx, "pstatl", NULL, MTX_SPIN);
mtx_init(&proc0.p_itimmtx, "pitiml", NULL, MTX_SPIN);
mtx_init(&proc0.p_profmtx, "pprofl", NULL, MTX_SPIN);

Modified: head/sys/kern/kern_proc.c
==
--- head/sys/kern/kern_proc.c   Mon Dec  1 16:10:44 2014(r275371)
+++ head/sys/kern/kern_proc.c   Mon Dec  1 17:36:10 2014(r275372)
@@ -227,7 +227,7 @@ proc_init(void *mem, int size, int flags
p->p_sched = (struct p_sched *)&p[1];
bzero(&p->p_mtx, sizeof(struct mtx));
mtx_init(&p->p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK);
-   mtx_init(&p->p_slock, "process slock", NULL, MTX_SPIN | MTX_RECURSE);
+   mtx_init(&p->p_slock, "process slock", NULL, MTX_SPIN);
mtx_init(&p->p_statmtx, "pstatl", NULL, MTX_SPIN);
mtx_init(&p->p_itimmtx, "pitiml", NULL, MTX_SPIN);
mtx_init(&p->p_profmtx, "pprofl", NULL, MTX_SPIN);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275373 - in head: . gnu/usr.bin/binutils lib lib/libelftc share/mk tools/build/options usr.bin usr.bin/addr2line usr.bin/elfcopy usr.bin/nm usr.bin/size usr.bin/strings

2014-12-01 Thread Ed Maste
Author: emaste
Date: Mon Dec  1 17:49:42 2014
New Revision: 275373
URL: https://svnweb.freebsd.org/changeset/base/275373

Log:
  Build infrastructure for elftoolchain tools
  
  Set WITH_ELFTOOLCHAIN_TOOLS in src.conf to use the elftoolchain version
  of the following tools:
  
   * addr2line
   * elfcopy (strip / mcs)
   * nm
   * size
   * strings
  
  Reviewed by:  bapt (earlier version)
  Sponsored by: The FreeBSD Foundation
  Differential Revision: https://reviews.freebsd.org/D1224

Added:
  head/lib/libelftc/
  head/lib/libelftc/Makefile   (contents, props changed)
  head/lib/libelftc/elftc_version.c   (contents, props changed)
  head/tools/build/options/WITH_ELFTOOLCHAIN_TOOLS   (contents, props changed)
  head/usr.bin/addr2line/
  head/usr.bin/addr2line/Makefile   (contents, props changed)
  head/usr.bin/elfcopy/
  head/usr.bin/elfcopy/Makefile   (contents, props changed)
  head/usr.bin/nm/
  head/usr.bin/nm/Makefile   (contents, props changed)
  head/usr.bin/size/
  head/usr.bin/size/Makefile   (contents, props changed)
  head/usr.bin/strings/
  head/usr.bin/strings/Makefile   (contents, props changed)
Modified:
  head/Makefile.inc1
  head/gnu/usr.bin/binutils/Makefile
  head/lib/Makefile
  head/share/mk/src.libnames.mk
  head/share/mk/src.opts.mk
  head/usr.bin/Makefile

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Dec  1 17:36:10 2014(r275372)
+++ head/Makefile.inc1  Mon Dec  1 17:49:42 2014(r275373)
@@ -1415,6 +1415,14 @@ _kgzip=  usr.sbin/kgzip
 # If we're given an XAS, don't build binutils.
 .if ${XAS:M/*} == "" && ${MK_BINUTILS_BOOTSTRAP} != "no"
 _binutils= gnu/usr.bin/binutils
+.if ${MK_ELFTOOLCHAIN_TOOLS} != "no"
+_elftctools=   lib/libelftc \
+   usr.bin/addr2line \
+   usr.bin/elfcopy \
+   usr.bin/nm \
+   usr.bin/size \
+   usr.bin/strings
+.endif
 .endif
 
 # If an full path to an external cross compiler is given, don't build
@@ -1434,6 +1442,7 @@ cross-tools: .MAKE
 ${_clang_libs} \
 ${_clang} \
 ${_binutils} \
+${_elftctools} \
 ${_cc} \
 usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
 ${_btxld} \
@@ -1491,6 +1500,7 @@ native-xtools: .MAKE
 ${_clang_tblgen} \
 usr.bin/ar \
 ${_binutils} \
+${_elftctools} \
 ${_cc} \
 ${_gcc_tools} \
 ${_clang_libs} \
@@ -2045,6 +2055,7 @@ _xb-build-tools:
 _xb-cross-tools:
 .for _tool in \
 ${_binutils} \
+${_elftctools} \
 usr.bin/ar \
 ${_clang_libs} \
 ${_clang} \
@@ -2077,6 +2088,7 @@ _xi-cross-tools:
@echo "_xi-cross-tools"
 .for _tool in \
 ${_binutils} \
+${_elftctools} \
 usr.bin/ar \
 ${_clang_libs} \
 ${_clang} \

Modified: head/gnu/usr.bin/binutils/Makefile
==
--- head/gnu/usr.bin/binutils/Makefile  Mon Dec  1 17:36:10 2014
(r275372)
+++ head/gnu/usr.bin/binutils/Makefile  Mon Dec  1 17:49:42 2014
(r275373)
@@ -1,19 +1,29 @@
 # $FreeBSD$
 
+.include 
+
 SUBDIR=libiberty \
libbfd \
libopcodes \
libbinutils \
-   addr2line \
+   ${_addr2line} \
as \
ld \
-   nm \
+   ${_nm} \
objcopy \
objdump \
readelf \
-   size \
-   strings \
-   strip \
+   ${_size} \
+   ${_strings} \
+   ${_strip} \
doc
+   
+.if ${MK_ELFTOOLCHAIN_TOOLS} == "no"
+_addr2line=addr2line
+_nm=   nm
+_size= size
+_strings=  strings
+_strip=strip
+.endif
 
 .include 

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Mon Dec  1 17:36:10 2014(r275372)
+++ head/lib/Makefile   Mon Dec  1 17:49:42 2014(r275373)
@@ -45,6 +45,7 @@ SUBDIR=   ${SUBDIR_ORDERED} \
libdpv \
libdwarf \
libedit \
+   ${_libelftc} \
${_libevent} \
libexecinfo \
libexpat \
@@ -190,6 +191,10 @@ _clang=clang
 _cuse= libcuse
 .endif
 
+.if ${MK_ELFTOOLCHAIN_TOOLS} != "no"
+_libelftc= libelftc
+.endif
+
 .if ${MK_GPIB} != "no"
 _libgpib=  libgpib
 .endif

Added: head/lib/libelftc/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libelftc/Makefile  Mon Dec  1 17:49:42 2014(r275373)
@@ -0,0 +1,30 @@
+# $FreeBSD$
+.include 
+
+INTERNALLIB=
+
+ELFTCDIR=  ${.CURDIR}/../../contrib/elftoolchain
+
+.PATH: ${ELFTCDIR}/libelftc
+
+LIB=   elftc
+
+SRCS=  elftc_bfdtarget.c   \
+   elftc_copyfile.c\
+   elftc_demangle.c\
+   elftc_set_timestamps.c  \
+   elftc_string_tabl

svn commit: r275374 - head/share/man/man4

2014-12-01 Thread Alexander Motin
Author: mav
Date: Mon Dec  1 17:51:16 2014
New Revision: 275374
URL: https://svnweb.freebsd.org/changeset/base/275374

Log:
  Document ISP 2532 support and hint.isp.0.vports tunable.
  
  MFC after:1 week

Modified:
  head/share/man/man4/isp.4

Modified: head/share/man/man4/isp.4
==
--- head/share/man/man4/isp.4   Mon Dec  1 17:49:42 2014(r275373)
+++ head/share/man/man4/isp.4   Mon Dec  1 17:51:16 2014(r275374)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 28, 2007
+.Dd December 1, 2014
 .Dt ISP 4
 .Os
 .Sh NAME
@@ -136,6 +136,8 @@ Dell Branded version of the QLogic 2312 
 Qlogic 2422 Optical Fibre Channel PCI cards (4 Gigabit)
 .It Qlogic 2432
 Qlogic 2432 Optical Fibre Channel PCIe cards (4 Gigabit)
+.It Qlogic 2432
+Qlogic 2532 Optical Fibre Channel PCIe cards (8 Gigabit)
 .El
 .Sh CONFIGURATION OPTIONS
 Target mode support may be enabled with the
@@ -197,6 +199,8 @@ A hint to define default role for isp in
 A hint value for a driver debug level (see the file
 .Pa /usr/src/sys/dev/isp/ispvar.h
 for the values.
+.It Va hint.isp.0.vports
+A hint to create specified number of additional virtual ports.
 .El
 .Sh SYSCTL OPTIONS
 .Bl -tag -width indent
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Steven Hartland


On 01/12/2014 16:46, Alfred Perlstein wrote:



On Dec 1, 2014, at 8:37 AM, Hans Petter Selasky  wrote:

Hi,

I think you maybe missed a point 


On 12/01/14 17:31, Alfred Perlstein wrote:

Yes that is why it is being done by hand in the probe routine. I think proper 
thing might be a way to sort out how to get tunables to run at a driver load 
event?  Is that possible?

All sysctls are tried init when they are created, both so-called "static" and 
"dynamic" ones.

If the sysctl is created inside the probe routine and has the tunable flag set, 
it will get init before the creation is complete, if present in the boot 
environment.

If the sysctl is of a "static" kind, it will be created and initialized when 
SI_SUB_KMEM is executing!

I totally understand this. It is in the phabricator review. :)

As a more general comment, my personal preference when I ask for review 
is that at least one of the reviewers accepts the final revision before 
I commit, but preferably all that have taken part in the discussion. 
This often takes a bit longer and some times takes a little prodding but 
should be worth it in the long run.


I know I commented on this one but I unfortunately didn't get chance to 
look after changes where made and hence never accepted the revision. Had 
I done so I would have caveat-ed it with it being accepted by Jack or 
other Intel delegate in his absence, so sorry about that Jack.


No one should take this personally, as know this is still new to 
everyone, but it does raise the wider question of who should be counted 
as a "reviewer" from phabric and do we need some additional guidelines 
on this, or even better can it be automated?


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


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Jack Vogel
Not taking it personally, in this case I see some style things I don't
like, and I'm not at all clear
why this is even necessary, what the old way of doing queue config was
missing for instance?

Thanks Steve,

Jack


On Mon, Dec 1, 2014 at 11:04 AM, Steven Hartland 
wrote:

>
> On 01/12/2014 16:46, Alfred Perlstein wrote:
>
>>
>>  On Dec 1, 2014, at 8:37 AM, Hans Petter Selasky  wrote:
>>>
>>> Hi,
>>>
>>> I think you maybe missed a point 
>>>
>>>  On 12/01/14 17:31, Alfred Perlstein wrote:

 Yes that is why it is being done by hand in the probe routine. I think
 proper thing might be a way to sort out how to get tunables to run at a
 driver load event?  Is that possible?

>>> All sysctls are tried init when they are created, both so-called
>>> "static" and "dynamic" ones.
>>>
>>> If the sysctl is created inside the probe routine and has the tunable
>>> flag set, it will get init before the creation is complete, if present in
>>> the boot environment.
>>>
>>> If the sysctl is of a "static" kind, it will be created and initialized
>>> when SI_SUB_KMEM is executing!
>>>
>> I totally understand this. It is in the phabricator review. :)
>>
>>  As a more general comment, my personal preference when I ask for review
> is that at least one of the reviewers accepts the final revision before I
> commit, but preferably all that have taken part in the discussion. This
> often takes a bit longer and some times takes a little prodding but should
> be worth it in the long run.
>
> I know I commented on this one but I unfortunately didn't get chance to
> look after changes where made and hence never accepted the revision. Had I
> done so I would have caveat-ed it with it being accepted by Jack or other
> Intel delegate in his absence, so sorry about that Jack.
>
> No one should take this personally, as know this is still new to everyone,
> but it does raise the wider question of who should be counted as a
> "reviewer" from phabric and do we need some additional guidelines on this,
> or even better can it be automated?
>
> Regards
> Steve
>
>
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys

2014-12-01 Thread Steven Hartland


On 01/12/2014 19:17, Jack Vogel wrote:
Not taking it personally, in this case I see some style things I don't 
like, and I'm not at all clear
why this is even necessary, what the old way of doing queue config was 
missing for instance?
Having asked the same question on the review I think I can take a stab 
at answering that question; they are looking to tune the number of 
queues on a NIC by NIC basis based on the available CPU cores via an 
external module.


For reference the original review can be found here:

https://reviews.freebsd.org/D1149


Regards
Steve

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


svn commit: r275376 - head/sys/arm/ti

2014-12-01 Thread Rui Paulo
Author: rpaulo
Date: Mon Dec  1 19:48:23 2014
New Revision: 275376
URL: https://svnweb.freebsd.org/changeset/base/275376

Log:
  Allow multiple devices to mmap.  It's impossible to prevent this with
  checks on the open/close functions.
  
  MFC after:1 week

Modified:
  head/sys/arm/ti/ti_pruss.c

Modified: head/sys/arm/ti/ti_pruss.c
==
--- head/sys/arm/ti/ti_pruss.c  Mon Dec  1 19:39:38 2014(r275375)
+++ head/sys/arm/ti/ti_pruss.c  Mon Dec  1 19:48:23 2014(r275376)
@@ -67,7 +67,6 @@ static device_attach_tti_pruss_attach;
 static device_detach_t ti_pruss_detach;
 static voidti_pruss_intr(void *);
 static d_open_tti_pruss_open;
-static d_close_t   ti_pruss_close;
 static d_mmap_tti_pruss_mmap;
 static voidti_pruss_kq_read_detach(struct knote *);
 static int ti_pruss_kq_read_event(struct knote *, long);
@@ -83,14 +82,12 @@ struct ti_pruss_softc {
bus_space_handle_t  sc_bh;
struct cdev *sc_pdev;
struct selinfo  sc_selinfo;
-   uint32_tsc_inuse;
 };
 
 static struct cdevsw ti_pruss_cdevsw = {
.d_version =D_VERSION,
.d_name =   "ti_pruss",
.d_open =   ti_pruss_open,
-   .d_close =  ti_pruss_close,
.d_mmap =   ti_pruss_mmap,
.d_kqfilter =   ti_pruss_kqfilter,
 };
@@ -187,11 +184,11 @@ ti_pruss_attach(device_t dev)
for (i = 0; i < TI_PRUSS_IRQS; i++) {
ti_pruss_irq_args[i].irq = i;
ti_pruss_irq_args[i].sc = sc;
-   if (bus_setup_intr(dev, sc->sc_irq_res[i], 
+   if (bus_setup_intr(dev, sc->sc_irq_res[i],
INTR_MPSAFE | INTR_TYPE_MISC,
-   NULL, ti_pruss_intr, &ti_pruss_irq_args[i], 
+   NULL, ti_pruss_intr, &ti_pruss_irq_args[i],
&sc->sc_intr[i]) != 0) {
-   device_printf(dev, 
+   device_printf(dev,
"unable to setup the interrupt handler\n");
ti_pruss_detach(dev);
return (ENXIO);
@@ -220,7 +217,7 @@ ti_pruss_detach(device_t dev)
if (sc->sc_intr[i])
bus_teardown_intr(dev, sc->sc_irq_res[i], 
sc->sc_intr[i]);
if (sc->sc_irq_res[i])
-   bus_release_resource(dev, SYS_RES_IRQ, 
+   bus_release_resource(dev, SYS_RES_IRQ,
rman_get_rid(sc->sc_irq_res[i]),
sc->sc_irq_res[i]);
}
@@ -246,25 +243,9 @@ ti_pruss_intr(void *arg)
 }
 
 static int
-ti_pruss_open(struct cdev *cdev, int oflags, int devtype, struct thread *td)
+ti_pruss_open(struct cdev *cdev __unused, int oflags __unused,
+int devtype __unused, struct thread *td __unused)
 {
-   device_t dev = cdev->si_drv1;
-   struct ti_pruss_softc *sc = device_get_softc(dev);
-
-   if (atomic_cmpset_32(&sc->sc_inuse, 0, 1) == 0)
-   return (EBUSY);
-   else
-   return (0);
-}
-
-static int
-ti_pruss_close(struct cdev *cdev, int fflag, int devtype, struct thread *td)
-{
-   device_t dev = cdev->si_drv1;
-   struct ti_pruss_softc *sc = device_get_softc(dev);
-
-   sc->sc_inuse = 0;
-
return (0);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275377 - head/sbin/sysctl

2014-12-01 Thread Xin LI
Author: delphij
Date: Mon Dec  1 20:51:01 2014
New Revision: 275377
URL: https://svnweb.freebsd.org/changeset/base/275377

Log:
  Fix inverted logic introduced in r272154.
  
  Noticed by:   trasz
  MFC after:2 weeks

Modified:
  head/sbin/sysctl/sysctl.c

Modified: head/sbin/sysctl/sysctl.c
==
--- head/sbin/sysctl/sysctl.c   Mon Dec  1 19:48:23 2014(r275376)
+++ head/sbin/sysctl/sysctl.c   Mon Dec  1 20:51:01 2014(r275377)
@@ -679,15 +679,18 @@ strIKtoi(const char *str, char **endptrp
p = &str[len - 1];
if (*p == 'C' || *p == 'F') {
temp = strtof(str, endptrp);
-   if (*endptrp != str && *endptrp == p && errno != 0) {
+   if (*endptrp != str && *endptrp == p && errno == 0) {
if (*p == 'F')
temp = (temp - 32) * 5 / 9;
+   *endptrp = NULL;
return (temp * 10 + 2732);
}
} else {
kelv = (int)strtol(str, endptrp, 10);
-   if (*endptrp != str && *endptrp == p && errno != 0)
+   if (*endptrp != str && *endptrp == p && errno == 0) {
+   *endptrp = NULL;
return (kelv);
+   }
}
 
errno = ERANGE;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275378 - head/sys/arm/include

2014-12-01 Thread Andrew Turner
Author: andrew
Date: Mon Dec  1 21:04:26 2014
New Revision: 275378
URL: https://svnweb.freebsd.org/changeset/base/275378

Log:
  Pull in the NetBSD global offset table handling code. Clang 3.5 creates
  relocations the linker complains about.
  
  Obtained from:NetBSD
  MFC after:1 Week

Modified:
  head/sys/arm/include/asm.h

Modified: head/sys/arm/include/asm.h
==
--- head/sys/arm/include/asm.h  Mon Dec  1 20:51:01 2014(r275377)
+++ head/sys/arm/include/asm.h  Mon Dec  1 21:04:26 2014(r275378)
@@ -112,10 +112,16 @@
ldr x, [x, got]
 #defineGOT_INIT(got,gotsym,pclabel) \
ldr got, gotsym;\
-   add got, got, pc;   \
-   pclabel:
+   pclabel: addgot, got, pc
+#ifdef __thumb__
 #defineGOT_INITSYM(gotsym,pclabel) \
-   gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (pclabel+4))
+   .align 0;   \
+   gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - (pclabel+4)
+#else
+#defineGOT_INITSYM(gotsym,pclabel) \
+   .align 0;   \
+   gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - (pclabel+8)
+#endif
 
 #ifdef __STDC__
 #definePIC_SYM(x,y)x ## ( ## y ## )
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275379 - head/share/mk

2014-12-01 Thread Andrew Turner
Author: andrew
Date: Mon Dec  1 21:07:36 2014
New Revision: 275379
URL: https://svnweb.freebsd.org/changeset/base/275379

Log:
  Set the correct architecture when targeting ARMv7
  
  MFC after:1 Week
  Sponsored by: ABT Systems Ltd

Modified:
  head/share/mk/bsd.cpu.mk

Modified: head/share/mk/bsd.cpu.mk
==
--- head/share/mk/bsd.cpu.mkMon Dec  1 21:04:26 2014(r275378)
+++ head/share/mk/bsd.cpu.mkMon Dec  1 21:07:36 2014(r275379)
@@ -99,7 +99,7 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__
 . elif ${CPUTYPE} == "armv6"
 _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1
 . elif ${CPUTYPE} == "cortexa"
-_CPUCFLAGS = -DARM_ARCH_6=1 -mfpu=vfp
+_CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp
 .  else
 _CPUCFLAGS = -mcpu=${CPUTYPE}
 .  endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275380 - head/contrib/gcc/config/arm

2014-12-01 Thread Andrew Turner
Author: andrew
Date: Mon Dec  1 21:13:47 2014
New Revision: 275380
URL: https://svnweb.freebsd.org/changeset/base/275380

Log:
  Use the floating-point instruction on ARMv7 as the clang 3.5 integrated
  assembler doesn't allow these two instructions to use co-processor 11.
  
  MFC after:1 Week
  Sponsored by: ABT Systems Ltd

Modified:
  head/contrib/gcc/config/arm/libunwind.S

Modified: head/contrib/gcc/config/arm/libunwind.S
==
--- head/contrib/gcc/config/arm/libunwind.S Mon Dec  1 21:07:36 2014
(r275379)
+++ head/contrib/gcc/config/arm/libunwind.S Mon Dec  1 21:13:47 2014
(r275380)
@@ -26,6 +26,13 @@
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.  */
 
+#include 
+
+/* Allow the use of VFP instructions */
+#if __ARM_ARCH >= 7
+.fpu   vfp
+#endif
+
 #ifndef __symbian__
 
 #include "lib1funcs.asm"
@@ -66,14 +73,22 @@ ARM_FUNC_START restore_core_regs
 ARM_FUNC_START gnu_Unwind_Restore_VFP
/* Use the generic coprocessor form so that gas doesn't complain
   on soft-float targets.  */
+#if __ARM_ARCH >= 7
+   fldmiax r0, {d0-d15}
+#else
ldc   p11,cr0,[r0],{0x21} /* fldmiax r0, {d0-d15} */
+#endif
RET
 
 /* Store VFR regsters d0-d15 to the address in r0.  */
 ARM_FUNC_START gnu_Unwind_Save_VFP
/* Use the generic coprocessor form so that gas doesn't complain
   on soft-float targets.  */
+#if __ARM_ARCH >= 7
+   fstmiax r0, {d0-d15}
+#else
stc   p11,cr0,[r0],{0x21} /* fstmiax r0, {d0-d15} */
+#endif
RET
 
 /* Wrappers to save core registers, then call the real routine.   */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r275379 - head/share/mk

2014-12-01 Thread Ian Lepore
On Mon, 2014-12-01 at 21:07 +, Andrew Turner wrote:
> Author: andrew
> Date: Mon Dec  1 21:07:36 2014
> New Revision: 275379
> URL: https://svnweb.freebsd.org/changeset/base/275379
> 
> Log:
>   Set the correct architecture when targeting ARMv7
>   
>   MFC after:  1 Week
>   Sponsored by:   ABT Systems Ltd
> 
> Modified:
>   head/share/mk/bsd.cpu.mk
> 
> Modified: head/share/mk/bsd.cpu.mk
> ==
> --- head/share/mk/bsd.cpu.mk  Mon Dec  1 21:04:26 2014(r275378)
> +++ head/share/mk/bsd.cpu.mk  Mon Dec  1 21:07:36 2014(r275379)
> @@ -99,7 +99,7 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__
>  . elif ${CPUTYPE} == "armv6"
>  _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1
>  . elif ${CPUTYPE} == "cortexa"
> -_CPUCFLAGS = -DARM_ARCH_6=1 -mfpu=vfp
> +_CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp
>  .  else
>  _CPUCFLAGS = -mcpu=${CPUTYPE}
>  .  endif
> 

Doesn't cortex-a also imply vfp3?

-- Ian


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


Re: svn commit: r275379 - head/share/mk

2014-12-01 Thread Andrew Turner
On Mon, 01 Dec 2014 14:36:22 -0700
Ian Lepore  wrote:

> On Mon, 2014-12-01 at 21:07 +, Andrew Turner wrote:
> > Author: andrew
> > Date: Mon Dec  1 21:07:36 2014
> > New Revision: 275379
> > URL: https://svnweb.freebsd.org/changeset/base/275379
> > 
> > Log:
> >   Set the correct architecture when targeting ARMv7
> >   
> >   MFC after:1 Week
> >   Sponsored by: ABT Systems Ltd
> > 
> > Modified:
> >   head/share/mk/bsd.cpu.mk
> > 
> > Modified: head/share/mk/bsd.cpu.mk
> > ==
> > --- head/share/mk/bsd.cpu.mkMon Dec  1 21:04:26 2014
> > (r275378) +++ head/share/mk/bsd.cpu.mk  Mon Dec  1 21:07:36
> > 2014(r275379) @@ -99,7 +99,7 @@ _CPUCFLAGS = -march=armv5te
> > -D__XSCALE__ . elif ${CPUTYPE} == "armv6"
> >  _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1
> >  . elif ${CPUTYPE} == "cortexa"
> > -_CPUCFLAGS = -DARM_ARCH_6=1 -mfpu=vfp
> > +_CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp
> >  .  else
> >  _CPUCFLAGS = -mcpu=${CPUTYPE}
> >  .  endif
> > 
> 
> Doesn't cortex-a also imply vfp3?

The vfp looks to be incorrect as it's optional on ARMv7. If present I
think it will be either a VFPv3 or v4 depending on the core.

I also think we could remove the "-DARM_ARCH_6=1" as, if it's used at
all, it can be replaced with a combination of 
and __ARM_ARCH >= 6.

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


svn commit: r275384 - head/tools/tools/nanobsd

2014-12-01 Thread Poul-Henning Kamp
Author: phk
Date: Mon Dec  1 22:39:35 2014
New Revision: 275384
URL: https://svnweb.freebsd.org/changeset/base/275384

Log:
  Make this work with pkgng, and allow PORTS_OPTS to be passed in

Modified:
  head/tools/tools/nanobsd/fill_pkg.sh

Modified: head/tools/tools/nanobsd/fill_pkg.sh
==
--- head/tools/tools/nanobsd/fill_pkg.shMon Dec  1 22:37:36 2014
(r275383)
+++ head/tools/tools/nanobsd/fill_pkg.shMon Dec  1 22:39:35 2014
(r275384)
@@ -57,8 +57,8 @@ ports_recurse() (
else
(
cd $d
-   rd=`make -V RUN_DEPENDS`
-   ld=`make -V LIB_DEPENDS`
+   rd=`make -V RUN_DEPENDS ${PORTS_OPTS}`
+   ld=`make -V LIB_DEPENDS ${PORTS_OPTS}`

for x in $rd $ld
do
@@ -84,8 +84,8 @@ done
 for i in `cat $PL`
 do
p=`(cd $i && make -V PKGNAME)`
-   if [ -f $NANO_PKG_DUMP/$p.tbz ] ; then
-   ln -s $NANO_PKG_DUMP/$p.tbz $NANO_PACKAGE_DIR
+   if [ -f $NANO_PKG_DUMP/$p.t[bx]z ] ; then
+   ln -s $NANO_PKG_DUMP/$p.t[bx]z $NANO_PACKAGE_DIR
else
echo "Package $p misssing in $NANO_PKG_DUMP" 1>&2
exit 1
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275385 - head/contrib/subversion/subversion/svn

2014-12-01 Thread Baptiste Daroussin
Author: bapt
Date: Tue Dec  2 00:23:26 2014
New Revision: 275385
URL: https://svnweb.freebsd.org/changeset/base/275385

Log:
  Sync the svn template with the one from ports

Modified:
  head/contrib/subversion/subversion/svn/util.c

Modified: head/contrib/subversion/subversion/svn/util.c
==
--- head/contrib/subversion/subversion/svn/util.c   Mon Dec  1 22:39:35 
2014(r275384)
+++ head/contrib/subversion/subversion/svn/util.c   Tue Dec  2 00:23:26 
2014(r275385)
@@ -333,11 +333,13 @@ truncate_buffer_at_prefix(apr_size_t *ne
 
 static const char *prefixes[] = {
   "PR:",
+  "Differential Revision:",
   "Submitted by:",
   "Reviewed by:",
   "Approved by:",
   "Obtained from:",
   "MFC after:",
+  "MFH:",
   "Relnotes:",
   "Security:",
   "Sponsored by:"
@@ -404,11 +406,13 @@ svn_cl__get_log_message(const char **log
   default_msg = svn_stringbuf_create(APR_EOL_STR, pool);
   svn_stringbuf_appendcstr(default_msg, APR_EOL_STR);
   svn_stringbuf_appendcstr(default_msg, "PR:\t\t" APR_EOL_STR);
+  svn_stringbuf_appendcstr(default_msg, "Differential Revision:\t" 
APR_EOL_STR);
   svn_stringbuf_appendcstr(default_msg, "Submitted by:\t" APR_EOL_STR);
   svn_stringbuf_appendcstr(default_msg, "Reviewed by:\t" APR_EOL_STR);
   svn_stringbuf_appendcstr(default_msg, "Approved by:\t" APR_EOL_STR);
   svn_stringbuf_appendcstr(default_msg, "Obtained from:\t" APR_EOL_STR);
   svn_stringbuf_appendcstr(default_msg, "MFC after:\t" APR_EOL_STR);
+  svn_stringbuf_appendcstr(default_msg, "MFH:\t\t" APR_EOL_STR);
   svn_stringbuf_appendcstr(default_msg, "Relnotes:\t" APR_EOL_STR);
   svn_stringbuf_appendcstr(default_msg, "Security:\t" APR_EOL_STR);
   svn_stringbuf_appendcstr(default_msg, "Sponsored by:\t"
@@ -419,15 +423,17 @@ svn_cl__get_log_message(const char **log
   svn_stringbuf_appendcstr(default_msg, EDITOR_EOF_PREFIX);
   svn_stringbuf_appendcstr(default_msg, APR_EOL_STR);
   svn_stringbuf_appendcstr(default_msg, "> Description of fields to fill in 
above: 76 columns --|" APR_EOL_STR);
-  svn_stringbuf_appendcstr(default_msg, "> PR:If a Bugzilla PR is 
affected by the change." APR_EOL_STR);
-  svn_stringbuf_appendcstr(default_msg, "> Submitted by:  If someone else sent 
in the change." APR_EOL_STR);
-  svn_stringbuf_appendcstr(default_msg, "> Reviewed by:   If someone else 
reviewed your modification." APR_EOL_STR);
-  svn_stringbuf_appendcstr(default_msg, "> Approved by:   If you needed 
approval for this commit." APR_EOL_STR);
-  svn_stringbuf_appendcstr(default_msg, "> Obtained from: If the change is 
from a third party." APR_EOL_STR);
-  svn_stringbuf_appendcstr(default_msg, "> MFC after: N 
[day[s]|week[s]|month[s]].  Request a reminder email." APR_EOL_STR);
-  svn_stringbuf_appendcstr(default_msg, "> Relnotes:  Set to 'yes' for 
mention in release notes." APR_EOL_STR);
-  svn_stringbuf_appendcstr(default_msg, "> Security:  Vulnerability 
reference (one per line) or description." APR_EOL_STR);
-  svn_stringbuf_appendcstr(default_msg, "> Sponsored by:  If the change was 
sponsored by an organization." APR_EOL_STR);
+  svn_stringbuf_appendcstr(default_msg, "> PR:   If a 
Bugzilla PR is affected by the change." APR_EOL_STR);
+  svn_stringbuf_appendcstr(default_msg, "> Differential Revision:
https://reviews.freebsd.org/D### (*full* phabric URL needed)." APR_EOL_STR);
+  svn_stringbuf_appendcstr(default_msg, "> Submitted by: If 
someone else sent in the change." APR_EOL_STR);
+  svn_stringbuf_appendcstr(default_msg, "> Reviewed by:  If 
someone else reviewed your modification." APR_EOL_STR);
+  svn_stringbuf_appendcstr(default_msg, "> Approved by:  If you 
needed approval for this commit." APR_EOL_STR);
+  svn_stringbuf_appendcstr(default_msg, "> Obtained from:If the 
change is from a third party." APR_EOL_STR);
+  svn_stringbuf_appendcstr(default_msg, "> MFC after:N 
[day[s]|week[s]|month[s]].  Request a reminder email." APR_EOL_STR);
+  svn_stringbuf_appendcstr(default_msg, "> MFH:  Ports 
tree branch name.  Request approval for merge." APR_EOL_STR);
+  svn_stringbuf_appendcstr(default_msg, "> Relnotes: Set to 
'yes' for mention in release notes." APR_EOL_STR);
+  svn_stringbuf_appendcstr(default_msg, "> Security: 
Vulnerability reference (one per line) or description." APR_EOL_STR);
+  svn_stringbuf_appendcstr(default_msg, "> Sponsored by: If the 
change was sponsored by an organization." APR_EOL_STR);
   svn_stringbuf_appendcstr(default_msg, "> Empty fields above will be 
automatically removed." APR_EOL_STR);
   svn_stringbuf_appendcstr(default_msg, APR_EOL_STR);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any

svn commit: r275386 - in head/contrib/binutils/bfd: . po

2014-12-01 Thread Dimitry Andric
Author: dim
Date: Tue Dec  2 01:30:53 2014
New Revision: 275386
URL: https://svnweb.freebsd.org/changeset/base/275386

Log:
  Let GNU ld be less obscure about missing symbols and DSOs.  If the BFD
  object looks like a typical shared library, suggest adding '-l',
  where  has the 'lib' prefix and '.so' or '.a' suffix removed.
  
  Otherwise, suggest adding '-l:', where  is the full DT_SONAME.
  
  Submitted by: Conrad Meyer 
  Sponsored by: EMC / Isilon storage division
  Reviewed by:  emaste
  PR:   194296
  MFC after:1 week
  Differential Revision: https://reviews.freebsd.org/D1152

Modified:
  head/contrib/binutils/bfd/elflink.c
  head/contrib/binutils/bfd/po/bfd.pot

Modified: head/contrib/binutils/bfd/elflink.c
==
--- head/contrib/binutils/bfd/elflink.c Tue Dec  2 00:23:26 2014
(r275385)
+++ head/contrib/binutils/bfd/elflink.c Tue Dec  2 01:30:53 2014
(r275386)
@@ -4356,9 +4356,38 @@ elf_link_add_object_symbols (bfd *abfd, 
 --no-add-needed is used.  */
  if ((elf_dyn_lib_class (abfd) & DYN_NO_NEEDED) != 0)
{
+ bfd_boolean looks_soish;
+ const char *print_name;
+ int print_len;
+ size_t len, lend = 0;
+
+ looks_soish = FALSE;
+ print_name = soname;
+ print_len = strlen(soname);
+ if (strncmp(soname, "lib", 3) == 0)
+   {
+ len = print_len;
+ if (len > 5 && strcmp(soname + len - 2, ".a") == 0)
+   lend = len - 5;
+ else
+   {
+ while (len > 6 && (ISDIGIT(soname[len - 1]) ||
+soname[len - 1] == '.'))
+   len--;
+ if (strncmp(soname + len - 3, ".so", 3) == 0)
+   lend = len - 6;
+   }
+ if (lend != 0)
+   {
+ print_name = soname + 3;
+ print_len = lend;
+ looks_soish = TRUE;
+   }
+   }
+
  (*_bfd_error_handler)
-   (_("%B: invalid DSO for symbol `%s' definition"),
-   abfd, name);
+   (_("undefined reference to symbol `%s' (try adding 
-l%s%.*s)"),
+   name, looks_soish? "" : ":", print_len, print_name);
  bfd_set_error (bfd_error_bad_value);
  goto error_free_vers;
}

Modified: head/contrib/binutils/bfd/po/bfd.pot
==
--- head/contrib/binutils/bfd/po/bfd.potTue Dec  2 00:23:26 2014
(r275385)
+++ head/contrib/binutils/bfd/po/bfd.potTue Dec  2 01:30:53 2014
(r275386)
@@ -2438,9 +2438,9 @@ msgstr ""
 msgid "Warning: size of symbol `%s' changed from %lu in %B to %lu in %B"
 msgstr ""
 
-#: elflink.c:4309
+#: elflink.c:4389
 #, c-format
-msgid "%B: invalid DSO for symbol `%s' definition"
+msgid "undefined reference to symbol `%s' (try adding -l%s%.*s)"
 msgstr ""
 
 #: elflink.c:5535
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275388 - head/tools/build/mk

2014-12-01 Thread Ed Maste
Author: emaste
Date: Tue Dec  2 02:11:09 2014
New Revision: 275388
URL: https://svnweb.freebsd.org/changeset/base/275388

Log:
  Add elfcopy and man page to OptionalObsoleteFiles

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Tue Dec  2 01:45:04 
2014(r275387)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Tue Dec  2 02:11:09 
2014(r275388)
@@ -1198,6 +1198,11 @@ OLD_FILES+=usr/share/dict/words
 OLD_DIRS+=usr/share/dict
 .endif
 
+.if ${MK_ELFTOOLCHAIN_TOOLS} == no
+OLD_FILES+=usr/bin/elfcopy
+OLD_FILES+=usr/share/man/man1/elfcopy.1.gz
+.endif
+
 #.if ${MK_EXAMPLES} == no
 # to be filled in
 #.endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275389 - head/share/man/man5

2014-12-01 Thread Ed Maste
Author: emaste
Date: Tue Dec  2 02:16:30 2014
New Revision: 275389
URL: https://svnweb.freebsd.org/changeset/base/275389

Log:
  Regenerate src.conf(5) after r275373

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Tue Dec  2 02:11:09 2014
(r275388)
+++ head/share/man/man5/src.conf.5  Tue Dec  2 02:16:30 2014
(r275389)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z 
des
 .\" $FreeBSD$
-.Dd November 26, 2014
+.Dd December 1, 2014
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -383,6 +383,16 @@ without support for encryption/decryptio
 .It Va WITH_EISA
 .\" from FreeBSD: head/tools/build/options/WITH_EISA 264654 2014-04-18 
16:53:06Z imp
 Set to build EISA kernel modules.
+.It Va WITH_ELFTOOLCHAIN_TOOLS
+.\" from FreeBSD: head/tools/build/options/WITH_ELFTOOLCHAIN_TOOLS 275373 
2014-12-01 17:49:42Z emaste
+Set to use
+.Xr addr2line 1 ,
+.Xr nm 1 ,
+.Xr size 1 ,
+.Xr strings 1 ,
+and
+.Xr strip 1
+from the elftoolchain project instead of GNU binutils.
 .It Va WITHOUT_EXAMPLES
 .\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 
09:06:24Z ru
 Set to avoid installing examples to
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275390 - head/sys/netipsec

2014-12-01 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec  2 02:32:28 2014
New Revision: 275390
URL: https://svnweb.freebsd.org/changeset/base/275390

Log:
  Remove unused declartations.
  
  Sponsored by: Yandex LLC

Modified:
  head/sys/netipsec/ipsec6.h

Modified: head/sys/netipsec/ipsec6.h
==
--- head/sys/netipsec/ipsec6.h  Tue Dec  2 02:16:30 2014(r275389)
+++ head/sys/netipsec/ipsec6.h  Tue Dec  2 02:32:28 2014(r275390)
@@ -59,23 +59,13 @@ VNET_DECLARE(int, ip6_ipsec_ecn);
 #defineV_ip6_ipsec_ecn VNET(ip6_ipsec_ecn)
 
 struct inpcb;
-
 extern int ipsec6_in_reject __P((struct mbuf *, struct inpcb *));
 
-struct ip6_hdr;
-extern const char *ipsec6_logpacketstr __P((struct ip6_hdr *, u_int32_t));
-
 struct m_tag;
 extern int ipsec6_common_input(struct mbuf **mp, int *offp, int proto);
 extern int ipsec6_common_input_cb(struct mbuf *m, struct secasvar *sav,
int skip, int protoff, struct m_tag *mt);
 extern void esp6_ctlinput(int, struct sockaddr *, void *);
-
-struct ipsec_output_state;
-extern int ipsec6_output_trans __P((struct ipsec_output_state *, u_char *,
-   struct mbuf *, struct secpolicy *, int, int *));
-extern int ipsec6_output_tunnel __P((struct ipsec_output_state *,
-   struct secpolicy *, int));
 extern int ipsec6_process_packet(struct mbuf *, struct ipsecrequest *);
 #endif /*_KERNEL*/
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275391 - head/sys/netipsec

2014-12-01 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec  2 02:41:44 2014
New Revision: 275391
URL: https://svnweb.freebsd.org/changeset/base/275391

Log:
  Remove unused structure declarations.
  
  Sponsored by: Yandex LLC

Modified:
  head/sys/netipsec/ipsec.h

Modified: head/sys/netipsec/ipsec.h
==
--- head/sys/netipsec/ipsec.h   Tue Dec  2 02:32:28 2014(r275390)
+++ head/sys/netipsec/ipsec.h   Tue Dec  2 02:41:44 2014(r275391)
@@ -263,17 +263,6 @@ struct ipsecstat {
 #ifdef _KERNEL
 #include 
 
-struct ipsec_output_state {
-   struct mbuf *m;
-   struct route *ro;
-   struct sockaddr *dst;
-};
-
-struct ipsec_history {
-   int ih_proto;
-   u_int32_t ih_spi;
-};
-
 VNET_DECLARE(int, ipsec_debug);
 #defineV_ipsec_debug   VNET(ipsec_debug)
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275392 - in head/sys: netinet netinet6 netipsec

2014-12-01 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec  2 04:20:50 2014
New Revision: 275392
URL: https://svnweb.freebsd.org/changeset/base/275392

Log:
  Remove route chaching support from ipsec code. It isn't used for some time.
  * remove sa_route_union declaration and route_cache member from struct 
secashead;
  * remove key_sa_routechange() call from ICMP and ICMPv6 code;
  * simplify ip_ipsec_mtu();
  * remove #include ;
  
  Sponsored by: Yandex LLC

Modified:
  head/sys/netinet/ip_icmp.c
  head/sys/netinet/ip_ipsec.c
  head/sys/netinet6/icmp6.c
  head/sys/netinet6/ip6_ipsec.c
  head/sys/netipsec/ipsec.c
  head/sys/netipsec/ipsec.h
  head/sys/netipsec/ipsec_input.c
  head/sys/netipsec/ipsec_mbuf.c
  head/sys/netipsec/ipsec_output.c
  head/sys/netipsec/key.c
  head/sys/netipsec/key.h
  head/sys/netipsec/key_debug.c
  head/sys/netipsec/keydb.h
  head/sys/netipsec/keysock.c
  head/sys/netipsec/xform_ah.c
  head/sys/netipsec/xform_esp.c
  head/sys/netipsec/xform_ipcomp.c
  head/sys/netipsec/xform_ipip.c
  head/sys/netipsec/xform_tcp.c

Modified: head/sys/netinet/ip_icmp.c
==
--- head/sys/netinet/ip_icmp.c  Tue Dec  2 02:41:44 2014(r275391)
+++ head/sys/netinet/ip_icmp.c  Tue Dec  2 04:20:50 2014(r275392)
@@ -33,7 +33,6 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_inet.h"
-#include "opt_ipsec.h"
 
 #include 
 #include 
@@ -65,10 +64,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #ifdef INET
-#ifdef IPSEC
-#include 
-#include 
-#endif
 
 #include 
 
@@ -619,9 +614,6 @@ reflect:
  (struct sockaddr *)&icmpgw, fibnum);
}
pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&icmpsrc);
-#ifdef IPSEC
-   key_sa_routechange((struct sockaddr *)&icmpsrc);
-#endif
break;
 
/*

Modified: head/sys/netinet/ip_ipsec.c
==
--- head/sys/netinet/ip_ipsec.c Tue Dec  2 02:41:44 2014(r275391)
+++ head/sys/netinet/ip_ipsec.c Tue Dec  2 04:20:50 2014(r275392)
@@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -206,35 +205,7 @@ ip_ipsec_mtu(struct mbuf *m, int mtu)
 *  tunnel MTU = if MTU - sizeof(IP) - ESP/AH hdrsiz
 * XXX quickhack!!!
 */
-   struct secpolicy *sp = NULL;
-   int ipsecerror;
-   int ipsechdr;
-   struct route *ro;
-   sp = ipsec_getpolicybyaddr(m,
-  IPSEC_DIR_OUTBOUND,
-  IP_FORWARDING,
-  &ipsecerror);
-   if (sp != NULL) {
-   /* count IPsec header size */
-   ipsechdr = ipsec_hdrsiz(m, IPSEC_DIR_OUTBOUND, NULL);
-
-   /*
-* find the correct route for outer IPv4
-* header, compute tunnel MTU.
-*/
-   if (sp->req != NULL &&
-   sp->req->sav != NULL &&
-   sp->req->sav->sah != NULL) {
-   ro = &sp->req->sav->sah->route_cache.sa_route;
-   if (ro->ro_rt && ro->ro_rt->rt_ifp) {
-   mtu = ro->ro_rt->rt_mtu ? ro->ro_rt->rt_mtu :
-   ro->ro_rt->rt_ifp->if_mtu;
-   mtu -= ipsechdr;
-   }
-   }
-   KEY_FREESP(&sp);
-   }
-   return mtu;
+   return (mtu - ipsec_hdrsiz(m, IPSEC_DIR_OUTBOUND, NULL));
 }
 
 /*

Modified: head/sys/netinet6/icmp6.c
==
--- head/sys/netinet6/icmp6.c   Tue Dec  2 02:41:44 2014(r275391)
+++ head/sys/netinet6/icmp6.c   Tue Dec  2 04:20:50 2014(r275392)
@@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
-#include "opt_ipsec.h"
 
 #include 
 #include 
@@ -110,11 +109,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef IPSEC
-#include 
-#include 
-#endif
-
 extern struct domain inet6domain;
 
 VNET_PCPUSTAT_DEFINE(struct icmp6stat, icmp6stat);
@@ -2472,9 +2466,6 @@ icmp6_redirect_input(struct mbuf *m, int
sdst.sin6_len = sizeof(struct sockaddr_in6);
bcopy(&reddst6, &sdst.sin6_addr, sizeof(struct in6_addr));
pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&sdst);
-#ifdef IPSEC
-   key_sa_routechange((struct sockaddr *)&sdst);
-#endif /* IPSEC */
 }
 
  freeit:

Modified: head/sys/netinet6/ip6_ipsec.c
==
--- head/sys/netinet6/ip6_ipsec.c   Tue Dec  2 02:41:44 2014
(r275391)
+++ head/sys/netinet6/ip6_ipsec.c   Tue Dec  2 04:20:50 2014
(r275392)
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 
 #include 

Modified: head/sys/netipsec/ipsec.c
=

svn commit: r275393 - head/sys/netipsec

2014-12-01 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec  2 05:28:40 2014
New Revision: 275393
URL: https://svnweb.freebsd.org/changeset/base/275393

Log:
  Remove unneded check. No need to do m_pullup to the size that we prepended.
  
  Sponsored by: Yandex LLC

Modified:
  head/sys/netipsec/keysock.c

Modified: head/sys/netipsec/keysock.c
==
--- head/sys/netipsec/keysock.c Tue Dec  2 04:20:50 2014(r275392)
+++ head/sys/netipsec/keysock.c Tue Dec  2 05:28:40 2014(r275393)
@@ -148,8 +148,6 @@ key_sendup0(rp, m, promisc)
struct sadb_msg *pmsg;
 
M_PREPEND(m, sizeof(struct sadb_msg), M_NOWAIT);
-   if (m && m->m_len < sizeof(struct sadb_msg))
-   m = m_pullup(m, sizeof(struct sadb_msg));
if (!m) {
PFKEYSTAT_INC(in_nomem);
m_freem(m);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275394 - in head/sys: net netinet6

2014-12-01 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec  2 05:41:03 2014
New Revision: 275394
URL: https://svnweb.freebsd.org/changeset/base/275394

Log:
  Remove unneded check. No need to do m_pullup to the size that we prepended.
  
  MFC after:1 week
  Sponsored by: Yandex LLC

Modified:
  head/sys/net/if_stf.c
  head/sys/netinet6/icmp6.c

Modified: head/sys/net/if_stf.c
==
--- head/sys/net/if_stf.c   Tue Dec  2 05:28:40 2014(r275393)
+++ head/sys/net/if_stf.c   Tue Dec  2 05:41:03 2014(r275394)
@@ -482,8 +482,6 @@ stf_output(struct ifnet *ifp, struct mbu
}
 
M_PREPEND(m, sizeof(struct ip), M_NOWAIT);
-   if (m && m->m_len < sizeof(struct ip))
-   m = m_pullup(m, sizeof(struct ip));
if (m == NULL) {
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
return ENOBUFS;

Modified: head/sys/netinet6/icmp6.c
==
--- head/sys/netinet6/icmp6.c   Tue Dec  2 05:28:40 2014(r275393)
+++ head/sys/netinet6/icmp6.c   Tue Dec  2 05:41:03 2014(r275394)
@@ -363,8 +363,6 @@ icmp6_error(struct mbuf *m, int type, in
 
preplen = sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr);
M_PREPEND(m, preplen, M_NOWAIT);/* FIB is also copied over. */
-   if (m && m->m_len < preplen)
-   m = m_pullup(m, preplen);
if (m == NULL) {
nd6log((LOG_DEBUG, "ENOBUFS in icmp6_error %d\n", __LINE__));
return;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275395 - head/usr.sbin/gpioctl

2014-12-01 Thread Rui Paulo
Author: rpaulo
Date: Tue Dec  2 06:11:32 2014
New Revision: 275395
URL: https://svnweb.freebsd.org/changeset/base/275395

Log:
  Rewrite parts of gpioctl(8) to use the gpio(3) library.

Modified:
  head/usr.sbin/gpioctl/Makefile
  head/usr.sbin/gpioctl/gpioctl.c

Modified: head/usr.sbin/gpioctl/Makefile
==
--- head/usr.sbin/gpioctl/Makefile  Tue Dec  2 05:41:03 2014
(r275394)
+++ head/usr.sbin/gpioctl/Makefile  Tue Dec  2 06:11:32 2014
(r275395)
@@ -3,4 +3,9 @@
 PROG=  gpioctl
 MAN=   gpioctl.8
 
+CFLAGS+= -I${.CURDIR}/../../lib/libgpio
+
+DPADD+=${LIBGPIO}
+LDADD+= -lgpio
+
 .include 

Modified: head/usr.sbin/gpioctl/gpioctl.c
==
--- head/usr.sbin/gpioctl/gpioctl.c Tue Dec  2 05:41:03 2014
(r275394)
+++ head/usr.sbin/gpioctl/gpioctl.c Tue Dec  2 06:11:32 2014
(r275395)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2009, Oleksandr Tymoshenko 
+ * Copyright (c) 2014, Rui Paulo 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -37,7 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 
 struct flag_desc {
const char *name;
@@ -100,7 +101,7 @@ str2cap(const char *str)
 /*
  * Our handmade function for converting string to number
  */
-static int 
+static int
 str2int(const char *s, int *ok)
 {
char *endptr;
@@ -132,44 +133,35 @@ print_caps(int caps)
 }
 
 static void
-dump_pins(int fd, int verbose)
+dump_pins(gpio_handle_t handle, int verbose)
 {
-   int i, maxpin;
-   struct gpio_pin pin;
-   struct gpio_req req;
-
-   if (ioctl(fd, GPIOMAXPIN, &maxpin) < 0) {
-   perror("ioctl(GPIOMAXPIN)");
+   int i, maxpin, pinv;
+   gpio_config_t *cfgs;
+   gpio_config_t *pin;
+
+   maxpin = gpio_pin_list(handle, &cfgs);
+   if (maxpin < 0) {
+   perror("gpio_pin_list");
exit(1);
}
 
for (i = 0; i <= maxpin; i++) {
-   pin.gp_pin = i;
-   if (ioctl(fd, GPIOGETCONFIG, &pin) < 0)
-   /* For some reason this pin is inaccessible */
-   continue;
-
-   req.gp_pin = i;
-   if (ioctl(fd, GPIOGET, &req) < 0) {
-   /* Now, that's wrong */
-   perror("ioctl(GPIOGET)");
-   exit(1);
-   }
-
-   printf("pin %02d:\t%d\t%s", pin.gp_pin, req.gp_value, 
-   pin.gp_name);
+   pin = cfgs + i;
+   pinv = gpio_pin_get(handle, pin->g_pin);
+   printf("pin %02d:\t%d\t%s", pin->g_pin, pinv,
+   pin->g_name);
 
-   print_caps(pin.gp_flags);
+   print_caps(pin->g_flags);
 
if (verbose) {
printf(", caps:");
-   print_caps(pin.gp_caps);
+   print_caps(pin->g_caps);
}
printf("\n");
}
 }
 
-static void 
+static void
 fail(const char *fmt, ...)
 {
va_list ap;
@@ -180,15 +172,14 @@ fail(const char *fmt, ...)
exit(1);
 }
 
-int 
+int
 main(int argc, char **argv)
 {
int i;
-   struct gpio_pin pin;
-   struct gpio_req req;
-   char defctlfile[] = _PATH_DEVGPIOC "0";
+   gpio_config_t pin;
+   gpio_handle_t handle;
char *ctlfile = NULL;
-   int pinn, pinv, fd, ch;
+   int pinn, pinv, ch;
int flags, flag, ok;
int config, toggle, verbose, list;
 
@@ -228,17 +219,17 @@ main(int argc, char **argv)
printf("%d/%s\n", i, argv[i]);
 
if (ctlfile == NULL)
-   ctlfile = defctlfile;
-
-   fd = open(ctlfile, O_RDONLY);
-   if (fd < 0) {
-   perror("open");
+   handle = gpio_open(0);
+   else
+   handle = gpio_open_device(ctlfile);
+   if (handle == GPIO_INVALID_HANDLE) {
+   perror("gpio_open");
exit(1);
}
 
if (list) {
-   dump_pins(fd, verbose);
-   close(fd);
+   dump_pins(handle, verbose);
+   gpio_close(handle);
exit(0);
}
 
@@ -246,19 +237,16 @@ main(int argc, char **argv)
/*
 * -t pin assumes no additional arguments
 */
-   if(argc > 0) {
+   if (argc > 0) {
usage();
exit(1);
}
-
-   req.gp_pin = pinn;
-   if (ioctl(fd, GPIOTOGGLE, &req) < 0) {
-   perror("ioctl(GPIOTOGGLE)");
+   if (gpio_pin_toggle(handle, pinn) < 0) {
+   perror("gpio_pin_toggle");
exit(1);
}
-
-  

svn commit: r275396 - head/lib/libgpio

2014-12-01 Thread Rui Paulo
Author: rpaulo
Date: Tue Dec  2 06:24:45 2014
New Revision: 275396
URL: https://svnweb.freebsd.org/changeset/base/275396

Log:
  Fix an off-by-one in gpio_pin_list().
  
  Coverity CID: 1256495

Modified:
  head/lib/libgpio/gpio.c

Modified: head/lib/libgpio/gpio.c
==
--- head/lib/libgpio/gpio.c Tue Dec  2 06:11:32 2014(r275395)
+++ head/lib/libgpio/gpio.c Tue Dec  2 06:24:45 2014(r275396)
@@ -89,7 +89,7 @@ gpio_pin_list(gpio_handle_t handle, gpio
errno = EINVAL;
return (-1);
}
-   cfgs = calloc(maxpins, sizeof(*cfgs));
+   cfgs = calloc(maxpins + 1, sizeof(*cfgs));
if (cfgs == NULL)
return (-1);
for (i = 0; i <= maxpins; i++) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r275399 - head/usr.sbin/ctld

2014-12-01 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Dec  2 07:42:25 2014
New Revision: 275399
URL: https://svnweb.freebsd.org/changeset/base/275399

Log:
  Fix null pointer dereference.
  
  MFC after:2 weeks
  Coverity CID: 1256497
  Sponsored by: The FreeBSD Foundation

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

Modified: head/usr.sbin/ctld/ctld.c
==
--- head/usr.sbin/ctld/ctld.c   Tue Dec  2 07:36:02 2014(r275398)
+++ head/usr.sbin/ctld/ctld.c   Tue Dec  2 07:42:25 2014(r275399)
@@ -1825,7 +1825,7 @@ conf_apply(struct conf *oldconf, struct 
error = kernel_port_add(newtarg);
if (error != 0) {
log_warnx("failed to add target %s",
-   oldtarg->t_name);
+   newtarg->t_name);
/*
 * XXX: Uncomment after fixing the root cause.
 *
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"