Re: svn commit: r311585 - in head: crypto/openssh secure/usr.sbin/sshd

2017-01-09 Thread Ngie Cooper (yaneurabeya)

> On Jan 9, 2017, at 11:56 PM, Xin Li  wrote:
> 
> 
> On 1/7/17 00:08, Ngie Cooper wrote:
>> Author: ngie
>> Date: Sat Jan  7 08:08:35 2017
>> New Revision: 311585
>> URL: https://svnweb.freebsd.org/changeset/base/311585
>> 
>> Log:
>>  Conditionalize building libwrap support into sshd
>> 
>>  Only build libwrap support into sshd if MK_TCP_WRAPPERS != no
>> 
>>  This will unbreak the build if libwrap has been removed from the system
>> 
>>  MFC after:  2 weeks
>>  PR: 210141
>>  Submitted by:   kp...@protonmail.com
>>  Differential Revision:  D9049
> 
> I didn't see this approved by maintainer, did you ping him?
> 
> [delphij@saturn] /usr/src> grep ssh MAINTAINERS
> openssh des Pre-commit review requested.
> 
> (Not that the change itself is bad, though, but it's important to keep
> everyone on the same page).

I waited 3 days for a reply on the review: https://reviews.freebsd.org/D9049 
 . Admittedly, it was a bit short of a 
timeout.
-Ngie
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r311585 - in head: crypto/openssh secure/usr.sbin/sshd

2017-01-09 Thread Xin Li

On 1/7/17 00:08, Ngie Cooper wrote:
> Author: ngie
> Date: Sat Jan  7 08:08:35 2017
> New Revision: 311585
> URL: https://svnweb.freebsd.org/changeset/base/311585
> 
> Log:
>   Conditionalize building libwrap support into sshd
>   
>   Only build libwrap support into sshd if MK_TCP_WRAPPERS != no
>   
>   This will unbreak the build if libwrap has been removed from the system
>   
>   MFC after:  2 weeks
>   PR: 210141
>   Submitted by:   kp...@protonmail.com
>   Differential Revision:  D9049

I didn't see this approved by maintainer, did you ping him?

[delphij@saturn] /usr/src> grep ssh MAINTAINERS
openssh des Pre-commit review requested.

(Not that the change itself is bad, though, but it's important to keep
everyone on the same page).

> Modified:
>   head/crypto/openssh/config.h
>   head/secure/usr.sbin/sshd/Makefile
> 
> Modified: head/crypto/openssh/config.h
> ==
> --- head/crypto/openssh/config.h  Sat Jan  7 07:54:23 2017
> (r311584)
> +++ head/crypto/openssh/config.h  Sat Jan  7 08:08:35 2017
> (r311585)
> @@ -1408,7 +1408,7 @@
>  /* #undef LASTLOG_WRITE_PUTUTXLINE */
>  
>  /* Define if you want TCP Wrappers support */
> -#define LIBWRAP 1
> +/* #undef LIBWRAP */
>  
>  /* Define to whatever link() returns for "not supported" if it doesn't return
> EOPNOTSUPP. */
> 
> Modified: head/secure/usr.sbin/sshd/Makefile
> ==
> --- head/secure/usr.sbin/sshd/MakefileSat Jan  7 07:54:23 2017
> (r311584)
> +++ head/secure/usr.sbin/sshd/MakefileSat Jan  7 08:08:35 2017
> (r311585)
> @@ -27,7 +27,7 @@ CFLAGS+=-I${SSHDIR} -include ssh_namespa
>  SRCS+=   ssh_namespace.h
>  
>  # pam should always happen before ssh here for static linking
> -LIBADD=  pam ssh util wrap
> +LIBADD=  pam ssh util
>  
>  .if ${MK_LDNS} != "no"
>  CFLAGS+= -DHAVE_LDNS=1
> @@ -53,6 +53,11 @@ SRCS+= krb5_config.h
>  LIBADD+= gssapi_krb5 gssapi krb5
>  .endif
>  
> +.if ${MK_TCP_WRAPPERS} != "no"
> +CFLAGS+= -DLIBWRAP
> +LIBADD+= wrap
> +.endif
> +
>  LIBADD+= crypto
>  
>  .if defined(LOCALBASE)
> 



signature.asc
Description: OpenPGP digital signature


svn commit: r311862 - head/sys/net80211

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 10 07:50:21 2017
New Revision: 311862
URL: https://svnweb.freebsd.org/changeset/base/311862

Log:
  [net80211] add VHT mediatype initialisation and update helper functions.

Modified:
  head/sys/net80211/ieee80211.c

