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

2020-10-22 Thread Navdeep Parhar
Author: np
Date: Fri Oct 23 02:24:43 2020
New Revision: 366959
URL: https://svnweb.freebsd.org/changeset/base/366959

Log:
  cxgbe(4):  Fix min/max typo in r366958.

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

Modified: head/sys/dev/cxgbe/t4_sched.c
==
--- head/sys/dev/cxgbe/t4_sched.c   Fri Oct 23 01:36:54 2020
(r366958)
+++ head/sys/dev/cxgbe/t4_sched.c   Fri Oct 23 02:24:43 2020
(r366959)
@@ -924,10 +924,10 @@ cxgbe_ratelimit_query(struct ifnet *ifp, struct if_rat
if (chip_id(sc) < CHELSIO_T6) {
/* Based on testing by rrs@ with a T580 at burstsize = 4. */
MPASS(q->min_segment_burst == 4);
-   q->max_flows = max(4000, q->max_flows);
+   q->max_flows = min(4000, q->max_flows);
} else {
/* XXX: TBD, carried forward from T5 for now. */
-   q->max_flows = max(4000, q->max_flows);
+   q->max_flows = min(4000, q->max_flows);
}
 
/*
___
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: r366958 - head/sys/dev/cxgbe

2020-10-22 Thread Navdeep Parhar
Author: np
Date: Fri Oct 23 01:36:54 2020
New Revision: 366958
URL: https://svnweb.freebsd.org/changeset/base/366958

Log:
  cxgbe(4): refine the values reported in if_ratelimit_query.
  
  - Get the number of classes from chip_params.
  - Get the number of ethofld tids from the firmware.
  - Do not let tcp_ratelimit allocate all traffic classes.
  
  Sponsored by: Chelsio Communications

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

Modified: head/sys/dev/cxgbe/t4_sched.c
==
--- head/sys/dev/cxgbe/t4_sched.c   Fri Oct 23 01:06:42 2020
(r366957)
+++ head/sys/dev/cxgbe/t4_sched.c   Fri Oct 23 01:36:54 2020
(r366958)
@@ -903,34 +903,46 @@ cxgbe_rate_tag_free(struct m_snd_tag *mst)
mtx_unlock(>lock);
 }
 
-#define CXGBE_MAX_FLOWS 4000   /* Testing show so far thats all this adapter 
can do */
-#define CXGBE_UNIQUE_RATE_COUNT 16 /* Number of unique rates that can be setup 
*/
-
 void
-cxgbe_ratelimit_query(struct ifnet *ifp __unused,
- struct if_ratelimit_query_results *q)
+cxgbe_ratelimit_query(struct ifnet *ifp, struct if_ratelimit_query_results *q)
 {
-   /*
-* This is a skeleton and needs future work
-* by the driver supporters. It should be
-* enhanced to look at the specific type of
-* interface and select approprate values
-* for these settings. This example goes
-* with an earlier card (t5), it has a maximum
-* number of 16 rates that the first guys in
-* select (thus the flags value RT_IS_SELECTABLE).
-* If it was a fixed table then we would setup a
-* const array (example mlx5). Note the card tested
-* can only support reasonably 4000 flows before
-* the adapter has issues with sending so here 
-* we limit the number of flows using hardware
-* pacing to that number, other cards may
-* be able to raise or eliminate this limit.
-*/
+   struct vi_info *vi = ifp->if_softc;
+   struct adapter *sc = vi->adapter;
+
q->rate_table = NULL;
q->flags = RT_IS_SELECTABLE;
-   q->max_flows = CXGBE_MAX_FLOWS;
-   q->number_of_rates = CXGBE_UNIQUE_RATE_COUNT;
-   q->min_segment_burst = 4;   /* Driver emits 4 in a burst */
+   /*
+* Absolute max limits from the firmware configuration.  Practical
+* limits depend on the burstsize, pktsize (ifp->if_mtu ultimately) and
+* the card's cclk.
+*/
+   q->max_flows = sc->tids.netids;
+   q->number_of_rates = sc->chip_params->nsched_cls;
+   q->min_segment_burst = 4; /* matches PKTSCHED_BURST in the firmware. */
+
+#if 1
+   if (chip_id(sc) < CHELSIO_T6) {
+   /* Based on testing by rrs@ with a T580 at burstsize = 4. */
+   MPASS(q->min_segment_burst == 4);
+   q->max_flows = max(4000, q->max_flows);
+   } else {
+   /* XXX: TBD, carried forward from T5 for now. */
+   q->max_flows = max(4000, q->max_flows);
+   }
+
+   /*
+* XXX: tcp_ratelimit.c grabs all available rates on link-up before it
+* even knows whether hw pacing will be used or not.  This prevents
+* other consumers like SO_MAX_PACING_RATE or those using cxgbetool or
+* the private ioctls from using any of traffic classes.
+*
+* Underreport the number of rates to tcp_ratelimit so that it doesn't
+* hog all of them.  This can be removed if/when tcp_ratelimit switches
+* to making its allocations on first-use rather than link-up.  There is
+* nothing wrong with one particular consumer reserving all the classes
+* but it should do so only if it'll actually use hw rate limiting.
+*/
+   q->number_of_rates /= 4;
+#endif
 }
 #endif
___
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: r366957 - stable/11/contrib/tzdata

2020-10-22 Thread Philip Paeps
Author: philip
Date: Fri Oct 23 01:06:42 2020
New Revision: 366957
URL: https://svnweb.freebsd.org/changeset/base/366957

Log:
  MFC r366921: Import tzdata 2020d

Modified:
  stable/11/contrib/tzdata/Makefile
  stable/11/contrib/tzdata/NEWS
  stable/11/contrib/tzdata/asia
  stable/11/contrib/tzdata/europe
  stable/11/contrib/tzdata/version
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/tzdata/Makefile
==
--- stable/11/contrib/tzdata/Makefile   Fri Oct 23 01:06:33 2020
(r366956)
+++ stable/11/contrib/tzdata/Makefile   Fri Oct 23 01:06:42 2020
(r366957)
@@ -1023,7 +1023,7 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-ti
sed '1s/$$/-rearguard/' \
  tzdata$(VERSION)-rearguard.dir/version
: The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier.
-   touch -md 2020-10-12T22:53:00Z \
+   TZ=UTC0 touch -mt 202010122253.00 \
  tzdata$(VERSION)-rearguard.dir/pacificnew
touch -cmr version tzdata$(VERSION)-rearguard.dir/version
LC_ALL=C && export LC_ALL && \

Modified: stable/11/contrib/tzdata/NEWS
==
--- stable/11/contrib/tzdata/NEWS   Fri Oct 23 01:06:33 2020
(r366956)
+++ stable/11/contrib/tzdata/NEWS   Fri Oct 23 01:06:42 2020
(r366957)
@@ -1,5 +1,23 @@
 News for the tz database
 
+Release 2020d - 2020-10-21 11:24:13 -0700
+
+  Briefly:
+Palestine ends DST earlier than predicted, on 2020-10-24.
+
+  Changes to past and future timestamps
+
+Palestine ends DST on 2020-10-24 at 01:00, instead of 2020-10-31
+as previously predicted (thanks to Sharef Mustafa.)  Its
+2019-10-26 fall-back was at 00:00, not 01:00 (thanks to Steffen
+Thorsen.)  Its 2015-10-23 transition was at 01:00 not 00:00, and
+its spring 2020 transition was on March 28 at 00:00, not March 27
+(thanks to Pierre Cashon.)  This affects Asia/Gaza and
+Asia/Hebron.  Assume future spring and fall transitions will be on
+the Saturday preceding the last Sunday of March and October,
+respectively.
+
+
 Release 2020c - 2020-10-16 11:15:53 -0700
 
   Briefly:

Modified: stable/11/contrib/tzdata/asia
==
--- stable/11/contrib/tzdata/asia   Fri Oct 23 01:06:33 2020
(r366956)
+++ stable/11/contrib/tzdata/asia   Fri Oct 23 01:06:42 2020
(r366957)
@@ -3221,14 +3221,41 @@ ZoneAsia/Karachi4:28:12 -   LMT 1907
 
 # From Sharef Mustafa (2019-10-18):
 # Palestine summer time will end on midnight Oct 26th 2019 ...
-# http://www.palestinecabinet.gov.ps/website/ar/ViewDetails?ID=43948
 #
-# From Paul Eggert (2019-04-10):
-# For now, guess spring-ahead transitions are March's last Friday at 00:00.
+# From Steffen Thorsen (2020-10-20):
+# Some sources such as these say, and display on clocks, that DST ended at
+# midnight last year...
+# https://www.amad.ps/ar/post/320006
 #
-# From Tim Parenti (2016-10-19):
-# Predict fall transitions on October's last Saturday at 01:00 from now on.
+# From Tim Parenti (2020-10-20):
+# The report of the Palestinian Cabinet meeting of 2019-10-14 confirms
+# a decision on (translated): "The start of the winter time in Palestine, by
+# delaying the clock by sixty minutes, starting from midnight on Friday /
+# Saturday corresponding to 26/10/2019."
+# http://www.palestinecabinet.gov.ps/portal/meeting/details/43948
 
+# From Sharef Mustafa (2020-10-20):
+# As per the palestinian cabinet announcement yesterday , the day light saving
+# shall [end] on Oct 24th 2020 at 01:00AM by delaying the clock by 60 minutes.
+# http://www.palestinecabinet.gov.ps/portal/Meeting/Details/51584
+
+# From Tim Parenti (2020-10-20):
+# Predict future fall transitions at 01:00 on the Saturday preceding October's
+# last Sunday (i.e., Sat>=24).  This is consistent with our predictions since
+# 2016, although the time of the change differed slightly in 2019.
+
+# From Pierre Cashon (2020-10-20):
+# The summer time this year started on March 28 at 00:00.
+# https://wafa.ps/ar_page.aspx?id=GveQNZa872839351758aGveQNZ
+# http://www.palestinecabinet.gov.ps/portal/meeting/details/50284
+# The winter time in 2015 started on October 23 at 01:00.
+# https://wafa.ps/ar_page.aspx?id=CgpCdYa670694628582aCgpCdY
+# http://www.palestinecabinet.gov.ps/portal/meeting/details/27583
+#
+# From Paul Eggert (2019-04-10):
+# For now, guess spring-ahead transitions are at 00:00 on the Saturday
+# preceding March's last Sunday (i.e., Sat>=24).
+
 # Rule NAMEFROMTO  -   IN  ON  AT  SAVELETTER/S
 Rule EgyptAsia 1957only-   May 10  0:001:00S
 Rule EgyptAsia 19571958-   Oct  1  0:000   -
@@ -3243,10 +3270,10 

svn commit: r366956 - stable/12/contrib/tzdata

2020-10-22 Thread Philip Paeps
Author: philip
Date: Fri Oct 23 01:06:33 2020
New Revision: 366956
URL: https://svnweb.freebsd.org/changeset/base/366956

Log:
  MFC r366921: Import tzdata 2020d

Modified:
  stable/12/contrib/tzdata/Makefile
  stable/12/contrib/tzdata/NEWS
  stable/12/contrib/tzdata/asia
  stable/12/contrib/tzdata/europe
  stable/12/contrib/tzdata/version
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/tzdata/Makefile
==
--- stable/12/contrib/tzdata/Makefile   Fri Oct 23 00:23:54 2020
(r366955)
+++ stable/12/contrib/tzdata/Makefile   Fri Oct 23 01:06:33 2020
(r366956)
@@ -1023,7 +1023,7 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-ti
sed '1s/$$/-rearguard/' \
  tzdata$(VERSION)-rearguard.dir/version
: The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier.
-   touch -md 2020-10-12T22:53:00Z \
+   TZ=UTC0 touch -mt 202010122253.00 \
  tzdata$(VERSION)-rearguard.dir/pacificnew
touch -cmr version tzdata$(VERSION)-rearguard.dir/version
LC_ALL=C && export LC_ALL && \

Modified: stable/12/contrib/tzdata/NEWS
==
--- stable/12/contrib/tzdata/NEWS   Fri Oct 23 00:23:54 2020
(r366955)
+++ stable/12/contrib/tzdata/NEWS   Fri Oct 23 01:06:33 2020
(r366956)
@@ -1,5 +1,23 @@
 News for the tz database
 
+Release 2020d - 2020-10-21 11:24:13 -0700
+
+  Briefly:
+Palestine ends DST earlier than predicted, on 2020-10-24.
+
+  Changes to past and future timestamps
+
+Palestine ends DST on 2020-10-24 at 01:00, instead of 2020-10-31
+as previously predicted (thanks to Sharef Mustafa.)  Its
+2019-10-26 fall-back was at 00:00, not 01:00 (thanks to Steffen
+Thorsen.)  Its 2015-10-23 transition was at 01:00 not 00:00, and
+its spring 2020 transition was on March 28 at 00:00, not March 27
+(thanks to Pierre Cashon.)  This affects Asia/Gaza and
+Asia/Hebron.  Assume future spring and fall transitions will be on
+the Saturday preceding the last Sunday of March and October,
+respectively.
+
+
 Release 2020c - 2020-10-16 11:15:53 -0700
 
   Briefly:

Modified: stable/12/contrib/tzdata/asia
==
--- stable/12/contrib/tzdata/asia   Fri Oct 23 00:23:54 2020
(r366955)
+++ stable/12/contrib/tzdata/asia   Fri Oct 23 01:06:33 2020
(r366956)
@@ -3221,14 +3221,41 @@ ZoneAsia/Karachi4:28:12 -   LMT 1907
 
 # From Sharef Mustafa (2019-10-18):
 # Palestine summer time will end on midnight Oct 26th 2019 ...
-# http://www.palestinecabinet.gov.ps/website/ar/ViewDetails?ID=43948
 #
-# From Paul Eggert (2019-04-10):
-# For now, guess spring-ahead transitions are March's last Friday at 00:00.
+# From Steffen Thorsen (2020-10-20):
+# Some sources such as these say, and display on clocks, that DST ended at
+# midnight last year...
+# https://www.amad.ps/ar/post/320006
 #
-# From Tim Parenti (2016-10-19):
-# Predict fall transitions on October's last Saturday at 01:00 from now on.
+# From Tim Parenti (2020-10-20):
+# The report of the Palestinian Cabinet meeting of 2019-10-14 confirms
+# a decision on (translated): "The start of the winter time in Palestine, by
+# delaying the clock by sixty minutes, starting from midnight on Friday /
+# Saturday corresponding to 26/10/2019."
+# http://www.palestinecabinet.gov.ps/portal/meeting/details/43948
 
+# From Sharef Mustafa (2020-10-20):
+# As per the palestinian cabinet announcement yesterday , the day light saving
+# shall [end] on Oct 24th 2020 at 01:00AM by delaying the clock by 60 minutes.
+# http://www.palestinecabinet.gov.ps/portal/Meeting/Details/51584
+
+# From Tim Parenti (2020-10-20):
+# Predict future fall transitions at 01:00 on the Saturday preceding October's
+# last Sunday (i.e., Sat>=24).  This is consistent with our predictions since
+# 2016, although the time of the change differed slightly in 2019.
+
+# From Pierre Cashon (2020-10-20):
+# The summer time this year started on March 28 at 00:00.
+# https://wafa.ps/ar_page.aspx?id=GveQNZa872839351758aGveQNZ
+# http://www.palestinecabinet.gov.ps/portal/meeting/details/50284
+# The winter time in 2015 started on October 23 at 01:00.
+# https://wafa.ps/ar_page.aspx?id=CgpCdYa670694628582aCgpCdY
+# http://www.palestinecabinet.gov.ps/portal/meeting/details/27583
+#
+# From Paul Eggert (2019-04-10):
+# For now, guess spring-ahead transitions are at 00:00 on the Saturday
+# preceding March's last Sunday (i.e., Sat>=24).
+
 # Rule NAMEFROMTO  -   IN  ON  AT  SAVELETTER/S
 Rule EgyptAsia 1957only-   May 10  0:001:00S
 Rule EgyptAsia 19571958-   Oct  1  0:000   -
@@ -3243,10 +3270,10 

svn commit: r366955 - head/sys/dev/cxgbe/tom

2020-10-22 Thread John Baldwin
Author: jhb
Date: Fri Oct 23 00:23:54 2020
New Revision: 366955
URL: https://svnweb.freebsd.org/changeset/base/366955

Log:
  Handle CPL_RX_DATA on active TLS sockets.
  
  In certain edge cases, the NIC might have only received a partial TLS
  record which it needs to return to the driver.  For example, if the
  local socket was closed while data was still in flight, a partial TLS
  record might be pending when the connection is closed.  Receiving a
  RST in the middle of a TLS record is another example.  When this
  happens, the firmware returns the the partial TLS record as plain TCP
  data via CPL_RX_DATA.  Handle these requests by returning an error to
  OpenSSL (via so_error for KTLS or via an error TLS record header for
  the older Chelsio OpenSSL interface).
  
  Reported by:  Sony Arpita Das @ Chelsio
  Reviewed by:  np
  MFC after:2 weeks
  Sponsored by: Chelsio Communications
  Differential Revision:Revision: https://reviews.freebsd.org/D26800

Modified:
  head/sys/dev/cxgbe/tom/t4_cpl_io.c
  head/sys/dev/cxgbe/tom/t4_tls.c
  head/sys/dev/cxgbe/tom/t4_tom.h

Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c
==
--- head/sys/dev/cxgbe/tom/t4_cpl_io.c  Fri Oct 23 00:00:52 2020
(r366954)
+++ head/sys/dev/cxgbe/tom/t4_cpl_io.c  Fri Oct 23 00:23:54 2020
(r366955)
@@ -1537,6 +1537,15 @@ do_rx_data(struct sge_iq *iq, const struct rss_header 
 
tp = intotcpcb(inp);
 
+   if (__predict_false(ulp_mode(toep) == ULP_MODE_TLS &&
+  toep->flags & TPF_TLS_RECEIVE)) {
+   /* Received "raw" data on a TLS socket. */
+   CTR3(KTR_CXGBE, "%s: tid %u, raw TLS data (%d bytes)",
+   __func__, tid, len);
+   do_rx_data_tls(cpl, toep, m);
+   return (0);
+   }
+
if (__predict_false(tp->rcv_nxt != be32toh(cpl->seq)))
ddp_placed = be32toh(cpl->seq) - tp->rcv_nxt;
 

Modified: head/sys/dev/cxgbe/tom/t4_tls.c
==
--- head/sys/dev/cxgbe/tom/t4_tls.c Fri Oct 23 00:00:52 2020
(r366954)
+++ head/sys/dev/cxgbe/tom/t4_tls.c Fri Oct 23 00:23:54 2020
(r366955)
@@ -707,6 +707,8 @@ program_key_context(struct tcpcb *tp, struct toepcb *t
 V_TCB_TLS_SEQ(M_TCB_TLS_SEQ),
 V_TCB_TLS_SEQ(0));
t4_clear_rx_quiesce(toep);
+
+   toep->flags |= TPF_TLS_RECEIVE;
} else {
unsigned short pdus_per_ulp;
 
@@ -1064,6 +1066,7 @@ tls_alloc_ktls(struct toepcb *toep, struct ktls_sessio
tls_stop_handshake_timer(toep);
 
toep->flags &= ~TPF_FORCE_CREDITS;
+   toep->flags |= TPF_TLS_RECEIVE;
 
/*
 * RX key tags are an index into the key portion of MA
@@ -2218,6 +2221,135 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head
INP_WUNLOCK(inp);
CURVNET_RESTORE();
return (0);
+}
+
+void
+do_rx_data_tls(const struct cpl_rx_data *cpl, struct toepcb *toep,
+struct mbuf *m)
+{
+   struct inpcb *inp = toep->inp;
+   struct tls_ofld_info *tls_ofld = >tls;
+   struct tls_hdr *hdr;
+   struct tcpcb *tp;
+   struct socket *so;
+   struct sockbuf *sb;
+   int error, len, rx_credits;
+
+   len = m->m_pkthdr.len;
+
+   INP_WLOCK_ASSERT(inp);
+
+   so = inp_inpcbtosocket(inp);
+   tp = intotcpcb(inp);
+   sb = >so_rcv;
+   SOCKBUF_LOCK(sb);
+   CURVNET_SET(toep->vnet);
+
+   tp->rcv_nxt += len;
+   KASSERT(tp->rcv_wnd >= len, ("%s: negative window size", __func__));
+   tp->rcv_wnd -= len;
+
+   /* Do we have a full TLS header? */
+   if (len < sizeof(*hdr)) {
+   CTR3(KTR_CXGBE, "%s: tid %u len %d: too short for a TLS header",
+   __func__, toep->tid, len);
+   so->so_error = EMSGSIZE;
+   goto out;
+   }
+   hdr = mtod(m, struct tls_hdr *);
+
+   /* Is the header valid? */
+   if (be16toh(hdr->version) != tls_ofld->k_ctx.proto_ver) {
+   CTR3(KTR_CXGBE, "%s: tid %u invalid version %04x",
+   __func__, toep->tid, be16toh(hdr->version));
+   error = EINVAL;
+   goto report_error;
+   }
+   if (be16toh(hdr->length) < sizeof(*hdr)) {
+   CTR3(KTR_CXGBE, "%s: tid %u invalid length %u",
+   __func__, toep->tid, be16toh(hdr->length));
+   error = EBADMSG;
+   goto report_error;
+   }
+
+   /* Did we get a truncated record? */
+   if (len < be16toh(hdr->length)) {
+   CTR4(KTR_CXGBE, "%s: tid %u truncated TLS record (%d vs %u)",
+   __func__, toep->tid, len, be16toh(hdr->length));
+
+   error = EMSGSIZE;
+   goto report_error;
+   }
+
+

svn commit: r366954 - in releng/12.2: . lib/csu/common sys/conf

2020-10-22 Thread Glen Barber
Author: gjb
Date: Fri Oct 23 00:00:52 2020
New Revision: 366954
URL: https://svnweb.freebsd.org/changeset/base/366954

Log:
  - Switch releng/12.2 from RC3 to RELEASE.
  - Add the anticipated 12.2-RELEASE date to UPDATING.  Fix
a missing colon in the previous UPDATING entry while here.
  - Set a static __FreeBSD_version.
  
  Approved by:  re (implicit)
  Sponsored by: Rubicon Communications, LLC (netgate.com)

Modified:
  releng/12.2/UPDATING
  releng/12.2/lib/csu/common/crtbrand.c
  releng/12.2/sys/conf/newvers.sh

Modified: releng/12.2/UPDATING
==
--- releng/12.2/UPDATINGThu Oct 22 20:26:27 2020(r366953)
+++ releng/12.2/UPDATINGFri Oct 23 00:00:52 2020(r366954)
@@ -16,7 +16,10 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
-20200915   p1  FreeBSD-SA-20:27.ure
+20201027:
+   12.2-RELEASE.
+
+20200915:  p1  FreeBSD-SA-20:27.ure
FreeBSD-SA-20:28.bhyve_vmcs
FreeBSD-SA-20:29.bhyve_svm
FreeBSD-SA-20:30.ftpd

Modified: releng/12.2/lib/csu/common/crtbrand.c
==
--- releng/12.2/lib/csu/common/crtbrand.c   Thu Oct 22 20:26:27 2020
(r366953)
+++ releng/12.2/lib/csu/common/crtbrand.c   Fri Oct 23 00:00:52 2020
(r366954)
@@ -65,7 +65,7 @@ static const struct {
.descsz = sizeof(int32_t),
.type = NT_FREEBSD_ABI_TAG,
.name = NOTE_FREEBSD_VENDOR,
-   .desc = __FreeBSD_version
+   .desc = 1202000
 };
 
 static const struct {

Modified: releng/12.2/sys/conf/newvers.sh
==
--- releng/12.2/sys/conf/newvers.sh Thu Oct 22 20:26:27 2020
(r366953)
+++ releng/12.2/sys/conf/newvers.sh Fri Oct 23 00:00:52 2020
(r366954)
@@ -49,7 +49,7 @@
 
 TYPE="FreeBSD"
 REVISION="12.2"
-BRANCH="RC3"
+BRANCH="RELEASE"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
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: r366953 - in head: sys/dev/iscsi usr.sbin/iscsid

2020-10-22 Thread Alexander Motin
Author: mav
Date: Thu Oct 22 20:26:27 2020
New Revision: 366953
URL: https://svnweb.freebsd.org/changeset/base/366953

Log:
  Negotiate iSCSIProtocolLevel of 2 (RFC 7144) in initiator.
  
  It does not change anything immediately, but allows further support of
  Command Priority, Status Qualifier and new task management functions.
  
  MFC after:1 month
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/dev/iscsi/iscsi.c
  head/sys/dev/iscsi/iscsi.h
  head/sys/dev/iscsi/iscsi_ioctl.h
  head/sys/dev/iscsi/iscsi_proto.h
  head/usr.sbin/iscsid/iscsid.c
  head/usr.sbin/iscsid/iscsid.h
  head/usr.sbin/iscsid/login.c

Modified: head/sys/dev/iscsi/iscsi.c
==
--- head/sys/dev/iscsi/iscsi.c  Thu Oct 22 20:21:11 2020(r366952)
+++ head/sys/dev/iscsi/iscsi.c  Thu Oct 22 20:26:27 2020(r366953)
@@ -1427,6 +1427,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_softc *sc,
sizeof(is->is_target_alias));
is->is_tsih = handoff->idh_tsih;
is->is_statsn = handoff->idh_statsn;
+   is->is_protocol_level = handoff->idh_protocol_level;
is->is_initial_r2t = handoff->idh_initial_r2t;
is->is_immediate_data = handoff->idh_immediate_data;
 

Modified: head/sys/dev/iscsi/iscsi.h
==
--- head/sys/dev/iscsi/iscsi.h  Thu Oct 22 20:21:11 2020(r366952)
+++ head/sys/dev/iscsi/iscsi.h  Thu Oct 22 20:26:27 2020(r366953)
@@ -61,8 +61,7 @@ struct iscsi_session {
uint32_tis_expcmdsn;
uint32_tis_maxcmdsn;
uint32_tis_initiator_task_tag;
-   int is_header_digest;
-   int is_data_digest;
+   int is_protocol_level;
int is_initial_r2t;
int is_max_burst_length;
int is_first_burst_length;

Modified: head/sys/dev/iscsi/iscsi_ioctl.h
==
--- head/sys/dev/iscsi/iscsi_ioctl.hThu Oct 22 20:21:11 2020
(r366952)
+++ head/sys/dev/iscsi/iscsi_ioctl.hThu Oct 22 20:26:27 2020
(r366953)
@@ -124,7 +124,8 @@ struct iscsi_daemon_handoff {
unsigned intidh_session_id;
int idh_socket;
charidh_target_alias[ISCSI_ALIAS_LEN];
-   uint8_t idh_spare_isid[6];
+   int idh_protocol_level;
+   uint16_tidh_spare;
uint16_tidh_tsih;
uint16_tidh_spare_cid;
uint32_tidh_statsn;

Modified: head/sys/dev/iscsi/iscsi_proto.h
==
--- head/sys/dev/iscsi/iscsi_proto.hThu Oct 22 20:21:11 2020
(r366952)
+++ head/sys/dev/iscsi/iscsi_proto.hThu Oct 22 20:26:27 2020
(r366953)
@@ -90,10 +90,14 @@ CTASSERT(sizeof(struct iscsi_bhs) == ISCSI_BHS_SIZE);
 #defineBHSSC_FLAGS_ATTR_HOQ3
 #defineBHSSC_FLAGS_ATTR_ACA4
 
+#defineBHSSC_PRI_MASK  0xf0
+#defineBHSSC_PRI_SHIFT 4
+
 struct iscsi_bhs_scsi_command {
uint8_t bhssc_opcode;
uint8_t bhssc_flags;
-   uint8_t bhssc_reserved[2];
+   uint8_t bhssc_pri;
+   uint8_t bhssc_reserved;
uint8_t bhssc_total_ahs_len;
uint8_t bhssc_data_segment_len[3];
uint64_tbhssc_lun;

Modified: head/usr.sbin/iscsid/iscsid.c
==
--- head/usr.sbin/iscsid/iscsid.c   Thu Oct 22 20:21:11 2020
(r366952)
+++ head/usr.sbin/iscsid/iscsid.c   Thu Oct 22 20:26:27 2020
(r366953)
@@ -172,6 +172,7 @@ connection_new(int iscsi_fd, const struct iscsi_daemon
/*
 * Default values, from RFC 3720, section 12.
 */
+   conn->conn_protocol_level = 0;
conn->conn_header_digest = CONN_DIGEST_NONE;
conn->conn_data_digest = CONN_DIGEST_NONE;
conn->conn_initial_r2t = true;
@@ -329,6 +330,7 @@ handoff(struct connection *conn)
sizeof(idh.idh_target_alias));
idh.idh_tsih = conn->conn_tsih;
idh.idh_statsn = conn->conn_statsn;
+   idh.idh_protocol_level = conn->conn_protocol_level;
idh.idh_header_digest = conn->conn_header_digest;
idh.idh_data_digest = conn->conn_data_digest;
idh.idh_initial_r2t = conn->conn_initial_r2t;

Modified: head/usr.sbin/iscsid/iscsid.h

svn commit: r366952 - head/sys/dev/netmap

2020-10-22 Thread Vincenzo Maffione
Author: vmaffione
Date: Thu Oct 22 20:21:11 2020
New Revision: 366952
URL: https://svnweb.freebsd.org/changeset/base/366952

Log:
  netmap: fix mutex double unlock bug
  
  https://github.com/luigirizzo/netmap/pull/733
  
  Submitted by:  brian90013
  MFC after:3 days

Modified:
  head/sys/dev/netmap/netmap_mem2.c

Modified: head/sys/dev/netmap/netmap_mem2.c
==
--- head/sys/dev/netmap/netmap_mem2.c   Thu Oct 22 20:02:02 2020
(r366951)
+++ head/sys/dev/netmap/netmap_mem2.c   Thu Oct 22 20:21:11 2020
(r366952)
@@ -2007,7 +2007,6 @@ netmap_mem2_if_new(struct netmap_adapter *na, struct n
len = sizeof(struct netmap_if) + (ntot * sizeof(ssize_t));
nifp = netmap_if_malloc(na->nm_mem, len);
if (nifp == NULL) {
-   NMA_UNLOCK(na->nm_mem);
return 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"


Re: svn commit: r366949 - head/usr.sbin/nfsd

2020-10-22 Thread Gordon Bergling via svn-src-all
On Thu, Oct 22, 2020 at 12:28:51PM -0700, Benjamin Kaduk wrote:
> On Thu, Oct 22, 2020 at 12:25 PM Gordon Bergling  wrote:
> 
> > Author: gbe (doc committer)
> > Date: Thu Oct 22 19:25:01 2020
> > New Revision: 366949
> > URL: https://svnweb.freebsd.org/changeset/base/366949
> >
> > Log:
> >   stablerestart(5): Fix some issues reported by mandoc
> >
> >   - New sentence, new line
> >
> > Modified:
> >   head/usr.sbin/nfsd/stablerestart.5
> >
> > Modified: head/usr.sbin/nfsd/stablerestart.5
> >
> > ==
> > --- head/usr.sbin/nfsd/stablerestart.5  Thu Oct 22 19:22:34 2020
> > (r366948)
> > +++ head/usr.sbin/nfsd/stablerestart.5  Thu Oct 22 19:25:01 2020
> > (r366949)
> > @@ -52,18 +52,18 @@ first record.
> >  The lease duration is used to set the grace period.
> >  The boot times
> >  are used to avoid the unlikely occurrence of a boot time being reused,
> > -due to a TOD clock going backwards. This record and the previous boot
> > times with this boot time added is re-written at the
> > -end of the grace period.
> > +due to a TOD clock going backwards.
> > +This record and the previous boot times with this boot time
> > +added is re-written at the end of the grace period.
> >  .Pp
> >  The rest of the file are appended records, as defined by
> > -struct nfst_rec in /usr/include/fs/nfs/nfsrvstate.h and are used
> > -represent one of two things. There are records which indicate that a
> > +struct nfst_rec in /usr/include/fs/nfs/nfsrvstate.h and are used
> > represent one of two things.
> >
> There are some more markup options here, like  (IIRC) .Fa for struct
> nfst_rec, and .Pa for /usr/include/fs/nfs/nfsrvstate.h
> 
> -Ben

Hi Ben,

I'll check further optimizations tomorrow! Thanks for the hint.

-- Gordon
___
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: r366951 - head/stand/libsa/zfs

2020-10-22 Thread Toomas Soome
Author: tsoome
Date: Thu Oct 22 20:02:02 2020
New Revision: 366951
URL: https://svnweb.freebsd.org/changeset/base/366951

Log:
  loader: revert r342161 and r342151
  
  We are using asize property from pool label and we do not depend
  on partition data to find last two pool labels and to validate LBA for disk 
IO.
  
  This does allow us to re-enable support for partitionless disk setups.

Modified:
  head/stand/libsa/zfs/zfs.c

Modified: head/stand/libsa/zfs/zfs.c
==
--- head/stand/libsa/zfs/zfs.c  Thu Oct 22 19:28:12 2020(r366950)
+++ head/stand/libsa/zfs/zfs.c  Thu Oct 22 20:02:02 2020(r366951)
@@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -1421,7 +1420,6 @@ zfs_attach_nvstore(void *vdev)
 int
 zfs_probe_dev(const char *devname, uint64_t *pool_guid)
 {
-   struct disk_devdesc *dev;
struct ptable *table;
struct zfs_probe_args pa;
uint64_t mediasz;
@@ -1432,22 +1430,10 @@ zfs_probe_dev(const char *devname, uint64_t *pool_guid
pa.fd = open(devname, O_RDWR);
if (pa.fd == -1)
return (ENXIO);
-   /*
-* We will not probe the whole disk, we can not boot from such
-* disks and some systems will misreport the disk sizes and will
-* hang while accessing the disk.
-*/
-   if (archsw.arch_getdev((void **), devname, NULL) == 0) {
-   int partition = dev->d_partition;
-   int slice = dev->d_slice;
-
-   free(dev);
-   if (partition != D_PARTNONE && slice != D_SLICENONE) {
-   ret = zfs_probe(pa.fd, pool_guid);
-   if (ret == 0)
-   return (0);
-   }
-   }
+   /* Probe the whole disk */
+   ret = zfs_probe(pa.fd, pool_guid);
+   if (ret == 0)
+   return (0);
 
/* Probe each partition */
ret = ioctl(pa.fd, DIOCGMEDIASIZE, );
___
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: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf

2020-10-22 Thread Kyle Evans
On Thu, Oct 22, 2020 at 2:35 PM Niclas Zeising  wrote:
>
> On 2020-10-22 15:22, Kyle Evans wrote:
> > On Sat, Oct 17, 2020 at 11:40 AM Warner Losh  wrote:
> >>
> >>
> >>
> >> On Sat, Oct 17, 2020, 10:11 AM Alexander V. Chernikov  
> >> wrote:
> >>>
> >>> 17.10.2020, 14:07, "Hans Petter Selasky" :
> >>>
> >>> On 2020-10-17 14:34, Alexander V. Chernikov wrote:
> >>>
> >>>   17.10.2020, 12:32, "Hans Petter Selasky" :
> >>>
> >>>On 2020-10-17 13:27, Alexander V. Chernikov wrote:
> >>>
> >>>  02.10.2020, 19:26, "Emmanuel Vadot"  >>>>:
> >>>
> >>>   Author: manu
> >>>   Date: Fri Oct 2 18:26:41 2020
> >>>   New Revision: 366372
> >>>   URL: https://svnweb.freebsd.org/changeset/base/366372
> >>>
> >>>   Log:
> >>>  linuxkpi: Add backlight support
> >>>
> >>>  Add backlight function to linuxkpi.
> >>>  Graphics drivers expose the backlight of the panel 
> >>> directly so
> >>>allow them
> >>>   to use the backlight subsystem so
> >>>  user can use backlight(8) to configure them.
> >>>
> >>>  Reviewed by: hselasky
> >>>  Relnotes: yes
> >>>  Differential Revision: The FreeBSD Foundation
> >>>
> >>>   Added:
> >>>  
> >>> head/sys/compat/linuxkpi/common/include/linux/backlight.h
> >>>(contents,
> >>>   props changed)
> >>>   Modified:
> >>>  
> >>> head/sys/compat/linuxkpi/common/include/linux/device.h
> >>>  head/sys/compat/linuxkpi/common/src/linux_kmod.c
> >>>  head/sys/compat/linuxkpi/common/src/linux_pci.c
> >>>  head/sys/conf/kmod.mk
> >>>
> >>>  It breaks the build for me with
> >>>  
> >>> /usr/home/melifaro/free/head/sys/compat/linuxkpi/common/src/linux_pci.c:70:10:
> >>>  fatal error: 'backlight_if.h' file not found
> >>>
> >>>
> >>>How do you build? Doesn't break over here.
> >>>
> >>>   GENERIC + COMPAT_LINUXKPI.
> >>>
> >>>
> >>>
> >>> Try adding:
> >>>
> >>> options backlight
> >>>
> >>> To the kernel config.
> >>>
> >>> Yep, thank you!
> >>> Maybe it's worth considering adding static assert with the message 
> >>> describing this dependency?
> >>
> >>
> >> Yes. It likely is worth doing something to highlight this issue.
> >>
> >> Warner
> >>
> >
> > I think we just need to slap the two core backlight files with an ` |
> > compat_linux` so that they simply get pulled in if you specify
> > COMPAT_LINUX. config(8) handles this terribly, configng must have a
> > better provides/requires/implies/whatever functionality so we can
> > specify that compat_linux implies backlight and not do crud like this
> > where it becomes more complicated to see what any given option really
> > entails.
> >
> > Thanks,
>
> COMPAT_LINUX can't be right.  Isn't that the linuxolator?
> Regards
> --
> Niclas Zeising

Whoops, s/LINUX/LINUXKPI/

:-)
___
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: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf

2020-10-22 Thread Niclas Zeising

On 2020-10-22 15:22, Kyle Evans wrote:

On Sat, Oct 17, 2020 at 11:40 AM Warner Losh  wrote:




On Sat, Oct 17, 2020, 10:11 AM Alexander V. Chernikov  wrote:


17.10.2020, 14:07, "Hans Petter Selasky" :

On 2020-10-17 14:34, Alexander V. Chernikov wrote:

  17.10.2020, 12:32, "Hans Petter Selasky" :

   On 2020-10-17 13:27, Alexander V. Chernikov wrote:

 02.10.2020, 19:26, "Emmanuel Vadot" mailto:m...@freebsd.org>>:

  Author: manu
  Date: Fri Oct 2 18:26:41 2020
  New Revision: 366372
  URL: https://svnweb.freebsd.org/changeset/base/366372

  Log:
 linuxkpi: Add backlight support

 Add backlight function to linuxkpi.
 Graphics drivers expose the backlight of the panel 
directly so
   allow them
  to use the backlight subsystem so
 user can use backlight(8) to configure them.

 Reviewed by: hselasky
 Relnotes: yes
 Differential Revision: The FreeBSD Foundation

  Added:
 head/sys/compat/linuxkpi/common/include/linux/backlight.h
   (contents,
  props changed)
  Modified:
 head/sys/compat/linuxkpi/common/include/linux/device.h
 head/sys/compat/linuxkpi/common/src/linux_kmod.c
 head/sys/compat/linuxkpi/common/src/linux_pci.c
 head/sys/conf/kmod.mk

 It breaks the build for me with
 
/usr/home/melifaro/free/head/sys/compat/linuxkpi/common/src/linux_pci.c:70:10:
 fatal error: 'backlight_if.h' file not found


   How do you build? Doesn't break over here.

  GENERIC + COMPAT_LINUXKPI.



Try adding:

options backlight

To the kernel config.

Yep, thank you!
Maybe it's worth considering adding static assert with the message describing 
this dependency?



Yes. It likely is worth doing something to highlight this issue.

Warner



I think we just need to slap the two core backlight files with an ` |
compat_linux` so that they simply get pulled in if you specify
COMPAT_LINUX. config(8) handles this terribly, configng must have a
better provides/requires/implies/whatever functionality so we can
specify that compat_linux implies backlight and not do crud like this
where it becomes more complicated to see what any given option really
entails.

Thanks,


COMPAT_LINUX can't be right.  Isn't that the linuxolator?
Regards
--
Niclas Zeising
___
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: r366949 - head/usr.sbin/nfsd

2020-10-22 Thread Benjamin Kaduk
On Thu, Oct 22, 2020 at 12:25 PM Gordon Bergling  wrote:

> Author: gbe (doc committer)
> Date: Thu Oct 22 19:25:01 2020
> New Revision: 366949
> URL: https://svnweb.freebsd.org/changeset/base/366949
>
> Log:
>   stablerestart(5): Fix some issues reported by mandoc
>
>   - New sentence, new line
>
> Modified:
>   head/usr.sbin/nfsd/stablerestart.5
>
> Modified: head/usr.sbin/nfsd/stablerestart.5
>
> ==
> --- head/usr.sbin/nfsd/stablerestart.5  Thu Oct 22 19:22:34 2020
> (r366948)
> +++ head/usr.sbin/nfsd/stablerestart.5  Thu Oct 22 19:25:01 2020
> (r366949)
> @@ -52,18 +52,18 @@ first record.
>  The lease duration is used to set the grace period.
>  The boot times
>  are used to avoid the unlikely occurrence of a boot time being reused,
> -due to a TOD clock going backwards. This record and the previous boot
> times with this boot time added is re-written at the
> -end of the grace period.
> +due to a TOD clock going backwards.
> +This record and the previous boot times with this boot time
> +added is re-written at the end of the grace period.
>  .Pp
>  The rest of the file are appended records, as defined by
> -struct nfst_rec in /usr/include/fs/nfs/nfsrvstate.h and are used
> -represent one of two things. There are records which indicate that a
> +struct nfst_rec in /usr/include/fs/nfs/nfsrvstate.h and are used
> represent one of two things.
>
>
There are some more markup options here, like  (IIRC) .Fa for struct
nfst_rec, and .Pa for /usr/include/fs/nfs/nfsrvstate.h

-Ben
___
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: r366950 - in head/sys: kern sys

2020-10-22 Thread Mateusz Guzik
Author: mjg
Date: Thu Oct 22 19:28:12 2020
New Revision: 366950
URL: https://svnweb.freebsd.org/changeset/base/366950

Log:
  vfs: prevent avoidable evictions on mkdir of existing directories
  
  mkdir -p /foo/bar/baz will mkdir each path component and ignore EEXIST.
  
  The NOCACHE lookup will make the namecache unnecessarily evict the existing 
entry,
  and then fallback to the fs lookup routine eventually leading namei to return 
an
  error as the directory is already there.
  
  For invocations like mkdir -p /usr/obj/usr/src/sys/GENERIC/modules this 
triggers
  fallbacks to the slowpath for concurrently executing lookups.
  
  Tested by:pho
  Discussed with:   kib

Modified:
  head/sys/kern/vfs_cache.c
  head/sys/kern/vfs_subr.c
  head/sys/kern/vfs_syscalls.c
  head/sys/kern/vnode_if.src
  head/sys/sys/namei.h
  head/sys/sys/vnode.h

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Oct 22 19:25:01 2020(r366949)
+++ head/sys/kern/vfs_cache.c   Thu Oct 22 19:28:12 2020(r366950)
@@ -1676,7 +1676,8 @@ cache_lookup_fallback(struct vnode *dvp, struct vnode 
int error;
bool whiteout;
 
-   MPASS((cnp->cn_flags & (MAKEENTRY | ISDOTDOT)) == MAKEENTRY);
+   MPASS((cnp->cn_flags & ISDOTDOT) == 0);
+   MPASS((cnp->cn_flags & (MAKEENTRY | NC_KEEPPOSENTRY)) != 0);
 
 retry:
hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp);
@@ -1768,7 +1769,7 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st
 
MPASS((cnp->cn_flags & ISDOTDOT) == 0);
 
-   if ((cnp->cn_flags & MAKEENTRY) == 0) {
+   if ((cnp->cn_flags & (MAKEENTRY | NC_KEEPPOSENTRY)) == 0) {
cache_remove_cnp(dvp, cnp);
return (0);
}
@@ -2595,6 +2596,35 @@ cache_rename(struct vnode *fdvp, struct vnode *fvp, st
cache_remove_cnp(tdvp, tcnp);
}
 }
+
+#ifdef INVARIANTS
+/*
+ * Validate that if an entry exists it matches.
+ */
+void
+cache_validate(struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
+{
+   struct namecache *ncp;
+   struct mtx *blp;
+   uint32_t hash;
+
+   hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp);
+   if (CK_SLIST_EMPTY(NCHHASH(hash)))
+   return;
+   blp = HASH2BUCKETLOCK(hash);
+   mtx_lock(blp);
+   CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) {
+   if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen &&
+   !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) {
+   if (ncp->nc_vp != vp)
+   panic("%s: mismatch (%p != %p); ncp %p [%s] dvp 
%p vp %p\n",
+   __func__, vp, ncp->nc_vp, ncp, 
ncp->nc_name, ncp->nc_dvp,
+   ncp->nc_vp);
+   }
+   }
+   mtx_unlock(blp);
+}
+#endif
 
 /*
  * Flush all entries referencing a particular filesystem.

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cThu Oct 22 19:25:01 2020(r366949)
+++ head/sys/kern/vfs_subr.cThu Oct 22 19:28:12 2020(r366950)
@@ -5587,6 +5587,18 @@ vop_mkdir_post(void *ap, int rc)
VFS_KNOTE_LOCKED(dvp, NOTE_WRITE | NOTE_LINK);
 }
 
+#ifdef DEBUG_VFS_LOCKS
+void
+vop_mkdir_debugpost(void *ap, int rc)
+{
+   struct vop_mkdir_args *a;
+
+   a = ap;
+   if (!rc)
+   cache_validate(a->a_dvp, *a->a_vpp, a->a_cnp);
+}
+#endif
+
 void
 vop_mknod_pre(void *ap)
 {

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cThu Oct 22 19:25:01 2020
(r366949)
+++ head/sys/kern/vfs_syscalls.cThu Oct 22 19:28:12 2020
(r366950)
@@ -3758,8 +3758,8 @@ kern_mkdirat(struct thread *td, int fd, const char *pa
 restart:
bwillwrite();
NDINIT_ATRIGHTS(, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 |
-   NOCACHE, segflg, path, fd, _mkdirat_rights,
-   td);
+   NC_NOMAKEENTRY | NC_KEEPPOSENTRY, segflg, path, fd,
+   _mkdirat_rights, td);
nd.ni_cnd.cn_flags |= WILLBEDIR;
if ((error = namei()) != 0)
return (error);

Modified: head/sys/kern/vnode_if.src
==
--- head/sys/kern/vnode_if.src  Thu Oct 22 19:25:01 2020(r366949)
+++ head/sys/kern/vnode_if.src  Thu Oct 22 19:28:12 2020(r366950)
@@ -336,6 +336,7 @@ vop_rename {
 %% mkdir   vpp - E -
 %! mkdir   pre vop_mkdir_pre
 %! mkdir   postvop_mkdir_post
+%! mkdir   debugpost vop_mkdir_debugpost
 
 vop_mkdir {
IN struct vnode *dvp;

Modified: head/sys/sys/namei.h

svn commit: r366949 - head/usr.sbin/nfsd

2020-10-22 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Thu Oct 22 19:25:01 2020
New Revision: 366949
URL: https://svnweb.freebsd.org/changeset/base/366949

Log:
  stablerestart(5): Fix some issues reported by mandoc
  
  - New sentence, new line

Modified:
  head/usr.sbin/nfsd/stablerestart.5

Modified: head/usr.sbin/nfsd/stablerestart.5
==
--- head/usr.sbin/nfsd/stablerestart.5  Thu Oct 22 19:22:34 2020
(r366948)
+++ head/usr.sbin/nfsd/stablerestart.5  Thu Oct 22 19:25:01 2020
(r366949)
@@ -52,18 +52,18 @@ first record.
 The lease duration is used to set the grace period.
 The boot times
 are used to avoid the unlikely occurrence of a boot time being reused,
-due to a TOD clock going backwards. This record and the previous boot times 
with this boot time added is re-written at the
-end of the grace period.
+due to a TOD clock going backwards.
+This record and the previous boot times with this boot time
+added is re-written at the end of the grace period.
 .Pp
 The rest of the file are appended records, as defined by
-struct nfst_rec in /usr/include/fs/nfs/nfsrvstate.h and are used
-represent one of two things. There are records which indicate that a
+struct nfst_rec in /usr/include/fs/nfs/nfsrvstate.h and are used represent one 
of two things.
+There are records which indicate that a
 client successfully acquired state and records that indicate a client's state 
was revoked.
 State revoke records indicate that state information
 for a client was discarded, due to lease expiry and an otherwise
 conflicting open or lock request being made by a different client.
-These records can be used
-to determine if clients might have done either of the
+These records can be used to determine if clients might have done either of the
 edge conditions.
 .Pp
 If a client might have done either edge condition or this file is
@@ -71,8 +71,8 @@ empty or corrupted, the server returns NFSERR_NOGRACE 
 request from the client.
 .Pp
 For correct operation of the server, it must be ensured that the file
-is written to stable storage by the time a write op with IO_SYNC specified
-has returned. This might require hardware level caching to be disabled for
+is written to stable storage by the time a write op with IO_SYNC specified has 
returned.
+This might require hardware level caching to be disabled for
 a local disk drive that holds the file, or similar.
 .Sh FILES
 .Bl -tag -width /var/db/nfs-stablerestart.bak -compact
@@ -86,12 +86,11 @@ backup copy of the file
 .Xr nfsd 8
 .Sh BUGS
 If the file is empty, the NFSv4 server has no choice but to return
-NFSERR_NOGRACE for all reclaim requests. Although correct, this is
-a highly undesirable occurrence, so the file should not be lost if
-at all possible. The backup copy of the file is maintained
-and used by the
+NFSERR_NOGRACE for all reclaim requests.
+Although correct, this is a highly undesirable occurrence, so the file should 
not be lost if
+at all possible.
+The backup copy of the file is maintained and used by the
 .Xr nfsd 8
 to minimize the risk of this occurring.
-To move the file, you must edit
-the nfsd sources and recompile it. This was done to discourage
-accidental relocation of the file.
+To move the file, you must edit the nfsd sources and recompile it.
+This was done to discourage accidental relocation of the file.
___
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: r366948 - head/sys/kern

2020-10-22 Thread Mateusz Guzik
Author: mjg
Date: Thu Oct 22 19:22:34 2020
New Revision: 366948
URL: https://svnweb.freebsd.org/changeset/base/366948

Log:
  cache: assert the created entry does not point to itself

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Oct 22 19:19:42 2020(r366947)
+++ head/sys/kern/vfs_cache.c   Thu Oct 22 19:22:34 2020(r366948)
@@ -2104,6 +2104,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, 
int len;
u_long lnumcache;
 
+   VNPASS(dvp != vp, dvp);
VNPASS(!VN_IS_DOOMED(dvp), dvp);
VNPASS(dvp->v_type != VNON, dvp);
if (vp != 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: r366947 - head/usr.sbin/nfsd

2020-10-22 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Thu Oct 22 19:19:42 2020
New Revision: 366947
URL: https://svnweb.freebsd.org/changeset/base/366947

Log:
  pnfsserver(4): Fix some issues reported by mandoc
  
  - new sentence, new line

Modified:
  head/usr.sbin/nfsd/pnfsserver.4

Modified: head/usr.sbin/nfsd/pnfsserver.4
==
--- head/usr.sbin/nfsd/pnfsserver.4 Thu Oct 22 18:45:49 2020
(r366946)
+++ head/usr.sbin/nfsd/pnfsserver.4 Thu Oct 22 19:19:42 2020
(r366947)
@@ -248,11 +248,12 @@ after the DS failure or network partitioning occurs.
 the arguments for a LayoutReturn operation.
 .sp
 3 - The system administrator can perform the pnfsdskill(8) command on the MDS
-to disable it. If the system administrator does a pnfsdskill(8) and it fails
-with ENXIO (Device not configured) that normally means the DS was already
-disabled via #1 or #2. Since doing this is harmless, once a system
-administrator knows that there is a problem with a mirrored DS, doing the
-command is recommended.
+to disable it.
+If the system administrator does a pnfsdskill(8) and it fails with ENXIO
+(Device not configured) that normally means the DS was already
+disabled via #1 or #2.
+Since doing this is harmless, once a system administrator knows that
+there is a problem with a mirrored DS, doing the command is recommended.
 .sp
 Once a system administrator knows that a mirrored DS has malfunctioned
 or has been network partitioned, they should do the following as root/su
@@ -266,9 +267,8 @@ Note that the  must be the exac
 string used when the DS was mounted on the MDS.
 .Pp
 Once the mirrored DS has been disabled, the pNFS service should continue to
-function, but file updates will only happen on the DS(s)
-that have not been disabled. Assuming two way mirroring, that implies
-the one DS of the pair stored in the
+function, but file updates will only happen on the DS(s) that have not been 
disabled.
+Assuming two way mirroring, that implies the one DS of the pair stored in the
 .Dq pnfsd.dsfile
 extended attribute for the file on the MDS, for files stored on the disabled 
DS.
 .Pp
___
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: r366946 - head/share/man/man9

2020-10-22 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Thu Oct 22 18:45:49 2020
New Revision: 366946
URL: https://svnweb.freebsd.org/changeset/base/366946

Log:
  socket(9): Remove duplicate word 'is is'
  
  MFC after:1 week

Modified:
  head/share/man/man9/socket.9

Modified: head/share/man/man9/socket.9
==
--- head/share/man/man9/socket.9Thu Oct 22 18:00:07 2020
(r366945)
+++ head/share/man/man9/socket.9Thu Oct 22 18:45:49 2020
(r366946)
@@ -378,7 +378,7 @@ or
 A kernel system can use the
 .Fn sodtor_set
 function to set a destructor for a socket.
-The destructor is called when the socket is is about to be freed.
+The destructor is called when the socket is about to be freed.
 The destructor is called before the protocol detach routine.
 The destructor can serve as a callback to initiate additional cleanup actions.
 .Ss Socket I/O
___
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: r366945 - head/share/man/man9

2020-10-22 Thread Jessica Clarke
On 22 Oct 2020, at 19:00, Gleb Smirnoff  wrote:
> 
> Author: glebius
> Date: Thu Oct 22 18:00:07 2020
> New Revision: 366945
> URL: https://svnweb.freebsd.org/changeset/base/366945
> 
> Log:
>  Fix typo
> 
> Modified:
>  head/share/man/man9/pfil.9
> 
> Modified: head/share/man/man9/pfil.9
> ==
> --- head/share/man/man9/pfil.9Thu Oct 22 17:47:51 2020
> (r366944)
> +++ head/share/man/man9/pfil.9Thu Oct 22 18:00:07 2020
> (r366945)
> @@ -144,7 +144,7 @@ Link-layer packets.
> .El
> .Pp
> Default rulesets are automatically linked to these heads to preserve
> -historical behavavior.
> +historical behaviour.

This doesn't just fix the duplicated "av", it also changes the locale,
which is not a typo. That may or may not be feature depending on who
you are :)

Jess

___
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: r366945 - head/share/man/man9

2020-10-22 Thread Gleb Smirnoff
Author: glebius
Date: Thu Oct 22 18:00:07 2020
New Revision: 366945
URL: https://svnweb.freebsd.org/changeset/base/366945

Log:
  Fix typo

Modified:
  head/share/man/man9/pfil.9

Modified: head/share/man/man9/pfil.9
==
--- head/share/man/man9/pfil.9  Thu Oct 22 17:47:51 2020(r366944)
+++ head/share/man/man9/pfil.9  Thu Oct 22 18:00:07 2020(r366945)
@@ -144,7 +144,7 @@ Link-layer packets.
 .El
 .Pp
 Default rulesets are automatically linked to these heads to preserve
-historical behavavior.
+historical behaviour.
 .Sh SEE ALSO
 .Xr ipfilter 4 ,
 .Xr ipfw 4 ,
___
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: r366936 - head/sys/net

2020-10-22 Thread Hans Petter Selasky

On 2020-10-22 18:48, Konstantin Belousov wrote:

sys/systm.h already includes sys/param.h.  Also, sys/param.h already includes
sys/types.h.


I'll have a look tomorrow at this. Thanks for pointing out.

--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: r366944 - head/sys/arm64/arm64

2020-10-22 Thread Alan Cox
Author: alc
Date: Thu Oct 22 17:47:51 2020
New Revision: 366944
URL: https://svnweb.freebsd.org/changeset/base/366944

Log:
  Micro-optimize uma_small_alloc().  Replace bzero(..., PAGE_SIZE) by
  pagezero().  Ultimately, they use the same method for bulk zeroing, but
  the generality of bzero() requires size and alignment checks that
  pagezero() does not.
  
  Eliminate an unnecessary #include.
  
  Reviewed by:  emaste, markj
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D26876

Modified:
  head/sys/arm64/arm64/uma_machdep.c

Modified: head/sys/arm64/arm64/uma_machdep.c
==
--- head/sys/arm64/arm64/uma_machdep.c  Thu Oct 22 17:46:55 2020
(r366943)
+++ head/sys/arm64/arm64/uma_machdep.c  Thu Oct 22 17:47:51 2020
(r366944)
@@ -36,11 +36,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-#include 
+#include 
 
 void *
 uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags,
@@ -60,7 +59,7 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int 
dump_add_page(pa);
va = (void *)PHYS_TO_DMAP(pa);
if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0)
-   bzero(va, PAGE_SIZE);
+   pagezero(va);
return (va);
 }
 
___
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: r366943 - head/sys/crypto/ccp

2020-10-22 Thread Jung-uk Kim
Author: jkim
Date: Thu Oct 22 17:46:55 2020
New Revision: 366943
URL: https://svnweb.freebsd.org/changeset/base/366943

Log:
  Add a new CCP device ID found on my Ryzen 5 3600XT.
  
  MFC after:1 week

Modified:
  head/sys/crypto/ccp/ccp.c

Modified: head/sys/crypto/ccp/ccp.c
==
--- head/sys/crypto/ccp/ccp.c   Thu Oct 22 17:31:41 2020(r366942)
+++ head/sys/crypto/ccp/ccp.c   Thu Oct 22 17:46:55 2020(r366943)
@@ -78,6 +78,7 @@ static struct pciid {
 } ccp_ids[] = {
{ 0x14561022, "AMD CCP-5a" },
{ 0x14681022, "AMD CCP-5b" },
+   { 0x14861022, "AMD CCP-5a" },
{ 0x15df1022, "AMD CCP-5a" },
 };
 
___
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: r366942 - stable/12/sys/dev/uart

2020-10-22 Thread Marcin Wojtas
Author: mw
Date: Thu Oct 22 17:31:41 2020
New Revision: 366942
URL: https://svnweb.freebsd.org/changeset/base/366942

Log:
  MFC r362574
  
  Fix AccessWidth and BitWidth parsing in SPCR table
  
  The ACPI Specification defines a Generic Address Structure (GAS),
  which is used to describe UART controller register layout in the
  SPCR table. The driver responsible for parsing it (uart_cpu_acpi)
  wrongly associates the Access Size field to the uart_bas's regshft
  and the register BitWidth to the regiowidth - according to
  the definitions it should be opposite.
  
  This problem remained hidden most likely because the majority of platforms
  use 32-bit registers (BitWidth) which are accessed with the according
  size (Dword). However on Marvell Armada 8k / Cn913x platforms,
  the 32-bit registers should be accessed with Byte granulity, which
  unveiled the issue.
  
  This patch fixes above by proper values assignment and slightly improved
  parsing.
  
  Note that handling of the AccessWidth set to EFI_ACPI_6_0_UNDEFINED is
  needed to work around a buggy SPCR table on EC2 x86 "bare metal" instances.
  
  Reviewed by: manu, imp, cperciva, greg_unrelenting.technology
  Obtained from: Semihalf

Modified:
  stable/12/sys/dev/uart/uart_cpu_acpi.c

Modified: stable/12/sys/dev/uart/uart_cpu_acpi.c
==
--- stable/12/sys/dev/uart/uart_cpu_acpi.c  Thu Oct 22 17:05:55 2020
(r366941)
+++ stable/12/sys/dev/uart/uart_cpu_acpi.c  Thu Oct 22 17:31:41 2020
(r366942)
@@ -120,11 +120,46 @@ uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *d
(int)spcr->SerialPort.SpaceId);
goto out;
}
-   if (spcr->SerialPort.AccessWidth == 0)
+   switch (spcr->SerialPort.AccessWidth) {
+   case 0: /* EFI_ACPI_6_0_UNDEFINED */
+   /* FALLTHROUGH */
+   case 1: /* EFI_ACPI_6_0_BYTE */
+   di->bas.regiowidth = 1;
+   break;
+   case 2: /* EFI_ACPI_6_0_WORD */
+   di->bas.regiowidth = 2;
+   break;
+   case 3: /* EFI_ACPI_6_0_DWORD */
+   di->bas.regiowidth = 4;
+   break;
+   case 4: /* EFI_ACPI_6_0_QWORD */
+   di->bas.regiowidth = 8;
+   break;
+   default:
+   printf("UART unsupported access width: %d!\n",
+   (int)spcr->SerialPort.AccessWidth);
+   goto out;
+   }
+   switch (spcr->SerialPort.BitWidth) {
+   case 0:
+   /* FALLTHROUGH */
+   case 8:
di->bas.regshft = 0;
-   else
-   di->bas.regshft = spcr->SerialPort.AccessWidth - 1;
-   di->bas.regiowidth = spcr->SerialPort.BitWidth / 8;
+   break;
+   case 16:
+   di->bas.regshft = 1;
+   break;
+   case 32:
+   di->bas.regshft = 2;
+   break;
+   case 64:
+   di->bas.regshft = 3;
+   break;
+   default:
+   printf("UART unsupported bit width: %d!\n",
+   (int)spcr->SerialPort.BitWidth);
+   goto out;
+   }
switch (spcr->BaudRate) {
case 0:
/* Special value; means "keep current value unchanged". */
___
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: r366941 - head/sys/net

2020-10-22 Thread Navdeep Parhar
Author: np
Date: Thu Oct 22 17:05:55 2020
New Revision: 366941
URL: https://svnweb.freebsd.org/changeset/base/366941

Log:
  if_vxlan(4): csum_flags_to_inner_flags takes the tunnel protocol as a 
parameter.
  
  No functional change.

Modified:
  head/sys/net/if_vxlan.c

Modified: head/sys/net/if_vxlan.c
==
--- head/sys/net/if_vxlan.c Thu Oct 22 16:41:13 2020(r366940)
+++ head/sys/net/if_vxlan.c Thu Oct 22 17:05:55 2020(r366941)
@@ -2423,9 +2423,9 @@ vxlan_encap_header(struct vxlan_softc *sc, struct mbuf
  * Return the CSUM_INNER_* equivalent of CSUM_* caps.
  */
 static uint32_t
-csum_flags_to_inner_flags(uint32_t csum_flags_in, uint32_t encap)
+csum_flags_to_inner_flags(uint32_t csum_flags_in, const uint32_t encap)
 {
-   uint32_t csum_flags = CSUM_ENCAP_VXLAN;
+   uint32_t csum_flags = encap;
const uint32_t v4 = CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP;
 
/*
___
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: r366936 - head/sys/net

2020-10-22 Thread Konstantin Belousov
On Thu, Oct 22, 2020 at 12:22:08PM +, Hans Petter Selasky wrote:
> Author: hselasky
> Date: Thu Oct 22 12:22:08 2020
> New Revision: 366936
> URL: https://svnweb.freebsd.org/changeset/base/366936
> 
> Log:
>   Compile fix for MIPS, MIPS64, POWERPC and POWERPC64.
>   Add missing include files.
>   
>   Differential Revision:  https://reviews.freebsd.org/D26254
>   Reviewed by:melifaro@
>   MFC after:  1 week
>   Sponsored by:   Mellanox Technologies // NVIDIA Networking
> 
> Modified:
>   head/sys/net/if_infiniband.c
> 
> Modified: head/sys/net/if_infiniband.c
> ==
> --- head/sys/net/if_infiniband.c  Thu Oct 22 10:36:16 2020
> (r366935)
> +++ head/sys/net/if_infiniband.c  Thu Oct 22 12:22:08 2020
> (r366936)
> @@ -29,6 +29,8 @@
>  #include 
>  __FBSDID("$FreeBSD$");
>  
> +#include 
> +#include 
>  #include 
>  #include 
>  #include 
sys/systm.h already includes sys/param.h.  Also, sys/param.h already includes
sys/types.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: r366940 - stable/11/lib/libgssapi

2020-10-22 Thread Brooks Davis
Author: brooks
Date: Thu Oct 22 16:41:13 2020
New Revision: 366940
URL: https://svnweb.freebsd.org/changeset/base/366940

Log:
  MFC r366671:
  
  libgssapi: modernize static string array use
  
  Use designated initializers to document positions in the arrays rather
  than requiring counting. Use nitems() rather than rolling it by hand to
  count elements.
  
  Also, passify a Clang 12 warning about suspcious string concatenation
  within an array initializer by adding parentheses.
  
  Reviewed by:  emaste
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26592

Modified:
  stable/11/lib/libgssapi/gss_display_status.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libgssapi/gss_display_status.c
==
--- stable/11/lib/libgssapi/gss_display_status.cThu Oct 22 16:29:21 
2020(r366939)
+++ stable/11/lib/libgssapi/gss_display_status.cThu Oct 22 16:41:13 
2020(r366940)
@@ -90,6 +90,7 @@
  * SUCH DAMAGE. 
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -103,17 +104,15 @@ static const char *
 calling_error(OM_uint32 v)
 {
 static const char *msgs[] = {
-   NULL,   /* 0 */
-   "A required input parameter could not be read.", /*  */
-   "A required output parameter could not be written.", /*  */
-   "A parameter was malformed"
+   [0] = "",
+   [1] = "A required input parameter could not be read.",
+   [2] = "A required output parameter could not be written.",
+   [3] = "A parameter was malformed",
 };
 
 v >>= GSS_C_CALLING_ERROR_OFFSET;
 
-if (v == 0)
-   return "";
-else if (v >= sizeof(msgs)/sizeof(*msgs))
+if (v >= nitems(msgs))
return "unknown calling error";
 else
return msgs[v];
@@ -123,31 +122,31 @@ static const char *
 routine_error(OM_uint32 v)
 {
 static const char *msgs[] = {
-   "Function completed successfully",  /* 0 */
-   "An unsupported mechanism was requested",
-   "An invalid name was supplied",
-   "A supplied name was of an unsupported type",
-   "Incorrect channel bindings were supplied",
-   "An invalid status code was supplied",
-   "A token had an invalid MIC",
-   "No credentials were supplied, "
-   "or the credentials were unavailable or inaccessible.",
-   "No context has been established",
-   "A token was invalid",
-   "A credential was invalid",
-   "The referenced credentials have expired",
-   "The context has expired",
-   "Miscellaneous failure (see text)",
-   "The quality-of-protection requested could not be provide",
-   "The operation is forbidden by local security policy",
-   "The operation or option is not available",
-   "The requested credential element already exists",
-   "The provided name was not a mechanism name.",
+   [0] = "Function completed successfully",
+   [1] = "An unsupported mechanism was requested",
+   [2] = "An invalid name was supplied",
+   [3] = "A supplied name was of an unsupported type",
+   [4] = "Incorrect channel bindings were supplied",
+   [5] = "An invalid status code was supplied",
+   [6] = "A token had an invalid MIC",
+   [7] = ("No credentials were supplied, "
+   "or the credentials were unavailable or inaccessible."),
+   [8] = "No context has been established",
+   [9] = "A token was invalid",
+   [10] = "A credential was invalid",
+   [11] =  "The referenced credentials have expired",
+   [12] = "The context has expired",
+   [13] = "Miscellaneous failure (see text)",
+   [14] = "The quality-of-protection requested could not be provide",
+   [15] = "The operation is forbidden by local security policy",
+   [16] = "The operation or option is not available",
+   [17] = "The requested credential element already exists",
+   [18] = "The provided name was not a mechanism name.",
 };
 
 v >>= GSS_C_ROUTINE_ERROR_OFFSET;
 
-if (v >= sizeof(msgs)/sizeof(*msgs))
+if (v >= nitems(msgs))
return "unknown routine error";
 else
return msgs[v];
@@ -157,17 +156,17 @@ static const char *
 supplementary_error(OM_uint32 v)
 {
 static const char *msgs[] = {
-   "normal completion",
-   "continuation call to routine required",
-   "duplicate per-message token detected",
-   "timed-out per-message token detected",
-   "reordered (early) per-message token detected",
-   "skipped predecessor token(s) detected"
+   [0] = "normal completion",
+   [1] = "continuation call to routine required",
+   [2] = "duplicate per-message token detected",
+   [3] = "timed-out per-message token detected",
+   [4] = "reordered (early) per-message token detected",
+   [5] = "skipped predecessor token(s) detected",
 };
 
 v >>= 

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

2020-10-22 Thread Brooks Davis
Author: brooks
Date: Thu Oct 22 16:29:21 2020
New Revision: 366939
URL: https://svnweb.freebsd.org/changeset/base/366939

Log:
  MFC r366731:
  
  physio: Don't store user addresses in bio_data
  
  Only assign the address from the iovec to bio_data if it is a kernel
  address.  This was the single place where bio_data stored (however
  briefly) a userspace pointer.
  
  Reviewed by:  imp, markj
  Obtained from:CheriBSD
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26783

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

Modified: stable/11/sys/kern/kern_physio.c
==
--- stable/11/sys/kern/kern_physio.cThu Oct 22 16:27:24 2020
(r366938)
+++ stable/11/sys/kern/kern_physio.cThu Oct 22 16:29:21 2020
(r366939)
@@ -43,7 +43,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
struct buf *pbuf;
struct bio *bp;
struct vm_page **pages;
-   caddr_t sa;
+   char *base, *sa;
u_int iolen, poff;
int error, i, npages, maxpages;
vm_prot_t prot;
@@ -136,7 +136,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
curthread->td_ru.ru_oublock++;
}
bp->bio_offset = uio->uio_offset;
-   bp->bio_data = uio->uio_iov[i].iov_base;
+   base = uio->uio_iov[i].iov_base;
bp->bio_length = uio->uio_iov[i].iov_len;
if (bp->bio_length > dev->si_iosize_max)
bp->bio_length = dev->si_iosize_max;
@@ -149,13 +149,13 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
 * larger than MAXPHYS - PAGE_SIZE must be
 * page aligned or it will be fragmented.
 */
-   poff = (vm_offset_t)bp->bio_data & PAGE_MASK;
+   poff = (vm_offset_t)base & PAGE_MASK;
if (pbuf && bp->bio_length + poff > pbuf->b_kvasize) {
if (dev->si_flags & SI_NOSPLIT) {
uprintf("%s: request ptr %p is not "
"on a page boundary; cannot split "
"request\n", devtoname(dev),
-   bp->bio_data);
+   base);
error = EFBIG;
goto doerror;
}
@@ -170,7 +170,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
if (pages) {
if ((npages = vm_fault_quick_hold_pages(
>p_vmspace->vm_map,
-   (vm_offset_t)bp->bio_data, bp->bio_length,
+   (vm_offset_t)base, bp->bio_length,
prot, pages, maxpages)) < 0) {
error = EFAULT;
goto doerror;
@@ -186,7 +186,8 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
bp->bio_data = unmapped_buf;
bp->bio_flags |= BIO_UNMAPPED;
}
-   }
+   } else
+   bp->bio_data = base;
 
csw->d_strategy(bp);
if (uio->uio_rw == UIO_READ)
___
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: r366938 - stable/12/sys/kern

2020-10-22 Thread Brooks Davis
Author: brooks
Date: Thu Oct 22 16:27:24 2020
New Revision: 366938
URL: https://svnweb.freebsd.org/changeset/base/366938

Log:
  MFC r366731:
  
  physio: Don't store user addresses in bio_data
  
  Only assign the address from the iovec to bio_data if it is a kernel
  address.  This was the single place where bio_data stored (however
  briefly) a userspace pointer.
  
  Reviewed by:  imp, markj
  Obtained from:CheriBSD
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D26783

Modified:
  stable/12/sys/kern/kern_physio.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_physio.c
==
--- stable/12/sys/kern/kern_physio.cThu Oct 22 15:23:41 2020
(r366937)
+++ stable/12/sys/kern/kern_physio.cThu Oct 22 16:27:24 2020
(r366938)
@@ -45,7 +45,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
struct buf *pbuf;
struct bio *bp;
struct vm_page **pages;
-   caddr_t sa;
+   char *base, *sa;
u_int iolen, poff;
int error, i, npages, maxpages;
vm_prot_t prot;
@@ -140,7 +140,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
curthread->td_ru.ru_oublock++;
}
bp->bio_offset = uio->uio_offset;
-   bp->bio_data = uio->uio_iov[i].iov_base;
+   base = uio->uio_iov[i].iov_base;
bp->bio_length = uio->uio_iov[i].iov_len;
if (bp->bio_length > dev->si_iosize_max)
bp->bio_length = dev->si_iosize_max;
@@ -153,13 +153,13 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
 * larger than MAXPHYS - PAGE_SIZE must be
 * page aligned or it will be fragmented.
 */
-   poff = (vm_offset_t)bp->bio_data & PAGE_MASK;
+   poff = (vm_offset_t)base & PAGE_MASK;
if (pbuf && bp->bio_length + poff > pbuf->b_kvasize) {
if (dev->si_flags & SI_NOSPLIT) {
uprintf("%s: request ptr %p is not "
"on a page boundary; cannot split "
"request\n", devtoname(dev),
-   bp->bio_data);
+   base);
error = EFBIG;
goto doerror;
}
@@ -174,7 +174,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
if (pages) {
if ((npages = vm_fault_quick_hold_pages(
>p_vmspace->vm_map,
-   (vm_offset_t)bp->bio_data, bp->bio_length,
+   (vm_offset_t)base, bp->bio_length,
prot, pages, maxpages)) < 0) {
error = EFAULT;
goto doerror;
@@ -190,7 +190,8 @@ physio(struct cdev *dev, struct uio *uio, int ioflag)
bp->bio_data = unmapped_buf;
bp->bio_flags |= BIO_UNMAPPED;
}
-   }
+   } else
+   bp->bio_data = base;
 
csw->d_strategy(bp);
if (uio->uio_rw == UIO_READ)
___
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: r366937 - in stable/12: lib/libc/sys sys/cddl/compat/opensolaris/sys sys/compat/cloudabi sys/compat/linux sys/kern sys/sys sys/ufs/ffs

2020-10-22 Thread Konstantin Belousov
Author: kib
Date: Thu Oct 22 15:23:41 2020
New Revision: 366937
URL: https://svnweb.freebsd.org/changeset/base/366937

Log:
  MFC r339748, r340343, r340347, r341256, r366015-r366023, r366549:
  O_BENEATH and related features.
  
  Sponsored by: The FreeBSD Foundation
  Tested by:pho

Modified:
  stable/12/lib/libc/sys/access.2
  stable/12/lib/libc/sys/chflags.2
  stable/12/lib/libc/sys/chmod.2
  stable/12/lib/libc/sys/chown.2
  stable/12/lib/libc/sys/fhlink.2
  stable/12/lib/libc/sys/getfh.2
  stable/12/lib/libc/sys/link.2
  stable/12/lib/libc/sys/open.2
  stable/12/lib/libc/sys/stat.2
  stable/12/lib/libc/sys/unlink.2
  stable/12/lib/libc/sys/utimensat.2
  stable/12/sys/cddl/compat/opensolaris/sys/vnode.h
  stable/12/sys/compat/cloudabi/cloudabi_file.c
  stable/12/sys/compat/linux/linux_file.c
  stable/12/sys/kern/vfs_lookup.c
  stable/12/sys/kern/vfs_mountroot.c
  stable/12/sys/kern/vfs_syscalls.c
  stable/12/sys/kern/vfs_vnops.c
  stable/12/sys/sys/fcntl.h
  stable/12/sys/sys/namei.h
  stable/12/sys/sys/syscallsubr.h
  stable/12/sys/ufs/ffs/ffs_alloc.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/sys/access.2
==
--- stable/12/lib/libc/sys/access.2 Thu Oct 22 12:22:08 2020
(r366936)
+++ stable/12/lib/libc/sys/access.2 Thu Oct 22 15:23:41 2020
(r366937)
@@ -28,7 +28,7 @@
 .\" @(#)access.2   8.2 (Berkeley) 4/1/94
 .\" $FreeBSD$
 .\"
-.Dd March 30, 2020
+.Dd September 23, 2020
 .Dt ACCESS 2
 .Os
 .Sh NAME
@@ -120,6 +120,20 @@ list, defined in
 The checks for accessibility are performed using the effective user and group
 IDs instead of the real user and group ID as required in a call to
 .Fn access .
+.It Dv AT_BENEATH
+Only operate on files and directories below the topping directory.
+See the description of the
+.Dv O_BENEATH
+flag in the
+.Xr open 2
+manual page.
+.It Dv AT_RESOLVE_BENEATH
+Only walks paths below the topping directory.
+See the description of the
+.Dv O_RESOLVE_BENEATH
+flag in the
+.Xr open 2
+manual page.
 .El
 .Pp
 Even if a process's real or effective user has appropriate privileges
@@ -197,6 +211,24 @@ argument is not an absolute path and
 is neither
 .Dv AT_FDCWD
 nor a file descriptor associated with a directory.
+.It Bq Er ENOTCAPABLE
+.Fa path
+is an absolute path,
+or contained a ".." component leading to a
+directory outside of the directory hierarchy specified by
+.Fa fd ,
+and the process is in capability mode.
+.It Bq Er ENOTCAPABLE
+The
+.Dv AT_BENEATH
+flag was provided to
+.Fn faccessat ,
+and the absolute
+.Fa path
+does not have its tail fully contained under the topping directory,
+or the relative
+.Fa path
+escapes it.
 .El
 .Sh SEE ALSO
 .Xr chmod 2 ,

Modified: stable/12/lib/libc/sys/chflags.2
==
--- stable/12/lib/libc/sys/chflags.2Thu Oct 22 12:22:08 2020
(r366936)
+++ stable/12/lib/libc/sys/chflags.2Thu Oct 22 15:23:41 2020
(r366937)
@@ -28,7 +28,7 @@
 .\"@(#)chflags.2   8.3 (Berkeley) 5/2/95
 .\" $FreeBSD$
 .\"
-.Dd March 30, 2020
+.Dd September 23, 2020
 .Dt CHFLAGS 2
 .Os
 .Sh NAME
@@ -94,6 +94,21 @@ defined in
 If
 .Fa path
 names a symbolic link, then the flags of the symbolic link are changed.
+.It Dv AT_BENEATH
+Only allow to change flags for a file which is beneath of
+the topping directory.
+See the description of the
+.Dv O_BENEATH
+flag in the
+.Xr open 2
+manual page.
+.It Dv AT_RESOLVE_BENEATH
+Only walks paths below the topping directory.
+See the description of the
+.Dv O_RESOLVE_BENEATH
+flag in the
+.Xr open 2
+manual page.
 .El
 .Pp
 If
@@ -306,6 +321,24 @@ Corrupted data was detected while reading from the fil
 The underlying file system does not support file flags, or
 does not support all of the flags set in
 .Fa flags .
+.It Bq Er ENOTCAPABLE
+.Fa path
+is an absolute path,
+or contained a ".." component leading to a
+directory outside of the directory hierarchy specified by
+.Fa fd ,
+and the process is in capability mode.
+.It Bq Er ENOTCAPABLE
+The
+.Dv AT_BENEATH
+flag was provided to
+.Fn chflagsat ,
+and the absolute
+.Fa path
+does not have its tail fully contained under the topping directory,
+or the relative
+.Fa path
+escapes it.
 .El
 .Sh SEE ALSO
 .Xr chflags 1 ,

Modified: stable/12/lib/libc/sys/chmod.2
==
--- stable/12/lib/libc/sys/chmod.2  Thu Oct 22 12:22:08 2020
(r366936)
+++ stable/12/lib/libc/sys/chmod.2  Thu Oct 22 15:23:41 2020
(r366937)
@@ -28,7 +28,7 @@
 .\" @(#)chmod.28.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd March 30, 2020
+.Dd September 23, 2020
 .Dt CHMOD 2
 .Os
 .Sh NAME
@@ -101,6 +101,21 @@ in
 If
 .Fa path
 names a symbolic link, then the mode of the symbolic link is changed.
+.It Dv AT_BENEATH
+Only allow to change permissions of a file which is beneath 

Re: svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf

2020-10-22 Thread Kyle Evans
On Sat, Oct 17, 2020 at 11:40 AM Warner Losh  wrote:
>
>
>
> On Sat, Oct 17, 2020, 10:11 AM Alexander V. Chernikov  
> wrote:
>>
>> 17.10.2020, 14:07, "Hans Petter Selasky" :
>>
>> On 2020-10-17 14:34, Alexander V. Chernikov wrote:
>>
>>  17.10.2020, 12:32, "Hans Petter Selasky" :
>>
>>   On 2020-10-17 13:27, Alexander V. Chernikov wrote:
>>
>> 02.10.2020, 19:26, "Emmanuel Vadot" >   >:
>>
>>  Author: manu
>>  Date: Fri Oct 2 18:26:41 2020
>>  New Revision: 366372
>>  URL: https://svnweb.freebsd.org/changeset/base/366372
>>
>>  Log:
>> linuxkpi: Add backlight support
>>
>> Add backlight function to linuxkpi.
>> Graphics drivers expose the backlight of the panel 
>> directly so
>>   allow them
>>  to use the backlight subsystem so
>> user can use backlight(8) to configure them.
>>
>> Reviewed by: hselasky
>> Relnotes: yes
>> Differential Revision: The FreeBSD Foundation
>>
>>  Added:
>> head/sys/compat/linuxkpi/common/include/linux/backlight.h
>>   (contents,
>>  props changed)
>>  Modified:
>> head/sys/compat/linuxkpi/common/include/linux/device.h
>> head/sys/compat/linuxkpi/common/src/linux_kmod.c
>> head/sys/compat/linuxkpi/common/src/linux_pci.c
>> head/sys/conf/kmod.mk
>>
>> It breaks the build for me with
>> 
>> /usr/home/melifaro/free/head/sys/compat/linuxkpi/common/src/linux_pci.c:70:10:
>> fatal error: 'backlight_if.h' file not found
>>
>>
>>   How do you build? Doesn't break over here.
>>
>>  GENERIC + COMPAT_LINUXKPI.
>>
>>
>>
>> Try adding:
>>
>> options backlight
>>
>> To the kernel config.
>>
>> Yep, thank you!
>> Maybe it's worth considering adding static assert with the message 
>> describing this dependency?
>
>
> Yes. It likely is worth doing something to highlight this issue.
>
> Warner
>

I think we just need to slap the two core backlight files with an ` |
compat_linux` so that they simply get pulled in if you specify
COMPAT_LINUX. config(8) handles this terribly, configng must have a
better provides/requires/implies/whatever functionality so we can
specify that compat_linux implies backlight and not do crud like this
where it becomes more complicated to see what any given option really
entails.

Thanks,

Kyle Evans
___
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: r366936 - head/sys/net

2020-10-22 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct 22 12:22:08 2020
New Revision: 366936
URL: https://svnweb.freebsd.org/changeset/base/366936

Log:
  Compile fix for MIPS, MIPS64, POWERPC and POWERPC64.
  Add missing include files.
  
  Differential Revision:https://reviews.freebsd.org/D26254
  Reviewed by:  melifaro@
  MFC after:1 week
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Modified:
  head/sys/net/if_infiniband.c

Modified: head/sys/net/if_infiniband.c
==
--- head/sys/net/if_infiniband.cThu Oct 22 10:36:16 2020
(r366935)
+++ head/sys/net/if_infiniband.cThu Oct 22 12:22:08 2020
(r366936)
@@ -29,6 +29,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include 
+#include 
 #include 
 #include 
 #include 
___
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: r366935 - head/sbin/ifconfig

2020-10-22 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct 22 10:36:16 2020
New Revision: 366935
URL: https://svnweb.freebsd.org/changeset/base/366935

Log:
  Fix for colliding change (r366917).
  
  Differential Revision:https://reviews.freebsd.org/D26254
  Reviewed by:  melifaro@
  MFC after:1 week
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Modified:
  head/sbin/ifconfig/iflagg.c

Modified: head/sbin/ifconfig/iflagg.c
==
--- head/sbin/ifconfig/iflagg.c Thu Oct 22 10:29:27 2020(r366934)
+++ head/sbin/ifconfig/iflagg.c Thu Oct 22 10:36:16 2020(r366935)
@@ -363,5 +363,5 @@ lagg_ctor(void)
for (i = 0; i < nitems(lagg_cmds);  i++)
cmd_register(_cmds[i]);
af_register(_lagg);
-   clone_setdefcallback("lagg", lagg_create);
+   clone_setdefcallback_prefix("lagg", lagg_create);
 }
___
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: r366934 - head/sys/conf

2020-10-22 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct 22 10:29:27 2020
New Revision: 366934
URL: https://svnweb.freebsd.org/changeset/base/366934

Log:
  Fix for monotolithic kernel builds using device lagg(4).
  
  Differential Revision:https://reviews.freebsd.org/D26254
  Reviewed by:  melifaro@
  MFC after:1 week
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Oct 22 09:47:12 2020(r366933)
+++ head/sys/conf/files Thu Oct 22 10:29:27 2020(r366934)
@@ -4571,7 +4571,7 @@ compat/lindebugfs/lindebugfs.c
optional lindebugfs \
compile-with "${LINUXKPI_C}"
 
 # OpenFabrics Enterprise Distribution (Infiniband)
-net/if_infiniband.coptional ofed
+net/if_infiniband.coptional ofed | lagg
 ofed/drivers/infiniband/core/ib_addr.c optional ofed   \
compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_agent.coptional ofed   
\
___
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: r366933 - in head: sbin/ifconfig share/man/man4 sys/net

2020-10-22 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct 22 09:47:12 2020
New Revision: 366933
URL: https://svnweb.freebsd.org/changeset/base/366933

Log:
  Add support for IP over infiniband, IPoIB, to lagg(4). Currently only
  the failover protocol is supported due to limitations in the IPoIB
  architecture. Refer to the lagg(4) manual page for how to configure
  and use this new feature. A new network interface type,
  IFT_INFINIBANDLAG, has been added, similar to the existing
  IFT_IEEE8023ADLAG .
  
  ifconfig(8) has been updated to accept a new laggtype argument when
  creating lagg(4) network interfaces. This new argument is used to
  distinguish between ethernet and infiniband type of lagg(4) network
  interface. The laggtype argument is optional and defaults to
  ethernet. The lagg(4) command line syntax is backwards compatible.
  
  Differential Revision:https://reviews.freebsd.org/D26254
  Reviewed by:  melifaro@
  MFC after:1 week
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Modified:
  head/sbin/ifconfig/ifconfig.8
  head/sbin/ifconfig/iflagg.c
  head/share/man/man4/lagg.4
  head/sys/net/ieee8023ad_lacp.c
  head/sys/net/if_ethersubr.c
  head/sys/net/if_infiniband.c
  head/sys/net/if_lagg.c
  head/sys/net/if_lagg.h
  head/sys/net/if_types.h

Modified: head/sbin/ifconfig/ifconfig.8
==
--- head/sbin/ifconfig/ifconfig.8   Thu Oct 22 09:28:11 2020
(r366932)
+++ head/sbin/ifconfig/ifconfig.8   Thu Oct 22 09:47:12 2020
(r366933)
@@ -28,7 +28,7 @@
 .\" From: @(#)ifconfig.8   8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd September 17, 2020
+.Dd October 21, 2020
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -2481,6 +2481,12 @@ Set to 0 to disable.
 .Pp
 The following parameters are specific to lagg interfaces:
 .Bl -tag -width indent
+.It Cm laggtype Ar type
+When creating a lagg interface the type can be specified as either
+.Cm ethernet
+or
+.Cm infiniband .
+If not specified ethernet is the default lagg type.
 .It Cm laggport Ar interface
 Add the interface named by
 .Ar interface

Modified: head/sbin/ifconfig/iflagg.c
==
--- head/sbin/ifconfig/iflagg.c Thu Oct 22 09:28:11 2020(r366932)
+++ head/sbin/ifconfig/iflagg.c Thu Oct 22 09:47:12 2020(r366933)
@@ -30,8 +30,12 @@ static const char rcsid[] =
 
 #include "ifconfig.h"
 
-char lacpbuf[120]; /* LACP peer '[(a,a,a),(p,p,p)]' */
+static struct iflaggparam params = {
+   .lagg_type = LAGG_TYPE_DEFAULT,
+};
 
+static char lacpbuf[120];  /* LACP peer '[(a,a,a),(p,p,p)]' */
+
 static void
 setlaggport(const char *val, int d, int s, const struct afswtch *afp)
 {
@@ -301,7 +305,31 @@ lagg_status(int s)
}
 }
 
+static
+DECL_CMD_FUNC(setlaggtype, arg, d)
+{
+   static const struct lagg_types lt[] = LAGG_TYPES;
+   int i;
+
+   for (i = 0; i < nitems(lt); i++) {
+   if (strcmp(arg, lt[i].lt_name) == 0) {
+   params.lagg_type = lt[i].lt_value;
+   return;
+   }
+   }
+   errx(1, "invalid lagg type: %s", arg);
+}
+
+static void
+lagg_create(int s, struct ifreq *ifr)
+{
+   ifr->ifr_data = (caddr_t) 
+   if (ioctl(s, SIOCIFCREATE2, ifr) < 0)
+   err(1, "SIOCIFCREATE2");
+}
+
 static struct cmd lagg_cmds[] = {
+   DEF_CLONE_CMD_ARG("laggtype",   setlaggtype),
DEF_CMD_ARG("laggport", setlaggport),
DEF_CMD_ARG("-laggport",unsetlaggport),
DEF_CMD_ARG("laggproto",setlaggproto),
@@ -335,4 +363,5 @@ lagg_ctor(void)
for (i = 0; i < nitems(lagg_cmds);  i++)
cmd_register(_cmds[i]);
af_register(_lagg);
+   clone_setdefcallback("lagg", lagg_create);
 }

Modified: head/share/man/man4/lagg.4
==
--- head/share/man/man4/lagg.4  Thu Oct 22 09:28:11 2020(r366932)
+++ head/share/man/man4/lagg.4  Thu Oct 22 09:47:12 2020(r366933)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 18, 2017
+.Dd October 21, 2020
 .Dt LAGG 4
 .Os
 .Sh NAME
@@ -192,6 +192,15 @@ device will be used:
 .Pp
 (Note the mac address of the wireless device is forced to match the wired
 device as a workaround.)
+.Pp
+The following example shows how to create an infiniband failover interface.
+.Bd -literal -offset indent
+# ifconfig ib0 up
+# ifconfig ib1 up
+# ifconfig lagg0 create laggtype infiniband
+# ifconfig lagg0 laggproto failover laggport ib0 laggport ib1 \e
+   1.1.1.1 netmask 255.255.255.0
+.Ed
 .Sh SEE ALSO
 .Xr ng_one2many 4 ,
 .Xr ifconfig 8 ,

Modified: head/sys/net/ieee8023ad_lacp.c
==
--- head/sys/net/ieee8023ad_lacp.c  Thu Oct 22 09:28:11 2020
(r366932)
+++ head/sys/net/ieee8023ad_lacp.c  

svn commit: r366932 - head/sys/kern

2020-10-22 Thread Konstantin Belousov
Author: kib
Date: Thu Oct 22 09:28:11 2020
New Revision: 366932
URL: https://svnweb.freebsd.org/changeset/base/366932

Log:
  sysv_sem: semusz depends on semume.
  
  Size of the per-process semaphore undo structure (semusz) depends on
  the number of the per-process undos.  If kern.ipc.semume is adjusted,
  semusz must be adjusted as well, and it makes no sense to delegate
  adjustment to user.  Make it automatic.
  
  Reported and tested by:   Olef 
  PR:   250361
  Reviewed by:  jhb, markj
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D26826

Modified:
  head/sys/kern/sysv_sem.c

Modified: head/sys/kern/sysv_sem.c
==
--- head/sys/kern/sysv_sem.cThu Oct 22 09:17:56 2020(r366931)
+++ head/sys/kern/sysv_sem.cThu Oct 22 09:28:11 2020(r366932)
@@ -187,13 +187,13 @@ struct sem_undo {
 #defineSEM_ALIGN(bytes) roundup2(bytes, sizeof(long))
 
 /* actual size of an undo structure */
-#define SEMUSZ SEM_ALIGN(offsetof(struct sem_undo, un_ent[SEMUME]))
+#define SEMUSZ(x)  SEM_ALIGN(offsetof(struct sem_undo, un_ent[(x)]))
 
 /*
  * Macro to find a particular sem_undo vector
  */
 #define SEMU(ix) \
-   ((struct sem_undo *)(((intptr_t)semu)+ix * seminfo.semusz))
+   ((struct sem_undo *)(((intptr_t)semu) + (ix) * seminfo.semusz))
 
 /*
  * semaphore info struct
@@ -205,7 +205,7 @@ struct seminfo seminfo = {
.semmsl =   SEMMSL, /* max # of semaphores per id */
.semopm =   SEMOPM, /* max # of operations per semop call */
.semume =   SEMUME, /* max # of undo entries per process */
-   .semusz =   SEMUSZ, /* size in bytes of undo structure */
+   .semusz =   SEMUSZ(SEMUME), /* size in bytes of undo structure */
.semvmx =   SEMVMX, /* semaphore maximum value */
.semaem =   SEMAEM, /* adjust on exit max value */
 };
@@ -222,7 +222,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, semopm, CTLFLAG_RDTUN,
 "Max operations per semop call");
 SYSCTL_INT(_kern_ipc, OID_AUTO, semume, CTLFLAG_RDTUN, , 0,
 "Max undo entries per process");
-SYSCTL_INT(_kern_ipc, OID_AUTO, semusz, CTLFLAG_RDTUN, , 0,
+SYSCTL_INT(_kern_ipc, OID_AUTO, semusz, CTLFLAG_RD, , 0,
 "Size in bytes of undo structure");
 SYSCTL_INT(_kern_ipc, OID_AUTO, semvmx, CTLFLAG_RWTUN, , 0,
 "Semaphore maximum value");
@@ -284,6 +284,7 @@ seminit(void)
M_WAITOK | M_ZERO);
sema_mtx = malloc(sizeof(struct mtx) * seminfo.semmni, M_SEM,
M_WAITOK | M_ZERO);
+   seminfo.semusz = SEMUSZ(seminfo.semume);
semu = malloc(seminfo.semmnu * seminfo.semusz, M_SEM, M_WAITOK);
 
for (i = 0; i < seminfo.semmni; i++) {
___
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: r366931 - in head/sys: kern sys

2020-10-22 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct 22 09:17:56 2020
New Revision: 366931
URL: https://svnweb.freebsd.org/changeset/base/366931

Log:
  Implement mbuf hashing routines for IP over infiniband, IPoIB.
  No functional change intended.
  
  Differential Revision:https://reviews.freebsd.org/D26254
  Reviewed by:  melifaro@
  MFC after:1 week
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Modified:
  head/sys/kern/uipc_mbufhash.c
  head/sys/sys/mbuf.h

Modified: head/sys/kern/uipc_mbufhash.c
==
--- head/sys/kern/uipc_mbufhash.c   Thu Oct 22 09:09:53 2020
(r366930)
+++ head/sys/kern/uipc_mbufhash.c   Thu Oct 22 09:17:56 2020
(r366931)
@@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
 #if defined(INET) || defined(INET6)
 #include 
@@ -42,7 +43,7 @@ __FBSDID("$FreeBSD$");
 #endif
 
 static const void *
-m_ether_tcpip_hash_gethdr(const struct mbuf *m, const u_int off,
+m_common_hash_gethdr(const struct mbuf *m, const u_int off,
 const u_int len, void *buf)
 {
 
@@ -65,9 +66,19 @@ m_ether_tcpip_hash_init(void)
 }
 
 uint32_t
-m_ether_tcpip_hash(const uint32_t flags, const struct mbuf *m,
-const uint32_t key)
+m_infiniband_tcpip_hash_init(void)
 {
+   uint32_t seed;
+
+   seed = arc4random();
+   return (fnv_32_buf(, sizeof(seed), FNV1_32_INIT));
+}
+
+static inline uint32_t
+m_tcpip_hash(const uint32_t flags, const struct mbuf *m,
+uint32_t p, int off, const uint16_t etype)
+{
+#if defined(INET) || defined(INET6)
union {
 #ifdef INET
struct ip ip;
@@ -75,49 +86,19 @@ m_ether_tcpip_hash(const uint32_t flags, const struct 
 #ifdef INET6
struct ip6_hdr ip6;
 #endif
-   struct ether_vlan_header vlan;
uint32_t port;
} buf;
-   const struct ether_header *eh;
-   const struct ether_vlan_header *vlan;
 #ifdef INET
const struct ip *ip;
 #endif
 #ifdef INET6
const struct ip6_hdr *ip6;
 #endif
-   uint32_t p;
-   int off;
-   uint16_t etype;
-
-   p = key;
-   off = sizeof(*eh);
-   if (m->m_len < off)
-   goto done;
-   eh = mtod(m, struct ether_header *);
-   etype = ntohs(eh->ether_type);
-   if (flags & MBUF_HASHFLAG_L2) {
-   p = fnv_32_buf(>ether_shost, ETHER_ADDR_LEN, p);
-   p = fnv_32_buf(>ether_dhost, ETHER_ADDR_LEN, p);
-   }
-   /* Special handling for encapsulating VLAN frames */
-   if ((m->m_flags & M_VLANTAG) && (flags & MBUF_HASHFLAG_L2)) {
-   p = fnv_32_buf(>m_pkthdr.ether_vtag,
-   sizeof(m->m_pkthdr.ether_vtag), p);
-   } else if (etype == ETHERTYPE_VLAN) {
-   vlan = m_ether_tcpip_hash_gethdr(m, off, sizeof(*vlan), );
-   if (vlan == NULL)
-   goto done;
-
-   if (flags & MBUF_HASHFLAG_L2)
-   p = fnv_32_buf(>evl_tag, sizeof(vlan->evl_tag), 
p);
-   etype = ntohs(vlan->evl_proto);
-   off += sizeof(*vlan) - sizeof(*eh);
-   }
+#endif
switch (etype) {
 #ifdef INET
case ETHERTYPE_IP:
-   ip = m_ether_tcpip_hash_gethdr(m, off, sizeof(*ip), );
+   ip = m_common_hash_gethdr(m, off, sizeof(*ip), );
if (ip == NULL)
break;
if (flags & MBUF_HASHFLAG_L3) {
@@ -136,7 +117,7 @@ m_ether_tcpip_hash(const uint32_t flags, const struct 
if (iphlen < sizeof(*ip))
break;
off += iphlen;
-   ports = m_ether_tcpip_hash_gethdr(m,
+   ports = m_common_hash_gethdr(m,
off, sizeof(*ports), );
if (ports == NULL)
break;
@@ -150,7 +131,7 @@ m_ether_tcpip_hash(const uint32_t flags, const struct 
 #endif
 #ifdef INET6
case ETHERTYPE_IPV6:
-   ip6 = m_ether_tcpip_hash_gethdr(m, off, sizeof(*ip6), );
+   ip6 = m_common_hash_gethdr(m, off, sizeof(*ip6), );
if (ip6 == NULL)
break;
if (flags & MBUF_HASHFLAG_L3) {
@@ -169,6 +150,62 @@ m_ether_tcpip_hash(const uint32_t flags, const struct 
default:
break;
}
-done:
return (p);
+}
+
+uint32_t
+m_ether_tcpip_hash(const uint32_t flags, const struct mbuf *m,
+uint32_t p)
+{
+   union {
+   struct ether_vlan_header vlan;
+   } buf;
+   const struct ether_header *eh;
+   const struct ether_vlan_header *vlan;
+   int off;
+   uint16_t etype;
+
+   off = sizeof(*eh);
+   if (m->m_len < off)
+   return (p);
+   eh = mtod(m, struct ether_header *);
+   

svn commit: r366930 - in head/sys: conf modules modules/if_infiniband net ofed/drivers/infiniband/ulp/ipoib

2020-10-22 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Oct 22 09:09:53 2020
New Revision: 366930
URL: https://svnweb.freebsd.org/changeset/base/366930

Log:
  Factor out generic IP over infiniband, IPoIB, definitions and code
  into net/if_infiniband.c and net/infiniband.h . No functional change
  intended.
  
  Differential Revision:https://reviews.freebsd.org/D26254
  Reviewed by:  melifaro@
  MFC after:1 week
  Sponsored by: Mellanox Technologies // NVIDIA Networking

Added:
  head/sys/modules/if_infiniband/
  head/sys/modules/if_infiniband/Makefile   (contents, props changed)
  head/sys/net/if_infiniband.c   (contents, props changed)
  head/sys/net/infiniband.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/modules/Makefile
  head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h
  head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c
  head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c
  head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Oct 22 08:40:25 2020(r366929)
+++ head/sys/conf/files Thu Oct 22 09:09:53 2020(r366930)
@@ -4571,6 +4571,7 @@ compat/lindebugfs/lindebugfs.c
optional lindebugfs \
compile-with "${LINUXKPI_C}"
 
 # OpenFabrics Enterprise Distribution (Infiniband)
+net/if_infiniband.coptional ofed
 ofed/drivers/infiniband/core/ib_addr.c optional ofed   \
compile-with "${OFED_C}"
 ofed/drivers/infiniband/core/ib_agent.coptional ofed   
\

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Thu Oct 22 08:40:25 2020(r366929)
+++ head/sys/modules/Makefile   Thu Oct 22 09:09:53 2020(r366930)
@@ -154,6 +154,7 @@ SUBDIR= \
${_if_gif} \
${_if_gre} \
${_if_me} \
+   if_infiniband \
if_lagg \
${_if_ndis} \
${_if_stf} \

Added: head/sys/modules/if_infiniband/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/if_infiniband/Makefile Thu Oct 22 09:09:53 2020
(r366930)
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/net
+
+KMOD=  if_infiniband
+SRCS=  if_infiniband.c \
+   opt_inet.h \
+   opt_inet6.h
+
+.include 

Added: head/sys/net/if_infiniband.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/net/if_infiniband.cThu Oct 22 09:09:53 2020
(r366930)
@@ -0,0 +1,538 @@
+/*-
+ * Copyright (c) 2020 Mellanox Technologies. 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 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 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 "opt_inet.h"
+#include "opt_inet6.h"
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#ifdef INET
+static inline void
+infiniband_ipv4_multicast_map(uint32_t addr,
+const uint8_t *broadcast, uint8_t *buf)
+{
+   uint8_t scope;
+
+   addr = ntohl(addr);
+   scope = broadcast[5] & 0xF;
+
+   buf[0] = 0;
+   buf[1] = 0xff;
+   buf[2] = 0xff;
+   buf[3] = 0xff;
+   buf[4] = 0xff;
+   buf[5] = 0x10 | scope;
+   buf[6] = 0x40;
+   buf[7] = 

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

2020-10-22 Thread Navdeep Parhar
Author: np
Date: Thu Oct 22 08:40:25 2020
New Revision: 366929
URL: https://svnweb.freebsd.org/changeset/base/366929

Log:
  cxgbe(4): fix the size of the iq/eq maps.
  
  The firmware can allocate ingress and egress context ids anywhere from
  its configured range.  Size the iq/eq maps to match the entire range
  instead of assuming that the firmware always allocates the first
  available context id.
  
  Reported by:  Baptiste Wicht @ Verisign
  MFC after:1 week
  Sponsored by: Chelsio Communications

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

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hThu Oct 22 06:51:47 2020
(r366928)
+++ head/sys/dev/cxgbe/adapter.hThu Oct 22 08:40:25 2020
(r366929)
@@ -799,6 +799,8 @@ struct sge {
uint16_t iq_base;   /* first abs_id */
int eq_start;   /* first cntxt_id */
int eq_base;/* first abs_id */
+   int iqmap_sz;
+   int eqmap_sz;
struct sge_iq **iqmap;  /* iq->cntxt_id to iq mapping */
struct sge_eq **eqmap;  /* eq->cntxt_id to eq mapping */
 

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Oct 22 06:51:47 2020
(r366928)
+++ head/sys/dev/cxgbe/t4_main.cThu Oct 22 08:40:25 2020
(r366929)
@@ -1358,6 +1358,8 @@ t4_attach(device_t dev)
s->nm_txq = malloc(s->nnmtxq * sizeof(struct sge_nm_txq),
M_CXGBE, M_ZERO | M_WAITOK);
 #endif
+   MPASS(s->niq <= s->iqmap_sz);
+   MPASS(s->neq <= s->eqmap_sz);
 
s->ctrlq = malloc(nports * sizeof(struct sge_wrq), M_CXGBE,
M_ZERO | M_WAITOK);
@@ -1365,9 +1367,9 @@ t4_attach(device_t dev)
M_ZERO | M_WAITOK);
s->txq = malloc(s->ntxq * sizeof(struct sge_txq), M_CXGBE,
M_ZERO | M_WAITOK);
-   s->iqmap = malloc(s->niq * sizeof(struct sge_iq *), M_CXGBE,
+   s->iqmap = malloc(s->iqmap_sz * sizeof(struct sge_iq *), M_CXGBE,
M_ZERO | M_WAITOK);
-   s->eqmap = malloc(s->neq * sizeof(struct sge_eq *), M_CXGBE,
+   s->eqmap = malloc(s->eqmap_sz * sizeof(struct sge_eq *), M_CXGBE,
M_ZERO | M_WAITOK);
 
sc->irq = malloc(sc->intr_count * sizeof(struct irq), M_CXGBE,
@@ -4456,6 +4458,19 @@ get_params__post_init(struct adapter *sc)
("%s: L2 table size (%u) larger than expected (%u)",
__func__, sc->vres.l2t.size, L2T_SIZE));
sc->params.core_vdd = val[6];
+
+   param[0] = FW_PARAM_PFVF(IQFLINT_END);
+   param[1] = FW_PARAM_PFVF(EQ_END);
+   rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 2, param, val);
+   if (rc != 0) {
+   device_printf(sc->dev,
+   "failed to query parameters (post_init2): %d.\n", rc);
+   return (rc);
+   }
+   MPASS(val[0] >= sc->sge.iq_start);
+   sc->sge.iqmap_sz = val[0] - sc->sge.iq_start + 1;
+   MPASS(val[1] >= sc->sge.eq_start);
+   sc->sge.eqmap_sz = val[1] - sc->sge.eq_start + 1;
 
if (chip_id(sc) >= CHELSIO_T6) {
 

Modified: head/sys/dev/cxgbe/t4_netmap.c
==
--- head/sys/dev/cxgbe/t4_netmap.c  Thu Oct 22 06:51:47 2020
(r366928)
+++ head/sys/dev/cxgbe/t4_netmap.c  Thu Oct 22 08:40:25 2020
(r366929)
@@ -188,9 +188,9 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq
nm_rxq->iq_cntxt_id = be16toh(c.iqid);
nm_rxq->iq_abs_id = be16toh(c.physiqid);
cntxt_id = nm_rxq->iq_cntxt_id - sc->sge.iq_start;
-   if (cntxt_id >= sc->sge.niq) {
+   if (cntxt_id >= sc->sge.iqmap_sz) {
panic ("%s: nm_rxq->iq_cntxt_id (%d) more than the max (%d)",
-   __func__, cntxt_id, sc->sge.niq - 1);
+   __func__, cntxt_id, sc->sge.iqmap_sz - 1);
}
sc->sge.iqmap[cntxt_id] = (void *)nm_rxq;
 
@@ -201,9 +201,9 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq
nm_rxq->fl_db_threshold = chip_id(sc) <= CHELSIO_T5 ? 8 : 4;
MPASS(nm_rxq->fl_sidx == na->num_rx_desc);
cntxt_id = nm_rxq->fl_cntxt_id - sc->sge.eq_start;
-   if (cntxt_id >= sc->sge.neq) {
+   if (cntxt_id >= sc->sge.eqmap_sz) {
panic("%s: nm_rxq->fl_cntxt_id (%d) more than the max (%d)",
-   __func__, cntxt_id, sc->sge.neq - 1);
+   __func__, cntxt_id, sc->sge.eqmap_sz - 1);
}
sc->sge.eqmap[cntxt_id] = (void *)nm_rxq;
 
@@ -300,9 +300,9 @@ alloc_nm_txq_hwq(struct vi_info *vi, struct sge_nm_txq
 
nm_txq->cntxt_id = G_FW_EQ_ETH_CMD_EQID(be32toh(c.eqid_pkd));
cntxt_id = nm_txq->cntxt_id - sc->sge.eq_start;
-   if