Modified: head/sys/net80211/ieee80211.c
==
--- head/sys/net80211/ieee80211.c   Tue Jan 10 07:24:29 2017
(r311861)
+++ head/sys/net80211/ieee80211.c   Tue Jan 10 07:50:21 2017
(r311862)
@@ -70,6 +70,8 @@ const char *ieee80211_phymode_name[IEEE8
[IEEE80211_MODE_QUARTER]  = "quarter",
[IEEE80211_MODE_11NA] = "11na",
[IEEE80211_MODE_11NG] = "11ng",
+   [IEEE80211_MODE_VHT_2GHZ] = "11acg",
+   [IEEE80211_MODE_VHT_5GHZ] = "11ac",
 };
 /* map ieee80211_opmode to the corresponding capability bit */
 const int ieee80211_opcap[IEEE80211_OPMODE_MAX] = {
@@ -181,6 +183,10 @@ ieee80211_chan_init(struct ieee80211com 
setbit(ic->ic_modecaps, IEEE80211_MODE_11NA);
if (IEEE80211_IS_CHAN_HTG(c))
setbit(ic->ic_modecaps, IEEE80211_MODE_11NG);
+   if (IEEE80211_IS_CHAN_VHTA(c))
+   setbit(ic->ic_modecaps, IEEE80211_MODE_VHT_5GHZ);
+   if (IEEE80211_IS_CHAN_VHTG(c))
+   setbit(ic->ic_modecaps, IEEE80211_MODE_VHT_2GHZ);
}
/* initialize candidate channels to all available */
memcpy(ic->ic_chan_active, ic->ic_chan_avail,
@@ -208,6 +214,8 @@ ieee80211_chan_init(struct ieee80211com 
DEFAULTRATES(IEEE80211_MODE_QUARTER, ieee80211_rateset_quarter);
DEFAULTRATES(IEEE80211_MODE_11NA,ieee80211_rateset_11a);
DEFAULTRATES(IEEE80211_MODE_11NG,ieee80211_rateset_11g);
+   DEFAULTRATES(IEEE80211_MODE_VHT_2GHZ,ieee80211_rateset_11g);
+   DEFAULTRATES(IEEE80211_MODE_VHT_5GHZ,ieee80211_rateset_11a);
 
/*
 * Setup required information to fill the mcsset field, if driver did
@@ -1492,6 +1500,8 @@ addmedia(struct ifmedia *media, int caps
[IEEE80211_MODE_QUARTER]= IFM_IEEE80211_11A,/* XXX */
[IEEE80211_MODE_11NA]   = IFM_IEEE80211_11NA,
[IEEE80211_MODE_11NG]   = IFM_IEEE80211_11NG,
+   [IEEE80211_MODE_VHT_2GHZ]   = IFM_IEEE80211_VHT2G,
+   [IEEE80211_MODE_VHT_5GHZ]   = IFM_IEEE80211_VHT5G,
};
u_int mopt;
 
@@ -1604,6 +1614,19 @@ ieee80211_media_setup(struct ieee80211co
if (rate > maxrate)
maxrate = rate;
}
+
+   /*
+* Add VHT media.
+*/
+   for (; mode <= IEEE80211_MODE_VHT_5GHZ; mode++) {
+   if (isclr(ic->ic_modecaps, mode))
+   continue;
+   addmedia(media, caps, addsta, mode, IFM_AUTO);
+   addmedia(media, caps, addsta, mode, IFM_IEEE80211_VHT);
+
+   /* XXX TODO: VHT maxrate */
+   }
+
return maxrate;
 }
 
@@ -1883,7 +1906,11 @@ enum ieee80211_phymode
 ieee80211_chan2mode(const struct ieee80211_channel *chan)
 {
 
-   if (IEEE80211_IS_CHAN_HTA(chan))
+   if (IEEE80211_IS_CHAN_VHT_2GHZ(chan))
+   return IEEE80211_MODE_VHT_2GHZ;
+   else if (IEEE80211_IS_CHAN_VHT_5GHZ(chan))
+   return IEEE80211_MODE_VHT_5GHZ;
+   else if (IEEE80211_IS_CHAN_HTA(chan))
return IEEE80211_MODE_11NA;
else if (IEEE80211_IS_CHAN_HTG(chan))
return IEEE80211_MODE_11NG;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311861 - head/sys/net80211

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 10 07:24:29 2017
New Revision: 311861
URL: https://svnweb.freebsd.org/changeset/base/311861

Log:
  [net80211] Add default parameters for 11ac.
  
  I doubt TDMA code will ever work for 11ac, but you never know, someone
  may one day make it happen.

Modified:
  head/sys/net80211/ieee80211_tdma.c

Modified: head/sys/net80211/ieee80211_tdma.c
==
--- head/sys/net80211/ieee80211_tdma.c  Tue Jan 10 07:21:07 2017
(r311860)
+++ head/sys/net80211/ieee80211_tdma.c  Tue Jan 10 07:24:29 2017
(r311861)
@@ -176,6 +176,8 @@ ieee80211_tdma_vattach(struct ieee80211v
settxparms(vap, IEEE80211_MODE_11NG, TDMA_TXRATE_11NG_DEFAULT);
settxparms(vap, IEEE80211_MODE_HALF, TDMA_TXRATE_HALF_DEFAULT);
settxparms(vap, IEEE80211_MODE_QUARTER, TDMA_TXRATE_QUARTER_DEFAULT);
+   settxparms(vap, IEEE80211_MODE_VHT_2GHZ, TDMA_TXRATE_11NG_DEFAULT);
+   settxparms(vap, IEEE80211_MODE_VHT_5GHZ, TDMA_TXRATE_11NA_DEFAULT);
 
setackpolicy(vap->iv_ic, 1);/* disable ACK's */
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311860 - head/sys/net80211

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 10 07:21:07 2017
New Revision: 311860
URL: https://svnweb.freebsd.org/changeset/base/311860

Log:
  [net80211] add VHT action frame placeholders for when it's time to implement.

Modified:
  head/sys/net80211/ieee80211_vht.c

Modified: head/sys/net80211/ieee80211_vht.c
==
--- head/sys/net80211/ieee80211_vht.c   Tue Jan 10 05:37:53 2017
(r311859)
+++ head/sys/net80211/ieee80211_vht.c   Tue Jan 10 07:21:07 2017
(r311860)
@@ -85,9 +85,49 @@ __FBSDID("$FreeBSD$");
  * Look at mac80211/vht.c:ieee80211_vht_handle_opmode() for further details.
  */
 
+static int
+vht_recv_action_placeholder(struct ieee80211_node *ni,
+const struct ieee80211_frame *wh,
+const uint8_t *frm, const uint8_t *efrm)
+{
+
+   ieee80211_note(ni->ni_vap, "%s: called; fc=0x%.2x/0x%.2x",
+   __func__,
+   wh->i_fc[0],
+   wh->i_fc[1]);
+
+   return (0);
+}
+
+static int
+vht_send_action_placeholder(struct ieee80211_node *ni,
+int category, int action, void *arg0)
+{
+
+   ieee80211_note(ni->ni_vap, "%s: called; category=%d, action=%d",
+   __func__,
+   category,
+   action);
+   return (EINVAL);
+}
+
 static void
 ieee80211_vht_init(void)
 {
+
+   ieee80211_recv_action_register(IEEE80211_ACTION_CAT_VHT,
+   WLAN_ACTION_VHT_COMPRESSED_BF, vht_recv_action_placeholder);
+   ieee80211_recv_action_register(IEEE80211_ACTION_CAT_VHT,
+   WLAN_ACTION_VHT_GROUPID_MGMT, vht_recv_action_placeholder);
+   ieee80211_recv_action_register(IEEE80211_ACTION_CAT_VHT,
+   WLAN_ACTION_VHT_OPMODE_NOTIF, vht_recv_action_placeholder);
+
+   ieee80211_send_action_register(IEEE80211_ACTION_CAT_VHT,
+   WLAN_ACTION_VHT_COMPRESSED_BF, vht_send_action_placeholder);
+   ieee80211_send_action_register(IEEE80211_ACTION_CAT_VHT,
+   WLAN_ACTION_VHT_GROUPID_MGMT, vht_send_action_placeholder);
+   ieee80211_send_action_register(IEEE80211_ACTION_CAT_VHT,
+   WLAN_ACTION_VHT_OPMODE_NOTIF, vht_send_action_placeholder);
 }
 
 SYSINIT(wlan_vht, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_vht_init, NULL);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311859 - head/usr.bin/calendar/calendars

2017-01-09 Thread Larry Rosenman
Author: ler (ports committer)
Date: Tue Jan 10 05:37:53 2017
New Revision: 311859
URL: https://svnweb.freebsd.org/changeset/base/311859

Log:
  Add my birthday to calendar.freebsd
  
  Approved by:  adamw (Mentor)
  Differential Revision:https://reviews.freebsd.org/D9119

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdTue Jan 10 05:33:34 
2017(r311858)
+++ head/usr.bin/calendar/calendars/calendar.freebsdTue Jan 10 05:37:53 
2017(r311859)
@@ -310,6 +310,7 @@
 09/20  Kevin Lo  born in Taipei, Taiwan, Republic of China, 
1972
 09/21  Gleb Kurtsou  born in Minsk, Belarus, 1984
 09/22  Bryan Drewery  born in San Diego, California, 
United States, 1984
+09/24  Larry Rosenman  born in Queens, New York, United 
States, 1957
 09/27  Neil Blakey-Milner  born in Port Elizabeth, South 
Africa, 1978
 09/27  Renato Botelho  born in Araras, Sao Paulo, Brazil, 
1979
 09/28  Greg Lehey  born in Melbourne, Victoria, Australia, 
1948
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311858 - head/sys/net80211

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 10 05:33:34 2017
New Revision: 311858
URL: https://svnweb.freebsd.org/changeset/base/311858

Log:
  [net80211] add missing VHTCAP declaration changes.
  
  These are required for the recent ieee80211_vht.[ch] changes -
  they make things start to work with MS() / SM() macros.

Modified:
  head/sys/net80211/ieee80211.h

Modified: head/sys/net80211/ieee80211.h
==
--- head/sys/net80211/ieee80211.h   Tue Jan 10 05:32:30 2017
(r311857)
+++ head/sys/net80211/ieee80211.h   Tue Jan 10 05:33:34 2017
(r311858)
@@ -798,37 +798,73 @@ struct ieee80211_ie_vht_operation {
 #defineIEEE80211_VHTCAP_MAX_MPDU_LENGTH_7991   0x0001
 #defineIEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454  0x0002
 #defineIEEE80211_VHTCAP_MAX_MPDU_MASK  0x0003
-#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ 0x0004
-#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ
0x0008
+#defineIEEE80211_VHTCAP_MAX_MPDU_MASK_S0
+
 #defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK   0x000C
+#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S 2
+#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_NONE   0
+#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ 1
+#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80P80MHZ   2
+#defineIEEE80211_VHTCAP_SUPP_CHAN_WIDTH_RESERVED   3
+
 #defineIEEE80211_VHTCAP_RXLDPC 0x0010
+#defineIEEE80211_VHTCAP_RXLDPC_S   4
+
 #defineIEEE80211_VHTCAP_SHORT_GI_800x0020
+#defineIEEE80211_VHTCAP_SHORT_GI_80_S  5
+
 #defineIEEE80211_VHTCAP_SHORT_GI_160   0x0040
+#defineIEEE80211_VHTCAP_SHORT_GI_160_S 6
+
 #defineIEEE80211_VHTCAP_TXSTBC 0x0080
+#defineIEEE80211_VHTCAP_TXSTBC_S   7
+
 #defineIEEE80211_VHTCAP_RXSTBC_1   0x0100
 #defineIEEE80211_VHTCAP_RXSTBC_2   0x0200
 #defineIEEE80211_VHTCAP_RXSTBC_3   0x0300
 #defineIEEE80211_VHTCAP_RXSTBC_4   0x0400
 #defineIEEE80211_VHTCAP_RXSTBC_MASK0x0700
+#defineIEEE80211_VHTCAP_RXSTBC_MASK_S  8
+
 #defineIEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE  0x0800
+#defineIEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE_S11
+
 #defineIEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE  0x1000
+#defineIEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE_S12
+
 #defineIEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT   13
 #defineIEEE80211_VHTCAP_BEAMFORMEE_STS_MASK \
(7 << IEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT)
+#defineIEEE80211_VHTCAP_BEAMFORMEE_STS_MASK_S  13
+
 #defineIEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT  16
 #defineIEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK \
(7 << IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT)
+#defineIEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK_S 16
+
 #defineIEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE  0x0008
+#defineIEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE_S19
 #defineIEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE  0x0010
+#defineIEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE_S20
 #defineIEEE80211_VHTCAP_VHT_TXOP_PS0x0020
+#defineIEEE80211_VHTCAP_VHT_TXOP_PS_S  21
 #defineIEEE80211_VHTCAP_HTC_VHT0x0040
+#defineIEEE80211_VHTCAP_HTC_VHT_S  22
+
 #defineIEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT   23
 #defineIEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \
(7 << IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT)
+#defineIEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK_S  23
+
+#defineIEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MASK   0x0c00
 #defineIEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB  
0x0800
 #defineIEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB
0x0c00
+#defineIEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MASK_S 26
+
 #defineIEEE80211_VHTCAP_RX_ANTENNA_PATTERN 0x1000
+#defineIEEE80211_VHTCAP_RX_ANTENNA_PATTERN_S   28
 #defineIEEE80211_VHTCAP_TX_ANTENNA_PATTERN 0x2000
+#defineIEEE80211_VHTCAP_TX_ANTENNA_PATTERN_S   29
 
 /*
  * XXX TODO: add the rest of the bits
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311857 - head/sys/net80211

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 10 05:32:30 2017
New Revision: 311857
URL: https://svnweb.freebsd.org/changeset/base/311857

Log:
  [net80211] add CHAN_VHT2G/CHAN_VHT5G macros.

Modified:
  head/sys/net80211/_ieee80211.h

Modified: head/sys/net80211/_ieee80211.h
==
--- head/sys/net80211/_ieee80211.h  Tue Jan 10 05:32:02 2017
(r311856)
+++ head/sys/net80211/_ieee80211.h  Tue Jan 10 05:32:30 2017
(r311857)
@@ -313,6 +313,12 @@ struct ieee80211_channel {
 
 #defineIEEE80211_IS_CHAN_VHT(_c) \
(((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0)
+#defineIEEE80211_IS_CHAN_VHT_2GHZ(_c) \
+   (IEEE80211_IS_CHAN_2GHZ(_c) && \
+((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0)
+#defineIEEE80211_IS_CHAN_VHT_5GHZ(_c) \
+   (IEEE80211_IS_CHAN_5GHZ(_c) && \
+((_c)->ic_flags & IEEE80211_CHAN_VHT) != 0)
 #defineIEEE80211_IS_CHAN_VHT20(_c) \
(((_c)->ic_flags & IEEE80211_CHAN_VHT20) != 0)
 #defineIEEE80211_IS_CHAN_VHT40(_c) \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311856 - head/sys/net80211

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 10 05:32:02 2017
New Revision: 311856
URL: https://svnweb.freebsd.org/changeset/base/311856

Log:
  [net80211] add VHT EDCA parameters for WME/QoS mode.

Modified:
  head/sys/net80211/ieee80211_proto.c

Modified: head/sys/net80211/ieee80211_proto.c
==
--- head/sys/net80211/ieee80211_proto.c Tue Jan 10 05:30:15 2017
(r311855)
+++ head/sys/net80211/ieee80211_proto.c Tue Jan 10 05:32:02 2017
(r311856)
@@ -842,6 +842,9 @@ setbasicrates(struct ieee80211_rateset *
[IEEE80211_MODE_11NA]   = { 3, { 12, 24, 48 } },
/* NB: mixed b/g */
[IEEE80211_MODE_11NG]   = { 4, { 2, 4, 11, 22 } },
+   /* NB: mixed b/g */
+   [IEEE80211_MODE_VHT_2GHZ]   = { 4, { 2, 4, 11, 22 } },
+   [IEEE80211_MODE_VHT_5GHZ]   = { 3, { 12, 24, 48 } },
};
int i, j;
 
@@ -906,6 +909,8 @@ static const struct phyParamType phyPara
[IEEE80211_MODE_QUARTER]= { 3, 4,  6,  0, 0 },
[IEEE80211_MODE_11NA]   = { 3, 4,  6,  0, 0 },
[IEEE80211_MODE_11NG]   = { 3, 4,  6,  0, 0 },
+   [IEEE80211_MODE_VHT_2GHZ]   = { 3, 4,  6,  0, 0 },
+   [IEEE80211_MODE_VHT_5GHZ]   = { 3, 4,  6,  0, 0 },
 };
 static const struct phyParamType phyParamForAC_BK[IEEE80211_MODE_MAX] = {
[IEEE80211_MODE_AUTO]   = { 7, 4, 10,  0, 0 },
@@ -920,6 +925,8 @@ static const struct phyParamType phyPara
[IEEE80211_MODE_QUARTER]= { 7, 4, 10,  0, 0 },
[IEEE80211_MODE_11NA]   = { 7, 4, 10,  0, 0 },
[IEEE80211_MODE_11NG]   = { 7, 4, 10,  0, 0 },
+   [IEEE80211_MODE_VHT_2GHZ]   = { 7, 4, 10,  0, 0 },
+   [IEEE80211_MODE_VHT_5GHZ]   = { 7, 4, 10,  0, 0 },
 };
 static const struct phyParamType phyParamForAC_VI[IEEE80211_MODE_MAX] = {
[IEEE80211_MODE_AUTO]   = { 1, 3, 4,  94, 0 },
@@ -934,6 +941,8 @@ static const struct phyParamType phyPara
[IEEE80211_MODE_QUARTER]= { 1, 3, 4,  94, 0 },
[IEEE80211_MODE_11NA]   = { 1, 3, 4,  94, 0 },
[IEEE80211_MODE_11NG]   = { 1, 3, 4,  94, 0 },
+   [IEEE80211_MODE_VHT_2GHZ]   = { 1, 3, 4,  94, 0 },
+   [IEEE80211_MODE_VHT_5GHZ]   = { 1, 3, 4,  94, 0 },
 };
 static const struct phyParamType phyParamForAC_VO[IEEE80211_MODE_MAX] = {
[IEEE80211_MODE_AUTO]   = { 1, 2, 3,  47, 0 },
@@ -948,6 +957,8 @@ static const struct phyParamType phyPara
[IEEE80211_MODE_QUARTER]= { 1, 2, 3,  47, 0 },
[IEEE80211_MODE_11NA]   = { 1, 2, 3,  47, 0 },
[IEEE80211_MODE_11NG]   = { 1, 2, 3,  47, 0 },
+   [IEEE80211_MODE_VHT_2GHZ]   = { 1, 2, 3,  47, 0 },
+   [IEEE80211_MODE_VHT_5GHZ]   = { 1, 2, 3,  47, 0 },
 };
 
 static const struct phyParamType bssPhyParamForAC_BE[IEEE80211_MODE_MAX] = {
@@ -1123,6 +1134,8 @@ ieee80211_wme_updateparams_locked(struct
[IEEE80211_MODE_QUARTER]= { 2, 4, 10, 64, 0 },
[IEEE80211_MODE_11NA]   = { 2, 4, 10, 64, 0 },  /* XXXcheck*/
[IEEE80211_MODE_11NG]   = { 2, 4, 10, 64, 0 },  /* XXXcheck*/
+   [IEEE80211_MODE_VHT_2GHZ]   = { 2, 4, 10, 64, 0 },  /* XXXcheck*/
+   [IEEE80211_MODE_VHT_5GHZ]   = { 2, 4, 10, 64, 0 },  /* XXXcheck*/
};
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211_wme_state *wme = >ic_wme;
@@ -1243,6 +1256,8 @@ ieee80211_wme_updateparams_locked(struct
[IEEE80211_MODE_QUARTER]= 3,
[IEEE80211_MODE_11NA]   = 3,
[IEEE80211_MODE_11NG]   = 3,
+   [IEEE80211_MODE_VHT_2GHZ]   = 3,
+   [IEEE80211_MODE_VHT_5GHZ]   = 3,
};
chanp = >wme_chanParams.cap_wmeParams[WME_AC_BE];
bssp = >wme_bssChanParams.cap_wmeParams[WME_AC_BE];
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311855 - head/sys/net80211

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Tue Jan 10 05:30:15 2017
New Revision: 311855
URL: https://svnweb.freebsd.org/changeset/base/311855

Log:
  [net80211] create a helper function to calculate the station facing VHT 
capabilities.
  
  This is needed for two reasons:
  
  * Drivers will need to know what the negotiated set of VHT capabilities
and rates are in order to configure (and reconfigure for opmode/chanwidth
changes) how to speak to a given peer; and
  * Because some vendors are "special", we should be careful in what we announce
to them during peer association.
  
  This isn't the complete solution, as I still need to make sure that when
  sending out probe requests before we know what we want, we don't limit
  the capabilities being announced.  This is important for IBSS/mesh work
  later on as probe request/response exchanges are the first hint at what
  a peer supports.  I'll look at adding that to the API soon.

Modified:
  head/sys/net80211/ieee80211_vht.c
  head/sys/net80211/ieee80211_vht.h

Modified: head/sys/net80211/ieee80211_vht.c
==
--- head/sys/net80211/ieee80211_vht.c   Tue Jan 10 04:50:26 2017
(r311854)
+++ head/sys/net80211/ieee80211_vht.c   Tue Jan 10 05:30:15 2017
(r311855)
@@ -71,6 +71,15 @@ __FBSDID("$FreeBSD$");
 } while (0)
 
 /*
+ * Immediate TODO:
+ *
+ * + handle WLAN_ACTION_VHT_OPMODE_NOTIF and other VHT action frames
+ * + ensure vhtinfo/vhtcap parameters correctly use the negotiated
+ *   capabilities and ratesets
+ * + group ID management operation
+ */
+
+/*
  * XXX TODO: handle WLAN_ACTION_VHT_OPMODE_NOTIF
  *
  * Look at mac80211/vht.c:ieee80211_vht_handle_opmode() for further details.
@@ -153,9 +162,9 @@ ieee80211_vht_announce(struct ieee80211c
 
/* Channel width */
ic_printf(ic, "[VHT] Channel Widths: 20MHz, 40MHz, 80MHz");
-   if (ic->ic_vhtcaps & IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
+   if (MS(ic->ic_vhtcaps, IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) == 2)
printf(" 80+80MHz");
-   if (ic->ic_vhtcaps & IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ)
+   if (MS(ic->ic_vhtcaps, IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) >= 1)
printf(" 160MHz");
printf("\n");
 
@@ -280,38 +289,357 @@ ieee80211_vht_node_leave(struct ieee8021
"%s: called", __func__);
 }
 
-uint8_t *
-ieee80211_add_vhtcap(uint8_t *frm, struct ieee80211_node *ni)
+/*
+ * Calculate the VHTCAP IE for a given node.
+ *
+ * This includes calculating the capability intersection based on the
+ * current operating mode and intersection of the TX/RX MCS maps.
+ *
+ * The standard only makes it clear about MCS rate negotiation
+ * and MCS basic rates (which must be a subset of the general
+ * negotiated rates).  It doesn't make it clear that the AP should
+ * figure out the minimum functional overlap with the STA and
+ * support that.
+ *
+ * Note: this is in host order, not in 802.11 endian order.
+ *
+ * TODO: ensure I re-read 9.7.11 Rate Selection for VHT STAs.
+ *
+ * TODO: investigate what we should negotiate for MU-MIMO beamforming
+ *   options.
+ *
+ * opmode is '1' for "vhtcap as if I'm a STA", 0 otherwise.
+ */
+void
+ieee80211_vht_get_vhtcap_ie(struct ieee80211_node *ni,
+struct ieee80211_ie_vhtcap *vhtcap, int opmode)
 {
-   uint32_t cap;
+   struct ieee80211vap *vap = ni->ni_vap;
+// struct ieee80211com *ic = vap->iv_ic;
+   uint32_t val, val1, val2;
+   uint32_t new_vhtcap;
+   int i;
 
-   memset(frm, '\0', sizeof(struct ieee80211_ie_vhtcap));
+   vhtcap->ie = IEEE80211_ELEMID_VHT_CAP;
+   vhtcap->len = sizeof(struct ieee80211_ie_vhtcap) - 2;
 
-   frm[0] = IEEE80211_ELEMID_VHT_CAP;
-   frm[1] = sizeof(struct ieee80211_ie_vhtcap) - 2;
-   frm += 2;
+   /*
+* Capabilities - it depends on whether we are a station
+* or not.
+*/
+   new_vhtcap = 0;
 
/*
-* For now, don't do any configuration.
-* Just populate the node configuration.
-* We can worry about making it configurable later.
+* Station - use our desired configuration based on
+* local config, local device bits and the already-learnt
+* vhtcap/vhtinfo IE in the node.
 */
 
-   cap = ni->ni_vhtcap;
+   /* Limit MPDU size to the smaller of the two */
+   val2 = val1 = MS(vap->iv_vhtcaps, IEEE80211_VHTCAP_MAX_MPDU_MASK);
+   if (opmode == 1) {
+   val2 = MS(ni->ni_vhtcap, IEEE80211_VHTCAP_MAX_MPDU_MASK);
+   }
+   val = MIN(val1, val2);
+   new_vhtcap |= SM(val, IEEE80211_VHTCAP_MAX_MPDU_MASK);
+
+   /* Limit supp channel config */
+   val2 = val1 = MS(vap->iv_vhtcaps,
+   IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK);
+   if (opmode == 1) {
+   val2 = MS(ni->ni_vhtcap,
+   IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK);
+   }
+   if ((val2 == 2) &&

svn commit: r311854 - head/sys/dev/e1000

2017-01-09 Thread Sean Bruno
Author: sbruno
Date: Tue Jan 10 04:50:26 2017
New Revision: 311854
URL: https://svnweb.freebsd.org/changeset/base/311854

Log:
  Add copywrite notices, 2-clause BSD.
  
  Reported by:  jmallett

Modified:
  head/sys/dev/e1000/em_txrx.c
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h
  head/sys/dev/e1000/igb_txrx.c

Modified: head/sys/dev/e1000/em_txrx.c
==
--- head/sys/dev/e1000/em_txrx.cTue Jan 10 04:49:59 2017
(r311853)
+++ head/sys/dev/e1000/em_txrx.cTue Jan 10 04:50:26 2017
(r311854)
@@ -1,3 +1,29 @@
+/*-
+ * Copyright (c) 2016 Matt Macy 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
 /* $FreeBSD$ */
 #include "if_em.h"
 

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Tue Jan 10 04:49:59 2017(r311853)
+++ head/sys/dev/e1000/if_em.c  Tue Jan 10 04:50:26 2017(r311854)
@@ -1,3 +1,29 @@
+/*-
+ * Copyright (c) 2016 Matt Macy 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
 /* $FreeBSD$ */
 #include "if_em.h"
 #include 

Modified: head/sys/dev/e1000/if_em.h
==
--- head/sys/dev/e1000/if_em.h  Tue Jan 10 04:49:59 2017(r311853)
+++ head/sys/dev/e1000/if_em.h  Tue Jan 10 04:50:26 2017(r311854)
@@ -1,3 +1,29 @@
+/*-
+ * Copyright (c) 2016 Matt Macy 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR 

svn commit: r311853 - head/share/misc

2017-01-09 Thread Adam Weinberger
Author: adamw (ports committer)
Date: Tue Jan 10 04:49:59 2017
New Revision: 311853
URL: https://svnweb.freebsd.org/changeset/base/311853

Log:
  As much as I've enjoyed being listed as emeritus for the last 10+ years,
  it's probably time to admit that I am an active committer.

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotTue Jan 10 04:31:56 2017
(r311852)
+++ head/share/misc/committers-ports.dotTue Jan 10 04:49:59 2017
(r311853)
@@ -29,7 +29,6 @@ node [color=grey62, style=filled, bgcolo
 
 # Alumni go here.. Try to keep things sorted.
 
-adamw [label="Adam Weinberger\nad...@freebsd.org\n2002/10/16\n2006/09/25"]
 asami [label="Satoshi Asami\nas...@freebsd.org\n1994/11/18\n2001/09/11"]
 billf [label="Bill Fumerola\nbi...@freebsd.org\n1998/11/11\n2006/12/14"]
 jmallett [label="Juli Mallett\njmall...@freebsd.org\n2003/01/16\n2006/08/10"]
@@ -43,6 +42,7 @@ node [color=lightblue2, style=filled, bg
 
 ache [label="Andrey Chernov\na...@freebsd.org\n1994/11/15"]
 acm [label="Jose Alonso Cardenas Marquez\n...@freebsd.org\n2006/07/18"]
+adamw [label="Adam Weinberger\nad...@freebsd.org\n2002/10/16"]
 ahze [label="Michael Johnson\na...@freebsd.org\n2004/10/29"]
 ak [label="Alex Kozlov\n...@freebsd.org\n2012/02/29"]
 ale [label="Alex Dupre\n...@freebsd.org\n2004/01/12"]
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311852 - head/share/misc

2017-01-09 Thread Larry Rosenman
Author: ler (ports committer)
Date: Tue Jan 10 04:31:56 2017
New Revision: 311852
URL: https://svnweb.freebsd.org/changeset/base/311852

Log:
  Add myself to committers-ports.dot
  
  Approved by:  adamw (mentor)
  Differential Revision:https://reviews.freebsd.org/D9117

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotTue Jan 10 04:17:53 2017
(r311851)
+++ head/share/misc/committers-ports.dotTue Jan 10 04:31:56 2017
(r311852)
@@ -144,6 +144,7 @@ laszlof [label="Frank Laszlo\nlaszlof@Fr
 lawrance [label="Sam Lawrance\nlawra...@freebsd.org\n2005/04/11\n2007/02/21"]
 lbr [label="Lars Balker Rasmussen\n...@freebsd.org\n2006/04/30"]
 leeym [label="Yen-Ming Lee\nle...@freebsd.org\n2002/08/14"]
+ler [label="Larry Rosenman\n...@freebsd.org\n2017/01/09"]
 lev [label="Lev Serebryakov\n...@freebsd.org\n2003/06/17"]
 lifanov [label="Nikolai Lifanov\nlifa...@freebsd.org\n2016/12/11"]
 linimon [label="Mark Linimon\nlini...@freebsd.org\n2003/10/23"]
@@ -252,6 +253,7 @@ znerd [label="Ernst de Haan\nznerd@FreeB
 
 adamw -> ahze
 adamw -> jylefort
+adamw -> ler
 adamw -> mezz
 adamw -> pav
 adamw -> woodsb02
@@ -554,6 +556,7 @@ rene -> bar
 rene -> cmt
 rene -> crees
 rene -> jgh
+rene -> ler
 rene -> olivierd
 
 rm -> koobs
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311851 - head/sys/fs/cd9660

2017-01-09 Thread Mateusz Guzik
Author: mjg
Date: Tue Jan 10 04:17:53 2017
New Revision: 311851
URL: https://svnweb.freebsd.org/changeset/base/311851

Log:
  cd9660: fix up compilation on sparc after r311665
  
  Reported by:  linimon

Modified:
  head/sys/fs/cd9660/cd9660_vfsops.c

Modified: head/sys/fs/cd9660/cd9660_vfsops.c
==
--- head/sys/fs/cd9660/cd9660_vfsops.c  Tue Jan 10 03:53:38 2017
(r311850)
+++ head/sys/fs/cd9660/cd9660_vfsops.c  Tue Jan 10 04:17:53 2017
(r311851)
@@ -88,7 +88,7 @@ static struct vfsops cd9660_vfsops = {
 VFS_SET(cd9660_vfsops, cd9660, VFCF_READONLY);
 MODULE_VERSION(cd9660, 1);
 
-static int cd9660_vfs_hash_cmp(struct vnode *vp, cd_ino_t *pino);
+static int cd9660_vfs_hash_cmp(struct vnode *vp, void *pino);
 static int iso_mountfs(struct vnode *devvp, struct mount *mp);
 
 /*
@@ -650,12 +650,14 @@ cd9660_vget(mp, ino, flags, vpp)
 static int
 cd9660_vfs_hash_cmp(vp, pino)
struct vnode *vp;
-   cd_ino_t *pino;
+   void *pino;
 {
struct iso_node *ip;
+   cd_ino_t ino;
 
ip = VTOI(vp);
-   return (ip->i_number != *pino);
+   ino = *(cd_ino_t *)pino;
+   return (ip->i_number != ino);
 }
 
 int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311850 - head/sys/dev/usb/controller

2017-01-09 Thread Ian Lepore
Author: ian
Date: Tue Jan 10 03:53:38 2017
New Revision: 311850
URL: https://svnweb.freebsd.org/changeset/base/311850

Log:
  Use the post-reset hook to force the controller to host mode.  This will
  make both usb ports work on imx6 systems (the OTG port of course will only
  work in host mode).

Modified:
  head/sys/dev/usb/controller/ehci_imx.c

Modified: head/sys/dev/usb/controller/ehci_imx.c
==
--- head/sys/dev/usb/controller/ehci_imx.c  Tue Jan 10 03:23:22 2017
(r311849)
+++ head/sys/dev/usb/controller/ehci_imx.c  Tue Jan 10 03:53:38 2017
(r311850)
@@ -157,6 +157,18 @@ struct imx_ehci_softc {
struct resource *ehci_irq_res;  /* EHCI core IRQ. */ 
 };
 
+static void
+imx_ehci_post_reset(struct ehci_softc *ehci_softc)
+{
+uint32_t usbmode;
+
+/* Force HOST mode */
+usbmode = EOREAD4(ehci_softc, EHCI_USBMODE_NOLPM);
+usbmode &= ~EHCI_UM_CM;
+usbmode |= EHCI_UM_CM_HOST;
+EOWRITE4(ehci_softc, EHCI_USBMODE_NOLPM, usbmode);
+}
+
 static int
 imx_ehci_probe(device_t dev)
 {
@@ -282,8 +294,13 @@ imx_ehci_attach(device_t dev)
esc->sc_id_vendor = USB_VENDOR_FREESCALE;
strlcpy(esc->sc_vendor, "Freescale", sizeof(esc->sc_vendor));
 
-   /* Set flags that affect ehci_init() behavior. */
-   esc->sc_flags |= EHCI_SCFLG_DONTRESET | EHCI_SCFLG_NORESTERM;
+   /*
+* Set flags that affect ehci_init() behavior, and hook our post-reset
+* code into the standard controller code.
+*/
+   esc->sc_flags |= EHCI_SCFLG_NORESTERM;
+   esc->sc_vendor_post_reset = imx_ehci_post_reset;
+
err = ehci_init(esc);
if (err != 0) {
device_printf(dev, "USB init failed, usb_err_t=%d\n", 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-01-09 Thread Sean Bruno
Author: sbruno
Date: Tue Jan 10 03:23:22 2017
New Revision: 311849
URL: https://svnweb.freebsd.org/changeset/base/311849

Log:
  Migrate e1000 to the IFLIB framework:
  - em(4) igb(4) and lem(4)
  - deprecate the igb device from kernel configurations
  - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko
  
  Devices tested:
  - 82574L
  - I218-LM
  - 82546GB
  - 82579LM
  - I350
  - I217
  
  Please report problems to freebsd-...@freebsd.org
  
  Partial review from jhb and suggestions on how to *not* brick folks who
  originally would have lost their igbX device.
  
  Submitted by: mm...@nextbsd.org
  MFC after:2 weeks
  Relnotes: yes
  Sponsored by: Limelight Networks and Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D8299

Added:
  head/sys/dev/e1000/em_txrx.c   (contents, props changed)
  head/sys/dev/e1000/igb_txrx.c   (contents, props changed)
Deleted:
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_igb.h
  head/sys/dev/e1000/if_lem.c
  head/sys/dev/e1000/if_lem.h
  head/sys/modules/igb/
Modified:
  head/UPDATING
  head/sys/amd64/conf/GENERIC
  head/sys/arm64/conf/GENERIC
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/makeLINT.mk
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h
  head/sys/i386/conf/GENERIC
  head/sys/mips/conf/OCTEON1
  head/sys/modules/Makefile
  head/sys/modules/em/Makefile
  head/sys/powerpc/conf/GENERIC64

Modified: head/UPDATING
==
--- head/UPDATING   Tue Jan 10 01:36:50 2017(r311848)
+++ head/UPDATING   Tue Jan 10 03:23:22 2017(r311849)
@@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12
 
 ** SPECIAL WARNING: **
 
+20170109:
+   The igb(4), em(4) and lem(4) ethernet drivers are now implemented via
+   IFLIB.  If you have a custom kernel configuration that excludes em(4)
+   but you use igb(4), you need to re-add em(4) to your custom 
configuration.
+
 20161217:
Clang, llvm, lldb, compiler-rt and libc++ have been upgraded to 3.9.1.
Please see the 20141231 entry below for information about prerequisites

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Tue Jan 10 01:36:50 2017(r311848)
+++ head/sys/amd64/conf/GENERIC Tue Jan 10 03:23:22 2017(r311849)
@@ -230,7 +230,6 @@ device  puc # Multi I/O 
cards and mult
 device bxe # Broadcom NetXtreme II 
BCM5771X/BCM578XX 10GbE
 device de  # DEC/Intel DC21x4x (``Tulip'')
 device em  # Intel PRO/1000 Gigabit Ethernet Family
-device igb # Intel PRO/1000 PCIE Server Gigabit 
Family
 device ix  # Intel PRO/10GbE PCIE PF Ethernet
 device ixv # Intel PRO/10GbE PCIE VF Ethernet
 device ixl # Intel XL710 40Gbe PCIE Ethernet

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Tue Jan 10 01:36:50 2017(r311848)
+++ head/sys/arm64/conf/GENERIC Tue Jan 10 03:23:22 2017(r311849)
@@ -120,7 +120,6 @@ device  mii
 device miibus  # MII bus support
 device awg # Allwinner EMAC Gigabit Ethernet
 device em  # Intel PRO/1000 Gigabit Ethernet Family
-device igb # Intel PRO/1000 PCIE Server Gigabit Family
 device ix  # Intel 10Gb Ethernet Family
 device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet
 device smc # SMSC LAN91C111

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Tue Jan 10 01:36:50 2017(r311848)
+++ head/sys/conf/NOTES Tue Jan 10 03:23:22 2017(r311849)
@@ -1972,7 +1972,6 @@ devicexmphy   # XaQti XMAC II
 #   KNE110TX.
 # de:   Digital Equipment DC21040
 # em:   Intel Pro/1000 Gigabit Ethernet 82542, 82543, 82544 based adapters.
-# igb:  Intel Pro/1000 PCI Express Gigabit Ethernet: 82575 and later adapters.
 # ep:   3Com 3C509, 3C529, 3C556, 3C562D, 3C563D, 3C572, 3C574X, 3C579, 3C589
 #   and PC Card devices using these chipsets.
 # ex:   Intel EtherExpress Pro/10 and other i82595-based adapters,
@@ -2145,7 +2144,6 @@ devicecxgbe   # Chelsio T4-T6 
1/10/25/4
 device cxgbev  # Chelsio T4-T6 Virtual Functions
 device de  # DEC/Intel DC21x4x (``Tulip'')
 device em  # Intel Pro/1000 Gigabit Ethernet
-device igb # Intel Pro/1000 PCIE Gigabit Ethernet
 device

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

2017-01-09 Thread Navdeep Parhar
Author: np
Date: Tue Jan 10 01:36:50 2017
New Revision: 311848
URL: https://svnweb.freebsd.org/changeset/base/311848

Log:
  cxgbe(4): Attach to the 2x25 debug card.  This is for internal use only.
  
  MFC after:3 days

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

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cTue Jan 10 01:31:26 2017
(r311847)
+++ head/sys/dev/cxgbe/t4_main.cTue Jan 10 01:36:50 2017
(r311848)
@@ -623,6 +623,7 @@ struct {
 #endif
 }, t6_pciids[] = {
{0xc006, "Chelsio Terminator 6 FPGA"},  /* T6 PE10K6 FPGA (PF0) */
+   {0x6400, "Chelsio T6225-DBG"},  /* 2 x 10/25G, debug */
{0x6401, "Chelsio T6225-CR"},   /* 2 x 10/25G */
{0x6402, "Chelsio T6225-SO-CR"},/* 2 x 10/25G, nomem */
{0x6407, "Chelsio T62100-LP-CR"},   /* 2 x 40/50/100G */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311847 - head/sys/dev/usb/misc

2017-01-09 Thread Bruce M Simpson
Author: bms
Date: Tue Jan 10 01:31:26 2017
New Revision: 311847
URL: https://svnweb.freebsd.org/changeset/base/311847

Log:
  Allow udbp(4) to claim Belkin "Windows Easy Transfer Cable" for Netgraph use.
  
  These have been tested back-to-back with Linux 3.x and a similar attachment
  at the other end; a CDC EEM-like encapsulation can be used for emulated
  Ethernet over udbp(4) with ng_ether.

Modified:
  head/sys/dev/usb/misc/udbp.c

Modified: head/sys/dev/usb/misc/udbp.c
==
--- head/sys/dev/usb/misc/udbp.cTue Jan 10 01:30:41 2017
(r311846)
+++ head/sys/dev/usb/misc/udbp.cTue Jan 10 01:31:26 2017
(r311847)
@@ -259,6 +259,7 @@ static driver_t udbp_driver = {
 };
 
 static const STRUCT_USB_HOST_ID udbp_devs[] = {
+   {USB_VPI(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U258, 0)},
{USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_TURBOCONNECT, 0)},
{USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_GADGETZERO, 0)},
{USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2301, 0)},
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311846 - head/sys/dev/cxgbe/common

2017-01-09 Thread Navdeep Parhar
Author: np
Date: Tue Jan 10 01:30:41 2017
New Revision: 311846
URL: https://svnweb.freebsd.org/changeset/base/311846

Log:
  cxgbe(4): Refresh t4_msg.h, mainly for definitions related to the crypto
  engine.
  
  Obtained from:Chelsio Communications
  MFC after:2 weeks
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/common/t4_msg.h

Modified: head/sys/dev/cxgbe/common/t4_msg.h
==
--- head/sys/dev/cxgbe/common/t4_msg.h  Tue Jan 10 01:09:39 2017
(r311845)
+++ head/sys/dev/cxgbe/common/t4_msg.h  Tue Jan 10 01:30:41 2017
(r311846)
@@ -106,6 +106,7 @@ enum {
CPL_RX_FCOE_DIF   = 0x4A,
CPL_RX_DATA_DIF   = 0x4B,
CPL_ERR_NOTIFY= 0x4D,
+   CPL_RX_TLS_CMP= 0x4E,
 
CPL_RDMA_READ_REQ = 0x60,
CPL_RX_ISCSI_DIF  = 0x60,
@@ -113,6 +114,11 @@ enum {
CPL_SET_LE_REQ= 0x80,
CPL_PASS_OPEN_REQ6= 0x81,
CPL_ACT_OPEN_REQ6 = 0x83,
+   CPL_TX_TLS_PDU= 0x88,
+   CPL_TX_TLS_SFO= 0x89,
+
+   CPL_TX_SEC_PDU= 0x8A,
+   CPL_TX_TLS_ACK= 0x8B,
 
CPL_RDMA_TERMINATE= 0xA2,
CPL_RDMA_WRITE= 0xA4,
@@ -129,6 +135,7 @@ enum {
 
CPL_TRACE_PKT = 0xB0,
CPL_RX2TX_DATA= 0xB1,
+   CPL_TLS_DATA  = 0xB1,
CPL_ISCSI_DATA= 0xB2,
CPL_FCOE_DATA = 0xB3,
 
@@ -136,6 +143,7 @@ enum {
CPL_FW4_PLD   = 0xC1,
CPL_FW4_ACK   = 0xC3,
CPL_SRQ_TABLE_RPL = 0xCC,
+   CPL_RX_PHYS_DSGL  = 0xD0,
 
CPL_FW6_MSG   = 0xE0,
CPL_FW6_PLD   = 0xE1,
@@ -200,6 +208,7 @@ enum {
ULP_MODE_RDMA  = 4,
ULP_MODE_TCPDDP= 5,
ULP_MODE_FCOE  = 6,
+   ULP_MODE_TLS   = 8,
 };
 
 enum {
@@ -993,6 +1002,23 @@ struct cpl_abort_req_rss {
__u8  status;
 };
 
+struct cpl_abort_req_rss6 {
+   RSS_HDR
+   union opcode_tid ot;
+   __u32 srqidx_status;
+};
+
+#define S_ABORT_RSS_STATUS0
+#define M_ABORT_RSS_STATUS0xff
+#define V_ABORT_RSS_STATUS(x) ((x) << S_ABORT_RSS_STATUS)
+#define G_ABORT_RSS_STATUS(x) (((x) >> S_ABORT_RSS_STATUS) & 
M_ABORT_RSS_STATUS)
+
+#define S_ABORT_RSS_SRQIDX8
+#define M_ABORT_RSS_SRQIDX0xff
+#define V_ABORT_RSS_SRQIDX(x) ((x) << S_ABORT_RSS_SRQIDX)
+#define G_ABORT_RSS_SRQIDX(x) (((x) >> S_ABORT_RSS_SRQIDX) & 
M_ABORT_RSS_SRQIDX)
+
+
 /* cpl_abort_req status command code in case of T6,
  * bit[0] specifies whether to send RST (0) to remote peer or suppress it (1)
  * bit[1] indicates ABORT_REQ was sent after a CLOSE_CON_REQ
@@ -1014,6 +1040,12 @@ struct cpl_abort_rpl_rss {
__u8  status;
 };
 
+struct cpl_abort_rpl_rss6 {
+   RSS_HDR
+   union opcode_tid ot;
+   __u32 srqidx_status;
+};
+
 struct cpl_abort_rpl {
WR_HDR;
union opcode_tid ot;
@@ -2612,6 +2644,7 @@ enum {
FW_TYPE_RSSCPL = 4,
FW_TYPE_WRERR_RPL = 5,
FW_TYPE_PI_ERR = 6,
+   FW_TYPE_TLS_KEY = 7,
 };
 
 struct cpl_fw2_pld {
@@ -2712,7 +2745,8 @@ enum {
ULP_TX_SC_IMM  = 0x81,
ULP_TX_SC_DSGL = 0x82,
ULP_TX_SC_ISGL = 0x83,
-   ULP_TX_SC_PICTRL = 0x84
+   ULP_TX_SC_PICTRL = 0x84,
+   ULP_TX_SC_MEMRD = 0x86
 };
 
 #define S_ULPTX_CMD24
@@ -2763,6 +2797,12 @@ struct ulptx_idata {
 #define S_ULPTX_NSGE0
 #define M_ULPTX_NSGE0x
 #define V_ULPTX_NSGE(x) ((x) << S_ULPTX_NSGE)
+#define G_ULPTX_NSGE(x) (((x) >> S_ULPTX_NSGE) & M_ULPTX_NSGE)
+
+struct ulptx_sc_memrd {
+   __be32 cmd_to_len;
+   __be32 addr;
+};
 
 struct ulp_mem_io {
WR_HDR;
@@ -2817,6 +2857,21 @@ struct ulp_txpkt {
 };
 
 /* ulp_txpkt.cmd_dest fields */
+#define S_ULP_TXPKT_DATAMODIFY   23
+#define M_ULP_TXPKT_DATAMODIFY   0x1
+#define V_ULP_TXPKT_DATAMODIFY(x)((x) << S_ULP_TXPKT_DATAMODIFY)
+#define G_ULP_TXPKT_DATAMODIFY(x)\
+   (((x) >> S_ULP_TXPKT_DATAMODIFY) & M_ULP_TXPKT_DATAMODIFY_)
+#define F_ULP_TXPKT_DATAMODIFY   V_ULP_TXPKT_DATAMODIFY(1U)
+
+#define S_ULP_TXPKT_CHANNELID22
+#define M_ULP_TXPKT_CHANNELID0x1
+#define V_ULP_TXPKT_CHANNELID(x) ((x) << S_ULP_TXPKT_CHANNELID)
+#define G_ULP_TXPKT_CHANNELID(x) \
+   (((x) >> S_ULP_TXPKT_CHANNELID) & M_ULP_TXPKT_CHANNELID)
+#define F_ULP_TXPKT_CHANNELIDV_ULP_TXPKT_CHANNELID(1U)
+
+/* ulp_txpkt.cmd_dest fields */
 #define S_ULP_TXPKT_DEST16
 #define M_ULP_TXPKT_DEST0x3
 #define V_ULP_TXPKT_DEST(x) ((x) << S_ULP_TXPKT_DEST)
@@ -3044,4 +3099,542 @@ struct cpl_rx_mps_pkt {
 #define X_CPL_RX_MPS_PKT_TYPE_QFC  (1 << 2)
 #define X_CPL_RX_MPS_PKT_TYPE_PTP  (1 << 3)
 
+struct cpl_tx_tls_sfo {
+   __be32 op_to_seg_len;
+   __be32 pld_len;
+   __be64 rsvd;
+   __be32 seqno_numivs;
+   __be32 ivgen_hdrlen;
+   __be64 scmd1;
+};
+

svn commit: r311845 - head/sys/dev/rtwn/pci

2017-01-09 Thread Andriy Voskoboinyk
Author: avos
Date: Tue Jan 10 01:09:39 2017
New Revision: 311845
URL: https://svnweb.freebsd.org/changeset/base/311845

Log:
  rtwn_pci(4): fix possible race while accessing 'matched_chip' variable.

Modified:
  head/sys/dev/rtwn/pci/rtwn_pci_attach.c

Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.c
==
--- head/sys/dev/rtwn/pci/rtwn_pci_attach.c Tue Jan 10 00:28:01 2017
(r311844)
+++ head/sys/dev/rtwn/pci/rtwn_pci_attach.c Tue Jan 10 01:09:39 2017
(r311845)
@@ -94,20 +94,31 @@ static void rtwn_pci_beacon_update_end(s
 static voidrtwn_pci_attach_methods(struct rtwn_softc *);
 
 
-static int matched_chip = RTWN_CHIP_MAX_PCI;
+static const struct rtwn_pci_ident *
+rtwn_pci_probe_sub(device_t dev)
+{
+   const struct rtwn_pci_ident *ident;
+   int vendor_id, device_id;
+
+   vendor_id = pci_get_vendor(dev);
+   device_id = pci_get_device(dev);
+
+   for (ident = rtwn_pci_ident_table; ident->name != NULL; ident++)
+   if (vendor_id == ident->vendor && device_id == ident->device)
+   return (ident);
+
+   return (NULL);
+}
 
 static int
 rtwn_pci_probe(device_t dev)
 {
const struct rtwn_pci_ident *ident;
 
-   for (ident = rtwn_pci_ident_table; ident->name != NULL; ident++) {
-   if (pci_get_vendor(dev) == ident->vendor &&
-   pci_get_device(dev) == ident->device) {
-   matched_chip = ident->chip;
-   device_set_desc(dev, ident->name);
-   return (BUS_PROBE_DEFAULT);
-   }
+   ident = rtwn_pci_probe_sub(dev);
+   if (ident != NULL) {
+   device_set_desc(dev, ident->name);
+   return (BUS_PROBE_DEFAULT);
}
return (ENXIO);
 }
@@ -591,13 +602,15 @@ rtwn_pci_attach_methods(struct rtwn_soft
 static int
 rtwn_pci_attach(device_t dev)
 {
+   const struct rtwn_pci_ident *ident;
struct rtwn_pci_softc *pc = device_get_softc(dev);
struct rtwn_softc *sc = >pc_sc;
struct ieee80211com *ic = >sc_ic;
uint32_t lcsr;
int cap_off, i, error, rid;
 
-   if (matched_chip >= RTWN_CHIP_MAX_PCI)
+   ident = rtwn_pci_probe_sub(dev);
+   if (ident == NULL)
return (ENXIO);
 
/*
@@ -649,8 +662,7 @@ rtwn_pci_attach(device_t dev)
mtx_init(>sc_mtx, ic->ic_name, MTX_NETWORK_LOCK, MTX_DEF);
 
rtwn_pci_attach_methods(sc);
-   /* XXX something similar to USB_GET_DRIVER_INFO() */
-   rtwn_pci_attach_private(pc, matched_chip);
+   rtwn_pci_attach_private(pc, ident->chip);
 
/* Allocate Tx/Rx buffers. */
error = rtwn_pci_alloc_rx_list(sc);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311844 - head/sys/dev/usb

2017-01-09 Thread Bruce M Simpson
Author: bms
Date: Tue Jan 10 00:28:01 2017
New Revision: 311844
URL: https://svnweb.freebsd.org/changeset/base/311844

Log:
  Add PID for Belkin F5U258 "Windows Easy Transfer Cable", a udbp-like device.

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsTue Jan 10 00:03:43 2017(r311843)
+++ head/sys/dev/usb/usbdevsTue Jan 10 00:28:01 2017(r311844)
@@ -1318,6 +1318,7 @@ product BELKIN RTL8188CU  0x1102  RTL8188
 product BELKIN F9L1103 0x1103  F9L1103 Wireless Adapter
 product BELKIN RTL8192CU   0x2102  RTL8192CU Wireless Adapter
 product BELKIN F7D2102 0x2103  F7D2102 Wireless Adapter
+product BELKIN F5U258  0x258A  F5U258 Host to Host cable
 product BELKIN ZD1211B 0x4050  ZD1211B
 product BELKIN F5D5055 0x5055  F5D5055
 product BELKIN F5D7050 0x7050  F5D7050 Wireless Adapter
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r311707 - in head/sys/dev/rtwn: . usb

2017-01-09 Thread Andriy Voskoboinyk
Mon, 09 Jan 2017 10:08:13 +0200 було написано Hans Petter Selasky  
:


Hi,

The race should be fixed in r311838.


On 01/09/17 00:41, Andriy Voskoboinyk wrote:

Modified: head/sys/dev/rtwn/usb/rtwn_usb_ep.c
==
--- head/sys/dev/rtwn/usb/rtwn_usb_ep.c	Sun Jan  8 23:25:46  
2017	(r311706)
+++ head/sys/dev/rtwn/usb/rtwn_usb_ep.c	Sun Jan  8 23:41:17  
2017	(r311707)

@@ -63,7 +63,6 @@ static struct usb_config rtwn_config[RTW
.type = UE_BULK,
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
-   .bufsize = RTWN_RXBUFSZ,
.flags = {
.pipe_bof = 1,
.short_xfer_ok = 1
@@ -222,6 +221,7 @@ rtwn_usb_setup_endpoints(struct rtwn_usb
break;
}

+   rtwn_config[RTWN_BULK_RX].bufsize = sc->rx_dma_size + 1024;


Hi,

You should copy the rtwn_config to the stack/softc, and not write to the  
static struct, which should be made "static const" after this change!


This might lead to a race when multiple adapters are connecting at the  
same time! Remember USB enumeration is multithreaded.


Else your change looks good.

--HPS

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

svn commit: r311843 - head/sys/contrib/dev/acpica/components/tables

2017-01-09 Thread Conrad E. Meyer
Author: cem
Date: Tue Jan 10 00:03:43 2017
New Revision: 311843
URL: https://svnweb.freebsd.org/changeset/base/311843

Log:
  Adjust ACPI_EXPORT_SYMBOL for AcpiGetTableWithSize
  
  Suggested by: jbeich@

Modified:
  head/sys/contrib/dev/acpica/components/tables/tbxface.c

Modified: head/sys/contrib/dev/acpica/components/tables/tbxface.c
==
--- head/sys/contrib/dev/acpica/components/tables/tbxface.c Mon Jan  9 
23:56:45 2017(r311842)
+++ head/sys/contrib/dev/acpica/components/tables/tbxface.c Tue Jan 10 
00:03:43 2017(r311843)
@@ -386,7 +386,7 @@ AcpiGetTableWithSize (
 return (Status);
 }
 
-ACPI_EXPORT_SYMBOL (AcpiGetTable)
+ACPI_EXPORT_SYMBOL (AcpiGetTableWithSize)
 
 
 
/***
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311842 - head/sys/fs/cd9660

2017-01-09 Thread Conrad E. Meyer
Author: cem
Date: Mon Jan  9 23:56:45 2017
New Revision: 311842
URL: https://svnweb.freebsd.org/changeset/base/311842

Log:
  cd9660: typedef cd_ino_t in preference to #define
  
  Suggested by: kib@

Modified:
  head/sys/fs/cd9660/iso.h

Modified: head/sys/fs/cd9660/iso.h
==
--- head/sys/fs/cd9660/iso.hMon Jan  9 23:51:31 2017(r311841)
+++ head/sys/fs/cd9660/iso.hMon Jan  9 23:56:45 2017(r311842)
@@ -222,7 +222,7 @@ enum ISO_FTYPE  { ISO_FTYPE_DEFAULT, ISO_
 /*
  * When ino_t becomes 64-bit, we can remove this definition in favor of ino_t.
  */
-#define cd_ino_t   uint64_t
+typedef __uint64_t cd_ino_t;
 
 struct iso_mnt {
uint64_t im_flags;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311841 - head/sys/fs/cd9660

2017-01-09 Thread Conrad E. Meyer
Author: cem
Date: Mon Jan  9 23:51:31 2017
New Revision: 311841
URL: https://svnweb.freebsd.org/changeset/base/311841

Log:
  cd9660: Add a prototype for cd9660_vfs_hash_cmp
  
  GCC warns (and errors, with -Werror) about it otherwise.  Clang doesn't care.
  
  Introduced in r311665.
  
  Reported by:  np@

Modified:
  head/sys/fs/cd9660/cd9660_vfsops.c

Modified: head/sys/fs/cd9660/cd9660_vfsops.c
==
--- head/sys/fs/cd9660/cd9660_vfsops.c  Mon Jan  9 23:45:40 2017
(r311840)
+++ head/sys/fs/cd9660/cd9660_vfsops.c  Mon Jan  9 23:51:31 2017
(r311841)
@@ -88,6 +88,7 @@ static struct vfsops cd9660_vfsops = {
 VFS_SET(cd9660_vfsops, cd9660, VFCF_READONLY);
 MODULE_VERSION(cd9660, 1);
 
+static int cd9660_vfs_hash_cmp(struct vnode *vp, cd_ino_t *pino);
 static int iso_mountfs(struct vnode *devvp, struct mount *mp);
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311840 - head/sys/conf

2017-01-09 Thread Sean Bruno
Author: sbruno
Date: Mon Jan  9 23:45:40 2017
New Revision: 311840
URL: https://svnweb.freebsd.org/changeset/base/311840

Log:
  White space cleanup from an cut-n-paste.
  
  Submitted by: mm...@nextbsd.org

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Mon Jan  9 23:43:42 2017(r311839)
+++ head/sys/conf/files Mon Jan  9 23:45:40 2017(r311840)
@@ -3905,9 +3905,9 @@ net/if_tun.c  optional tun
 net/if_tap.c   optional tap
 net/if_vlan.c  optional vlan
 net/if_vxlan.c optional vxlan inet | vxlan inet6
-net/ifdi_if.m  optional ether pci
-net/iflib.coptional ether pci
-net/mp_ring.c  optional ether
+net/ifdi_if.m  optional ether pci
+net/iflib.coptional ether pci
+net/mp_ring.c  optional ether
 net/mppcc.coptional netgraph_mppc_compression
 net/mppcd.coptional netgraph_mppc_compression
 net/netisr.c   standard
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311839 - stable/11/usr.bin/kdump

2017-01-09 Thread John Baldwin
Author: jhb
Date: Mon Jan  9 23:43:42 2017
New Revision: 311839
URL: https://svnweb.freebsd.org/changeset/base/311839

Log:
  MFC 306565,306566: Use timercmp() and timersub() in kdump.
  
  306565:
  Use timercmp() and timersub() in kdump.
  
  Previously, kdump used the kernel-only timervalsub() macro which required
  defining _KERNEL when including .  Now, kdump uses the existing
  userland API.  The timercmp() usage to check for a backwards timestamp is
  also clearer and simpler than the previous code which checked the result of
  the subtraction for a negative value.
  
  While here, take advantage of the 3-arg timersub() to store the subtraction
  results in a tempory timeval instead of overwriting the timestamp in the
  ktrace record and then having to restore it.
  
  306566:
  Don't declare the 'temp' timeval as static.

Modified:
  stable/11/usr.bin/kdump/kdump.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/kdump/kdump.c
==
--- stable/11/usr.bin/kdump/kdump.c Mon Jan  9 23:42:02 2017
(r311838)
+++ stable/11/usr.bin/kdump/kdump.c Mon Jan  9 23:43:42 2017
(r311839)
@@ -45,9 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#define _KERNEL
 #include 
-#undef _KERNEL
 #include 
 #include 
 #include 
@@ -564,7 +562,8 @@ void
 dumpheader(struct ktr_header *kth)
 {
static char unknown[64];
-   static struct timeval prevtime, prevtime_e, temp;
+   static struct timeval prevtime, prevtime_e;
+   struct timeval temp;
const char *type;
const char *sign;
 
@@ -637,27 +636,23 @@ dumpheader(struct ktr_header *kth)
if (timestamp & TIMESTAMP_ELAPSED) {
if (prevtime_e.tv_sec == 0)
prevtime_e = kth->ktr_time;
-   timevalsub(>ktr_time, _e);
-   printf("%jd.%06ld ", (intmax_t)kth->ktr_time.tv_sec,
-   kth->ktr_time.tv_usec);
-   timevaladd(>ktr_time, _e);
+   timersub(>ktr_time, _e, );
+   printf("%jd.%06ld ", (intmax_t)temp.tv_sec,
+   temp.tv_usec);
}
if (timestamp & TIMESTAMP_RELATIVE) {
if (prevtime.tv_sec == 0)
prevtime = kth->ktr_time;
-   temp = kth->ktr_time;
-   timevalsub(>ktr_time, );
-   if ((intmax_t)kth->ktr_time.tv_sec < 0) {
-   kth->ktr_time = prevtime;
-   prevtime = temp;
-   timevalsub(>ktr_time, );
+   if (timercmp(>ktr_time, , <)) {
+   timersub(, >ktr_time, );
sign = "-";
} else {
-   prevtime = temp;
+   timersub(>ktr_time, , );
sign = "";
}
-   printf("%s%jd.%06ld ", sign, 
(intmax_t)kth->ktr_time.tv_sec,
-   kth->ktr_time.tv_usec);
+   prevtime = kth->ktr_time;
+   printf("%s%jd.%06ld ", sign, (intmax_t)temp.tv_sec,
+   temp.tv_usec);
}
}
printf("%s  ", type);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311838 - head/sys/dev/rtwn/usb

2017-01-09 Thread Andriy Voskoboinyk
Author: avos
Date: Mon Jan  9 23:42:02 2017
New Revision: 311838
URL: https://svnweb.freebsd.org/changeset/base/311838

Log:
  rtwn_usb(4): do not try to modify global static structure.
  
  Use a local copy for modifications instead.
  
  Tested with RTL8821AU (AP) + RTL8188EU (STA).
  
  Reported by:  hselasky

Modified:
  head/sys/dev/rtwn/usb/rtwn_usb_ep.c

Modified: head/sys/dev/rtwn/usb/rtwn_usb_ep.c
==
--- head/sys/dev/rtwn/usb/rtwn_usb_ep.c Mon Jan  9 23:41:10 2017
(r311837)
+++ head/sys/dev/rtwn/usb/rtwn_usb_ep.c Mon Jan  9 23:42:02 2017
(r311838)
@@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 
-static struct usb_config rtwn_config[RTWN_N_TRANSFER] = {
+static const struct usb_config rtwn_config_common[RTWN_N_TRANSFER] = {
[RTWN_BULK_RX] = {
.type = UE_BULK,
.endpoint = UE_ADDR_ANY,
@@ -161,6 +161,7 @@ rtwn_usb_setup_queues(struct rtwn_usb_so
 int
 rtwn_usb_setup_endpoints(struct rtwn_usb_softc *uc)
 {
+   struct usb_config *rtwn_config;
struct rtwn_softc *sc = >uc_sc;
const uint8_t iface_index = RTWN_IFACE_INDEX;
struct usb_endpoint *ep, *ep_end;
@@ -197,6 +198,9 @@ rtwn_usb_setup_endpoints(struct rtwn_usb
return (EINVAL);
}
 
+   rtwn_config = malloc(sizeof(rtwn_config_common), M_TEMP, M_WAITOK);
+   memcpy(rtwn_config, rtwn_config_common, sizeof(rtwn_config_common));
+
/* NB: keep in sync with rtwn_dma_init(). */
rtwn_config[RTWN_BULK_TX_VO].endpoint = addr[0];
switch (uc->ntx) {
@@ -224,6 +228,8 @@ rtwn_usb_setup_endpoints(struct rtwn_usb
rtwn_config[RTWN_BULK_RX].bufsize = sc->rx_dma_size + 1024;
error = usbd_transfer_setup(uc->uc_udev, _index,
uc->uc_xfer, rtwn_config, RTWN_N_TRANSFER, uc, >sc_mtx);
+   free(rtwn_config, M_TEMP);
+
if (error) {
device_printf(sc->sc_dev, "could not allocate USB transfers, "
"err=%s\n", usbd_errstr(error));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311837 - head/sys/net

2017-01-09 Thread Sean Bruno
Author: sbruno
Date: Mon Jan  9 23:41:10 2017
New Revision: 311837
URL: https://svnweb.freebsd.org/changeset/base/311837

Log:
  Remove unused mtx_held() macro.

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cMon Jan  9 22:49:35 2017(r311836)
+++ head/sys/net/iflib.cMon Jan  9 23:41:10 2017(r311837)
@@ -447,10 +447,6 @@ struct iflib_rxq {
 
 static int enable_msix = 1;
 
-#define mtx_held(m)(((m)->mtx_lock & ~MTX_FLAGMASK) != (uintptr_t)0)
-
-
-
 #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING))
 
 #define CTX_LOCK_INIT(_sc, _name)  mtx_init(&(_sc)->ifc_mtx, _name, "iflib ctx 
lock", MTX_DEF)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2017-01-09 Thread Navdeep Parhar
Author: np
Date: Mon Jan  9 22:20:09 2017
New Revision: 311832
URL: https://svnweb.freebsd.org/changeset/base/311832

Log:
  cxgbe(4): Enable automatic cidx flush for all control queues.
  
  MFC after:3 days

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

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Mon Jan  9 22:18:08 2017(r311831)
+++ head/sys/dev/cxgbe/t4_sge.c Mon Jan  9 22:20:09 2017(r311832)
@@ -3305,12 +3305,13 @@ ctrl_eq_alloc(struct adapter *sc, struct
c.cmpliqid_eqid = htonl(V_FW_EQ_CTRL_CMD_CMPLIQID(eq->iqid));
c.physeqid_pkd = htobe32(0);
c.fetchszm_to_iqid =
-   htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) |
+   htobe32(V_FW_EQ_CTRL_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) |
V_FW_EQ_CTRL_CMD_PCIECHN(eq->tx_chan) |
F_FW_EQ_CTRL_CMD_FETCHRO | V_FW_EQ_CTRL_CMD_IQID(eq->iqid));
c.dcaen_to_eqsize =
htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) |
V_FW_EQ_CTRL_CMD_FBMAX(X_FETCHBURSTMAX_512B) |
+   V_FW_EQ_CTRL_CMD_CIDXFTHRESH(X_CIDXFLUSHTHRESH_32) |
V_FW_EQ_CTRL_CMD_EQSIZE(qsize));
c.eqaddr = htobe64(eq->ba);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2017-01-09 Thread Navdeep Parhar
Author: np
Date: Mon Jan  9 22:18:08 2017
New Revision: 311831
URL: https://svnweb.freebsd.org/changeset/base/311831

Log:
  cxgbe(4): The wraparound logic in start_wrq_wr() should not get involved
  in work requests that end at the end of the descriptor ring, even though
  the pidx wraps around to 0.
  
  MFC after:3 days

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

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Mon Jan  9 21:46:24 2017(r311830)
+++ head/sys/dev/cxgbe/t4_sge.c Mon Jan  9 22:18:08 2017(r311831)
@@ -2298,7 +2298,7 @@ slowpath:
 
w = >desc[eq->pidx];
IDXINCR(eq->pidx, ndesc, eq->sidx);
-   if (__predict_false(eq->pidx < ndesc - 1)) {
+   if (__predict_false(cookie->pidx + ndesc > eq->sidx)) {
w = >ss[0];
wrq->ss_pidx = cookie->pidx;
wrq->ss_len = len16 * 16;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311830 - head/sys/dev/usb/wlan

2017-01-09 Thread Adrian Chadd
Author: adrian
Date: Mon Jan  9 21:46:24 2017
New Revision: 311830
URL: https://svnweb.freebsd.org/changeset/base/311830

Log:
  [rsu] add support for the "green" rsu NICs.
  
  They're still a 1T2R NIC, so reuse the same rfconfig and
  nstream configuration.
  
  Submitted by: Idwer Vollering 

Modified:
  head/sys/dev/usb/wlan/if_rsu.c

Modified: head/sys/dev/usb/wlan/if_rsu.c
==
--- head/sys/dev/usb/wlan/if_rsu.c  Mon Jan  9 21:24:02 2017
(r311829)
+++ head/sys/dev/usb/wlan/if_rsu.c  Mon Jan  9 21:46:24 2017
(r311830)
@@ -523,6 +523,12 @@ rsu_attach(device_t self)
sc->sc_ntxstream = 2;
rft = "2T2R";
break;
+   case 0x3:   /* "green" NIC */
+   sc->sc_rftype = RTL8712_RFCONFIG_1T2R;
+   sc->sc_nrxstream = 2;
+   sc->sc_ntxstream = 1;
+   rft = "1T2R ('green')";
+   break;
default:
device_printf(sc->sc_dev,
"%s: unknown board type (rfconfig=0x%02x)\n",
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311827 - vendor/lld/lld-trunk-r291476

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 21:23:54 2017
New Revision: 311827
URL: https://svnweb.freebsd.org/changeset/base/311827

Log:
  Tag lld trunk r291476.

Added:
  vendor/lld/lld-trunk-r291476/
 - copied from r311826, vendor/lld/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311825 - vendor/libc++/libc++-trunk-r291476

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 21:23:46 2017
New Revision: 311825
URL: https://svnweb.freebsd.org/changeset/base/311825

Log:
  Tag libc++ trunk r291476.

Added:
  vendor/libc++/libc++-trunk-r291476/
 - copied from r311824, vendor/libc++/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311829 - vendor/lldb/lldb-trunk-r291476

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 21:24:02 2017
New Revision: 311829
URL: https://svnweb.freebsd.org/changeset/base/311829

Log:
  Tag lldb trunk r291476.

Added:
  vendor/lldb/lldb-trunk-r291476/
 - copied from r311828, vendor/lldb/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311826 - in vendor/lld/dist: ELF cmake/modules include/lld/Core lib/Config lib/Core lib/Driver lib/ReaderWriter lib/ReaderWriter/MachO lib/ReaderWriter/YAML test/COFF test/ELF test/ELF...

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 21:23:48 2017
New Revision: 311826
URL: https://svnweb.freebsd.org/changeset/base/311826

Log:
  Vendor import of lld trunk r291476:
  https://llvm.org/svn/llvm-project/lld/trunk@291476

Added:
  vendor/lld/dist/test/ELF/comdat-linkonce.s   (contents, props changed)
  vendor/lld/dist/test/ELF/undefined-versioned-symbol.s   (contents, props 
changed)
Modified:
  vendor/lld/dist/ELF/Driver.cpp
  vendor/lld/dist/ELF/Driver.h
  vendor/lld/dist/ELF/InputFiles.cpp
  vendor/lld/dist/ELF/InputFiles.h
  vendor/lld/dist/ELF/LinkerScript.cpp
  vendor/lld/dist/ELF/Symbols.cpp
  vendor/lld/dist/cmake/modules/AddLLD.cmake
  vendor/lld/dist/include/lld/Core/Reproduce.h
  vendor/lld/dist/lib/Config/CMakeLists.txt
  vendor/lld/dist/lib/Core/CMakeLists.txt
  vendor/lld/dist/lib/Core/Reproduce.cpp
  vendor/lld/dist/lib/Driver/CMakeLists.txt
  vendor/lld/dist/lib/ReaderWriter/CMakeLists.txt
  vendor/lld/dist/lib/ReaderWriter/MachO/CMakeLists.txt
  vendor/lld/dist/lib/ReaderWriter/YAML/CMakeLists.txt
  vendor/lld/dist/test/COFF/linkrepro.test
  vendor/lld/dist/test/ELF/linkerscript/symbol-assignexpr.s
  vendor/lld/dist/test/ELF/mips-gp-ext.s
  vendor/lld/dist/test/ELF/reproduce-linkerscript.s
  vendor/lld/dist/tools/lld/CMakeLists.txt

Modified: vendor/lld/dist/ELF/Driver.cpp
==
--- vendor/lld/dist/ELF/Driver.cpp  Mon Jan  9 21:23:46 2017
(r311825)
+++ vendor/lld/dist/ELF/Driver.cpp  Mon Jan  9 21:23:48 2017
(r311826)
@@ -26,6 +26,7 @@
 #include "llvm/ADT/StringSwitch.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Path.h"
+#include "llvm/Support/TarWriter.h"
 #include "llvm/Support/TargetSelect.h"
 #include "llvm/Support/raw_ostream.h"
 #include 
@@ -51,6 +52,7 @@ bool elf::link(ArrayRef Ar
   ErrorCount = 0;
   ErrorOS = 
   Argv0 = Args[0];
+  Tar = nullptr;
 
   Config = make();
   Driver = make();
@@ -170,25 +172,6 @@ void LinkerDriver::addFile(StringRef Pat
   }
 }
 
-Optional LinkerDriver::readFile(StringRef Path) {
-  if (Config->Verbose)
-outs() << Path << "\n";
-
-  auto MBOrErr = MemoryBuffer::getFile(Path);
-  if (auto EC = MBOrErr.getError()) {
-error(EC, "cannot open " + Path);
-return None;
-  }
-  std::unique_ptr  = *MBOrErr;
-  MemoryBufferRef MBRef = MB->getMemBufferRef();
-  make(std::move(MB)); // take MB ownership
-
-  if (Tar)
-Tar->append(relativeToRoot(Path), MBRef.getBuffer());
-
-  return MBRef;
-}
-
 // Add a given library by searching it from input search paths.
 void LinkerDriver::addLibrary(StringRef Name) {
   if (Optional Path = searchLibrary(Name))
@@ -313,9 +296,10 @@ void LinkerDriver::main(ArrayRef> ErrOrWriter =
 TarWriter::create(Path, path::stem(Path));
 if (ErrOrWriter) {
-  Tar = std::move(*ErrOrWriter);
+  Tar = ErrOrWriter->get();
   Tar->append("response.txt", createResponseFile(Args));
   Tar->append("version.txt", getLLDVersion() + "\n");
+  make(std::move(*ErrOrWriter));
 } else {
   error(Twine("--reproduce: failed to open ") + Path + ": " +
 toString(ErrOrWriter.takeError()));

Modified: vendor/lld/dist/ELF/Driver.h
==
--- vendor/lld/dist/ELF/Driver.hMon Jan  9 21:23:46 2017
(r311825)
+++ vendor/lld/dist/ELF/Driver.hMon Jan  9 21:23:48 2017
(r311826)
@@ -17,7 +17,6 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSet.h"
 #include "llvm/Option/ArgList.h"
-#include "llvm/Support/TarWriter.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace lld {
@@ -30,11 +29,9 @@ public:
   void main(ArrayRef Args, bool CanExitEarly);
   void addFile(StringRef Path);
   void addLibrary(StringRef Name);
-  std::unique_ptr Tar; // for reproduce
 
 private:
   std::vector getArchiveMembers(MemoryBufferRef MB);
-  llvm::Optional readFile(StringRef Path);
   void readConfigs(llvm::opt::InputArgList );
   void createFiles(llvm::opt::InputArgList );
   void inferMachineType();

Modified: vendor/lld/dist/ELF/InputFiles.cpp
==
--- vendor/lld/dist/ELF/InputFiles.cpp  Mon Jan  9 21:23:46 2017
(r311825)
+++ vendor/lld/dist/ELF/InputFiles.cpp  Mon Jan  9 21:23:48 2017
(r311826)
@@ -8,7 +8,6 @@
 
//===--===//
 
 #include "InputFiles.h"
-#include "Driver.h"
 #include "Error.h"
 #include "InputSection.h"
 #include "LinkerScript.h"
@@ -26,6 +25,7 @@
 #include "llvm/MC/StringTableBuilder.h"
 #include "llvm/Object/ELFObjectFile.h"
 #include "llvm/Support/Path.h"
+#include "llvm/Support/TarWriter.h"
 #include "llvm/Support/raw_ostream.h"
 
 using namespace llvm;
@@ -36,6 +36,8 @@ using namespace llvm::sys::fs;
 using namespace lld;
 using namespace lld::elf;
 
+TarWriter *elf::Tar;
+
 

svn commit: r311828 - in vendor/lldb/dist: packages/Python/lldbsuite/test/python_api/value/empty_class scripts source/Plugins/SymbolFile/DWARF source/Symbol

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 21:23:57 2017
New Revision: 311828
URL: https://svnweb.freebsd.org/changeset/base/311828

Log:
  Vendor import of lldb trunk r291476:
  https://llvm.org/svn/llvm-project/lldb/trunk@291476

Added:
  vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/
  
vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/Makefile
   (contents, props changed)
  
vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py
   (contents, props changed)
  
vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/main.cpp
   (contents, props changed)
Modified:
  vendor/lldb/dist/scripts/CMakeLists.txt
  vendor/lldb/dist/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  vendor/lldb/dist/source/Symbol/ClangASTContext.cpp

Added: 
vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/Makefile
   Mon Jan  9 21:23:57 2017(r311828)
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules

Added: 
vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py
  Mon Jan  9 21:23:57 2017(r311828)
@@ -0,0 +1,60 @@
+from __future__ import print_function
+
+import os
+import time
+import re
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class ValueAPIEmptyClassTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@add_test_categories(['pyapi'])
+def test(self):
+self.build()
+exe = os.path.join(os.getcwd(), 'a.out')
+line = line_number('main.cpp', '// Break at this line')
+
+# Create a target by the debugger.
+target = self.dbg.CreateTarget(exe)
+self.assertTrue(target, VALID_TARGET)
+
+# Create the breakpoint inside function 'main'.
+breakpoint = target.BreakpointCreateByLocation('main.cpp', line)
+self.assertTrue(breakpoint, VALID_BREAKPOINT)
+
+# Now launch the process, and do not stop at entry point.
+process = target.LaunchSimple(
+None, None, self.get_process_working_directory())
+self.assertTrue(process, PROCESS_IS_VALID)
+
+# Get Frame #0.
+self.assertTrue(process.GetState() == lldb.eStateStopped)
+thread = lldbutil.get_stopped_thread(
+process, lldb.eStopReasonBreakpoint)
+self.assertTrue(
+thread.IsValid(),
+"There should be a thread stopped due to breakpoint condition")
+frame0 = thread.GetFrameAtIndex(0)
+
+# Verify that we can access to a frame variable with an empty class 
type
+e = frame0.FindVariable('e')
+self.assertTrue(e.IsValid(), VALID_VARIABLE)
+self.DebugSBValue(e)
+self.assertEqual(e.GetNumChildren(), 0)
+
+# Verify that we can acces to a frame variable what is a pointer to an
+# empty class
+ep = frame0.FindVariable('ep')
+self.assertTrue(ep.IsValid(), VALID_VARIABLE)
+self.DebugSBValue(ep)
+
+# Verify that we can dereference a pointer to an empty class
+epd = ep.Dereference()
+self.assertTrue(epd.IsValid(), VALID_VARIABLE)
+self.DebugSBValue(epd)
+self.assertEqual(epd.GetNumChildren(), 0)
+

Added: 
vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/main.cpp
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
vendor/lldb/dist/packages/Python/lldbsuite/test/python_api/value/empty_class/main.cpp
   Mon Jan  9 21:23:57 2017(r311828)
@@ -0,0 +1,16 @@
+//===-- main.cpp *- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+class Empty {};
+
+int main (int argc, char const *argv[]) {
+  Empty e;
+  Empty* ep = new Empty;
+  return 0; // Break at this line
+}

Modified: vendor/lldb/dist/scripts/CMakeLists.txt
==
--- vendor/lldb/dist/scripts/CMakeLists.txt Mon Jan  

svn commit: r311824 - in vendor/libc++/dist: . docs docs/DesignDocs include include/experimental include/support/win32 lib src src/experimental src/include test test/libcxx/iterators test/libcxx/te...

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 21:23:41 2017
New Revision: 311824
URL: https://svnweb.freebsd.org/changeset/base/311824

Log:
  Vendor import of libc++ trunk r291476:
  https://llvm.org/svn/llvm-project/libcxx/trunk@291476

Added:
  vendor/libc++/dist/docs/DesignDocs/ThreadingSupportAPI.rst
  
vendor/libc++/dist/test/std/input.output/iostream.format/input.streams/istream/istream.cons/copy.fail.cpp
   (contents, props changed)
  vendor/libc++/dist/test/std/strings/string.view/string_view.literals/
  
vendor/libc++/dist/test/std/strings/string.view/string_view.literals/literal.pass.cpp
   (contents, props changed)
  
vendor/libc++/dist/test/std/strings/string.view/string_view.literals/literal1.fail.cpp
   (contents, props changed)
  
vendor/libc++/dist/test/std/strings/string.view/string_view.literals/literal1.pass.cpp
   (contents, props changed)
  
vendor/libc++/dist/test/std/strings/string.view/string_view.literals/literal2.fail.cpp
   (contents, props changed)
  
vendor/libc++/dist/test/std/strings/string.view/string_view.literals/literal2.pass.cpp
   (contents, props changed)
  
vendor/libc++/dist/test/std/strings/string.view/string_view.literals/literal3.pass.cpp
   (contents, props changed)
Deleted:
  vendor/libc++/dist/include/__undef___deallocate
Modified:
  vendor/libc++/dist/CMakeLists.txt
  vendor/libc++/dist/CREDITS.TXT
  vendor/libc++/dist/docs/DesignDocs/VisibilityMacros.rst
  vendor/libc++/dist/docs/index.rst
  vendor/libc++/dist/include/__bit_reference
  vendor/libc++/dist/include/__config
  vendor/libc++/dist/include/__config_site.in
  vendor/libc++/dist/include/__debug
  vendor/libc++/dist/include/__functional_base
  vendor/libc++/dist/include/__hash_table
  vendor/libc++/dist/include/__sso_allocator
  vendor/libc++/dist/include/__threading_support
  vendor/libc++/dist/include/algorithm
  vendor/libc++/dist/include/atomic
  vendor/libc++/dist/include/experimental/algorithm
  vendor/libc++/dist/include/experimental/dynarray
  vendor/libc++/dist/include/experimental/iterator
  vendor/libc++/dist/include/istream
  vendor/libc++/dist/include/memory
  vendor/libc++/dist/include/module.modulemap
  vendor/libc++/dist/include/new
  vendor/libc++/dist/include/ostream
  vendor/libc++/dist/include/regex
  vendor/libc++/dist/include/string_view
  vendor/libc++/dist/include/support/win32/support.h
  vendor/libc++/dist/include/thread
  vendor/libc++/dist/include/type_traits
  vendor/libc++/dist/include/valarray
  vendor/libc++/dist/lib/CMakeLists.txt
  vendor/libc++/dist/src/chrono.cpp
  vendor/libc++/dist/src/exception.cpp
  vendor/libc++/dist/src/experimental/memory_resource.cpp
  vendor/libc++/dist/src/include/config_elast.h
  vendor/libc++/dist/src/iostream.cpp
  vendor/libc++/dist/src/locale.cpp
  vendor/libc++/dist/src/thread.cpp
  vendor/libc++/dist/test/CMakeLists.txt
  vendor/libc++/dist/test/libcxx/iterators/trivial_iterators.pass.cpp
  vendor/libc++/dist/test/libcxx/test/config.py
  vendor/libc++/dist/test/libcxx/test/executor.py
  vendor/libc++/dist/test/libcxx/test/format.py
  vendor/libc++/dist/test/lit.site.cfg.in
  vendor/libc++/dist/test/std/containers/sequences/array/iterators.pass.cpp
  
vendor/libc++/dist/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp
  vendor/libc++/dist/test/std/iterators/iterator.range/begin-end.pass.cpp
  
vendor/libc++/dist/test/std/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h
  
vendor/libc++/dist/test/std/utilities/time/time.duration/time.duration.arithmetic/op_mod=duration.pass.cpp
  
vendor/libc++/dist/test/std/utilities/time/time.duration/time.duration.arithmetic/op_mod=rep.pass.cpp
  
vendor/libc++/dist/test/std/utilities/time/time.duration/time.duration.arithmetic/op_times=.pass.cpp
  vendor/libc++/dist/test/support/disable_missing_braces_warning.h
  vendor/libc++/dist/test/support/external_threads.cpp
  vendor/libc++/dist/test/support/nasty_macros.hpp
  vendor/libc++/dist/test/support/test_iterators.h
  vendor/libc++/dist/www/cxx1z_status.html

Modified: vendor/libc++/dist/CMakeLists.txt
==
--- vendor/libc++/dist/CMakeLists.txt   Mon Jan  9 21:23:37 2017
(r311823)
+++ vendor/libc++/dist/CMakeLists.txt   Mon Jan  9 21:23:41 2017
(r311824)
@@ -116,7 +116,12 @@ if (LIBCXX_CXX_ABI STREQUAL "default")
 set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
 set(LIBCXX_CXX_ABI_INTREE 1)
   else()
-set(LIBCXX_CXX_ABI_LIBNAME "default")
+if (WIN32 AND NOT MINGW)
+  # FIXME: Figure out how to configure the ABI library on Windows.
+  set(LIBCXX_CXX_ABI_LIBNAME "none")
+else()
+  set(LIBCXX_CXX_ABI_LIBNAME "default")
+endif()
   endif()
 else()
   set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}")
@@ -169,6 +174,9 @@ option(LIBCXX_HAS_PTHREAD_API "Ignore au
 option(LIBCXX_HAS_EXTERNAL_THREAD_API
   "Build libc++ with an externalized threading API.
This option 

svn commit: r311823 - vendor/compiler-rt/compiler-rt-trunk-r291476

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 21:23:37 2017
New Revision: 311823
URL: https://svnweb.freebsd.org/changeset/base/311823

Log:
  Tag compiler-rt trunk r291476.

Added:
  vendor/compiler-rt/compiler-rt-trunk-r291476/
 - copied from r311822, vendor/compiler-rt/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311819 - vendor/llvm/llvm-trunk-r291476

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 21:23:15 2017
New Revision: 311819
URL: https://svnweb.freebsd.org/changeset/base/311819

Log:
  Tag llvm trunk r291476.

Added:
  vendor/llvm/llvm-trunk-r291476/
 - copied from r311818, vendor/llvm/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311822 - in vendor/compiler-rt/dist: cmake/Modules lib/asan lib/asan/scripts lib/asan/tests lib/builtins/arm lib/lsan lib/sanitizer_common lib/sanitizer_common/tests lib/stats lib/tsan...

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 21:23:31 2017
New Revision: 311822
URL: https://svnweb.freebsd.org/changeset/base/311822

Log:
  Vendor import of compiler-rt trunk r291476:
  https://llvm.org/svn/llvm-project/compiler-rt/trunk@291476

Added:
  vendor/compiler-rt/dist/lib/asan/weak_symbols.txt   (contents, props changed)
  vendor/compiler-rt/dist/lib/sanitizer_common/weak_symbols.txt   (contents, 
props changed)
  vendor/compiler-rt/dist/lib/ubsan/weak_symbols.txt   (contents, props changed)
  vendor/compiler-rt/dist/test/asan/TestCases/Darwin/haswell-symbolication.cc   
(contents, props changed)
  vendor/compiler-rt/dist/test/asan/TestCases/Darwin/uuid.cc   (contents, props 
changed)
Modified:
  vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake
  vendor/compiler-rt/dist/lib/asan/CMakeLists.txt
  vendor/compiler-rt/dist/lib/asan/asan_report.cc
  vendor/compiler-rt/dist/lib/asan/asan_rtl.cc
  vendor/compiler-rt/dist/lib/asan/scripts/asan_symbolize.py
  vendor/compiler-rt/dist/lib/asan/tests/CMakeLists.txt
  vendor/compiler-rt/dist/lib/builtins/arm/aeabi_fcmp.S
  vendor/compiler-rt/dist/lib/builtins/arm/comparesf2.S
  vendor/compiler-rt/dist/lib/lsan/CMakeLists.txt
  vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc
  vendor/compiler-rt/dist/lib/lsan/lsan_common.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_internal_defs.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_printf.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace_printer.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace_printer.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_internal.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/CMakeLists.txt
  
vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cc
  vendor/compiler-rt/dist/lib/stats/CMakeLists.txt
  vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan.syms.extra
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_report.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl.cc
  vendor/compiler-rt/dist/lib/tsan/tests/CMakeLists.txt
  vendor/compiler-rt/dist/lib/ubsan/CMakeLists.txt
  vendor/compiler-rt/dist/lib/ubsan/ubsan_diag.cc
  
vendor/compiler-rt/dist/test/asan/TestCases/Posix/asan-symbolize-sanity-test.cc
  vendor/compiler-rt/dist/test/lit.common.cfg
  vendor/compiler-rt/dist/test/tsan/simple_stack2.cc

Modified: vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake
==
--- vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake  Mon Jan  9 
21:23:28 2017(r311821)
+++ vendor/compiler-rt/dist/cmake/Modules/SanitizerUtils.cmake  Mon Jan  9 
21:23:31 2017(r311822)
@@ -46,6 +46,17 @@ macro(add_sanitizer_rt_symbols name)
   endforeach()
 endmacro()
 
+# This function is only used on Darwin, where undefined symbols must be 
specified
+# in the linker invocation.
+function(add_weak_symbols libname linkflags)
+  file(STRINGS "${COMPILER_RT_SOURCE_DIR}/lib/${libname}/weak_symbols.txt" 
WEAK_SYMBOLS)
+  set(local_linkflags ${${linkflags}})
+  foreach(SYMBOL ${WEAK_SYMBOLS})
+set(local_linkflags ${local_linkflags} -Wl,-U,${SYMBOL})
+  endforeach()
+  set(${linkflags} ${local_linkflags} PARENT_SCOPE)
+endfunction()
+
 macro(add_sanitizer_rt_version_list name)
   set(vers ${CMAKE_CURRENT_BINARY_DIR}/${name}.vers)
   cmake_parse_arguments(ARG "" "" "LIBS;EXTRA" ${ARGN})

Modified: vendor/compiler-rt/dist/lib/asan/CMakeLists.txt
==
--- vendor/compiler-rt/dist/lib/asan/CMakeLists.txt Mon Jan  9 21:23:28 
2017(r311821)
+++ vendor/compiler-rt/dist/lib/asan/CMakeLists.txt Mon Jan  9 21:23:31 
2017(r311822)
@@ -106,6 +106,10 @@ endif()
 add_compiler_rt_component(asan)
 
 if(APPLE)
+  add_weak_symbols("asan" WEAK_SYMBOL_LINKFLAGS)
+  add_weak_symbols("ubsan" WEAK_SYMBOL_LINKFLAGS)
+  add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINKFLAGS)
+
   add_compiler_rt_runtime(clang_rt.asan
 SHARED
 OS ${SANITIZER_COMMON_SUPPORTED_OS}
@@ -117,6 +121,7 @@ 

svn commit: r311821 - vendor/clang/clang-trunk-r291476

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 21:23:28 2017
New Revision: 311821
URL: https://svnweb.freebsd.org/changeset/base/311821

Log:
  Tag clang trunk r291476.

Added:
  vendor/clang/clang-trunk-r291476/
 - copied from r311820, vendor/clang/dist/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311820 - in vendor/clang/dist: docs include/clang/AST include/clang/Basic include/clang/Driver include/clang/Frontend include/clang/Index include/clang/Sema include/clang/StaticAnalyze...

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 21:23:21 2017
New Revision: 311820
URL: https://svnweb.freebsd.org/changeset/base/311820

Log:
  Vendor import of clang trunk r291476:
  https://llvm.org/svn/llvm-project/cfe/trunk@291476

Added:
  vendor/clang/dist/lib/StaticAnalyzer/Checkers/IteratorPastEndChecker.cpp   
(contents, props changed)
  vendor/clang/dist/test/Analysis/iterator-past-end.cpp   (contents, props 
changed)
  vendor/clang/dist/test/CodeGenCXX/dllexport-ctor-closure.cpp   (contents, 
props changed)
  vendor/clang/dist/test/Modules/Inputs/pch-with-module-name/
  vendor/clang/dist/test/Modules/Inputs/pch-with-module-name/A.h   (contents, 
props changed)
  vendor/clang/dist/test/Modules/Inputs/pch-with-module-name/C.h   (contents, 
props changed)
  vendor/clang/dist/test/Modules/Inputs/pch-with-module-name/C.m
  vendor/clang/dist/test/Modules/Inputs/pch-with-module-name/D.h   (contents, 
props changed)
  vendor/clang/dist/test/Modules/Inputs/pch-with-module-name/module.modulemap
  vendor/clang/dist/test/Modules/Inputs/pch-with-module-name/test.h   
(contents, props changed)
  vendor/clang/dist/test/Modules/pch-with-module-name.m
  vendor/clang/dist/test/Sema/diagnose_if.c   (contents, props changed)
  vendor/clang/dist/test/SemaCXX/diagnose_if.cpp   (contents, props changed)
  vendor/clang/dist/test/SemaCXX/libstdcxx_gets_hack.cpp   (contents, props 
changed)
Modified:
  vendor/clang/dist/docs/ReleaseNotes.rst
  vendor/clang/dist/include/clang/AST/Expr.h
  vendor/clang/dist/include/clang/Basic/Attr.td
  vendor/clang/dist/include/clang/Basic/AttrDocs.td
  vendor/clang/dist/include/clang/Basic/DiagnosticCommonKinds.td
  vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td
  vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td
  vendor/clang/dist/include/clang/Basic/LangOptions.def
  vendor/clang/dist/include/clang/Driver/CC1Options.td
  vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def
  vendor/clang/dist/include/clang/Frontend/FrontendActions.h
  vendor/clang/dist/include/clang/Index/IndexSymbol.h
  vendor/clang/dist/include/clang/Sema/Initialization.h
  vendor/clang/dist/include/clang/Sema/Overload.h
  vendor/clang/dist/include/clang/Sema/Sema.h
  vendor/clang/dist/include/clang/StaticAnalyzer/Checkers/Checkers.td
  vendor/clang/dist/lib/AST/ExprConstant.cpp
  vendor/clang/dist/lib/AST/MicrosoftMangle.cpp
  vendor/clang/dist/lib/CodeGen/BackendUtil.cpp
  vendor/clang/dist/lib/CodeGen/CGCleanup.h
  vendor/clang/dist/lib/CodeGen/CGException.cpp
  vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp
  vendor/clang/dist/lib/Driver/ToolChains.cpp
  vendor/clang/dist/lib/Driver/Tools.cpp
  vendor/clang/dist/lib/Format/TokenAnnotator.cpp
  vendor/clang/dist/lib/Format/UnwrappedLineParser.cpp
  vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp
  vendor/clang/dist/lib/Frontend/FrontendActions.cpp
  vendor/clang/dist/lib/Index/IndexSymbol.cpp
  vendor/clang/dist/lib/Lex/PPDirectives.cpp
  vendor/clang/dist/lib/Parse/ParseDecl.cpp
  vendor/clang/dist/lib/Parse/ParseInit.cpp
  vendor/clang/dist/lib/Sema/SemaChecking.cpp
  vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp
  vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp
  vendor/clang/dist/lib/Sema/SemaExpr.cpp
  vendor/clang/dist/lib/Sema/SemaExprMember.cpp
  vendor/clang/dist/lib/Sema/SemaInit.cpp
  vendor/clang/dist/lib/Sema/SemaLambda.cpp
  vendor/clang/dist/lib/Sema/SemaLookup.cpp
  vendor/clang/dist/lib/Sema/SemaOverload.cpp
  vendor/clang/dist/lib/Sema/SemaTemplate.cpp
  vendor/clang/dist/lib/Sema/SemaTemplateDeduction.cpp
  vendor/clang/dist/lib/Sema/SemaTemplateInstantiate.cpp
  vendor/clang/dist/lib/Sema/SemaTemplateInstantiateDecl.cpp
  vendor/clang/dist/lib/Serialization/ASTWriter.cpp
  vendor/clang/dist/lib/StaticAnalyzer/Checkers/CMakeLists.txt
  vendor/clang/dist/lib/StaticAnalyzer/Core/ExprEngine.cpp
  vendor/clang/dist/test/Analysis/Inputs/system-header-simulator-cxx.h
  vendor/clang/dist/test/Analysis/diagnostics/explicit-suppression.cpp
  vendor/clang/dist/test/Analysis/inlining/stl.cpp
  vendor/clang/dist/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p15.cpp
  vendor/clang/dist/test/CXX/drs/dr13xx.cpp
  vendor/clang/dist/test/CXX/drs/dr19xx.cpp
  vendor/clang/dist/test/CXX/expr/expr.prim/expr.prim.lambda/templates.cpp
  
vendor/clang/dist/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p1-0x.cpp
  vendor/clang/dist/test/CXX/temp/temp.param/p5.cpp
  vendor/clang/dist/test/CodeGen/lifetime2.c
  vendor/clang/dist/test/CodeGen/thinlto_backend.ll
  vendor/clang/dist/test/CodeGenCXX/arm.cpp
  vendor/clang/dist/test/CodeGenCXX/debug-info-class.cpp
  vendor/clang/dist/test/CodeGenCXX/dllexport.cpp
  vendor/clang/dist/test/CodeGenCXX/eh-aggregate-copy-destroy.cpp
  vendor/clang/dist/test/CodeGenCXX/exceptions.cpp
  vendor/clang/dist/test/CodeGenCXX/goto.cpp
  vendor/clang/dist/test/Driver/B-opt.c
  vendor/clang/dist/test/Driver/coverage-ld.c
  vendor/clang/dist/test/Driver/cross-linux.c
  vendor/clang/dist/test/Driver/fuchsia.c
  

svn commit: r311818 - in vendor/llvm/dist: cmake cmake/modules include/llvm/Analysis include/llvm/CodeGen include/llvm/DebugInfo/MSF include/llvm/ExecutionEngine/Orc include/llvm/IR include/llvm/Su...

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 21:23:09 2017
New Revision: 311818
URL: https://svnweb.freebsd.org/changeset/base/311818

Log:
  Vendor import of llvm trunk r291476:
  https://llvm.org/svn/llvm-project/llvm/trunk@291476

Added:
  vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp   
(contents, props changed)
  vendor/llvm/dist/test/Analysis/ScalarEvolution/invalidation.ll
  vendor/llvm/dist/test/CodeGen/AMDGPU/r600-legalize-umax-bug.ll
  vendor/llvm/dist/test/CodeGen/AMDGPU/store-private.ll
  vendor/llvm/dist/test/CodeGen/AVR/intrinsics/
  vendor/llvm/dist/test/CodeGen/AVR/intrinsics/read_register.ll
  vendor/llvm/dist/test/CodeGen/WebAssembly/function-bitcasts.ll
  vendor/llvm/dist/test/CodeGen/WebAssembly/unsupported-function-bitcasts.ll
  vendor/llvm/dist/test/CodeGen/X86/fmaddsub-combine.ll
  
vendor/llvm/dist/test/ExecutionEngine/RuntimeDyld/AArch64/ELF_ARM64_local_branch.s
   (contents, props changed)
  vendor/llvm/dist/test/ThinLTO/X86/Inputs/funcimport-tbaa.ll
  vendor/llvm/dist/test/ThinLTO/X86/Inputs/local_name_conflict1.ll
  vendor/llvm/dist/test/ThinLTO/X86/Inputs/local_name_conflict2.ll
  vendor/llvm/dist/test/ThinLTO/X86/funcimport-tbaa.ll
  vendor/llvm/dist/test/ThinLTO/X86/local_name_conflict.ll
  vendor/llvm/dist/test/Transforms/InstSimplify/div.ll
  vendor/llvm/dist/test/Transforms/NewGVN/basic-cyclic-opt.ll
  vendor/llvm/dist/test/Transforms/NewGVN/cyclic-phi-handling.ll
  vendor/llvm/dist/test/Transforms/NewGVN/memory-handling.ll
  vendor/llvm/dist/test/Transforms/NewGVN/pr31501.ll
  vendor/llvm/dist/test/Transforms/NewGVN/pr31573.ll
  vendor/llvm/dist/test/tools/llvm-opt-report/Inputs/dm.c   (contents, props 
changed)
  vendor/llvm/dist/test/tools/llvm-opt-report/Inputs/dm.yaml
  vendor/llvm/dist/test/tools/llvm-opt-report/func-dm.test
Modified:
  vendor/llvm/dist/cmake/config-ix.cmake
  vendor/llvm/dist/cmake/modules/AddLLVM.cmake
  vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h
  vendor/llvm/dist/include/llvm/Analysis/TargetLibraryInfo.h
  vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h
  vendor/llvm/dist/include/llvm/CodeGen/MachineFrameInfo.h
  vendor/llvm/dist/include/llvm/DebugInfo/MSF/StreamArray.h
  vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h
  vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RPCUtils.h
  vendor/llvm/dist/include/llvm/ExecutionEngine/Orc/RawByteChannel.h
  vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndexYAML.h
  vendor/llvm/dist/include/llvm/IR/PassManager.h
  vendor/llvm/dist/include/llvm/IR/User.h
  vendor/llvm/dist/include/llvm/Support/Path.h
  vendor/llvm/dist/include/llvm/Transforms/IPO.h
  vendor/llvm/dist/include/llvm/Transforms/IPO/PassManagerBuilder.h
  vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp
  vendor/llvm/dist/lib/Analysis/LoopInfo.cpp
  vendor/llvm/dist/lib/Analysis/MemoryDependenceAnalysis.cpp
  vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp
  vendor/llvm/dist/lib/Analysis/ValueTracking.cpp
  vendor/llvm/dist/lib/Bitcode/Reader/MetadataLoader.cpp
  vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  vendor/llvm/dist/lib/CodeGen/StackSlotColoring.cpp
  vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
  vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h
  vendor/llvm/dist/lib/LTO/ThinLTOCodeGenerator.cpp
  vendor/llvm/dist/lib/Object/MachOObjectFile.cpp
  vendor/llvm/dist/lib/Object/ModuleSummaryIndexObjectFile.cpp
  vendor/llvm/dist/lib/Support/CommandLine.cpp
  vendor/llvm/dist/lib/Support/Path.cpp
  vendor/llvm/dist/lib/Support/TarWriter.cpp
  vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
  vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
  vendor/llvm/dist/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
  vendor/llvm/dist/lib/Target/AMDGPU/R600ISelLowering.cpp
  vendor/llvm/dist/lib/Target/AMDGPU/R600Instructions.td
  vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.cpp
  vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.h
  vendor/llvm/dist/lib/Target/AVR/AVRISelDAGToDAG.cpp
  vendor/llvm/dist/lib/Target/AVR/AVRISelLowering.cpp
  vendor/llvm/dist/lib/Target/AVR/AVRISelLowering.h
  vendor/llvm/dist/lib/Target/BPF/BPFInstrInfo.cpp
  vendor/llvm/dist/lib/Target/BPF/Disassembler/BPFDisassembler.cpp
  vendor/llvm/dist/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp
  vendor/llvm/dist/lib/Target/BPF/MCTargetDesc/BPFELFObjectWriter.cpp
  vendor/llvm/dist/lib/Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp
  vendor/llvm/dist/lib/Target/BPF/MCTargetDesc/BPFMCTargetDesc.cpp
  vendor/llvm/dist/lib/Target/TargetMachineC.cpp
  vendor/llvm/dist/lib/Target/WebAssembly/CMakeLists.txt
  vendor/llvm/dist/lib/Target/WebAssembly/WebAssembly.h
  vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyInstrInteger.td
  vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
  vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp
  vendor/llvm/dist/lib/Target/X86/X86InstrAVX512.td
  

svn commit: r311817 - head/sys/netpfil/ipfw

2017-01-09 Thread Marius Strobl
Author: marius
Date: Mon Jan  9 20:51:51 2017
New Revision: 311817
URL: https://svnweb.freebsd.org/changeset/base/311817

Log:
  In dummynet(4), random chunks of memory are casted to struct dn_*,
  potentially leading to fatal unaligned accesses on architectures with
  strict alignment requirements. This change fixes dummynet(4) as far
  as accesses to 64-bit members of struct dn_* are concerned, tripping
  up on sparc64 with accesses to 32-bit members happening to be correctly
  aligned there. In other words, this only fixes the tip of the iceberg;
  larger parts of dummynet(4) still need to be rewritten in order to
  properly work on all of !x86.
  In principle, considering the amount of code in dummynet(4) that needs
  this erroneous pattern corrected, an acceptable workaround would be to
  declare all struct dn_* packed, forcing compilers to do byte-accesses
  as a side-effect. However, given that the structs in question aren't
  laid out well either, this would break ABI/KBI.
  While at it, replace all existing bcopy(9) calls with memcpy(9) for
  performance reasons, as there is no need to check for overlap in these
  cases.
  
  PR:   189219
  MFC after:5 days

Modified:
  head/sys/netpfil/ipfw/ip_dummynet.c

Modified: head/sys/netpfil/ipfw/ip_dummynet.c
==
--- head/sys/netpfil/ipfw/ip_dummynet.c Mon Jan  9 20:14:20 2017
(r311816)
+++ head/sys/netpfil/ipfw/ip_dummynet.c Mon Jan  9 20:51:51 2017
(r311817)
@@ -931,29 +931,35 @@ delete_schk(int i)
 static int
 copy_obj(char **start, char *end, void *_o, const char *msg, int i)
 {
-   struct dn_id *o = _o;
+   struct dn_id o;
+   union {
+   struct dn_link l;
+   struct dn_schk s;
+   } dn;
int have = end - *start;
 
-   if (have < o->len || o->len == 0 || o->type == 0) {
+   memcpy(, _o, sizeof(o));
+   if (have < o.len || o.len == 0 || o.type == 0) {
D("(WARN) type %d %s %d have %d need %d",
-   o->type, msg, i, have, o->len);
+   o.type, msg, i, have, o.len);
return 1;
}
-   ND("type %d %s %d len %d", o->type, msg, i, o->len);
-   bcopy(_o, *start, o->len);
-   if (o->type == DN_LINK) {
+   ND("type %d %s %d len %d", o.type, msg, i, o.len);
+   if (o.type == DN_LINK) {
+   memcpy(, _o, sizeof(dn.l));
/* Adjust burst parameter for link */
-   struct dn_link *l = (struct dn_link *)*start;
-   l->burst =  div64(l->burst, 8 * hz);
-   l->delay = l->delay * 1000 / hz;
-   } else if (o->type == DN_SCH) {
-   /* Set id->id to the number of instances */
-   struct dn_schk *s = _o;
-   struct dn_id *id = (struct dn_id *)(*start);
-   id->id = (s->sch.flags & DN_HAVE_MASK) ?
-   dn_ht_entries(s->siht) : (s->siht ? 1 : 0);
-   }
-   *start += o->len;
+   dn.l.burst = div64(dn.l.burst, 8 * hz);
+   dn.l.delay = dn.l.delay * 1000 / hz;
+   memcpy(*start, , sizeof(dn.l));
+   } else if (o.type == DN_SCH) {
+   /* Set dn.s.sch.oid.id to the number of instances */
+   memcpy(, _o, sizeof(dn.s));
+   dn.s.sch.oid.id = (dn.s.sch.flags & DN_HAVE_MASK) ?
+   dn_ht_entries(dn.s.siht) : (dn.s.siht ? 1 : 0);
+   memcpy(*start, , sizeof(dn.s));
+   } else
+   memcpy(*start, _o, o.len);
+   *start += o.len;
return 0;
 }
 
@@ -974,7 +980,7 @@ copy_obj_q(char **start, char *end, void
return 1;
}
ND("type %d %s %d len %d", o->type, msg, i, len);
-   bcopy(_o, *start, len);
+   memcpy(*start, _o, len);
((struct dn_id*)(*start))->len = len;
*start += len;
return 0;
@@ -1022,7 +1028,7 @@ copy_profile(struct copy_args *a, struct
D("error have %d need %d", have, profile_len);
return 1;
}
-   bcopy(p, *a->start, profile_len);
+   memcpy(*a->start, p, profile_len);
((struct dn_id *)(*a->start))->len = profile_len;
*a->start += profile_len;
return 0;
@@ -1584,6 +1590,9 @@ config_fs(struct dn_fs *nfs, struct dn_i
 {
int i;
struct dn_fsk *fs;
+#ifdef NEW_AQM
+   struct dn_extra_parms *ep;
+#endif
 
if (nfs->oid.len != sizeof(*nfs)) {
D("invalid flowset len %d", nfs->oid.len);
@@ -1592,6 +1601,15 @@ config_fs(struct dn_fs *nfs, struct dn_i
i = nfs->fs_nr;
if (i <= 0 || i >= 3*DN_MAX_ID)
return NULL;
+#ifdef NEW_AQM
+   ep = NULL;
+   if (arg != NULL) {
+   ep = malloc(sizeof(*ep), M_TEMP, locked ? M_NOWAIT : M_WAITOK);
+   if (ep == NULL)
+   return (NULL);
+   memcpy(ep, arg, sizeof(*ep));
+ 

svn commit: r311814 - stable/10/contrib/tcp_wrappers

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 20:14:02 2017
New Revision: 311814
URL: https://svnweb.freebsd.org/changeset/base/311814

Log:
  MFC r257398 (by sbruno):
  
  Quiesce warnings by updating headerfile includes
  
  r257404 | sbruno | 2013-10-30 23:41:18 +0100 (Wed, 30 Oct 2013) | 9 lines
  
  Quiesce two warnings:
  
  1.  define the CODE * as const
  2.  restructure function to eliminate warning about exiting with no return.
  severity_map() never returns when it can't find an appropriate sysylog
  facility, and it longjmp()'s away into error code handling.  Keep this
  behavior by stashing the facility value found during our search and
  checking for -1 if found.
  
  MFC r257405 (by sbruno):
  
  Quiesce warning, which could be a bug IMO, by correctly defining the host_info
  structure name
  
  MFC r257406 (by sbruno):
  
  Queisce warning about undeclared function usage.
  
  yp_get_default_domain is defined in workaround.c but is not declared
  in any header file.  Tie the declaration to the same #define conditional
  used when the function is called, NETGROUP
  
  MFC r311459:
  
  Put proper prototypes in tcpd.h
  
  Clang 4.0.0 complains about tcpd.h's not-really-prototypes, e.g.:
  
  /usr/include/tcpd.h:75:24: error: this function declaration is not a 
prototype [-Werror,-Wstrict-prototypes]
  extern int hosts_access();  /* access control */
 ^
  
  To fix this, turn these declarations into real prototypes.  While here,
  garbage collect the incompatible rfc931() function from scaffold.c, as
  it is never used.
  
  Reviewed by:  emaste
  Differential Revision:https://reviews.freebsd.org/D9052
  
  MFC r311461:
  
  Also remove unnecessary extern keywords from tcpd.h.
  
  Noticed by:   kib
  
  MFC r311556:
  
  After r311459, some ports can break, because a few of the newly added
  prototypes in  use FILE.  Pull in a minimal forward declaration
  of FILE from  to minimize impact.  Sorry for the breakage.
  
  Reported by:  Shawn Webb 

Modified:
  stable/10/contrib/tcp_wrappers/clean_exit.c
  stable/10/contrib/tcp_wrappers/hosts_access.c
  stable/10/contrib/tcp_wrappers/options.c
  stable/10/contrib/tcp_wrappers/percent_x.c
  stable/10/contrib/tcp_wrappers/rfc931.c
  stable/10/contrib/tcp_wrappers/scaffold.c
  stable/10/contrib/tcp_wrappers/shell_cmd.c
  stable/10/contrib/tcp_wrappers/tcpd.h
  stable/10/contrib/tcp_wrappers/update.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/tcp_wrappers/clean_exit.c
==
--- stable/10/contrib/tcp_wrappers/clean_exit.c Mon Jan  9 20:13:50 2017
(r311813)
+++ stable/10/contrib/tcp_wrappers/clean_exit.c Mon Jan  9 20:14:02 2017
(r311814)
@@ -13,6 +13,7 @@ static char sccsid[] = "@(#) clean_exit.
 #endif
 
 #include 
+#include 
 
 extern void exit();
 

Modified: stable/10/contrib/tcp_wrappers/hosts_access.c
==
--- stable/10/contrib/tcp_wrappers/hosts_access.c   Mon Jan  9 20:13:50 
2017(r311813)
+++ stable/10/contrib/tcp_wrappers/hosts_access.c   Mon Jan  9 20:14:02 
2017(r311814)
@@ -44,6 +44,7 @@ static char sccsid[] = "@(#) hosts_acces
 #ifdef INET6
 #include 
 #endif
+#include 
 
 extern char *fgets();
 extern int errno;
@@ -102,6 +103,11 @@ static int masked_match6();
 
 #defineBUFLEN 2048
 
+/* definition to be used from workarounds.c */
+#ifdef NETGROUP
+int yp_get_default_domain(char  **);
+#endif
+
 /* hosts_access - host access control facility */
 
 int hosts_access(request)
@@ -269,7 +275,7 @@ struct request_info *request;
 
 static int hostfile_match(path, host)
 char   *path;
-struct hosts_info *host;
+struct host_info *host;
 {
 chartok[BUFSIZ];
 int match = NO;

Modified: stable/10/contrib/tcp_wrappers/options.c
==
--- stable/10/contrib/tcp_wrappers/options.cMon Jan  9 20:13:50 2017
(r311813)
+++ stable/10/contrib/tcp_wrappers/options.cMon Jan  9 20:14:02 2017
(r311814)
@@ -50,6 +50,8 @@ static char sccsid[] = "@(#) options.c 1
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #ifndef MAXPATHNAMELEN
 #define MAXPATHNAMELEN  BUFSIZ
@@ -441,16 +443,21 @@ struct request_info *request;
 /* severity_map - lookup facility or severity value */
 
 static int severity_map(table, name)
-CODE   *table;
+const CODE   *table;
 char   *name;
 {
-CODE *t;
+const CODE *t;
+int ret = -1;
 
 for (t = table; t->c_name; t++)
-   if (STR_EQ(t->c_name, name))
-   return (t->c_val);
-tcpd_jump("bad syslog facility or severity: \"%s\"", name);
-/* NOTREACHED */
+   if (STR_EQ(t->c_name, name)) {
+   ret = t->c_val;
+   break;
+   }
+if (ret == -1)
+

svn commit: r311816 - stable/9/contrib/tcp_wrappers

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 20:14:20 2017
New Revision: 311816
URL: https://svnweb.freebsd.org/changeset/base/311816

Log:
  MFC r257398 (by sbruno):
  
  Quiesce warnings by updating headerfile includes
  
  r257404 | sbruno | 2013-10-30 23:41:18 +0100 (Wed, 30 Oct 2013) | 9 lines
  
  Quiesce two warnings:
  
  1.  define the CODE * as const
  2.  restructure function to eliminate warning about exiting with no return.
  severity_map() never returns when it can't find an appropriate sysylog
  facility, and it longjmp()'s away into error code handling.  Keep this
  behavior by stashing the facility value found during our search and
  checking for -1 if found.
  
  MFC r257405 (by sbruno):
  
  Quiesce warning, which could be a bug IMO, by correctly defining the host_info
  structure name
  
  MFC r257406 (by sbruno):
  
  Queisce warning about undeclared function usage.
  
  yp_get_default_domain is defined in workaround.c but is not declared
  in any header file.  Tie the declaration to the same #define conditional
  used when the function is called, NETGROUP
  
  MFC r272949 (by pfg):
  
  tcpd: complete function prototypes.
  
  This clears up at least a build issues on mysql-server
  ports. While here also replace some spaces with tabs
  in our headers.
  
  PR:   42336
  
  MFC r272950 (by pfg):
  
  tcpd.h: add prototype for hosts_ctl
  
  According the hosts_access(3) man page the hosts_ctl() prototype
  should be in tcpd.h. For now, follow other declarations and don't
  add the arguments in the prototype.
  
  Reference:
  https://www.illumos.org/issues/4385
  
  PR:   32808
  
  MFC r311459:
  
  Put proper prototypes in tcpd.h
  
  Clang 4.0.0 complains about tcpd.h's not-really-prototypes, e.g.:
  
  /usr/include/tcpd.h:75:24: error: this function declaration is not a 
prototype [-Werror,-Wstrict-prototypes]
  extern int hosts_access();  /* access control */
 ^
  
  To fix this, turn these declarations into real prototypes.  While here,
  garbage collect the incompatible rfc931() function from scaffold.c, as
  it is never used.
  
  Reviewed by:  emaste
  Differential Revision:https://reviews.freebsd.org/D9052
  
  MFC r311461:
  
  Also remove unnecessary extern keywords from tcpd.h.
  
  Noticed by:   kib
  
  MFC r311556:
  
  After r311459, some ports can break, because a few of the newly added
  prototypes in  use FILE.  Pull in a minimal forward declaration
  of FILE from  to minimize impact.  Sorry for the breakage.
  
  Reported by:  Shawn Webb 

Modified:
  stable/9/contrib/tcp_wrappers/clean_exit.c
  stable/9/contrib/tcp_wrappers/hosts_access.c
  stable/9/contrib/tcp_wrappers/options.c
  stable/9/contrib/tcp_wrappers/percent_x.c
  stable/9/contrib/tcp_wrappers/rfc931.c
  stable/9/contrib/tcp_wrappers/scaffold.c
  stable/9/contrib/tcp_wrappers/shell_cmd.c
  stable/9/contrib/tcp_wrappers/tcpd.h
  stable/9/contrib/tcp_wrappers/update.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/contrib/   (props changed)

Modified: stable/9/contrib/tcp_wrappers/clean_exit.c
==
--- stable/9/contrib/tcp_wrappers/clean_exit.c  Mon Jan  9 20:14:18 2017
(r311815)
+++ stable/9/contrib/tcp_wrappers/clean_exit.c  Mon Jan  9 20:14:20 2017
(r311816)
@@ -13,6 +13,7 @@ static char sccsid[] = "@(#) clean_exit.
 #endif
 
 #include 
+#include 
 
 extern void exit();
 

Modified: stable/9/contrib/tcp_wrappers/hosts_access.c
==
--- stable/9/contrib/tcp_wrappers/hosts_access.cMon Jan  9 20:14:18 
2017(r311815)
+++ stable/9/contrib/tcp_wrappers/hosts_access.cMon Jan  9 20:14:20 
2017(r311816)
@@ -44,6 +44,7 @@ static char sccsid[] = "@(#) hosts_acces
 #ifdef INET6
 #include 
 #endif
+#include 
 
 extern char *fgets();
 extern int errno;
@@ -102,6 +103,11 @@ static int masked_match6();
 
 #defineBUFLEN 2048
 
+/* definition to be used from workarounds.c */
+#ifdef NETGROUP
+int yp_get_default_domain(char  **);
+#endif
+
 /* hosts_access - host access control facility */
 
 int hosts_access(request)
@@ -269,7 +275,7 @@ struct request_info *request;
 
 static int hostfile_match(path, host)
 char   *path;
-struct hosts_info *host;
+struct host_info *host;
 {
 chartok[BUFSIZ];
 int match = NO;

Modified: stable/9/contrib/tcp_wrappers/options.c
==
--- stable/9/contrib/tcp_wrappers/options.c Mon Jan  9 20:14:18 2017
(r311815)
+++ stable/9/contrib/tcp_wrappers/options.c Mon Jan  9 20:14:20 2017
(r311816)
@@ -50,6 +50,8 @@ static char sccsid[] = "@(#) options.c 1
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #ifndef MAXPATHNAMELEN
 #define MAXPATHNAMELEN  

svn commit: r311815 - head/sys/fs/pseudofs

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 20:14:18 2017
New Revision: 311815
URL: https://svnweb.freebsd.org/changeset/base/311815

Log:
  Forcibly remove the cached items from pseudofs vncache on module unload.
  
  If some process' nodes were accessed using procfs and the process
  cannot exit properly at the time modunload event is reported to the
  pseudofs-backed filesystem, the assertion in pfs_vncache_unload() is
  triggered.  Assertion is correct, the cache should be cleaned.
  
  Approved by:  des (pseudofs maintainer)
  Reported and tested by:   pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/fs/pseudofs/pseudofs_vncache.c

Modified: head/sys/fs/pseudofs/pseudofs_vncache.c
==
--- head/sys/fs/pseudofs/pseudofs_vncache.c Mon Jan  9 20:14:02 2017
(r311814)
+++ head/sys/fs/pseudofs/pseudofs_vncache.c Mon Jan  9 20:14:18 2017
(r311815)
@@ -51,6 +51,7 @@ static struct mtx pfs_vncache_mutex;
 static struct pfs_vdata *pfs_vncache;
 static eventhandler_tag pfs_exit_tag;
 static void pfs_exit(void *arg, struct proc *p);
+static void pfs_purge_locked(struct pfs_node *pn, bool force);
 
 static SYSCTL_NODE(_vfs_pfs, OID_AUTO, vncache, CTLFLAG_RW, 0,
 "pseudofs vnode cache");
@@ -97,6 +98,9 @@ pfs_vncache_unload(void)
 {
 
EVENTHANDLER_DEREGISTER(process_exit, pfs_exit_tag);
+   mtx_lock(_vncache_mutex);
+   pfs_purge_locked(NULL, true);
+   mtx_unlock(_vncache_mutex);
KASSERT(pfs_vncache_entries == 0,
("%d vncache entries remaining", pfs_vncache_entries));
mtx_destroy(_vncache_mutex);
@@ -272,7 +276,7 @@ pfs_vncache_free(struct vnode *vp)
  * used to implement the cache.
  */
 static void
-pfs_purge_locked(struct pfs_node *pn)
+pfs_purge_locked(struct pfs_node *pn, bool force)
 {
struct pfs_vdata *pvd;
struct vnode *vnp;
@@ -280,7 +284,8 @@ pfs_purge_locked(struct pfs_node *pn)
mtx_assert(_vncache_mutex, MA_OWNED);
pvd = pfs_vncache;
while (pvd != NULL) {
-   if (pvd->pvd_dead || (pn != NULL && pvd->pvd_pn == pn)) {
+   if (force || pvd->pvd_dead ||
+   (pn != NULL && pvd->pvd_pn == pn)) {
vnp = pvd->pvd_vnode;
vhold(vnp);
mtx_unlock(_vncache_mutex);
@@ -301,7 +306,7 @@ pfs_purge(struct pfs_node *pn)
 {
 
mtx_lock(_vncache_mutex);
-   pfs_purge_locked(pn);
+   pfs_purge_locked(pn, false);
mtx_unlock(_vncache_mutex);
 }
 
@@ -321,6 +326,6 @@ pfs_exit(void *arg, struct proc *p)
if (pvd->pvd_pid == p->p_pid)
dead = pvd->pvd_dead = 1;
if (dead)
-   pfs_purge_locked(NULL);
+   pfs_purge_locked(NULL, false);
mtx_unlock(_vncache_mutex);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311813 - stable/11/contrib/tcp_wrappers

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 20:13:50 2017
New Revision: 311813
URL: https://svnweb.freebsd.org/changeset/base/311813

Log:
  MFC r311459:
  
  Put proper prototypes in tcpd.h
  
  Clang 4.0.0 complains about tcpd.h's not-really-prototypes, e.g.:
  
  /usr/include/tcpd.h:75:24: error: this function declaration is not a 
prototype [-Werror,-Wstrict-prototypes]
  extern int hosts_access();  /* access control */
 ^
  
  To fix this, turn these declarations into real prototypes.  While here,
  garbage collect the incompatible rfc931() function from scaffold.c, as
  it is never used.
  
  Reviewed by:  emaste
  Differential Revision:https://reviews.freebsd.org/D9052
  
  MFC r311461:
  
  Also remove unnecessary extern keywords from tcpd.h.
  
  Noticed by:   kib
  
  MFC r311556:
  
  After r311459, some ports can break, because a few of the newly added
  prototypes in  use FILE.  Pull in a minimal forward declaration
  of FILE from  to minimize impact.  Sorry for the breakage.
  
  Reported by:  Shawn Webb 

Modified:
  stable/11/contrib/tcp_wrappers/scaffold.c
  stable/11/contrib/tcp_wrappers/tcpd.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/tcp_wrappers/scaffold.c
==
--- stable/11/contrib/tcp_wrappers/scaffold.c   Mon Jan  9 19:42:22 2017
(r311812)
+++ stable/11/contrib/tcp_wrappers/scaffold.c   Mon Jan  9 20:13:50 2017
(r311813)
@@ -235,16 +235,6 @@ struct request_info *request;
 exit(0);
 }
 
-/* dummy function  to intercept the real rfc931() */
-
-/* ARGSUSED */
-
-voidrfc931(request)
-struct request_info *request;
-{
-strcpy(request->user, unknown);
-}
-
 /* check_path - examine accessibility */
 
 int check_path(path, st)

Modified: stable/11/contrib/tcp_wrappers/tcpd.h
==
--- stable/11/contrib/tcp_wrappers/tcpd.h   Mon Jan  9 19:42:22 2017
(r311812)
+++ stable/11/contrib/tcp_wrappers/tcpd.h   Mon Jan  9 20:13:50 2017
(r311813)
@@ -6,6 +6,17 @@
   * $FreeBSD$
   */
 
+#ifdef INET6
+#defineTCPD_SOCKADDR struct sockaddr
+#else
+#defineTCPD_SOCKADDR struct sockaddr_in
+#endif
+
+#ifndef _STDFILE_DECLARED
+#define _STDFILE_DECLARED
+typedef struct __sFILE FILE;
+#endif
+
 /* Structure to describe one communications endpoint. */
 
 #defineSTRING_LENGTH   128 /* hosts, users, processes */
@@ -13,11 +24,7 @@
 struct host_info {
 charname[STRING_LENGTH];   /* access via eval_hostname(host) */
 charaddr[STRING_LENGTH];   /* access via eval_hostaddr(host) */
-#ifdef INET6
-struct sockaddr *sin;  /* socket address or 0 */
-#else
-struct sockaddr_in *sin;   /* socket address or 0 */
-#endif
+TCPD_SOCKADDR *sin;/* socket address or 0 */
 struct t_unitdata *unit;   /* TLI transport address or 0 */
 struct request_info *request;  /* for shared information */
 };
@@ -67,21 +74,22 @@ extern char paranoid[];
 /* Global functions. */
 
 #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
-extern void fromhost();/* get/validate client host 
info */
+void fromhost(struct request_info *);  /* get/validate client host info */
 #else
 #definefromhost sock_host  /* no TLI support needed */
 #endif
 
-extern int hosts_access(); /* access control */
-extern int hosts_ctl();/* wrapper around 
request_init() */
-extern void shell_cmd();   /* execute shell command */
-extern char *percent_x();  /* do % expansion */
-extern void rfc931();  /* client name from RFC 931 daemon */
-extern void clean_exit();  /* clean up and exit */
-extern void refuse();  /* clean up and exit */
-extern char *xgets();  /* fgets() on steroids */
-extern char *split_at();   /* strchr() and split */
-extern unsigned long dot_quad_addr();  /* restricted inet_addr() */
+int hosts_access(struct request_info *);   /* access 
control */
+int hosts_ctl(char *, char *, char *, char *); /* wrapper 
around request_init() */
+void shell_cmd(char *);/* 
execute shell command */
+char *percent_x(char *, int, char *, struct request_info *);   /* do % 
expansion */
+void rfc931(TCPD_SOCKADDR *, TCPD_SOCKADDR *, char *); /* client name 
from RFC 931 daemon */
+void clean_exit(struct request_info *);/* 
clean up and exit */
+void refuse(struct request_info *);/* clean up and 
exit */
+char *xgets(char *, int, FILE *);  /* fgets() on 
steroids */
+
+char 

svn commit: r311811 - head/usr.sbin/mfiutil

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 19:39:35 2017
New Revision: 311811
URL: https://svnweb.freebsd.org/changeset/base/311811

Log:
  Avoid taking the address of a packed struct member in mfiutil
  
  Fix a clang 4.0.0 warning about taking the address of a packed member of
  struct mfi_evt in mfiutil:
  
  usr.sbin/mfiutil/mfi_evt.c:583:30: error: taking address of packed
  member 'members' of class or structure 'mfi_evt' may result in an
  unaligned pointer value [-Werror,-Waddress-of-packed-member]
  if (parse_locale(optarg, ) 
< 0) {
^
  
  Use a local variable instead, and copy that into the struct.
  
  Reviewed by:  jhb
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D9069

Modified:
  head/usr.sbin/mfiutil/mfi_evt.c

Modified: head/usr.sbin/mfiutil/mfi_evt.c
==
--- head/usr.sbin/mfiutil/mfi_evt.c Mon Jan  9 19:37:17 2017
(r311810)
+++ head/usr.sbin/mfiutil/mfi_evt.c Mon Jan  9 19:39:35 2017
(r311811)
@@ -540,6 +540,7 @@ show_events(int ac, char **av)
char *cp;
ssize_t size;
uint32_t seq, start, stop;
+   uint16_t locale;
uint8_t status;
int ch, error, fd, num_events, verbose;
u_int i;
@@ -580,12 +581,13 @@ show_events(int ac, char **av)
}
break;
case 'l':
-   if (parse_locale(optarg, ) < 0) {
+   if (parse_locale(optarg, ) < 0) {
error = errno;
warn("Error parsing event locale");
close(fd);
return (error);
}
+   filter.members.locale = locale;
break;
case 'n':
val = strtol(optarg, , 0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311809 - in stable/11/sys: conf dev/ichiic modules/i2c/controllers/ichiic

2017-01-09 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jan  9 19:32:57 2017
New Revision: 311809
URL: https://svnweb.freebsd.org/changeset/base/311809

Log:
  MFC r310621:
  
  [ig4] Add ACPI platform support for ig4 driver
  
  Add ACPI part for ig4 driver to make it work on Intel BayTrail SoC where
  ig4 device is available only through ACPI
  
  Reviewed by:  avg
  Differential Revision:https://reviews.freebsd.org/D8742

Added:
  stable/11/sys/dev/ichiic/ig4_acpi.c
 - copied unchanged from r310621, head/sys/dev/ichiic/ig4_acpi.c
Modified:
  stable/11/sys/conf/files
  stable/11/sys/dev/ichiic/ig4_iic.c
  stable/11/sys/dev/ichiic/ig4_pci.c
  stable/11/sys/dev/ichiic/ig4_var.h
  stable/11/sys/modules/i2c/controllers/ichiic/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/conf/files
==
--- stable/11/sys/conf/filesMon Jan  9 19:25:49 2017(r311808)
+++ stable/11/sys/conf/filesMon Jan  9 19:32:57 2017(r311809)
@@ -1614,6 +1614,7 @@ dev/hptiop/hptiop.c   optional hptiop scb
 dev/hwpmc/hwpmc_logging.c  optional hwpmc
 dev/hwpmc/hwpmc_mod.c  optional hwpmc
 dev/hwpmc/hwpmc_soft.c optional hwpmc
+dev/ichiic/ig4_acpi.c  optional ig4 acpi iicbus
 dev/ichiic/ig4_iic.c   optional ig4 iicbus
 dev/ichiic/ig4_pci.c   optional ig4 pci iicbus
 dev/ichsmb/ichsmb.coptional ichsmb

Copied: stable/11/sys/dev/ichiic/ig4_acpi.c (from r310621, 
head/sys/dev/ichiic/ig4_acpi.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/sys/dev/ichiic/ig4_acpi.c Mon Jan  9 19:32:57 2017
(r311809, copy of r310621, head/sys/dev/ichiic/ig4_acpi.c)
@@ -0,0 +1,166 @@
+/*-
+ * Copyright (c) 2016 Oleksandr Tymoshenko 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include "opt_acpi.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+static int ig4iic_acpi_probe(device_t dev);
+static int ig4iic_acpi_attach(device_t dev);
+static int ig4iic_acpi_detach(device_t dev);
+
+static char *ig4iic_ids[] = {
+   "INT33C2",
+   "INT33C3",
+   "INT3432",
+   "INT3433",
+   "80860F41",
+   "808622C1",
+   "AMDI0510",
+   "APMC0D0F",
+   NULL
+};
+
+static int
+ig4iic_acpi_probe(device_t dev)
+{
+
+   if (acpi_disabled("ig4iic") ||
+   ACPI_ID_PROBE(device_get_parent(dev), dev, ig4iic_ids) == NULL)
+   return (ENXIO);
+
+   device_set_desc(dev, "Designware I2C Controller");
+   return (0);
+}
+
+static int
+ig4iic_acpi_attach(device_t dev)
+{
+   ig4iic_softc_t  *sc;
+   int error;
+
+   sc = device_get_softc(dev);
+
+   sc->dev = dev;
+   sc->regs_rid = 0;
+   sc->regs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+ >regs_rid, RF_ACTIVE);
+   if (sc->regs_res == NULL) {
+   device_printf(dev, "unable to map registers\n");
+   ig4iic_acpi_detach(dev);
+   return (ENXIO);
+   }
+   sc->intr_rid = 0;
+   sc->intr_res = bus_alloc_resource_any(dev, SYS_RES_IRQ,
+ >intr_rid, RF_SHAREABLE | 
RF_ACTIVE);
+   if (sc->intr_res == NULL) {
+   device_printf(dev, "unable to map interrupt\n");
+   ig4iic_acpi_detach(dev);
+   return (ENXIO);
+   }
+   

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

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 19:22:29 2017
New Revision: 311807
URL: https://svnweb.freebsd.org/changeset/base/311807

Log:
  Add recently added libc++ headers to OptionalObsoleteFiles.inc.
  
  MFC after:3 days

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

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Jan  9 19:12:41 
2017(r311806)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Mon Jan  9 19:22:29 
2017(r311807)
@@ -4438,6 +4438,8 @@ OLD_FILES+=usr/lib/libcxxrt.a
 OLD_FILES+=usr/lib/libcxxrt.so
 OLD_FILES+=usr/lib/libcxxrt_p.a
 OLD_FILES+=usr/include/c++/v1/__bit_reference
+OLD_FILES+=usr/include/c++/v1/__bsd_locale_defaults.h
+OLD_FILES+=usr/include/c++/v1/__bsd_locale_fallbacks.h
 OLD_FILES+=usr/include/c++/v1/__config
 OLD_FILES+=usr/include/c++/v1/__debug
 OLD_FILES+=usr/include/c++/v1/__functional_03
@@ -4446,10 +4448,12 @@ OLD_FILES+=usr/include/c++/v1/__function
 OLD_FILES+=usr/include/c++/v1/__hash_table
 OLD_FILES+=usr/include/c++/v1/__locale
 OLD_FILES+=usr/include/c++/v1/__mutex_base
+OLD_FILES+=usr/include/c++/v1/__nullptr
 OLD_FILES+=usr/include/c++/v1/__refstring
 OLD_FILES+=usr/include/c++/v1/__split_buffer
 OLD_FILES+=usr/include/c++/v1/__sso_allocator
 OLD_FILES+=usr/include/c++/v1/__std_stream
+OLD_FILES+=usr/include/c++/v1/__threading_support
 OLD_FILES+=usr/include/c++/v1/__tree
 OLD_FILES+=usr/include/c++/v1/__tuple
 OLD_FILES+=usr/include/c++/v1/__undef___deallocate
@@ -4485,30 +4489,51 @@ OLD_FILES+=usr/include/c++/v1/cstdlib
 OLD_FILES+=usr/include/c++/v1/cstring
 OLD_FILES+=usr/include/c++/v1/ctgmath
 OLD_FILES+=usr/include/c++/v1/ctime
+OLD_FILES+=usr/include/c++/v1/ctype.h
 OLD_FILES+=usr/include/c++/v1/cwchar
 OLD_FILES+=usr/include/c++/v1/cwctype
 OLD_FILES+=usr/include/c++/v1/cxxabi.h
 OLD_FILES+=usr/include/c++/v1/deque
+OLD_FILES+=usr/include/c++/v1/errno.h
 OLD_FILES+=usr/include/c++/v1/exception
 OLD_FILES+=usr/include/c++/v1/experimental/__config
+OLD_FILES+=usr/include/c++/v1/experimental/__memory
+OLD_FILES+=usr/include/c++/v1/experimental/algorithm
+OLD_FILES+=usr/include/c++/v1/experimental/any
 OLD_FILES+=usr/include/c++/v1/experimental/chrono
+OLD_FILES+=usr/include/c++/v1/experimental/deque
 OLD_FILES+=usr/include/c++/v1/experimental/dynarray
-OLD_FILES+=usr/include/c++/v1/experimental/dynarray
+OLD_FILES+=usr/include/c++/v1/experimental/filesystem
+OLD_FILES+=usr/include/c++/v1/experimental/forward_list
+OLD_FILES+=usr/include/c++/v1/experimental/functional
+OLD_FILES+=usr/include/c++/v1/experimental/iterator
+OLD_FILES+=usr/include/c++/v1/experimental/list
+OLD_FILES+=usr/include/c++/v1/experimental/map
+OLD_FILES+=usr/include/c++/v1/experimental/memory_resource
 OLD_FILES+=usr/include/c++/v1/experimental/optional
+OLD_FILES+=usr/include/c++/v1/experimental/propagate_const
 OLD_FILES+=usr/include/c++/v1/experimental/ratio
+OLD_FILES+=usr/include/c++/v1/experimental/regex
+OLD_FILES+=usr/include/c++/v1/experimental/set
+OLD_FILES+=usr/include/c++/v1/experimental/string
 OLD_FILES+=usr/include/c++/v1/experimental/string_view
 OLD_FILES+=usr/include/c++/v1/experimental/system_error
 OLD_FILES+=usr/include/c++/v1/experimental/tuple
 OLD_FILES+=usr/include/c++/v1/experimental/type_traits
+OLD_FILES+=usr/include/c++/v1/experimental/unordered_map
+OLD_FILES+=usr/include/c++/v1/experimental/unordered_set
 OLD_FILES+=usr/include/c++/v1/experimental/utility
+OLD_FILES+=usr/include/c++/v1/experimental/vector
 OLD_FILES+=usr/include/c++/v1/ext/__hash
 OLD_FILES+=usr/include/c++/v1/ext/hash_map
 OLD_FILES+=usr/include/c++/v1/ext/hash_set
+OLD_FILES+=usr/include/c++/v1/float.h
 OLD_FILES+=usr/include/c++/v1/forward_list
 OLD_FILES+=usr/include/c++/v1/fstream
 OLD_FILES+=usr/include/c++/v1/functional
 OLD_FILES+=usr/include/c++/v1/future
 OLD_FILES+=usr/include/c++/v1/initializer_list
+OLD_FILES+=usr/include/c++/v1/inttypes.h
 OLD_FILES+=usr/include/c++/v1/iomanip
 OLD_FILES+=usr/include/c++/v1/ios
 OLD_FILES+=usr/include/c++/v1/iosfwd
@@ -4519,6 +4544,7 @@ OLD_FILES+=usr/include/c++/v1/limits
 OLD_FILES+=usr/include/c++/v1/list
 OLD_FILES+=usr/include/c++/v1/locale
 OLD_FILES+=usr/include/c++/v1/map
+OLD_FILES+=usr/include/c++/v1/math.h
 OLD_FILES+=usr/include/c++/v1/memory
 OLD_FILES+=usr/include/c++/v1/mutex
 OLD_FILES+=usr/include/c++/v1/new
@@ -4530,17 +4556,25 @@ OLD_FILES+=usr/include/c++/v1/ratio
 OLD_FILES+=usr/include/c++/v1/regex
 OLD_FILES+=usr/include/c++/v1/scoped_allocator
 OLD_FILES+=usr/include/c++/v1/set
+OLD_FILES+=usr/include/c++/v1/setjmp.h
 OLD_FILES+=usr/include/c++/v1/shared_mutex
 OLD_FILES+=usr/include/c++/v1/sstream
 OLD_FILES+=usr/include/c++/v1/stack
+OLD_FILES+=usr/include/c++/v1/stdbool.h
+OLD_FILES+=usr/include/c++/v1/stddef.h
 OLD_FILES+=usr/include/c++/v1/stdexcept
+OLD_FILES+=usr/include/c++/v1/stdio.h
+OLD_FILES+=usr/include/c++/v1/stdlib.h
 

svn commit: r311806 - head

2017-01-09 Thread Dimitry Andric
Author: dim
Date: Mon Jan  9 19:12:41 2017
New Revision: 311806
URL: https://svnweb.freebsd.org/changeset/base/311806

Log:
  After r311565, also remove llvm-ranlib from ObsoleteFiles.inc.

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Mon Jan  9 18:35:41 2017(r311805)
+++ head/ObsoleteFiles.inc  Mon Jan  9 19:12:41 2017(r311806)
@@ -2260,7 +2260,6 @@ OLD_LIBS+=usr/lib32/private/libyaml.so.1
 OLD_FILES+=usr/lib32/private/libyaml_p.a
 # 20140216: new clang import which bumps version from 3.3 to 3.4.
 OLD_FILES+=usr/bin/llvm-prof
-OLD_FILES+=usr/bin/llvm-ranlib
 OLD_FILES+=usr/include/clang/3.3/__wmmintrin_aes.h
 OLD_FILES+=usr/include/clang/3.3/__wmmintrin_pclmul.h
 OLD_FILES+=usr/include/clang/3.3/altivec.h
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311804 - in head: sys/cam/ctl usr.bin/ctlstat

2017-01-09 Thread Alexander Motin
Author: mav
Date: Mon Jan  9 18:18:15 2017
New Revision: 311804
URL: https://svnweb.freebsd.org/changeset/base/311804

Log:
  Rewrite CTL statistics in more simple and scalable way.
  
  Instead of collecting statistics for each combination of ports and logical
  units, that consumed ~45KB per LU with present number of ports, collect
  separate statistics for every port and every logical unit separately, that
  consume only 176 bytes per each single LU/port.  This reduces struct
  ctl_lun size down to just 6KB.
  
  Also new IOCTL API/ABI does not hardcode number of LUs/ports, and should
  allow handling of very large quantities.
  
  MFC after:2 weeks (probably keeping old API enabled for some time)

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_backend.h
  head/sys/cam/ctl/ctl_frontend.c
  head/sys/cam/ctl/ctl_frontend.h
  head/sys/cam/ctl/ctl_ioctl.h
  head/sys/cam/ctl/ctl_private.h
  head/usr.bin/ctlstat/ctlstat.8
  head/usr.bin/ctlstat/ctlstat.c

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Mon Jan  9 17:25:23 2017(r311803)
+++ head/sys/cam/ctl/ctl.c  Mon Jan  9 18:18:15 2017(r311804)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2003-2009 Silicon Graphics International Corp.
  * Copyright (c) 2012 The FreeBSD Foundation
- * Copyright (c) 2015 Alexander Motin 
+ * Copyright (c) 2014-2017 Alexander Motin 
  * All rights reserved.
  *
  * Portions of this software were developed by Edward Tomasz Napierala
@@ -2567,6 +2567,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
  struct thread *td)
 {
struct ctl_softc *softc = dev->si_drv1;
+   struct ctl_port *port;
struct ctl_lun *lun;
int retval;
 
@@ -2778,6 +2779,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 #endif /* CTL_IO_DELAY */
break;
}
+#ifdef CTL_LEGACY_STATS
case CTL_GETSTATS: {
struct ctl_stats *stats = (struct ctl_stats *)addr;
int i;
@@ -2790,26 +2792,26 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
stats->status = CTL_SS_OK;
stats->fill_len = 0;
STAILQ_FOREACH(lun, >lun_list, links) {
-   if (stats->fill_len + sizeof(lun->stats) >
+   if (stats->fill_len + sizeof(lun->legacy_stats) >
stats->alloc_len) {
stats->status = CTL_SS_NEED_MORE_SPACE;
break;
}
-   retval = copyout(>stats, >lun_stats[i++],
-sizeof(lun->stats));
+   retval = copyout(>legacy_stats, 
>lun_stats[i++],
+sizeof(lun->legacy_stats));
if (retval != 0)
break;
-   stats->fill_len += sizeof(lun->stats);
+   stats->fill_len += sizeof(lun->legacy_stats);
}
stats->num_luns = softc->num_luns;
-#ifdef CTL_TIME_IO
-   stats->flags = CTL_STATS_FLAG_TIME_VALID;
-#else
stats->flags = CTL_STATS_FLAG_NONE;
+#ifdef CTL_TIME_IO
+   stats->flags |= CTL_STATS_FLAG_TIME_VALID;
 #endif
getnanouptime(>timestamp);
break;
}
+#endif /* CTL_LEGACY_STATS */
case CTL_ERROR_INJECT: {
struct ctl_error_desc *err_desc, *new_err_desc;
 
@@ -3397,6 +3399,72 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
ctl_isc_announce_port(port);
break;
}
+   case CTL_GET_LUN_STATS: {
+   struct ctl_get_io_stats *stats = (struct ctl_get_io_stats 
*)addr;
+   int i;
+
+   /*
+* XXX KDM no locking here.  If the LUN list changes,
+* things can blow up.
+*/
+   i = 0;
+   stats->status = CTL_SS_OK;
+   stats->fill_len = 0;
+   STAILQ_FOREACH(lun, >lun_list, links) {
+   if (lun->lun < stats->first_item)
+   continue;
+   if (stats->fill_len + sizeof(lun->stats) >
+   stats->alloc_len) {
+   stats->status = CTL_SS_NEED_MORE_SPACE;
+   break;
+   }
+   retval = copyout(>stats, >stats[i++],
+sizeof(lun->stats));
+   if (retval != 0)
+   break;
+   stats->fill_len += sizeof(lun->stats);
+   }
+   stats->num_items = softc->num_luns;
+   stats->flags = CTL_STATS_FLAG_NONE;
+#ifdef CTL_TIME_IO
+   stats->flags |= 

Re: svn commit: r311667 - in head/sys/contrib/dev/acpica: components/namespace components/tables include

2017-01-09 Thread Jung-uk Kim

On 01/09/2017 12:08, John Baldwin wrote:

On Sunday, January 08, 2017 06:26:33 AM Conrad E. Meyer wrote:

Author: cem
Date: Sun Jan  8 06:26:33 2017
New Revision: 311667
URL: https://svnweb.freebsd.org/changeset/base/311667

Log:
  Add some additional ACPI methods for DRM

  Add AcpiGetDataFull and AcpiGetTableWithSize.

  Submitted by: Matt Macy


Have these been submitted upstream?  The Intel folks are generally quite
responsive on freebsd-a...@freebsd.org and this codebase is actively
maintained externally.


Please submit upstream first.

https://github.com/acpica/acpica

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


svn commit: r311803 - in stable/11/sys/compat/linuxkpi/common: include/linux src

2017-01-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan  9 17:25:23 2017
New Revision: 311803
URL: https://svnweb.freebsd.org/changeset/base/311803

Log:
  MFC r310559 and r310583:
  Implement register and unregister chrdev in the LinuxKPI.
  
  Obtained from:kmacy @
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/compat/linuxkpi/common/include/linux/cdev.h
  stable/11/sys/compat/linuxkpi/common/include/linux/fs.h
  stable/11/sys/compat/linuxkpi/common/src/linux_compat.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/cdev.h
==
--- stable/11/sys/compat/linuxkpi/common/include/linux/cdev.h   Mon Jan  9 
17:20:04 2017(r311802)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/cdev.h   Mon Jan  9 
17:25:23 2017(r311803)
@@ -95,7 +95,7 @@ cdev_add(struct linux_cdev *cdev, dev_t 
args.mda_gid = 0;
args.mda_mode = 0700;
args.mda_si_drv1 = cdev;
-   args.mda_unit = MINOR(dev);
+   args.mda_unit = dev;
 
error = make_dev_s(, >cdev, "%s",
kobject_name(>kobj));
@@ -121,7 +121,7 @@ cdev_add_ext(struct linux_cdev *cdev, de
args.mda_gid = gid;
args.mda_mode = mode;
args.mda_si_drv1 = cdev;
-   args.mda_unit = MINOR(dev);
+   args.mda_unit = dev;
 
error = make_dev_s(, >cdev, "%s/%d",
kobject_name(>kobj), MINOR(dev));
@@ -142,6 +142,8 @@ cdev_del(struct linux_cdev *cdev)
kobject_put(>kobj);
 }
 
+struct linux_cdev *linux_find_cdev(const char *name, unsigned major, unsigned 
minor);
+
 #definecdevlinux_cdev
 
 #endif /* _LINUX_CDEV_H_ */

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/fs.h
==
--- stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Mon Jan  9 
17:20:04 2017(r311802)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Mon Jan  9 
17:25:23 2017(r311803)
@@ -2,7 +2,7 @@
  * Copyright (c) 2010 Isilon Systems, Inc.
  * Copyright (c) 2010 iX Systems, Inc.
  * Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2016 Mellanox Technologies, Ltd.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -151,6 +151,39 @@ struct file_operations {
 #defineFMODE_WRITE FWRITE
 #defineFMODE_EXEC  FEXEC
 
+int __register_chrdev(unsigned int major, unsigned int baseminor,
+unsigned int count, const char *name,
+const struct file_operations *fops);
+int __register_chrdev_p(unsigned int major, unsigned int baseminor,
+unsigned int count, const char *name,
+const struct file_operations *fops, uid_t uid,
+gid_t gid, int mode);
+void __unregister_chrdev(unsigned int major, unsigned int baseminor,
+unsigned int count, const char *name);
+
+static inline void
+unregister_chrdev(unsigned int major, const char *name)
+{
+
+   __unregister_chrdev(major, 0, 256, name);
+}
+
+static inline int
+register_chrdev(unsigned int major, const char *name,
+const struct file_operations *fops)
+{
+
+   return (__register_chrdev(major, 0, 256, name, fops));
+}
+
+static inline int
+register_chrdev_p(unsigned int major, const char *name,
+const struct file_operations *fops, uid_t uid, gid_t gid, int mode)
+{
+
+   return (__register_chrdev_p(major, 0, 256, name, fops, uid, gid, mode));
+}
+
 static inline int
 register_chrdev_region(dev_t dev, unsigned range, const char *name)
 {
@@ -184,7 +217,7 @@ static inline dev_t
 iminor(struct inode *inode)
 {
 
-   return dev2unit(inode->v_rdev);
+   return (minor(dev2unit(inode->v_rdev)));
 }
 
 static inline struct inode *

Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Mon Jan  9 
17:20:04 2017(r311802)
+++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Mon Jan  9 
17:25:23 2017(r311803)
@@ -1418,6 +1418,82 @@ linux_irq_handler(void *ent)
irqe->handler(irqe->irq, irqe->arg);
 }
 
+struct linux_cdev *
+linux_find_cdev(const char *name, unsigned major, unsigned minor)
+{
+   int unit = MKDEV(major, minor);
+   struct cdev *cdev;
+
+   dev_lock();
+   LIST_FOREACH(cdev, _devs, si_list) {
+   struct linux_cdev *ldev = cdev->si_drv1;
+   if (dev2unit(cdev) == unit &&
+   strcmp(kobject_name(>kobj), name) == 0) {
+   break;
+   }
+   }
+   dev_unlock();
+
+   return (cdev != NULL ? cdev->si_drv1 : NULL);
+}
+
+int
+__register_chrdev(unsigned int major, unsigned int baseminor,
+unsigned int count, const char *name,
+const 

svn commit: r311802 - stable/11/sys/compat/linuxkpi/common/include/linux

2017-01-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan  9 17:20:04 2017
New Revision: 311802
URL: https://svnweb.freebsd.org/changeset/base/311802

Log:
  MFC r310589:
  Implement more list header file functions.
  Add definition guard for the list_head structure.
  
  Obtained from:kmacy @
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/compat/linuxkpi/common/include/linux/list.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/list.h
==
--- stable/11/sys/compat/linuxkpi/common/include/linux/list.h   Mon Jan  9 
17:18:39 2017(r311801)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/list.h   Mon Jan  9 
17:20:04 2017(r311802)
@@ -72,10 +72,18 @@
 
 #defineprefetch(x)
 
+#define LINUX_LIST_HEAD_INIT(name) { &(name), &(name) }
+
+#define LINUX_LIST_HEAD(name) \
+   struct list_head name = LINUX_LIST_HEAD_INIT(name)
+
+#ifndef LIST_HEAD_DEF
+#defineLIST_HEAD_DEF
 struct list_head {
struct list_head *next;
struct list_head *prev;
 };
+#endif
 
 static inline void
 INIT_LIST_HEAD(struct list_head *list)
@@ -91,12 +99,26 @@ list_empty(const struct list_head *head)
return (head->next == head);
 }
 
+static inline int
+list_empty_careful(const struct list_head *head)
+{
+   struct list_head *next = head->next;
+
+   return ((next == head) && (next == head->prev));
+}
+
+static inline void
+__list_del(struct list_head *prev, struct list_head *next)
+{
+   next->prev = prev;
+   WRITE_ONCE(prev->next, next);
+}
+
 static inline void
 list_del(struct list_head *entry)
 {
 
-   entry->next->prev = entry->prev;
-   entry->prev->next = entry->next;
+   __list_del(entry->prev, entry->next);
 }
 
 static inline void
@@ -183,6 +205,11 @@ list_del_init(struct list_head *entry)
for (p = list_entry((h)->prev, typeof(*p), field); &(p)->field != (h); \
p = list_entry((p)->field.prev, typeof(*p), field))
 
+#definelist_for_each_entry_safe_reverse(p, n, h, field)
\
+   for (p = list_entry((h)->prev, typeof(*p), field),  \
+   n = list_entry((p)->field.prev, typeof(*p), field); &(p)->field != 
(h); \
+   p = n, n = list_entry(n->field.prev, typeof(*n), field))
+
 #definelist_for_each_entry_continue_reverse(p, h, field) \
for (p = list_entry((p)->field.prev, typeof(*p), field); &(p)->field != 
(h); \
p = list_entry((p)->field.prev, typeof(*p), field))
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311801 - stable/11/sys/compat/linuxkpi/common/include/linux

2017-01-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan  9 17:18:39 2017
New Revision: 311801
URL: https://svnweb.freebsd.org/changeset/base/311801

Log:
  MFC r310553:
  Improve LinuxKPI device support. Only delete own BSD devices and not
  the ones obtained through devclass_get_device(). Some minor code
  cleanups while at it.
  
  Obtained from:kmacy @
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/compat/linuxkpi/common/include/linux/device.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/device.h
==
--- stable/11/sys/compat/linuxkpi/common/include/linux/device.h Mon Jan  9 
17:16:14 2017(r311800)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/device.h Mon Jan  9 
17:18:39 2017(r311801)
@@ -63,6 +63,14 @@ struct device {
struct device   *parent;
struct list_head irqents;
device_tbsddev;
+   /*
+* The following flag is used to determine if the LinuxKPI is
+* responsible for detaching the BSD device or not. If the
+* LinuxKPI got the BSD device using devclass_get_device(), it
+* must not try to detach or delete it, because it's already
+* done somewhere else.
+*/
+   boolbsddev_attached_here;
dev_t   devt;
struct class*class;
void(*release)(struct device *dev);
@@ -208,23 +216,36 @@ static inline struct device *kobj_to_dev
 static inline void
 device_initialize(struct device *dev)
 {
-   device_t bsddev;
+   device_t bsddev = NULL;
+   int unit = -1;
 
-   bsddev = NULL;
if (dev->devt) {
-   int unit = MINOR(dev->devt);
+   unit = MINOR(dev->devt);
bsddev = devclass_get_device(dev->class->bsdclass, unit);
+   dev->bsddev_attached_here = false;
+   } else if (dev->parent == NULL) {
+   bsddev = devclass_get_device(dev->class->bsdclass, 0);
+   dev->bsddev_attached_here = false;
+   } else {
+   dev->bsddev_attached_here = true;
+   }
+
+   if (bsddev == NULL && dev->parent != NULL) {
+   bsddev = device_add_child(dev->parent->bsddev,
+   dev->class->kobj.name, unit);
}
+
if (bsddev != NULL)
device_set_softc(bsddev, dev);
 
dev->bsddev = bsddev;
+   MPASS(dev->bsddev != NULL);
kobject_init(>kobj, _dev_ktype);
 }
 
 static inline int
 device_add(struct device *dev)
-{  
+{
if (dev->bsddev != NULL) {
if (dev->devt == 0)
dev->devt = makedev(0, device_get_unit(dev->bsddev));
@@ -256,13 +277,13 @@ device_create_groups_vargs(struct class 
goto error;
}
 
-   device_initialize(dev);
dev->devt = devt;
dev->class = class;
dev->parent = parent;
dev->groups = groups;
dev->release = device_create_release;
-   dev->bsddev = devclass_get_device(dev->class->bsdclass, MINOR(devt));
+   /* device_initialize() needs the class and parent to be set */
+   device_initialize(dev);
dev_set_drvdata(dev, drvdata);
 
retval = kobject_set_name_vargs(>kobj, fmt, args);
@@ -298,17 +319,21 @@ device_create_with_groups(struct class *
 static inline int
 device_register(struct device *dev)
 {
-   device_t bsddev;
-   int unit;
+   device_t bsddev = NULL;
+   int unit = -1;
 
-   bsddev = NULL;
-   unit = -1;
+   if (dev->bsddev != NULL)
+   goto done;
 
if (dev->devt) {
unit = MINOR(dev->devt);
bsddev = devclass_get_device(dev->class->bsdclass, unit);
+   dev->bsddev_attached_here = false;
} else if (dev->parent == NULL) {
bsddev = devclass_get_device(dev->class->bsdclass, 0);
+   dev->bsddev_attached_here = false;
+   } else {
+   dev->bsddev_attached_here = true;
}
if (bsddev == NULL && dev->parent != NULL) {
bsddev = device_add_child(dev->parent->bsddev,
@@ -320,6 +345,7 @@ device_register(struct device *dev)
device_set_softc(bsddev, dev);
}
dev->bsddev = bsddev;
+done:
kobject_init(>kobj, _dev_ktype);
kobject_add(>kobj, >class->kobj, dev_name(dev));
 
@@ -334,7 +360,7 @@ device_unregister(struct device *dev)
bsddev = dev->bsddev;
dev->bsddev = NULL;
 
-   if (bsddev != NULL) {
+   if (bsddev != NULL && dev->bsddev_attached_here) {
mtx_lock();
device_delete_child(device_get_parent(bsddev), bsddev);
mtx_unlock();
@@ -350,7 +376,7 @@ device_del(struct device *dev)
bsddev = dev->bsddev;
dev->bsddev = NULL;
 
-   if (bsddev != NULL) {
+   if (bsddev != NULL && 

svn commit: r311800 - stable/11/sys/compat/linuxkpi/common/include/linux

2017-01-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan  9 17:16:14 2017
New Revision: 311800
URL: https://svnweb.freebsd.org/changeset/base/311800

Log:
  MFC r310557:
  Use correct integer type when computing the maximum physical address
  for kmem_alloc_contig().
  
  Obtained from:kmacy @
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h
==
--- stable/11/sys/compat/linuxkpi/common/include/linux/gfp.hMon Jan  9 
17:13:35 2017(r311799)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/gfp.hMon Jan  9 
17:16:14 2017(r311800)
@@ -136,8 +136,8 @@ alloc_pages(gfp_t gfp_mask, unsigned int
size_t size;
 
size = PAGE_SIZE << order;
-   page = kmem_alloc_contig(kmem_arena, size, gfp_mask, 0, -1,
-   size, 0, VM_MEMATTR_DEFAULT);
+   page = kmem_alloc_contig(kmem_arena, size, gfp_mask,
+   0, ~(vm_paddr_t)0, size, 0, VM_MEMATTR_DEFAULT);
if (page == 0)
return (NULL);
 return (virt_to_page(page));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311799 - stable/10/sys/dev/usb

2017-01-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan  9 17:13:35 2017
New Revision: 311799
URL: https://svnweb.freebsd.org/changeset/base/311799

Log:
  MFC r310242:
  Defer USB enumeration until the SI_SUB_KICK_SCHEDULER is executed to avoid
  boot panics in conjunction with the recently added EARLY_AP_STARTUP feature.
  The panics happen due to using kernel facilities like callouts too early.
  
  Tested by:jhb @

Modified:
  stable/10/sys/dev/usb/usb_hub.c
  stable/10/sys/dev/usb/usb_process.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/usb_hub.c
==
--- stable/10/sys/dev/usb/usb_hub.c Mon Jan  9 17:12:15 2017
(r311798)
+++ stable/10/sys/dev/usb/usb_hub.c Mon Jan  9 17:13:35 2017
(r311799)
@@ -2272,6 +2272,11 @@ usb_needs_explore(struct usb_bus *bus, u
 
DPRINTF("\n");
 
+   if (cold != 0) {
+   DPRINTF("Cold\n");
+   return;
+   }
+
if (bus == NULL) {
DPRINTF("No bus pointer!\n");
return;
@@ -2337,6 +2342,26 @@ usb_needs_explore_all(void)
 }
 
 /**
+ * usb_needs_explore_init
+ *
+ * This function will ensure that the USB controllers are not enumerated
+ * until the "cold" variable is cleared.
+ **/
+static void
+usb_needs_explore_init(void *arg)
+{
+   /*
+* The cold variable should be cleared prior to this function
+* being called:
+*/
+   if (cold == 0)
+   usb_needs_explore_all();
+   else
+   DPRINTFN(-1, "Cold variable is still set!\n");
+}
+SYSINIT(usb_needs_explore_init, SI_SUB_KICK_SCHEDULER, SI_ORDER_SECOND, 
usb_needs_explore_init, NULL);
+
+/**
  * usb_bus_power_update
  *
  * This function will ensure that all USB devices on the given bus are

Modified: stable/10/sys/dev/usb/usb_process.c
==
--- stable/10/sys/dev/usb/usb_process.c Mon Jan  9 17:12:15 2017
(r311798)
+++ stable/10/sys/dev/usb/usb_process.c Mon Jan  9 17:13:35 2017
(r311799)
@@ -455,14 +455,15 @@ usb_proc_drain(struct usb_process *up)
up->up_csleep = 0;
cv_signal(>up_cv);
}
+#ifndef EARLY_AP_STARTUP
/* Check if we are still cold booted */
-
if (cold) {
USB_THREAD_SUSPEND(up->up_ptr);
printf("WARNING: A USB process has "
"been left suspended\n");
break;
}
+#endif
cv_wait(>up_cv, up->up_mtx);
}
/* Check if someone is waiting - should not happen */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311798 - stable/11/sys/dev/usb

2017-01-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan  9 17:12:15 2017
New Revision: 311798
URL: https://svnweb.freebsd.org/changeset/base/311798

Log:
  MFC r310242:
  Defer USB enumeration until the SI_SUB_KICK_SCHEDULER is executed to avoid
  boot panics in conjunction with the recently added EARLY_AP_STARTUP feature.
  The panics happen due to using kernel facilities like callouts too early.
  
  Tested by:jhb @

Modified:
  stable/11/sys/dev/usb/usb_hub.c
  stable/11/sys/dev/usb/usb_process.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/usb_hub.c
==
--- stable/11/sys/dev/usb/usb_hub.c Mon Jan  9 17:10:50 2017
(r311797)
+++ stable/11/sys/dev/usb/usb_hub.c Mon Jan  9 17:12:15 2017
(r311798)
@@ -2261,6 +2261,11 @@ usb_needs_explore(struct usb_bus *bus, u
 
DPRINTF("\n");
 
+   if (cold != 0) {
+   DPRINTF("Cold\n");
+   return;
+   }
+
if (bus == NULL) {
DPRINTF("No bus pointer!\n");
return;
@@ -2326,6 +2331,26 @@ usb_needs_explore_all(void)
 }
 
 /**
+ * usb_needs_explore_init
+ *
+ * This function will ensure that the USB controllers are not enumerated
+ * until the "cold" variable is cleared.
+ **/
+static void
+usb_needs_explore_init(void *arg)
+{
+   /*
+* The cold variable should be cleared prior to this function
+* being called:
+*/
+   if (cold == 0)
+   usb_needs_explore_all();
+   else
+   DPRINTFN(-1, "Cold variable is still set!\n");
+}
+SYSINIT(usb_needs_explore_init, SI_SUB_KICK_SCHEDULER, SI_ORDER_SECOND, 
usb_needs_explore_init, NULL);
+
+/**
  * usb_bus_power_update
  *
  * This function will ensure that all USB devices on the given bus are

Modified: stable/11/sys/dev/usb/usb_process.c
==
--- stable/11/sys/dev/usb/usb_process.c Mon Jan  9 17:10:50 2017
(r311797)
+++ stable/11/sys/dev/usb/usb_process.c Mon Jan  9 17:12:15 2017
(r311798)
@@ -454,14 +454,15 @@ usb_proc_drain(struct usb_process *up)
up->up_csleep = 0;
cv_signal(>up_cv);
}
+#ifndef EARLY_AP_STARTUP
/* Check if we are still cold booted */
-
if (cold) {
USB_THREAD_SUSPEND(up->up_ptr);
printf("WARNING: A USB process has "
"been left suspended\n");
break;
}
+#endif
cv_wait(>up_cv, up->up_mtx);
}
/* Check if someone is waiting - should not happen */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r311667 - in head/sys/contrib/dev/acpica: components/namespace components/tables include

2017-01-09 Thread John Baldwin
On Sunday, January 08, 2017 06:26:33 AM Conrad E. Meyer wrote:
> Author: cem
> Date: Sun Jan  8 06:26:33 2017
> New Revision: 311667
> URL: https://svnweb.freebsd.org/changeset/base/311667
> 
> Log:
>   Add some additional ACPI methods for DRM
>   
>   Add AcpiGetDataFull and AcpiGetTableWithSize.
>   
>   Submitted by:   Matt Macy

Have these been submitted upstream?  The Intel folks are generally quite
responsive on freebsd-a...@freebsd.org and this codebase is actively
maintained externally.

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


svn commit: r311797 - head/sys/dev/sdhci

2017-01-09 Thread Ian Lepore
Author: ian
Date: Mon Jan  9 17:10:50 2017
New Revision: 311797
URL: https://svnweb.freebsd.org/changeset/base/311797

Log:
  Add sdhci_handle_card_present_locked() that can be called from the interrupt
  handler which already holds the mutex, and have sdhci_handle_card_present()
  be just a tiny wrapper that does the locking for external callers.
  
  This should fix the recursive locking panics seen on rpi3.
  
  Reported by:  Shawn Webb

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

Modified: head/sys/dev/sdhci/sdhci.c
==
--- head/sys/dev/sdhci/sdhci.c  Mon Jan  9 17:09:53 2017(r311796)
+++ head/sys/dev/sdhci/sdhci.c  Mon Jan  9 17:10:50 2017(r311797)
@@ -521,8 +521,8 @@ sdhci_card_task(void *arg, int pending)
}
 }
 
-void
-sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present)
+static void
+sdhci_handle_card_present_locked(struct sdhci_slot *slot, bool is_present)
 {
bool was_present;
 
@@ -537,7 +537,6 @@ sdhci_handle_card_present(struct sdhci_s
 * because once power is removed, a full card re-init is needed, and
 * that happens by deleting and recreating the child device.
 */
-   SDHCI_LOCK(slot);
was_present = slot->dev != NULL;
if (!was_present && is_present) {
taskqueue_enqueue_timeout(taskqueue_swi_giant,
@@ -545,6 +544,14 @@ sdhci_handle_card_present(struct sdhci_s
} else if (was_present && !is_present) {
taskqueue_enqueue(taskqueue_swi_giant, >card_task);
}
+}
+
+void
+sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present)
+{
+
+   SDHCI_LOCK(slot);
+   sdhci_handle_card_present_locked(slot, is_present);
SDHCI_UNLOCK(slot);
 }
 
@@ -1402,7 +1409,7 @@ sdhci_generic_intr(struct sdhci_slot *sl
WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask);
WR4(slot, SDHCI_INT_STATUS, intmask & 
(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE));
-   sdhci_handle_card_present(slot, present);
+   sdhci_handle_card_present_locked(slot, present);
intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE);
}
/* Handle command interrupts. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311796 - stable/9/sys/ofed/drivers/net/mlx4

2017-01-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan  9 17:09:53 2017
New Revision: 311796
URL: https://svnweb.freebsd.org/changeset/base/311796

Log:
  MFC r310058:
  Fix initialisation of mlx4_pci_table's .driver_data fields.
  
  Differential Revision:https://reviews.freebsd.org/D8791
  Sponsored by: Mellanox Technologies
  Submitted by: Dexuan Cui 

Modified:
  stable/9/sys/ofed/drivers/net/mlx4/main.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/ofed/drivers/net/mlx4/main.c
==
--- stable/9/sys/ofed/drivers/net/mlx4/main.c   Mon Jan  9 17:07:52 2017
(r311795)
+++ stable/9/sys/ofed/drivers/net/mlx4/main.c   Mon Jan  9 17:09:53 2017
(r311796)
@@ -3637,47 +3637,61 @@ int mlx4_restart_one(struct pci_dev *pde
 
 static DEFINE_PCI_DEVICE_TABLE(mlx4_pci_table) = {
/* MT25408 "Hermon" SDR */
-   { PCI_VDEVICE(MELLANOX, 0x6340), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6340),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" DDR */
-   { PCI_VDEVICE(MELLANOX, 0x634a), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x634a),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" QDR */
-   { PCI_VDEVICE(MELLANOX, 0x6354), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6354),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" DDR PCIe gen2 */
-   { PCI_VDEVICE(MELLANOX, 0x6732), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6732),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" QDR PCIe gen2 */
-   { PCI_VDEVICE(MELLANOX, 0x673c), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x673c),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" EN 10GigE */
-   { PCI_VDEVICE(MELLANOX, 0x6368), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6368),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" EN 10GigE PCIe gen2 */
-   { PCI_VDEVICE(MELLANOX, 0x6750), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6750),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25458 ConnectX EN 10GBASE-T 10GigE */
-   { PCI_VDEVICE(MELLANOX, 0x6372), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6372),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */
-   { PCI_VDEVICE(MELLANOX, 0x675a), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x675a),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT26468 ConnectX EN 10GigE PCIe gen2*/
-   { PCI_VDEVICE(MELLANOX, 0x6764), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6764),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT26438 ConnectX EN 40GigE PCIe gen2 5GT/s */
-   { PCI_VDEVICE(MELLANOX, 0x6746), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6746),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT26478 ConnectX2 40GigE PCIe gen2 */
-   { PCI_VDEVICE(MELLANOX, 0x676e), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x676e),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25400 Family [ConnectX-2 Virtual Function] */
-   { PCI_VDEVICE(MELLANOX, 0x1002), MLX4_PCI_DEV_IS_VF },
+   { PCI_VDEVICE(MELLANOX, 0x1002),
+   .driver_data = MLX4_PCI_DEV_IS_VF },
/* MT27500 Family [ConnectX-3] */
-   { PCI_VDEVICE(MELLANOX, 0x1003), 0 },
+   { PCI_VDEVICE(MELLANOX, 0x1003) },
/* MT27500 Family [ConnectX-3 Virtual Function] */
-   { PCI_VDEVICE(MELLANOX, 0x1004), MLX4_PCI_DEV_IS_VF },
-   { PCI_VDEVICE(MELLANOX, 0x1005), 0 }, /* MT27510 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1006), 0 }, /* MT27511 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1007), 0 }, /* MT27520 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1008), 0 }, /* MT27521 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1009), 0 }, /* MT27530 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100a), 0 }, /* MT27531 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100b), 0 }, /* MT27540 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100c), 0 }, /* MT27541 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100d), 0 }, /* MT27550 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100e), 0 }, /* MT27551 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100f), 0 }, /* MT27560 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1010), 0 }, /* MT27561 Family */
+   { PCI_VDEVICE(MELLANOX, 0x1004),
+   .driver_data = MLX4_PCI_DEV_IS_VF },
+   { 

svn commit: r311795 - stable/10/sys/ofed/drivers/net/mlx4

2017-01-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan  9 17:07:52 2017
New Revision: 311795
URL: https://svnweb.freebsd.org/changeset/base/311795

Log:
  MFC r310058:
  Fix initialisation of mlx4_pci_table's .driver_data fields.
  
  Differential Revision:https://reviews.freebsd.org/D8791
  Sponsored by: Mellanox Technologies
  Submitted by: Dexuan Cui 

Modified:
  stable/10/sys/ofed/drivers/net/mlx4/main.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/ofed/drivers/net/mlx4/main.c
==
--- stable/10/sys/ofed/drivers/net/mlx4/main.c  Mon Jan  9 17:07:13 2017
(r311794)
+++ stable/10/sys/ofed/drivers/net/mlx4/main.c  Mon Jan  9 17:07:52 2017
(r311795)
@@ -3637,47 +3637,61 @@ int mlx4_restart_one(struct pci_dev *pde
 
 static DEFINE_PCI_DEVICE_TABLE(mlx4_pci_table) = {
/* MT25408 "Hermon" SDR */
-   { PCI_VDEVICE(MELLANOX, 0x6340), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6340),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" DDR */
-   { PCI_VDEVICE(MELLANOX, 0x634a), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x634a),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" QDR */
-   { PCI_VDEVICE(MELLANOX, 0x6354), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6354),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" DDR PCIe gen2 */
-   { PCI_VDEVICE(MELLANOX, 0x6732), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6732),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" QDR PCIe gen2 */
-   { PCI_VDEVICE(MELLANOX, 0x673c), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x673c),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" EN 10GigE */
-   { PCI_VDEVICE(MELLANOX, 0x6368), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6368),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" EN 10GigE PCIe gen2 */
-   { PCI_VDEVICE(MELLANOX, 0x6750), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6750),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25458 ConnectX EN 10GBASE-T 10GigE */
-   { PCI_VDEVICE(MELLANOX, 0x6372), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6372),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */
-   { PCI_VDEVICE(MELLANOX, 0x675a), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x675a),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT26468 ConnectX EN 10GigE PCIe gen2*/
-   { PCI_VDEVICE(MELLANOX, 0x6764), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6764),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT26438 ConnectX EN 40GigE PCIe gen2 5GT/s */
-   { PCI_VDEVICE(MELLANOX, 0x6746), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6746),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT26478 ConnectX2 40GigE PCIe gen2 */
-   { PCI_VDEVICE(MELLANOX, 0x676e), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x676e),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25400 Family [ConnectX-2 Virtual Function] */
-   { PCI_VDEVICE(MELLANOX, 0x1002), MLX4_PCI_DEV_IS_VF },
+   { PCI_VDEVICE(MELLANOX, 0x1002),
+   .driver_data = MLX4_PCI_DEV_IS_VF },
/* MT27500 Family [ConnectX-3] */
-   { PCI_VDEVICE(MELLANOX, 0x1003), 0 },
+   { PCI_VDEVICE(MELLANOX, 0x1003) },
/* MT27500 Family [ConnectX-3 Virtual Function] */
-   { PCI_VDEVICE(MELLANOX, 0x1004), MLX4_PCI_DEV_IS_VF },
-   { PCI_VDEVICE(MELLANOX, 0x1005), 0 }, /* MT27510 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1006), 0 }, /* MT27511 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1007), 0 }, /* MT27520 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1008), 0 }, /* MT27521 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1009), 0 }, /* MT27530 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100a), 0 }, /* MT27531 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100b), 0 }, /* MT27540 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100c), 0 }, /* MT27541 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100d), 0 }, /* MT27550 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100e), 0 }, /* MT27551 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100f), 0 }, /* MT27560 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1010), 0 }, /* MT27561 Family */
+   { PCI_VDEVICE(MELLANOX, 0x1004),
+   .driver_data = MLX4_PCI_DEV_IS_VF },
+   { 

svn commit: r311794 - head/sys/dev/sdhci

2017-01-09 Thread Marius Strobl
Author: marius
Date: Mon Jan  9 17:07:13 2017
New Revision: 311794
URL: https://svnweb.freebsd.org/changeset/base/311794

Log:
  - Add support for Intel Apollo Lake and Bay Trail eMMC controllers.
Besides slots always having non-removable media, these HCIs require
a custom hardware reset sequence after power-up.
  - Flesh out the support for Intel Braswell eMMC controllers further.
Apart from also requiring said reset code, the timeout clock needs to
be hardcoded to 1 MHz for these.
Both the special reset and timeout clock handlings are implemented as
global sdhci(4) quirks as the same treatment will be necessary for
Intel eMMC controllers attached via ACPI (once sdhci(4) grows such a
front-end).
  - In sdhci_init_slot(), use the right capability field for determining
the announced bus width based on MMC_CAP_*_BIT_DATA.
  - Correct inverted sdhci_pci_softc member comments added in r276469. [1]
  
  Submitted by: Anton Yuzhaninov [1]
  MFC after:5 days

Modified:
  head/sys/dev/sdhci/sdhci.c
  head/sys/dev/sdhci/sdhci.h
  head/sys/dev/sdhci/sdhci_pci.c

Modified: head/sys/dev/sdhci/sdhci.c
==
--- head/sys/dev/sdhci/sdhci.c  Mon Jan  9 17:05:39 2017(r311793)
+++ head/sys/dev/sdhci/sdhci.c  Mon Jan  9 17:07:13 2017(r311794)
@@ -376,6 +376,13 @@ sdhci_set_power(struct sdhci_slot *slot,
/* Turn on the power. */
pwr |= SDHCI_POWER_ON;
WR1(slot, SDHCI_POWER_CONTROL, pwr);
+
+   if (slot->quirks & SDHCI_QUIRK_INTEL_POWER_UP_RESET) {
+   WR1(slot, SDHCI_POWER_CONTROL, pwr | 0x10);
+   DELAY(10);
+   WR1(slot, SDHCI_POWER_CONTROL, pwr);
+   DELAY(300);
+   }
 }
 
 static void
@@ -622,9 +629,11 @@ sdhci_init_slot(device_t dev, struct sdh
device_printf(dev, "Hardware doesn't specify base clock "
"frequency, using %dMHz as default.\n", 
SDHCI_DEFAULT_MAX_FREQ);
}
-   /* Calculate timeout clock frequency. */
+   /* Calculate/set timeout clock frequency. */
if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) {
slot->timeout_clk = slot->max_clk / 1000;
+   } else if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_1MHZ) {
+   slot->timeout_clk = 1000;
} else {
slot->timeout_clk =
(caps & SDHCI_TIMEOUT_CLK_MASK) >> 
SDHCI_TIMEOUT_CLK_SHIFT;
@@ -668,6 +677,8 @@ sdhci_init_slot(device_t dev, struct sdh
slot->opt &= ~SDHCI_HAVE_DMA;
if (slot->quirks & SDHCI_QUIRK_FORCE_DMA)
slot->opt |= SDHCI_HAVE_DMA;
+   if (slot->quirks & SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE)
+   slot->opt |= SDHCI_NON_REMOVABLE;
 
/* 
 * Use platform-provided transfer backend
@@ -680,8 +691,9 @@ sdhci_init_slot(device_t dev, struct sdh
slot_printf(slot, "%uMHz%s %s%s%s%s %s\n",
slot->max_clk / 100,
(caps & SDHCI_CAN_DO_HISPD) ? " HS" : "",
-   (caps & MMC_CAP_8_BIT_DATA) ? "8bits" :
-   ((caps & MMC_CAP_4_BIT_DATA) ? "4bits" : "1bit"),
+   (slot->host.caps & MMC_CAP_8_BIT_DATA) ? "8bits" :
+   ((slot->host.caps & MMC_CAP_4_BIT_DATA) ? "4bits" :
+   "1bit"),
(caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "",
(caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "",
(caps & SDHCI_CAN_VDD_180) ? " 1.8V" : "",

Modified: head/sys/dev/sdhci/sdhci.h
==
--- head/sys/dev/sdhci/sdhci.h  Mon Jan  9 17:05:39 2017(r311793)
+++ head/sys/dev/sdhci/sdhci.h  Mon Jan  9 17:07:13 2017(r311794)
@@ -66,7 +66,13 @@
 /* Alternate clock source is required when supplying a 400 KHz clock. */
 #defineSDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC  (1<<16)
 /* Card insert/remove interrupts don't work, polling required. */
-#define SDHCI_QUIRK_POLL_CARD_PRESENT  (1<<17)
+#defineSDHCI_QUIRK_POLL_CARD_PRESENT   (1<<17)
+/* All controller slots are non-removable. */
+#defineSDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE (1<<18)
+/* Issue custom Intel controller reset sequence after power-up. */
+#defineSDHCI_QUIRK_INTEL_POWER_UP_RESET(1<<19)
+/* Data timeout is invalid, use 1 MHz clock instead. */
+#defineSDHCI_QUIRK_DATA_TIMEOUT_1MHZ   (1<<20)
 
 /*
  * Controller registers

Modified: head/sys/dev/sdhci/sdhci_pci.c
==
--- head/sys/dev/sdhci/sdhci_pci.c  Mon Jan  9 17:05:39 2017
(r311793)
+++ head/sys/dev/sdhci/sdhci_pci.c  Mon Jan  9 17:07:13 2017
(r311794)
@@ -107,8 +107,19 @@ static 

svn commit: r311793 - head/sys/dev/mmc

2017-01-09 Thread Marius Strobl
Author: marius
Date: Mon Jan  9 17:05:39 2017
New Revision: 311793
URL: https://svnweb.freebsd.org/changeset/base/311793

Log:
  In mmcsd_task(), bio_resid was not being set to 0 on a successful read
  or write, resulting in random short-read and short-write returns for
  requests. Fixing this fixes nominal block I/O via mmcsd(4).
  
  Obtained from:DragonFlyBSD (fd4b97583be1a1e57234713c25f6e81bc0411cb0)
  MFC after:5 days

Modified:
  head/sys/dev/mmc/mmcsd.c

Modified: head/sys/dev/mmc/mmcsd.c
==
--- head/sys/dev/mmc/mmcsd.cMon Jan  9 17:04:51 2017(r311792)
+++ head/sys/dev/mmc/mmcsd.cMon Jan  9 17:05:39 2017(r311793)
@@ -545,6 +545,8 @@ mmcsd_task(void *arg)
bp->bio_error = EIO;
bp->bio_resid = (end - block) * sz;
bp->bio_flags |= BIO_ERROR;
+   } else {
+   bp->bio_resid = 0;
}
biodone(bp);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311792 - stable/11/sys/ofed/drivers/net/mlx4

2017-01-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan  9 17:04:51 2017
New Revision: 311792
URL: https://svnweb.freebsd.org/changeset/base/311792

Log:
  MFC r310058:
  Fix initialisation of mlx4_pci_table's .driver_data fields.
  
  Differential Revision:https://reviews.freebsd.org/D8791
  Sponsored by: Mellanox Technologies
  Submitted by: Dexuan Cui 

Modified:
  stable/11/sys/ofed/drivers/net/mlx4/main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/ofed/drivers/net/mlx4/main.c
==
--- stable/11/sys/ofed/drivers/net/mlx4/main.c  Mon Jan  9 16:55:29 2017
(r311791)
+++ stable/11/sys/ofed/drivers/net/mlx4/main.c  Mon Jan  9 17:04:51 2017
(r311792)
@@ -3635,47 +3635,61 @@ int mlx4_restart_one(struct pci_dev *pde
 
 static DEFINE_PCI_DEVICE_TABLE(mlx4_pci_table) = {
/* MT25408 "Hermon" SDR */
-   { PCI_VDEVICE(MELLANOX, 0x6340), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6340),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" DDR */
-   { PCI_VDEVICE(MELLANOX, 0x634a), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x634a),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" QDR */
-   { PCI_VDEVICE(MELLANOX, 0x6354), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6354),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" DDR PCIe gen2 */
-   { PCI_VDEVICE(MELLANOX, 0x6732), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6732),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" QDR PCIe gen2 */
-   { PCI_VDEVICE(MELLANOX, 0x673c), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x673c),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" EN 10GigE */
-   { PCI_VDEVICE(MELLANOX, 0x6368), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6368),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25408 "Hermon" EN 10GigE PCIe gen2 */
-   { PCI_VDEVICE(MELLANOX, 0x6750), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6750),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25458 ConnectX EN 10GBASE-T 10GigE */
-   { PCI_VDEVICE(MELLANOX, 0x6372), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6372),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */
-   { PCI_VDEVICE(MELLANOX, 0x675a), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x675a),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT26468 ConnectX EN 10GigE PCIe gen2*/
-   { PCI_VDEVICE(MELLANOX, 0x6764), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6764),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT26438 ConnectX EN 40GigE PCIe gen2 5GT/s */
-   { PCI_VDEVICE(MELLANOX, 0x6746), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x6746),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT26478 ConnectX2 40GigE PCIe gen2 */
-   { PCI_VDEVICE(MELLANOX, 0x676e), MLX4_PCI_DEV_FORCE_SENSE_PORT },
+   { PCI_VDEVICE(MELLANOX, 0x676e),
+   .driver_data = MLX4_PCI_DEV_FORCE_SENSE_PORT },
/* MT25400 Family [ConnectX-2 Virtual Function] */
-   { PCI_VDEVICE(MELLANOX, 0x1002), MLX4_PCI_DEV_IS_VF },
+   { PCI_VDEVICE(MELLANOX, 0x1002),
+   .driver_data = MLX4_PCI_DEV_IS_VF },
/* MT27500 Family [ConnectX-3] */
-   { PCI_VDEVICE(MELLANOX, 0x1003), 0 },
+   { PCI_VDEVICE(MELLANOX, 0x1003) },
/* MT27500 Family [ConnectX-3 Virtual Function] */
-   { PCI_VDEVICE(MELLANOX, 0x1004), MLX4_PCI_DEV_IS_VF },
-   { PCI_VDEVICE(MELLANOX, 0x1005), 0 }, /* MT27510 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1006), 0 }, /* MT27511 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1007), 0 }, /* MT27520 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1008), 0 }, /* MT27521 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1009), 0 }, /* MT27530 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100a), 0 }, /* MT27531 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100b), 0 }, /* MT27540 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100c), 0 }, /* MT27541 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100d), 0 }, /* MT27550 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100e), 0 }, /* MT27551 Family */
-   { PCI_VDEVICE(MELLANOX, 0x100f), 0 }, /* MT27560 Family */
-   { PCI_VDEVICE(MELLANOX, 0x1010), 0 }, /* MT27561 Family */
+   { PCI_VDEVICE(MELLANOX, 0x1004),
+   .driver_data = MLX4_PCI_DEV_IS_VF },
+   { 

svn commit: r311791 - stable/10/sys/dev/mlx5/mlx5_en

2017-01-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan  9 16:55:29 2017
New Revision: 311791
URL: https://svnweb.freebsd.org/changeset/base/311791

Log:
  MFC r310387:
  Add more comments regarding collection of statistics counters.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c   Mon Jan  9 16:52:35 
2017(r311790)
+++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c   Mon Jan  9 16:55:29 
2017(r311791)
@@ -306,6 +306,12 @@ mlx5e_update_carrier_work(struct work_st
PRIV_UNLOCK(priv);
 }
 
+/*
+ * This function reads the physical port counters from the firmware
+ * using a pre-defined layout defined by various MLX5E_PPORT_XXX()
+ * macros. The output is converted from big-endian 64-bit values into
+ * host endian ones and stored in the "priv->stats.pport" structure.
+ */
 static void
 mlx5e_update_pport_counters(struct mlx5e_priv *priv)
 {
@@ -319,20 +325,27 @@ mlx5e_update_pport_counters(struct mlx5e
unsigned x;
unsigned y;
 
+   /* allocate firmware request structures */
in = mlx5_vzalloc(sz);
out = mlx5_vzalloc(sz);
if (in == NULL || out == NULL)
goto free_out;
 
+   /*
+* Get pointer to the 64-bit counter set which is located at a
+* fixed offset in the output firmware request structure:
+*/
ptr = (const uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set);
 
MLX5_SET(ppcnt_reg, in, local_port, 1);
 
+   /* read IEEE802_3 counter group using predefined counter layout */
MLX5_SET(ppcnt_reg, in, grp, MLX5_IEEE_802_3_COUNTERS_GROUP);
mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0);
for (x = y = 0; x != MLX5E_PPORT_IEEE802_3_STATS_NUM; x++, y++)
s->arg[y] = be64toh(ptr[x]);
 
+   /* read RFC2819 counter group using predefined counter layout */
MLX5_SET(ppcnt_reg, in, grp, MLX5_RFC_2819_COUNTERS_GROUP);
mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0);
for (x = 0; x != MLX5E_PPORT_RFC2819_STATS_NUM; x++, y++)
@@ -341,20 +354,29 @@ mlx5e_update_pport_counters(struct mlx5e
MLX5E_PPORT_RFC2819_STATS_DEBUG_NUM; x++, y++)
s_debug->arg[y] = be64toh(ptr[x]);
 
+   /* read RFC2863 counter group using predefined counter layout */
MLX5_SET(ppcnt_reg, in, grp, MLX5_RFC_2863_COUNTERS_GROUP);
mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0);
for (x = 0; x != MLX5E_PPORT_RFC2863_STATS_DEBUG_NUM; x++, y++)
s_debug->arg[y] = be64toh(ptr[x]);
 
+   /* read physical layer stats counter group using predefined counter 
layout */
MLX5_SET(ppcnt_reg, in, grp, MLX5_PHYSICAL_LAYER_COUNTERS_GROUP);
mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0);
for (x = 0; x != MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG_NUM; x++, y++)
s_debug->arg[y] = be64toh(ptr[x]);
 free_out:
+   /* free firmware request structures */
kvfree(in);
kvfree(out);
 }
 
+/*
+ * This function is called regularly to collect all statistics
+ * counters from the firmware. The values can be viewed through the
+ * sysctl interface. Execution is serialized using the priv's global
+ * configuration lock.
+ */
 static void
 mlx5e_update_stats_work(struct work_struct *work)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311790 - stable/11/sys/dev/mlx5/mlx5_en

2017-01-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan  9 16:52:35 2017
New Revision: 311790
URL: https://svnweb.freebsd.org/changeset/base/311790

Log:
  MFC r310387:
  Add more comments regarding collection of statistics counters.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c   Mon Jan  9 16:47:39 
2017(r311789)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c   Mon Jan  9 16:52:35 
2017(r311790)
@@ -306,6 +306,12 @@ mlx5e_update_carrier_work(struct work_st
PRIV_UNLOCK(priv);
 }
 
+/*
+ * This function reads the physical port counters from the firmware
+ * using a pre-defined layout defined by various MLX5E_PPORT_XXX()
+ * macros. The output is converted from big-endian 64-bit values into
+ * host endian ones and stored in the "priv->stats.pport" structure.
+ */
 static void
 mlx5e_update_pport_counters(struct mlx5e_priv *priv)
 {
@@ -319,20 +325,27 @@ mlx5e_update_pport_counters(struct mlx5e
unsigned x;
unsigned y;
 
+   /* allocate firmware request structures */
in = mlx5_vzalloc(sz);
out = mlx5_vzalloc(sz);
if (in == NULL || out == NULL)
goto free_out;
 
+   /*
+* Get pointer to the 64-bit counter set which is located at a
+* fixed offset in the output firmware request structure:
+*/
ptr = (const uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set);
 
MLX5_SET(ppcnt_reg, in, local_port, 1);
 
+   /* read IEEE802_3 counter group using predefined counter layout */
MLX5_SET(ppcnt_reg, in, grp, MLX5_IEEE_802_3_COUNTERS_GROUP);
mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0);
for (x = y = 0; x != MLX5E_PPORT_IEEE802_3_STATS_NUM; x++, y++)
s->arg[y] = be64toh(ptr[x]);
 
+   /* read RFC2819 counter group using predefined counter layout */
MLX5_SET(ppcnt_reg, in, grp, MLX5_RFC_2819_COUNTERS_GROUP);
mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0);
for (x = 0; x != MLX5E_PPORT_RFC2819_STATS_NUM; x++, y++)
@@ -341,20 +354,29 @@ mlx5e_update_pport_counters(struct mlx5e
MLX5E_PPORT_RFC2819_STATS_DEBUG_NUM; x++, y++)
s_debug->arg[y] = be64toh(ptr[x]);
 
+   /* read RFC2863 counter group using predefined counter layout */
MLX5_SET(ppcnt_reg, in, grp, MLX5_RFC_2863_COUNTERS_GROUP);
mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0);
for (x = 0; x != MLX5E_PPORT_RFC2863_STATS_DEBUG_NUM; x++, y++)
s_debug->arg[y] = be64toh(ptr[x]);
 
+   /* read physical layer stats counter group using predefined counter 
layout */
MLX5_SET(ppcnt_reg, in, grp, MLX5_PHYSICAL_LAYER_COUNTERS_GROUP);
mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0);
for (x = 0; x != MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG_NUM; x++, y++)
s_debug->arg[y] = be64toh(ptr[x]);
 free_out:
+   /* free firmware request structures */
kvfree(in);
kvfree(out);
 }
 
+/*
+ * This function is called regularly to collect all statistics
+ * counters from the firmware. The values can be viewed through the
+ * sysctl interface. Execution is serialized using the priv's global
+ * configuration lock.
+ */
 static void
 mlx5e_update_stats_work(struct work_struct *work)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r311736 - head/sys/dev/sdhci

2017-01-09 Thread Shawn Webb
Hey Ian,

On Mon, Jan 09, 2017 at 02:04:54AM +, Ian Lepore wrote:
> Author: ian
> Date: Mon Jan  9 02:04:54 2017
> New Revision: 311736
> URL: https://svnweb.freebsd.org/changeset/base/311736
> 
> Log:
>   Use the new sdhci_fdt_gpio helper functions to add full support for FDT
>   gpio pins for detecting card insert/remove and write protect.

Looks like the new sdhci work causes a kernel panic on the RPI3. It was
reported to me by one of our users. I'll shortly be in the process of
dissecting which exact commit causes it.

Screenshots of the kernel panic:

http://www.zyxst.net/~bofh/rpi3/hbsd/panic0.jpg
http://www.zyxst.net/~bofh/rpi3/hbsd/panic1.jpg

Thanks,

-- 
Shawn Webb
Cofounder and Security Engineer
HardenedBSD

GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature


svn commit: r311789 - stable/10/sys/dev/mlx5/mlx5_en

2017-01-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan  9 16:47:39 2017
New Revision: 311789
URL: https://svnweb.freebsd.org/changeset/base/311789

Log:
  MFC r310388:
  Make a read only pointer constant.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c   Mon Jan  9 16:45:08 
2017(r311788)
+++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c   Mon Jan  9 16:47:39 
2017(r311789)
@@ -314,7 +314,7 @@ mlx5e_update_pport_counters(struct mlx5e
struct mlx5e_port_stats_debug *s_debug = >stats.port_stats_debug;
u32 *in;
u32 *out;
-   u64 *ptr;
+   const u64 *ptr;
unsigned sz = MLX5_ST_SZ_BYTES(ppcnt_reg);
unsigned x;
unsigned y;
@@ -324,7 +324,7 @@ mlx5e_update_pport_counters(struct mlx5e
if (in == NULL || out == NULL)
goto free_out;
 
-   ptr = (uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set);
+   ptr = (const uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set);
 
MLX5_SET(ppcnt_reg, in, local_port, 1);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311788 - stable/11/sys/dev/mlx5/mlx5_en

2017-01-09 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jan  9 16:45:08 2017
New Revision: 311788
URL: https://svnweb.freebsd.org/changeset/base/311788

Log:
  MFC r310388:
  Make a read only pointer constant.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c   Mon Jan  9 16:21:06 
2017(r311787)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c   Mon Jan  9 16:45:08 
2017(r311788)
@@ -314,7 +314,7 @@ mlx5e_update_pport_counters(struct mlx5e
struct mlx5e_port_stats_debug *s_debug = >stats.port_stats_debug;
u32 *in;
u32 *out;
-   u64 *ptr;
+   const u64 *ptr;
unsigned sz = MLX5_ST_SZ_BYTES(ppcnt_reg);
unsigned x;
unsigned y;
@@ -324,7 +324,7 @@ mlx5e_update_pport_counters(struct mlx5e
if (in == NULL || out == NULL)
goto free_out;
 
-   ptr = (uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set);
+   ptr = (const uint64_t *)MLX5_ADDR_OF(ppcnt_reg, out, counter_set);
 
MLX5_SET(ppcnt_reg, in, local_port, 1);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2017-01-09 Thread Alexander Motin
Author: mav
Date: Mon Jan  9 16:21:06 2017
New Revision: 311787
URL: https://svnweb.freebsd.org/changeset/base/311787

Log:
  Allocate memory for prevent flags only for removable LUs.
  
  This array takes 64KB of RAM now, that was more then half of struct ctl_lun
  size.  If at some point we support more ports, this may need another tune.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_private.h

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Mon Jan  9 14:13:47 2017(r311786)
+++ head/sys/cam/ctl/ctl.c  Mon Jan  9 16:21:06 2017(r311787)
@@ -4585,6 +4585,10 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
lun->ie_reported = 1;
callout_init_mtx(>ie_callout, >lun_lock, 0);
ctl_tpc_lun_init(lun);
+   if (lun->flags & CTL_LUN_REMOVABLE) {
+   lun->prevent = malloc((CTL_MAX_INITIATORS + 31) / 32 * 4,
+   M_CTL, M_WAITOK);
+   }
 
/*
 * Initialize the mode and log page index.
@@ -4666,6 +4670,7 @@ ctl_free_lun(struct ctl_lun *lun)
for (i = 0; i < CTL_MAX_PORTS; i++)
free(lun->pr_keys[i], M_CTL);
free(lun->write_buffer, M_CTL);
+   free(lun->prevent, M_CTL);
if (lun->flags & CTL_LUN_MALLOCED)
free(lun, M_CTL);
 
@@ -5276,7 +5281,7 @@ ctl_prevent_allow(struct ctl_scsiio *cts
 
cdb = (struct scsi_prevent *)ctsio->cdb;
 
-   if ((lun->flags & CTL_LUN_REMOVABLE) == 0) {
+   if ((lun->flags & CTL_LUN_REMOVABLE) == 0 || lun->prevent == NULL) {
ctl_set_invalid_opcode(ctsio);
ctl_done((union ctl_io *)ctsio);
return (CTL_RETVAL_COMPLETE);
@@ -11872,8 +11877,10 @@ ctl_do_lun_reset(struct ctl_lun *lun, un
ctl_clear_mask(lun->have_ca, i);
 #endif
lun->prevent_count = 0;
-   for (i = 0; i < CTL_MAX_INITIATORS; i++)
-   ctl_clear_mask(lun->prevent, i);
+   if (lun->prevent) {
+   for (i = 0; i < CTL_MAX_INITIATORS; i++)
+   ctl_clear_mask(lun->prevent, i);
+   }
mtx_unlock(>lun_lock);
 
return (0);
@@ -12019,7 +12026,7 @@ ctl_i_t_nexus_reset(union ctl_io *io)
 #endif
if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx == 
initidx))
lun->flags &= ~CTL_LUN_RESERVED;
-   if (ctl_is_set(lun->prevent, initidx)) {
+   if (lun->prevent && ctl_is_set(lun->prevent, initidx)) {
ctl_clear_mask(lun->prevent, initidx);
lun->prevent_count--;
}

Modified: head/sys/cam/ctl/ctl_private.h
==
--- head/sys/cam/ctl/ctl_private.h  Mon Jan  9 14:13:47 2017
(r311786)
+++ head/sys/cam/ctl/ctl_private.h  Mon Jan  9 16:21:06 2017
(r311787)
@@ -412,7 +412,7 @@ struct ctl_lun {
uint32_tpr_res_idx;
uint8_t pr_res_type;
int prevent_count;
-   uint32_tprevent[(CTL_MAX_INITIATORS+31)/32];
+   uint32_t*prevent;
uint8_t *write_buffer;
struct ctl_devid*lun_devid;
TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311786 - stable/11/lib/libfetch

2017-01-09 Thread Dag-Erling Smørgrav
Author: des
Date: Mon Jan  9 14:13:47 2017
New Revision: 311786
URL: https://svnweb.freebsd.org/changeset/base/311786

Log:
  MFH (r310823): fix multi-line CONNECT responses
  
  PR:   194483

Modified:
  stable/11/lib/libfetch/http.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libfetch/http.c
==
--- stable/11/lib/libfetch/http.c   Mon Jan  9 13:12:09 2017
(r311785)
+++ stable/11/lib/libfetch/http.c   Mon Jan  9 14:13:47 2017
(r311786)
@@ -1432,7 +1432,7 @@ http_connect(struct url *URL, struct url
default:
/* ignore */ ;
}
-   } while (h < hdr_end);
+   } while (h > hdr_end);
}
if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 &&
fetch_ssl(conn, URL, verbose) == -1) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311781 - head/lib/libprocstat

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 11:11:52 2017
New Revision: 311781
URL: https://svnweb.freebsd.org/changeset/base/311781

Log:
  Use standard Versions.def for libprocstat.
  
  This makes the versions inheritance consistent for our versioned libraries.
  
  Extracted from:   ino64
  Discussed with:   kan
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Deleted:
  head/lib/libprocstat/Versions.def
Modified:
  head/lib/libprocstat/Makefile

Modified: head/lib/libprocstat/Makefile
==
--- head/lib/libprocstat/Makefile   Mon Jan  9 10:47:20 2017
(r311780)
+++ head/lib/libprocstat/Makefile   Mon Jan  9 11:11:52 2017
(r311781)
@@ -13,7 +13,7 @@ SRCS= cd9660.c\
smbfs.c \
udf.c
 
-VERSION_DEF=   ${.CURDIR}/Versions.def
+VERSION_DEF=   ${LIBCSRCDIR}/Versions.def
 SYMBOL_MAPS=   ${.CURDIR}/Symbol.map
 
 INCS=  libprocstat.h
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311780 - head/lib/libprocstat

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 10:47:20 2017
New Revision: 311780
URL: https://svnweb.freebsd.org/changeset/base/311780

Log:
  Use tab for indent.
  
  Extracted from:   ino64 work by gleb
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/lib/libprocstat/Makefile

Modified: head/lib/libprocstat/Makefile
==
--- head/lib/libprocstat/Makefile   Mon Jan  9 10:31:39 2017
(r311779)
+++ head/lib/libprocstat/Makefile   Mon Jan  9 10:47:20 2017
(r311780)
@@ -9,7 +9,7 @@ SRCS=   cd9660.c\
common_kvm.c\
core.c  \
libprocstat.c   \
-msdosfs.c  \
+   msdosfs.c   \
smbfs.c \
udf.c
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311779 - stable/10/sys/kern

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 10:31:39 2017
New Revision: 311779
URL: https://svnweb.freebsd.org/changeset/base/311779

Log:
  MFC r33:
  There is no need to use temporary statfs buffer for fsid obliteration
  and prison enforcement.  Do it on the caller buffer directly.

Modified:
  stable/10/sys/kern/vfs_syscalls.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/vfs_syscalls.c
==
--- stable/10/sys/kern/vfs_syscalls.c   Mon Jan  9 10:30:24 2017
(r311778)
+++ stable/10/sys/kern/vfs_syscalls.c   Mon Jan  9 10:31:39 2017
(r311779)
@@ -259,7 +259,7 @@ statfs_scale_blocks(struct statfs *sf, l
 static int
 kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf)
 {
-   struct statfs *sp, sb;
+   struct statfs *sp;
int error;
 
if (mp == NULL)
@@ -283,13 +283,11 @@ kern_do_statfs(struct thread *td, struct
error = VFS_STATFS(mp, sp);
if (error != 0)
goto out;
+   *buf = *sp;
if (priv_check(td, PRIV_VFS_GENERATION)) {
-   bcopy(sp, , sizeof(sb));
-   sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
-   prison_enforce_statfs(td->td_ucred, mp, );
-   sp = 
+   buf->f_fsid.val[0] = buf->f_fsid.val[1] = 0;
+   prison_enforce_statfs(td->td_ucred, mp, buf);
}
-   *buf = *sp;
 out:
vfs_unbusy(mp);
return (error);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311778 - stable/10/sys/kern

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 10:30:24 2017
New Revision: 311778
URL: https://svnweb.freebsd.org/changeset/base/311778

Log:
  MFC r31:
  Style.

Modified:
  stable/10/sys/kern/vfs_syscalls.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/vfs_syscalls.c
==
--- stable/10/sys/kern/vfs_syscalls.c   Mon Jan  9 10:29:13 2017
(r311777)
+++ stable/10/sys/kern/vfs_syscalls.c   Mon Jan  9 10:30:24 2017
(r311778)
@@ -387,7 +387,7 @@ kern_fstatfs(struct thread *td, int fd, 
AUDIT_ARG_VNODE1(vp);
 #endif
mp = vp->v_mount;
-   if (mp)
+   if (mp != NULL)
vfs_ref(mp);
VOP_UNLOCK(vp, 0);
fdrop(fp, td);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311777 - stable/10/sys/kern

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 10:29:13 2017
New Revision: 311777
URL: https://svnweb.freebsd.org/changeset/base/311777

Log:
  MFC r311108:
  Move common code from kern_statfs() and kern_fstatfs() into a new helper.

Modified:
  stable/10/sys/kern/vfs_syscalls.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/vfs_syscalls.c
==
--- stable/10/sys/kern/vfs_syscalls.c   Mon Jan  9 10:26:02 2017
(r311776)
+++ stable/10/sys/kern/vfs_syscalls.c   Mon Jan  9 10:29:13 2017
(r311777)
@@ -256,6 +256,45 @@ statfs_scale_blocks(struct statfs *sf, l
sf->f_bavail >>= shift;
 }
 
+static int
+kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf)
+{
+   struct statfs *sp, sb;
+   int error;
+
+   if (mp == NULL)
+   return (EBADF);
+   error = vfs_busy(mp, 0);
+   vfs_rel(mp);
+   if (error != 0)
+   return (error);
+#ifdef MAC
+   error = mac_mount_check_stat(td->td_ucred, mp);
+   if (error != 0)
+   goto out;
+#endif
+   /*
+* Set these in case the underlying filesystem fails to do so.
+*/
+   sp = >mnt_stat;
+   sp->f_version = STATFS_VERSION;
+   sp->f_namemax = NAME_MAX;
+   sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
+   error = VFS_STATFS(mp, sp);
+   if (error != 0)
+   goto out;
+   if (priv_check(td, PRIV_VFS_GENERATION)) {
+   bcopy(sp, , sizeof(sb));
+   sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
+   prison_enforce_statfs(td->td_ucred, mp, );
+   sp = 
+   }
+   *buf = *sp;
+out:
+   vfs_unbusy(mp);
+   return (error);
+}
+
 /*
  * Get filesystem statistics.
  */
@@ -287,7 +326,6 @@ kern_statfs(struct thread *td, char *pat
 struct statfs *buf)
 {
struct mount *mp;
-   struct statfs *sp, sb;
struct nameidata nd;
int error;
 
@@ -300,35 +338,7 @@ kern_statfs(struct thread *td, char *pat
vfs_ref(mp);
NDFREE(, NDF_ONLY_PNBUF);
vput(nd.ni_vp);
-   error = vfs_busy(mp, 0);
-   vfs_rel(mp);
-   if (error != 0)
-   return (error);
-#ifdef MAC
-   error = mac_mount_check_stat(td->td_ucred, mp);
-   if (error != 0)
-   goto out;
-#endif
-   /*
-* Set these in case the underlying filesystem fails to do so.
-*/
-   sp = >mnt_stat;
-   sp->f_version = STATFS_VERSION;
-   sp->f_namemax = NAME_MAX;
-   sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
-   error = VFS_STATFS(mp, sp);
-   if (error != 0)
-   goto out;
-   if (priv_check(td, PRIV_VFS_GENERATION)) {
-   bcopy(sp, , sizeof(sb));
-   sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
-   prison_enforce_statfs(td->td_ucred, mp, );
-   sp = 
-   }
-   *buf = *sp;
-out:
-   vfs_unbusy(mp);
-   return (error);
+   return (kern_do_statfs(td, mp, buf));
 }
 
 /*
@@ -362,7 +372,6 @@ kern_fstatfs(struct thread *td, int fd, 
 {
struct file *fp;
struct mount *mp;
-   struct statfs *sp, sb;
struct vnode *vp;
cap_rights_t rights;
int error;
@@ -382,40 +391,7 @@ kern_fstatfs(struct thread *td, int fd, 
vfs_ref(mp);
VOP_UNLOCK(vp, 0);
fdrop(fp, td);
-   if (mp == NULL) {
-   error = EBADF;
-   goto out;
-   }
-   error = vfs_busy(mp, 0);
-   vfs_rel(mp);
-   if (error != 0)
-   return (error);
-#ifdef MAC
-   error = mac_mount_check_stat(td->td_ucred, mp);
-   if (error != 0)
-   goto out;
-#endif
-   /*
-* Set these in case the underlying filesystem fails to do so.
-*/
-   sp = >mnt_stat;
-   sp->f_version = STATFS_VERSION;
-   sp->f_namemax = NAME_MAX;
-   sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
-   error = VFS_STATFS(mp, sp);
-   if (error != 0)
-   goto out;
-   if (priv_check(td, PRIV_VFS_GENERATION)) {
-   bcopy(sp, , sizeof(sb));
-   sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
-   prison_enforce_statfs(td->td_ucred, mp, );
-   sp = 
-   }
-   *buf = *sp;
-out:
-   if (mp)
-   vfs_unbusy(mp);
-   return (error);
+   return (kern_do_statfs(td, mp, buf));
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311776 - stable/11/sys/kern

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 10:26:02 2017
New Revision: 311776
URL: https://svnweb.freebsd.org/changeset/base/311776

Log:
  MFC r33:
  There is no need to use temporary statfs buffer for fsid obliteration
  and prison enforcement.  Do it on the caller buffer directly.

Modified:
  stable/11/sys/kern/vfs_syscalls.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/vfs_syscalls.c
==
--- stable/11/sys/kern/vfs_syscalls.c   Mon Jan  9 10:23:37 2017
(r311775)
+++ stable/11/sys/kern/vfs_syscalls.c   Mon Jan  9 10:26:02 2017
(r311776)
@@ -247,7 +247,7 @@ statfs_scale_blocks(struct statfs *sf, l
 static int
 kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf)
 {
-   struct statfs *sp, sb;
+   struct statfs *sp;
int error;
 
if (mp == NULL)
@@ -271,13 +271,11 @@ kern_do_statfs(struct thread *td, struct
error = VFS_STATFS(mp, sp);
if (error != 0)
goto out;
+   *buf = *sp;
if (priv_check(td, PRIV_VFS_GENERATION)) {
-   bcopy(sp, , sizeof(sb));
-   sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
-   prison_enforce_statfs(td->td_ucred, mp, );
-   sp = 
+   buf->f_fsid.val[0] = buf->f_fsid.val[1] = 0;
+   prison_enforce_statfs(td->td_ucred, mp, buf);
}
-   *buf = *sp;
 out:
vfs_unbusy(mp);
return (error);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311775 - stable/11/sys/kern

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 10:23:37 2017
New Revision: 311775
URL: https://svnweb.freebsd.org/changeset/base/311775

Log:
  MFC r31:
  Style.

Modified:
  stable/11/sys/kern/vfs_syscalls.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/vfs_syscalls.c
==
--- stable/11/sys/kern/vfs_syscalls.c   Mon Jan  9 10:21:46 2017
(r311774)
+++ stable/11/sys/kern/vfs_syscalls.c   Mon Jan  9 10:23:37 2017
(r311775)
@@ -374,7 +374,7 @@ kern_fstatfs(struct thread *td, int fd, 
AUDIT_ARG_VNODE1(vp);
 #endif
mp = vp->v_mount;
-   if (mp)
+   if (mp != NULL)
vfs_ref(mp);
VOP_UNLOCK(vp, 0);
fdrop(fp, td);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311774 - stable/11/sys/kern

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 10:21:46 2017
New Revision: 311774
URL: https://svnweb.freebsd.org/changeset/base/311774

Log:
  MFC r311108:
  Move common code from kern_statfs() and kern_fstatfs() into a new helper.

Modified:
  stable/11/sys/kern/vfs_syscalls.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/vfs_syscalls.c
==
--- stable/11/sys/kern/vfs_syscalls.c   Mon Jan  9 10:18:34 2017
(r311773)
+++ stable/11/sys/kern/vfs_syscalls.c   Mon Jan  9 10:21:46 2017
(r311774)
@@ -244,6 +244,45 @@ statfs_scale_blocks(struct statfs *sf, l
sf->f_bavail >>= shift;
 }
 
+static int
+kern_do_statfs(struct thread *td, struct mount *mp, struct statfs *buf)
+{
+   struct statfs *sp, sb;
+   int error;
+
+   if (mp == NULL)
+   return (EBADF);
+   error = vfs_busy(mp, 0);
+   vfs_rel(mp);
+   if (error != 0)
+   return (error);
+#ifdef MAC
+   error = mac_mount_check_stat(td->td_ucred, mp);
+   if (error != 0)
+   goto out;
+#endif
+   /*
+* Set these in case the underlying filesystem fails to do so.
+*/
+   sp = >mnt_stat;
+   sp->f_version = STATFS_VERSION;
+   sp->f_namemax = NAME_MAX;
+   sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
+   error = VFS_STATFS(mp, sp);
+   if (error != 0)
+   goto out;
+   if (priv_check(td, PRIV_VFS_GENERATION)) {
+   bcopy(sp, , sizeof(sb));
+   sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
+   prison_enforce_statfs(td->td_ucred, mp, );
+   sp = 
+   }
+   *buf = *sp;
+out:
+   vfs_unbusy(mp);
+   return (error);
+}
+
 /*
  * Get filesystem statistics.
  */
@@ -275,7 +314,6 @@ kern_statfs(struct thread *td, char *pat
 struct statfs *buf)
 {
struct mount *mp;
-   struct statfs *sp, sb;
struct nameidata nd;
int error;
 
@@ -288,35 +326,7 @@ kern_statfs(struct thread *td, char *pat
vfs_ref(mp);
NDFREE(, NDF_ONLY_PNBUF);
vput(nd.ni_vp);
-   error = vfs_busy(mp, 0);
-   vfs_rel(mp);
-   if (error != 0)
-   return (error);
-#ifdef MAC
-   error = mac_mount_check_stat(td->td_ucred, mp);
-   if (error != 0)
-   goto out;
-#endif
-   /*
-* Set these in case the underlying filesystem fails to do so.
-*/
-   sp = >mnt_stat;
-   sp->f_version = STATFS_VERSION;
-   sp->f_namemax = NAME_MAX;
-   sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
-   error = VFS_STATFS(mp, sp);
-   if (error != 0)
-   goto out;
-   if (priv_check(td, PRIV_VFS_GENERATION)) {
-   bcopy(sp, , sizeof(sb));
-   sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
-   prison_enforce_statfs(td->td_ucred, mp, );
-   sp = 
-   }
-   *buf = *sp;
-out:
-   vfs_unbusy(mp);
-   return (error);
+   return (kern_do_statfs(td, mp, buf));
 }
 
 /*
@@ -350,7 +360,6 @@ kern_fstatfs(struct thread *td, int fd, 
 {
struct file *fp;
struct mount *mp;
-   struct statfs *sp, sb;
struct vnode *vp;
cap_rights_t rights;
int error;
@@ -369,40 +378,7 @@ kern_fstatfs(struct thread *td, int fd, 
vfs_ref(mp);
VOP_UNLOCK(vp, 0);
fdrop(fp, td);
-   if (mp == NULL) {
-   error = EBADF;
-   goto out;
-   }
-   error = vfs_busy(mp, 0);
-   vfs_rel(mp);
-   if (error != 0)
-   return (error);
-#ifdef MAC
-   error = mac_mount_check_stat(td->td_ucred, mp);
-   if (error != 0)
-   goto out;
-#endif
-   /*
-* Set these in case the underlying filesystem fails to do so.
-*/
-   sp = >mnt_stat;
-   sp->f_version = STATFS_VERSION;
-   sp->f_namemax = NAME_MAX;
-   sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
-   error = VFS_STATFS(mp, sp);
-   if (error != 0)
-   goto out;
-   if (priv_check(td, PRIV_VFS_GENERATION)) {
-   bcopy(sp, , sizeof(sb));
-   sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
-   prison_enforce_statfs(td->td_ucred, mp, );
-   sp = 
-   }
-   *buf = *sp;
-out:
-   if (mp)
-   vfs_unbusy(mp);
-   return (error);
+   return (kern_do_statfs(td, mp, buf));
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311773 - stable/10/sys/kern

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 10:18:34 2017
New Revision: 311773
URL: https://svnweb.freebsd.org/changeset/base/311773

Log:
  MFC r310615:
  Change knlist_destroy() to assertion.

Modified:
  stable/10/sys/kern/kern_event.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_event.c
==
--- stable/10/sys/kern/kern_event.c Mon Jan  9 10:13:53 2017
(r311772)
+++ stable/10/sys/kern/kern_event.c Mon Jan  9 10:18:34 2017
(r311773)
@@ -2177,17 +2177,8 @@ void
 knlist_destroy(struct knlist *knl)
 {
 
-#ifdef INVARIANTS
-   /*
-* if we run across this error, we need to find the offending
-* driver and have it call knlist_clear or knlist_delete.
-*/
-   if (!SLIST_EMPTY(>kl_list))
-   printf("WARNING: destroying knlist w/ knotes on it!\n");
-#endif
-
-   knl->kl_lockarg = knl->kl_lock = knl->kl_unlock = NULL;
-   SLIST_INIT(>kl_list);
+   KASSERT(KNLIST_EMPTY(knl),
+   ("destroying knlist %p with knotes on it", knl));
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311772 - stable/10/sys/sys

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 10:13:53 2017
New Revision: 311772
URL: https://svnweb.freebsd.org/changeset/base/311772

Log:
  MFC r311055:
  Remove unneeded externs keywords.  Reindent long lines.

Modified:
  stable/10/sys/sys/event.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/sys/event.h
==
--- stable/10/sys/sys/event.h   Mon Jan  9 09:57:34 2017(r311771)
+++ stable/10/sys/sys/event.h   Mon Jan  9 10:13:53 2017(r311772)
@@ -253,29 +253,29 @@ struct knlist;
 struct mtx;
 struct rwlock;
 
-extern voidknote(struct knlist *list, long hint, int lockflags);
-extern voidknote_fork(struct knlist *list, int pid);
-extern voidknlist_add(struct knlist *knl, struct knote *kn, int islocked);
-extern voidknlist_remove(struct knlist *knl, struct knote *kn, int 
islocked);
-extern voidknlist_remove_inevent(struct knlist *knl, struct knote *kn);
-extern int knlist_empty(struct knlist *knl);
-extern voidknlist_init(struct knlist *knl, void *lock,
-void (*kl_lock)(void *), void (*kl_unlock)(void *),
-void (*kl_assert_locked)(void *), void (*kl_assert_unlocked)(void *));
-extern voidknlist_init_mtx(struct knlist *knl, struct mtx *lock);
-extern voidknlist_init_rw_reader(struct knlist *knl, struct rwlock *lock);
-extern voidknlist_destroy(struct knlist *knl);
-extern voidknlist_cleardel(struct knlist *knl, struct thread *td,
+void   knote(struct knlist *list, long hint, int lockflags);
+void   knote_fork(struct knlist *list, int pid);
+void   knlist_add(struct knlist *knl, struct knote *kn, int islocked);
+void   knlist_remove(struct knlist *knl, struct knote *kn, int islocked);
+void   knlist_remove_inevent(struct knlist *knl, struct knote *kn);
+intknlist_empty(struct knlist *knl);
+void   knlist_init(struct knlist *knl, void *lock, void (*kl_lock)(void *),
+void (*kl_unlock)(void *), void (*kl_assert_locked)(void *),
+void (*kl_assert_unlocked)(void *));
+void   knlist_init_mtx(struct knlist *knl, struct mtx *lock);
+void   knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock);
+void   knlist_destroy(struct knlist *knl);
+void   knlist_cleardel(struct knlist *knl, struct thread *td,
int islocked, int killkn);
 #define knlist_clear(knl, islocked)\
-   knlist_cleardel((knl), NULL, (islocked), 0)
+   knlist_cleardel((knl), NULL, (islocked), 0)
 #define knlist_delete(knl, td, islocked)   \
-   knlist_cleardel((knl), (td), (islocked), 1)
-extern voidknote_fdclose(struct thread *p, int fd);
-extern int kqfd_register(int fd, struct kevent *kev, struct thread *p,
-   int waitok);
-extern int kqueue_add_filteropts(int filt, struct filterops *filtops);
-extern int kqueue_del_filteropts(int filt);
+   knlist_cleardel((knl), (td), (islocked), 1)
+void   knote_fdclose(struct thread *p, int fd);
+intkqfd_register(int fd, struct kevent *kev, struct thread *p,
+   int waitok);
+intkqueue_add_filteropts(int filt, struct filterops *filtops);
+intkqueue_del_filteropts(int filt);
 
 #else  /* !_KERNEL */
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311771 - stable/11/sys/kern

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 09:57:34 2017
New Revision: 311771
URL: https://svnweb.freebsd.org/changeset/base/311771

Log:
  MFC r310615:
  Change knlist_destroy() to assertion.

Modified:
  stable/11/sys/kern/kern_event.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_event.c
==
--- stable/11/sys/kern/kern_event.c Mon Jan  9 09:53:07 2017
(r311770)
+++ stable/11/sys/kern/kern_event.c Mon Jan  9 09:57:34 2017
(r311771)
@@ -2249,17 +2249,8 @@ void
 knlist_destroy(struct knlist *knl)
 {
 
-#ifdef INVARIANTS
-   /*
-* if we run across this error, we need to find the offending
-* driver and have it call knlist_clear or knlist_delete.
-*/
-   if (!SLIST_EMPTY(>kl_list))
-   printf("WARNING: destroying knlist w/ knotes on it!\n");
-#endif
-
-   knl->kl_lockarg = knl->kl_lock = knl->kl_unlock = NULL;
-   SLIST_INIT(>kl_list);
+   KASSERT(KNLIST_EMPTY(knl),
+   ("destroying knlist %p with knotes on it", knl));
 }
 
 void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311770 - stable/11/sys/sys

2017-01-09 Thread Konstantin Belousov
Author: kib
Date: Mon Jan  9 09:53:07 2017
New Revision: 311770
URL: https://svnweb.freebsd.org/changeset/base/311770

Log:
  MFC r311055:
  Remove unneeded externs keywords.  Reindent long lines.

Modified:
  stable/11/sys/sys/event.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/sys/event.h
==
--- stable/11/sys/sys/event.h   Mon Jan  9 09:28:03 2017(r311769)
+++ stable/11/sys/sys/event.h   Mon Jan  9 09:53:07 2017(r311770)
@@ -257,30 +257,30 @@ struct knlist;
 struct mtx;
 struct rwlock;
 
-extern voidknote(struct knlist *list, long hint, int lockflags);
-extern voidknote_fork(struct knlist *list, int pid);
-extern struct knlist *knlist_alloc(struct mtx *lock);
-extern voidknlist_detach(struct knlist *knl);
-extern voidknlist_add(struct knlist *knl, struct knote *kn, int islocked);
-extern voidknlist_remove(struct knlist *knl, struct knote *kn, int 
islocked);
-extern int knlist_empty(struct knlist *knl);
-extern voidknlist_init(struct knlist *knl, void *lock,
-void (*kl_lock)(void *), void (*kl_unlock)(void *),
-void (*kl_assert_locked)(void *), void (*kl_assert_unlocked)(void *));
-extern voidknlist_init_mtx(struct knlist *knl, struct mtx *lock);
-extern voidknlist_init_rw_reader(struct knlist *knl, struct rwlock *lock);
-extern voidknlist_destroy(struct knlist *knl);
-extern voidknlist_cleardel(struct knlist *knl, struct thread *td,
-   int islocked, int killkn);
+void   knote(struct knlist *list, long hint, int lockflags);
+void   knote_fork(struct knlist *list, int pid);
+struct knlist *knlist_alloc(struct mtx *lock);
+void   knlist_detach(struct knlist *knl);
+void   knlist_add(struct knlist *knl, struct knote *kn, int islocked);
+void   knlist_remove(struct knlist *knl, struct knote *kn, int islocked);
+intknlist_empty(struct knlist *knl);
+void   knlist_init(struct knlist *knl, void *lock, void (*kl_lock)(void *),
+   void (*kl_unlock)(void *), void (*kl_assert_locked)(void *),
+   void (*kl_assert_unlocked)(void *));
+void   knlist_init_mtx(struct knlist *knl, struct mtx *lock);
+void   knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock);
+void   knlist_destroy(struct knlist *knl);
+void   knlist_cleardel(struct knlist *knl, struct thread *td,
+   int islocked, int killkn);
 #define knlist_clear(knl, islocked)\
-   knlist_cleardel((knl), NULL, (islocked), 0)
+   knlist_cleardel((knl), NULL, (islocked), 0)
 #define knlist_delete(knl, td, islocked)   \
-   knlist_cleardel((knl), (td), (islocked), 1)
-extern voidknote_fdclose(struct thread *p, int fd);
-extern int kqfd_register(int fd, struct kevent *kev, struct thread *p,
-   int waitok);
-extern int kqueue_add_filteropts(int filt, struct filterops *filtops);
-extern int kqueue_del_filteropts(int filt);
+   knlist_cleardel((knl), (td), (islocked), 1)
+void   knote_fdclose(struct thread *p, int fd);
+intkqfd_register(int fd, struct kevent *kev, struct thread *p,
+   int waitok);
+intkqueue_add_filteropts(int filt, struct filterops *filtops);
+intkqueue_del_filteropts(int filt);
 
 #else  /* !_KERNEL */
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311769 - head/usr.bin/netstat

2017-01-09 Thread Steven Hartland
Author: smh
Date: Mon Jan  9 09:28:03 2017
New Revision: 311769
URL: https://svnweb.freebsd.org/changeset/base/311769

Log:
  Fix rstat: symbol not in namelist from netstat
  
  Load kvm symbols earlier to prevent rstat: symbol not in namelist
  error when running netstat -rs.
  
  Submitted by: Sebastian Huber 
  MFC after:1 week
  Sponsored by: Multiplay

Modified:
  head/usr.bin/netstat/main.c

Modified: head/usr.bin/netstat/main.c
==
--- head/usr.bin/netstat/main.c Mon Jan  9 08:12:22 2017(r311768)
+++ head/usr.bin/netstat/main.c Mon Jan  9 09:28:03 2017(r311769)
@@ -427,6 +427,9 @@ main(int argc, char *argv[])
if (xflag && Tflag)
xo_errx(1, "-x and -T are incompatible, pick one.");
 
+   /* Load all necessary kvm symbols */
+   kresolve_list(nl);
+
if (Bflag) {
if (!live)
usage();
@@ -507,9 +510,6 @@ main(int argc, char *argv[])
exit(0);
}
 
-   /* Load all necessary kvm symbols */
-   kresolve_list(nl);
-
if (tp) {
xo_open_container("statistics");
printproto(tp, tp->pr_name, );
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311768 - in stable/10/sys/dev/sfxge: . common

2017-01-09 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jan  9 08:12:22 2017
New Revision: 311768
URL: https://svnweb.freebsd.org/changeset/base/311768

Log:
  MFC r311640
  
  sfxge(4): allow DMA descs to cross 4k boundary on EF10
  
  Siena has limitation on maximum byte count and 4k boundary crosssing
  (which is stricter than maximum byte count).
  EF10 has limitation on maximum byte count only.
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/common/ef10_tx.c
  stable/10/sys/dev/sfxge/common/efx.h
  stable/10/sys/dev/sfxge/common/efx_tx.c
  stable/10/sys/dev/sfxge/common/hunt_nic.c
  stable/10/sys/dev/sfxge/common/medford_nic.c
  stable/10/sys/dev/sfxge/common/siena_nic.c
  stable/10/sys/dev/sfxge/sfxge_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/10/sys/dev/sfxge/common/ef10_tx.cMon Jan  9 08:11:16 2017
(r311767)
+++ stable/10/sys/dev/sfxge/common/ef10_tx.cMon Jan  9 08:12:22 2017
(r311768)
@@ -438,8 +438,9 @@ ef10_tx_qpost(
size_t offset;
efx_qword_t qword;
 
-   /* Fragments must not span 4k boundaries. */
-   EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= (addr + size));
+   /* No limitations on boundary crossing */
+   EFSYS_ASSERT(size <=
+   etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max);
 
id = added++ & etp->et_mask;
offset = id * sizeof (efx_qword_t);
@@ -584,8 +585,8 @@ ef10_tx_qdesc_dma_create(
__inboolean_t eop,
__out   efx_desc_t *edp)
 {
-   /* Fragments must not span 4k boundaries. */
-   EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= addr + size);
+   /* No limitations on boundary crossing */
+   EFSYS_ASSERT(size <= etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max);
 
EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index,
efsys_dma_addr_t, addr,

Modified: stable/10/sys/dev/sfxge/common/efx.h
==
--- stable/10/sys/dev/sfxge/common/efx.hMon Jan  9 08:11:16 2017
(r311767)
+++ stable/10/sys/dev/sfxge/common/efx.hMon Jan  9 08:12:22 2017
(r311768)
@@ -1154,6 +1154,13 @@ typedef struct efx_nic_cfg_s {
uint32_tenc_rx_batch_max;
/* Number of rx descriptors the hardware requires for a push. */
uint32_tenc_rx_push_align;
+   /* Maximum amount of data in DMA descriptor */
+   uint32_tenc_tx_dma_desc_size_max;
+   /*
+* Boundary which DMA descriptor data must not cross or 0 if no
+* limitation.
+*/
+   uint32_tenc_tx_dma_desc_boundary;
/*
 * Maximum number of bytes into the packet the TCP header can start for
 * the hardware to apply TSO packet edits.

Modified: stable/10/sys/dev/sfxge/common/efx_tx.c
==
--- stable/10/sys/dev/sfxge/common/efx_tx.c Mon Jan  9 08:11:16 2017
(r311767)
+++ stable/10/sys/dev/sfxge/common/efx_tx.c Mon Jan  9 08:12:22 2017
(r311768)
@@ -748,8 +748,12 @@ siena_tx_qpost(
size_t size = ebp->eb_size;
efsys_dma_addr_t end = start + size;
 
-   /* Fragments must not span 4k boundaries. */
-   EFSYS_ASSERT(P2ROUNDUP(start + 1, 4096) >= end);
+   /*
+* Fragments must not span 4k boundaries.
+* Here it is a stricter requirement than the maximum length.
+*/
+   EFSYS_ASSERT(P2ROUNDUP(start + 1,
+   etp->et_enp->en_nic_cfg.enc_tx_dma_desc_boundary) >= end);
 
EFX_TX_DESC(etp, start, size, ebp->eb_eop, added);
}
@@ -1009,8 +1013,12 @@ siena_tx_qdesc_dma_create(
__inboolean_t eop,
__out   efx_desc_t *edp)
 {
-   /* Fragments must not span 4k boundaries. */
-   EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= addr + size);
+   /*
+* Fragments must not span 4k boundaries.
+* Here it is a stricter requirement than the maximum length.
+*/
+   EFSYS_ASSERT(P2ROUNDUP(addr + 1,
+   etp->et_enp->en_nic_cfg.enc_tx_dma_desc_boundary) >= addr + size);
 
EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index,
efsys_dma_addr_t, addr,

Modified: stable/10/sys/dev/sfxge/common/hunt_nic.c
==
--- stable/10/sys/dev/sfxge/common/hunt_nic.c   Mon Jan  9 08:11:16 2017
(r311767)
+++ stable/10/sys/dev/sfxge/common/hunt_nic.c   Mon Jan  9 08:12:22 2017
(r311768)
@@ -304,6 +304,10 @@ hunt_board_cfg(
/* Alignment for WPTR 

svn commit: r311767 - stable/10/sys/dev/sfxge

2017-01-09 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jan  9 08:11:16 2017
New Revision: 311767
URL: https://svnweb.freebsd.org/changeset/base/311767

Log:
  MFC r311639
  
  sfxge(4): treat EFX_LINK_UNKOWN as link down
  
  It is safer to consider EFX_LINK_UNKNOWN as link down.
  link_mode is set to EFX_LINK_UNKNOWN on port stop and fini.
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/sfxge.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge.h
==
--- stable/10/sys/dev/sfxge/sfxge.h Mon Jan  9 08:10:12 2017
(r311766)
+++ stable/10/sys/dev/sfxge/sfxge.h Mon Jan  9 08:11:16 2017
(r311767)
@@ -329,7 +329,9 @@ struct sfxge_softc {
 #endif
 };
 
-#defineSFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN)
+#defineSFXGE_LINK_UP(sc) \
+   ((sc)->port.link_mode != EFX_LINK_DOWN && \
+(sc)->port.link_mode != EFX_LINK_UNKNOWN)
 #defineSFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING)
 
 #defineSFXGE_PARAM(_name)  "hw.sfxge." #_name
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311766 - stable/10/sys/dev/sfxge

2017-01-09 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jan  9 08:10:12 2017
New Revision: 311766
URL: https://svnweb.freebsd.org/changeset/base/311766

Log:
  MFC r311638
  
  sfxge(4): use SFXGE_LINK_UP() to report link up state
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/sfxge_port.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge_port.c
==
--- stable/10/sys/dev/sfxge/sfxge_port.cMon Jan  9 08:07:18 2017
(r311765)
+++ stable/10/sys/dev/sfxge/sfxge_port.cMon Jan  9 08:10:12 2017
(r311766)
@@ -284,8 +284,7 @@ sfxge_mac_link_update(struct sfxge_softc
port->link_mode = mode;
 
/* Push link state update to the OS */
-   link_state = (port->link_mode != EFX_LINK_DOWN ?
- LINK_STATE_UP : LINK_STATE_DOWN);
+   link_state = (SFXGE_LINK_UP(sc) ? LINK_STATE_UP : LINK_STATE_DOWN);
if_initbaudrate(sc->ifnet, sfxge_link_baudrate[port->link_mode]);
if_link_state_change(sc->ifnet, link_state);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r311707 - in head/sys/dev/rtwn: . usb

2017-01-09 Thread Hans Petter Selasky

On 01/09/17 00:41, Andriy Voskoboinyk wrote:

Modified: head/sys/dev/rtwn/usb/rtwn_usb_ep.c
==
--- head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jan  8 23:25:46 2017
(r311706)
+++ head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jan  8 23:41:17 2017
(r311707)
@@ -63,7 +63,6 @@ static struct usb_config rtwn_config[RTW
.type = UE_BULK,
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
-   .bufsize = RTWN_RXBUFSZ,
.flags = {
.pipe_bof = 1,
.short_xfer_ok = 1
@@ -222,6 +221,7 @@ rtwn_usb_setup_endpoints(struct rtwn_usb
break;
}

+   rtwn_config[RTWN_BULK_RX].bufsize = sc->rx_dma_size + 1024;


Hi,

You should copy the rtwn_config to the stack/softc, and not write to the 
static struct, which should be made "static const" after this change!


This might lead to a race when multiple adapters are connecting at the 
same time! Remember USB enumeration is multithreaded.


Else your change looks good.

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


svn commit: r311765 - in stable/11/sys/dev/sfxge: . common

2017-01-09 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jan  9 08:07:18 2017
New Revision: 311765
URL: https://svnweb.freebsd.org/changeset/base/311765

Log:
  MFC r311640
  
  sfxge(4): allow DMA descs to cross 4k boundary on EF10
  
  Siena has limitation on maximum byte count and 4k boundary crosssing
  (which is stricter than maximum byte count).
  EF10 has limitation on maximum byte count only.
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/ef10_tx.c
  stable/11/sys/dev/sfxge/common/efx.h
  stable/11/sys/dev/sfxge/common/efx_tx.c
  stable/11/sys/dev/sfxge/common/hunt_nic.c
  stable/11/sys/dev/sfxge/common/medford_nic.c
  stable/11/sys/dev/sfxge/common/siena_nic.c
  stable/11/sys/dev/sfxge/sfxge_tx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_tx.c
==
--- stable/11/sys/dev/sfxge/common/ef10_tx.cMon Jan  9 08:06:01 2017
(r311764)
+++ stable/11/sys/dev/sfxge/common/ef10_tx.cMon Jan  9 08:07:18 2017
(r311765)
@@ -438,8 +438,9 @@ ef10_tx_qpost(
size_t offset;
efx_qword_t qword;
 
-   /* Fragments must not span 4k boundaries. */
-   EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= (addr + size));
+   /* No limitations on boundary crossing */
+   EFSYS_ASSERT(size <=
+   etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max);
 
id = added++ & etp->et_mask;
offset = id * sizeof (efx_qword_t);
@@ -584,8 +585,8 @@ ef10_tx_qdesc_dma_create(
__inboolean_t eop,
__out   efx_desc_t *edp)
 {
-   /* Fragments must not span 4k boundaries. */
-   EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= addr + size);
+   /* No limitations on boundary crossing */
+   EFSYS_ASSERT(size <= etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max);
 
EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index,
efsys_dma_addr_t, addr,

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hMon Jan  9 08:06:01 2017
(r311764)
+++ stable/11/sys/dev/sfxge/common/efx.hMon Jan  9 08:07:18 2017
(r311765)
@@ -1154,6 +1154,13 @@ typedef struct efx_nic_cfg_s {
uint32_tenc_rx_batch_max;
/* Number of rx descriptors the hardware requires for a push. */
uint32_tenc_rx_push_align;
+   /* Maximum amount of data in DMA descriptor */
+   uint32_tenc_tx_dma_desc_size_max;
+   /*
+* Boundary which DMA descriptor data must not cross or 0 if no
+* limitation.
+*/
+   uint32_tenc_tx_dma_desc_boundary;
/*
 * Maximum number of bytes into the packet the TCP header can start for
 * the hardware to apply TSO packet edits.

Modified: stable/11/sys/dev/sfxge/common/efx_tx.c
==
--- stable/11/sys/dev/sfxge/common/efx_tx.c Mon Jan  9 08:06:01 2017
(r311764)
+++ stable/11/sys/dev/sfxge/common/efx_tx.c Mon Jan  9 08:07:18 2017
(r311765)
@@ -748,8 +748,12 @@ siena_tx_qpost(
size_t size = ebp->eb_size;
efsys_dma_addr_t end = start + size;
 
-   /* Fragments must not span 4k boundaries. */
-   EFSYS_ASSERT(P2ROUNDUP(start + 1, 4096) >= end);
+   /*
+* Fragments must not span 4k boundaries.
+* Here it is a stricter requirement than the maximum length.
+*/
+   EFSYS_ASSERT(P2ROUNDUP(start + 1,
+   etp->et_enp->en_nic_cfg.enc_tx_dma_desc_boundary) >= end);
 
EFX_TX_DESC(etp, start, size, ebp->eb_eop, added);
}
@@ -1009,8 +1013,12 @@ siena_tx_qdesc_dma_create(
__inboolean_t eop,
__out   efx_desc_t *edp)
 {
-   /* Fragments must not span 4k boundaries. */
-   EFSYS_ASSERT(P2ROUNDUP(addr + 1, 4096) >= addr + size);
+   /*
+* Fragments must not span 4k boundaries.
+* Here it is a stricter requirement than the maximum length.
+*/
+   EFSYS_ASSERT(P2ROUNDUP(addr + 1,
+   etp->et_enp->en_nic_cfg.enc_tx_dma_desc_boundary) >= addr + size);
 
EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index,
efsys_dma_addr_t, addr,

Modified: stable/11/sys/dev/sfxge/common/hunt_nic.c
==
--- stable/11/sys/dev/sfxge/common/hunt_nic.c   Mon Jan  9 08:06:01 2017
(r311764)
+++ stable/11/sys/dev/sfxge/common/hunt_nic.c   Mon Jan  9 08:07:18 2017
(r311765)
@@ -304,6 +304,10 @@ hunt_board_cfg(
/* Alignment for WPTR 

svn commit: r311764 - stable/11/sys/dev/sfxge

2017-01-09 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jan  9 08:06:01 2017
New Revision: 311764
URL: https://svnweb.freebsd.org/changeset/base/311764

Log:
  MFC r311639
  
  sfxge(4): treat EFX_LINK_UNKOWN as link down
  
  It is safer to consider EFX_LINK_UNKNOWN as link down.
  link_mode is set to EFX_LINK_UNKNOWN on port stop and fini.
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/sfxge.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/sfxge.h
==
--- stable/11/sys/dev/sfxge/sfxge.h Mon Jan  9 08:05:14 2017
(r311763)
+++ stable/11/sys/dev/sfxge/sfxge.h Mon Jan  9 08:06:01 2017
(r311764)
@@ -326,7 +326,9 @@ struct sfxge_softc {
 #endif
 };
 
-#defineSFXGE_LINK_UP(sc) ((sc)->port.link_mode != EFX_LINK_DOWN)
+#defineSFXGE_LINK_UP(sc) \
+   ((sc)->port.link_mode != EFX_LINK_DOWN && \
+(sc)->port.link_mode != EFX_LINK_UNKNOWN)
 #defineSFXGE_RUNNING(sc) ((sc)->ifnet->if_drv_flags & IFF_DRV_RUNNING)
 
 #defineSFXGE_PARAM(_name)  "hw.sfxge." #_name
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r311763 - stable/11/sys/dev/sfxge

2017-01-09 Thread Andrew Rybchenko
Author: arybchik
Date: Mon Jan  9 08:05:14 2017
New Revision: 311763
URL: https://svnweb.freebsd.org/changeset/base/311763

Log:
  MFC r311638
  
  sfxge(4): use SFXGE_LINK_UP() to report link up state
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/sfxge_port.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/sfxge_port.c
==
--- stable/11/sys/dev/sfxge/sfxge_port.cMon Jan  9 07:36:31 2017
(r311762)
+++ stable/11/sys/dev/sfxge/sfxge_port.cMon Jan  9 08:05:14 2017
(r311763)
@@ -311,8 +311,7 @@ sfxge_mac_link_update(struct sfxge_softc
port->link_mode = mode;
 
/* Push link state update to the OS */
-   link_state = (port->link_mode != EFX_LINK_DOWN ?
- LINK_STATE_UP : LINK_STATE_DOWN);
+   link_state = (SFXGE_LINK_UP(sc) ? LINK_STATE_UP : LINK_STATE_DOWN);
sc->ifnet->if_baudrate = sfxge_link_baudrate[port->link_mode];
if_link_state_change(sc->ifnet, link_state);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"