svn commit: r367153 - head/sys/dev/mlx5/mlx5_en

2020-10-29 Thread John Baldwin
Author: jhb
Date: Fri Oct 30 00:06:36 2020
New Revision: 367153
URL: https://svnweb.freebsd.org/changeset/base/367153

Log:
  Fix a couple of silly bugs in r367149.
  
  - Assign the TLS rate limit value to the correct member of the
rl_params for the nested rate limit tag.
  
  - Remove a dead condition.
  
  Pointy hat to:jhb

Modified:
  head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c  Fri Oct 30 00:03:59 2020
(r367152)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c  Fri Oct 30 00:06:36 2020
(r367153)
@@ -383,13 +383,11 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp,
 #if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT)
case IF_SND_TAG_TYPE_TLS_RATE_LIMIT:
rl_params.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT;
-   rl_params.max_rate = params->tls_rate_limit.max_rate;
+   rl_params.rate_limit.max_rate = params->tls_rate_limit.max_rate;
break;
 #endif
case IF_SND_TAG_TYPE_TLS:
rl_params.hdr.type = IF_SND_TAG_TYPE_UNLIMITED;
-   if (error)
-   goto failure;
break;
default:
error = EOPNOTSUPP;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367152 - head/usr.sbin/bhyve

2020-10-29 Thread Olivier Cochard
Author: olivier (ports committer)
Date: Fri Oct 30 00:03:59 2020
New Revision: 367152
URL: https://svnweb.freebsd.org/changeset/base/367152

Log:
  bhyve currently reports each of "smbios.system.maker" and
  "smbios.system.family" as " ".
  This presents challenges for both humans and tools when trying to parse output
  that uses those results.
  The new values reported are now:
  smbios.system.family="Virtual Machine"
  smbios.system.maker="FreeBSD"
  
  PR:   250728
  Approved by:  gre...@freebsd.org
  Sponsored by: Netflix

Modified:
  head/usr.sbin/bhyve/smbiostbl.c

Modified: head/usr.sbin/bhyve/smbiostbl.c
==
--- head/usr.sbin/bhyve/smbiostbl.c Thu Oct 29 23:28:39 2020
(r367151)
+++ head/usr.sbin/bhyve/smbiostbl.c Fri Oct 30 00:03:59 2020
(r367152)
@@ -346,12 +346,12 @@ static int smbios_type1_initializer(struct smbios_stru
 uint16_t *n, uint16_t *size);
 
 const char *smbios_type1_strings[] = {
-   " ",/* manufacturer string */
-   "BHYVE",/* product name string */
-   "1.0",  /* version string */
-   "None", /* serial number string */
-   "None", /* sku string */
-   " ",/* family name string */
+   "FreeBSD",  /* manufacturer string */
+   "BHYVE",/* product name string */
+   "1.0",  /* version string */
+   "None", /* serial number string */
+   "None", /* sku string */
+   "Virtual Machine",  /* family name string */
NULL
 };
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367151 - in head/sys: dev/mlx5/mlx5_en kern net netinet sys

2020-10-29 Thread John Baldwin
Author: jhb
Date: Thu Oct 29 23:28:39 2020
New Revision: 367151
URL: https://svnweb.freebsd.org/changeset/base/367151

Log:
  Add m_snd_tag_alloc() as a wrapper around if_snd_tag_alloc().
  
  This gives a more uniform API for send tag life cycle management.
  
  Reviewed by:  gallatin, hselasky
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D27000

Modified:
  head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
  head/sys/kern/kern_mbuf.c
  head/sys/kern/uipc_ktls.c
  head/sys/net/if_lagg.c
  head/sys/net/if_vlan.c
  head/sys/netinet/in_pcb.c
  head/sys/netinet/tcp_ratelimit.c
  head/sys/sys/mbuf.h

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c  Thu Oct 29 23:15:11 2020
(r367150)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c  Thu Oct 29 23:28:39 2020
(r367151)
@@ -396,7 +396,7 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp,
goto failure;
}
 
-   error = ifp->if_snd_tag_alloc(ifp, _params, >rl_tag);
+   error = m_snd_tag_alloc(ifp, _params, >rl_tag);
if (error)
goto failure;
 

Modified: head/sys/kern/kern_mbuf.c
==
--- head/sys/kern/kern_mbuf.c   Thu Oct 29 23:15:11 2020(r367150)
+++ head/sys/kern/kern_mbuf.c   Thu Oct 29 23:28:39 2020(r367151)
@@ -1525,6 +1525,16 @@ m_freem(struct mbuf *mb)
mb = m_free(mb);
 }
 
+int
+m_snd_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params,
+struct m_snd_tag **mstp)
+{
+
+   if (ifp->if_snd_tag_alloc == NULL)
+   return (EOPNOTSUPP);
+   return (ifp->if_snd_tag_alloc(ifp, params, mstp));
+}
+
 void
 m_snd_tag_init(struct m_snd_tag *mst, struct ifnet *ifp, u_int type)
 {

Modified: head/sys/kern/uipc_ktls.c
==
--- head/sys/kern/uipc_ktls.c   Thu Oct 29 23:15:11 2020(r367150)
+++ head/sys/kern/uipc_ktls.c   Thu Oct 29 23:28:39 2020(r367151)
@@ -834,10 +834,6 @@ ktls_alloc_snd_tag(struct inpcb *inp, struct ktls_sess
params.hdr.numa_domain = inp->inp_numa_domain;
INP_RUNLOCK(inp);
 
-   if (ifp->if_snd_tag_alloc == NULL) {
-   error = EOPNOTSUPP;
-   goto out;
-   }
if ((ifp->if_capenable & IFCAP_NOMAP) == 0) {   
error = EOPNOTSUPP;
goto out;
@@ -853,7 +849,7 @@ ktls_alloc_snd_tag(struct inpcb *inp, struct ktls_sess
goto out;
}
}
-   error = ifp->if_snd_tag_alloc(ifp, , mstp);
+   error = m_snd_tag_alloc(ifp, , mstp);
 out:
if_rele(ifp);
return (error);

Modified: head/sys/net/if_lagg.c
==
--- head/sys/net/if_lagg.c  Thu Oct 29 23:15:11 2020(r367150)
+++ head/sys/net/if_lagg.c  Thu Oct 29 23:28:39 2020(r367151)
@@ -1808,7 +1808,7 @@ lagg_snd_tag_alloc(struct ifnet *ifp,
LAGG_RUNLOCK();
return (EOPNOTSUPP);
}
-   if (lp->lp_ifp == NULL || lp->lp_ifp->if_snd_tag_alloc == NULL) {
+   if (lp->lp_ifp == NULL) {
LAGG_RUNLOCK();
return (EOPNOTSUPP);
}
@@ -1822,7 +1822,7 @@ lagg_snd_tag_alloc(struct ifnet *ifp,
return (ENOMEM);
}
 
-   error = lp_ifp->if_snd_tag_alloc(lp_ifp, params, >tag);
+   error = m_snd_tag_alloc(lp_ifp, params, >tag);
if_rele(lp_ifp);
if (error) {
free(lst, M_LAGG);

Modified: head/sys/net/if_vlan.c
==
--- head/sys/net/if_vlan.c  Thu Oct 29 23:15:11 2020(r367150)
+++ head/sys/net/if_vlan.c  Thu Oct 29 23:28:39 2020(r367151)
@@ -2047,7 +2047,7 @@ vlan_snd_tag_alloc(struct ifnet *ifp,
parent = PARENT(ifv);
else
parent = NULL;
-   if (parent == NULL || parent->if_snd_tag_alloc == NULL) {
+   if (parent == NULL) {
NET_EPOCH_EXIT(et);
return (EOPNOTSUPP);
}
@@ -2060,7 +2060,7 @@ vlan_snd_tag_alloc(struct ifnet *ifp,
return (ENOMEM);
}
 
-   error = parent->if_snd_tag_alloc(parent, params, >tag);
+   error = m_snd_tag_alloc(parent, params, >tag);
if_rele(parent);
if (error) {
free(vst, M_VLAN);

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Thu Oct 29 23:15:11 2020(r367150)
+++ head/sys/netinet/in_pcb.c   Thu Oct 29 23:28:39 2020(r367151)
@@ -3330,19 +3330,14 @@ in_pcbattach_txrtlmt(struct inpcb *inp, struct ifnet *
if (*st != 

svn commit: r367150 - head/sbin/savecore

2020-10-29 Thread Gleb Smirnoff
Author: glebius
Date: Thu Oct 29 23:15:11 2020
New Revision: 367150
URL: https://svnweb.freebsd.org/changeset/base/367150

Log:
  Convert flags from int to bool.  Some (compress) were already used in
  comparisons with bool values.  No functional changes.

Modified:
  head/sbin/savecore/savecore.c

Modified: head/sbin/savecore/savecore.c
==
--- head/sbin/savecore/savecore.c   Thu Oct 29 22:22:27 2020
(r367149)
+++ head/sbin/savecore/savecore.c   Thu Oct 29 23:15:11 2020
(r367150)
@@ -102,7 +102,8 @@ __FBSDID("$FreeBSD$");
 
 static cap_channel_t *capsyslog;
 static fileargs_t *capfa;
-static int checkfor, compress, clear, force, keep, verbose;/* flags */
+static bool checkfor, compress, clear, force, keep;/* flags */
+static int verbose;
 static int nfound, nsaved, nerr;   /* statistics */
 static int maxdumps;
 
@@ -676,7 +677,7 @@ DoFile(const char *savedir, int savedirfd, const char 
dtoh32(kdhl.version), device);
 
status = STATUS_BAD;
-   if (force == 0)
+   if (force == false)
goto closefd;
}
} else if (compare_magic(, KERNELDUMPMAGIC)) {
@@ -686,7 +687,7 @@ DoFile(const char *savedir, int savedirfd, const char 
dtoh32(kdhl.version), device);
 
status = STATUS_BAD;
-   if (force == 0)
+   if (force == false)
goto closefd;
}
switch (kdhl.compression) {
@@ -710,7 +711,7 @@ DoFile(const char *savedir, int savedirfd, const char 
device);
 
status = STATUS_BAD;
-   if (force == 0)
+   if (force == false)
goto closefd;
 
if (compare_magic(, KERNELDUMPMAGIC_CLEARED)) {
@@ -727,7 +728,7 @@ DoFile(const char *savedir, int savedirfd, const char 
dtoh32(kdhl.version), device);
 
status = STATUS_BAD;
-   if (force == 0)
+   if (force == false)
goto closefd;
}
}
@@ -741,7 +742,7 @@ DoFile(const char *savedir, int savedirfd, const char 
"parity error on last dump header on %s", device);
nerr++;
status = STATUS_BAD;
-   if (force == 0)
+   if (force == false)
goto closefd;
}
dumpextent = dtoh64(kdhl.dumpextent);
@@ -772,7 +773,7 @@ DoFile(const char *savedir, int savedirfd, const char 
"first and last dump headers disagree on %s", device);
nerr++;
status = STATUS_BAD;
-   if (force == 0)
+   if (force == false)
goto closefd;
} else {
status = STATUS_GOOD;
@@ -1110,7 +,8 @@ main(int argc, char **argv)
char **devs;
int i, ch, error, savedirfd;
 
-   checkfor = compress = clear = force = keep = verbose = 0;
+   checkfor = compress = clear = force = keep = false;
+   verbose = 0;
nfound = nsaved = nerr = 0;
savedir = ".";
 
@@ -1124,16 +1126,16 @@ main(int argc, char **argv)
while ((ch = getopt(argc, argv, "Ccfkm:vz")) != -1)
switch(ch) {
case 'C':
-   checkfor = 1;
+   checkfor = true;
break;
case 'c':
-   clear = 1;
+   clear = true;
break;
case 'f':
-   force = 1;
+   force = true;
break;
case 'k':
-   keep = 1;
+   keep = true;
break;
case 'm':
maxdumps = atoi(optarg);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367149 - head/sys/dev/mlx5/mlx5_en

2020-10-29 Thread John Baldwin
Author: jhb
Date: Thu Oct 29 22:22:27 2020
New Revision: 367149
URL: https://svnweb.freebsd.org/changeset/base/367149

Log:
  Use public interfaces to manage the nested rate limit send tag.
  
  Each TLS send tag in mlx5 contains a nested rate limit send tag.
  Previously, the driver was calling internal functions to manage the
  nested tag.  Calling free methods directly instead of m_snd_tag_rele()
  leaked send tag references and references on the ifp.  Changes to use
  the ifp methods for the nested tag for other methods are more cosmetic
  but do simplify the code.
  
  Reviewed by:  gallatin, hselasky
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D26996

Modified:
  head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c  Thu Oct 29 22:18:56 2020
(r367148)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c  Thu Oct 29 22:22:27 2020
(r367149)
@@ -280,7 +280,7 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp,
 union if_snd_tag_alloc_params *params,
 struct m_snd_tag **ppmt)
 {
-   struct if_snd_tag_alloc_rate_limit rl_params;
+   union if_snd_tag_alloc_params rl_params;
struct mlx5e_priv *priv;
struct mlx5e_tls_tag *ptag;
const struct tls_session_params *en;
@@ -377,29 +377,17 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp,
goto failure;
}
 
+   memset(_params, 0, sizeof(rl_params));
+   rl_params.hdr = params->hdr;
switch (params->hdr.type) {
 #if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT)
case IF_SND_TAG_TYPE_TLS_RATE_LIMIT:
-   memset(_params, 0, sizeof(rl_params));
-   rl_params.hdr = params->tls_rate_limit.hdr;
rl_params.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT;
rl_params.max_rate = params->tls_rate_limit.max_rate;
-
-   error = mlx5e_rl_snd_tag_alloc(ifp,
-   container_of(_params, union if_snd_tag_alloc_params, 
rate_limit),
-   >rl_tag);
-   if (error)
-   goto failure;
break;
 #endif
case IF_SND_TAG_TYPE_TLS:
-   memset(_params, 0, sizeof(rl_params));
-   rl_params.hdr = params->tls.hdr;
rl_params.hdr.type = IF_SND_TAG_TYPE_UNLIMITED;
-
-   error = mlx5e_ul_snd_tag_alloc(ifp,
-   container_of(_params, union if_snd_tag_alloc_params, 
unlimited),
-   >rl_tag);
if (error)
goto failure;
break;
@@ -408,6 +396,10 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp,
goto failure;
}
 
+   error = ifp->if_snd_tag_alloc(ifp, _params, >rl_tag);
+   if (error)
+   goto failure;
+
/* store pointer to mbuf tag */
MPASS(ptag->tag.refcount == 0);
m_snd_tag_init(>tag, ifp, params->hdr.type);
@@ -427,7 +419,7 @@ int
 mlx5e_tls_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_params 
*params)
 {
 #if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT)
-   struct if_snd_tag_rate_limit_params rl_params;
+   union if_snd_tag_modify_params rl_params;
struct mlx5e_tls_tag *ptag =
container_of(pmt, struct mlx5e_tls_tag, tag);
int error;
@@ -437,9 +429,9 @@ mlx5e_tls_snd_tag_modify(struct m_snd_tag *pmt, union 
 #if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT)
case IF_SND_TAG_TYPE_TLS_RATE_LIMIT:
memset(_params, 0, sizeof(rl_params));
-   rl_params.max_rate = params->tls_rate_limit.max_rate;
-   error = mlx5e_rl_snd_tag_modify(ptag->rl_tag,
-   container_of(_params, union if_snd_tag_modify_params, 
rate_limit));
+   rl_params.rate_limit.max_rate = params->tls_rate_limit.max_rate;
+   error = ptag->rl_tag->ifp->if_snd_tag_modify(ptag->rl_tag,
+   _params);
return (error);
 #endif
default:
@@ -457,11 +449,10 @@ mlx5e_tls_snd_tag_query(struct m_snd_tag *pmt, union i
switch (pmt->type) {
 #if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT)
case IF_SND_TAG_TYPE_TLS_RATE_LIMIT:
-   error = mlx5e_rl_snd_tag_query(ptag->rl_tag, params);
-   break;
 #endif
case IF_SND_TAG_TYPE_TLS:
-   error = mlx5e_ul_snd_tag_query(ptag->rl_tag, params);
+   error = ptag->rl_tag->ifp->if_snd_tag_query(ptag->rl_tag,
+   params);
break;
default:
error = EOPNOTSUPP;
@@ -477,18 +468,8 @@ mlx5e_tls_snd_tag_free(struct m_snd_tag *pmt)
container_of(pmt, struct mlx5e_tls_tag, tag);
struct mlx5e_priv *priv;
 
-   switch (pmt->type) 

svn commit: r367148 - head/sys/netinet

2020-10-29 Thread John Baldwin
Author: jhb
Date: Thu Oct 29 22:18:56 2020
New Revision: 367148
URL: https://svnweb.freebsd.org/changeset/base/367148

Log:
  Call m_snd_tag_rele() to free send tags.
  
  Send tags are refcounted and if_snd_tag_free() is called by
  m_snd_tag_rele() when the last reference is dropped on a send tag.
  
  Reviewed by:  gallatin, hselasky
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D26995

Modified:
  head/sys/netinet/in_pcb.c
  head/sys/netinet/in_pcb.h
  head/sys/netinet/tcp_ratelimit.c

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Thu Oct 29 22:16:59 2020(r367147)
+++ head/sys/netinet/in_pcb.c   Thu Oct 29 22:18:56 2020(r367148)
@@ -3347,20 +3347,10 @@ in_pcbattach_txrtlmt(struct inpcb *inp, struct ifnet *
 }
 
 void
-in_pcbdetach_tag(struct ifnet *ifp, struct m_snd_tag *mst)
+in_pcbdetach_tag(struct m_snd_tag *mst)
 {
-   if (ifp == NULL)
-   return;
 
-   /*
-* If the device was detached while we still had reference(s)
-* on the ifp, we assume if_snd_tag_free() was replaced with
-* stubs.
-*/
-   ifp->if_snd_tag_free(mst);
-
-   /* release reference count on network interface */
-   if_rele(ifp);
+   m_snd_tag_rele(mst);
 #ifdef INET
counter_u64_add(rate_limit_active, -1);
 #endif

Modified: head/sys/netinet/in_pcb.h
==
--- head/sys/netinet/in_pcb.h   Thu Oct 29 22:16:59 2020(r367147)
+++ head/sys/netinet/in_pcb.h   Thu Oct 29 22:18:56 2020(r367148)
@@ -884,7 +884,7 @@ in_pcboutput_txrtlmt_locked(struct inpcb *, struct ifn
 intin_pcbattach_txrtlmt(struct inpcb *, struct ifnet *, uint32_t, uint32_t,
uint32_t, struct m_snd_tag **);
 void   in_pcbdetach_txrtlmt(struct inpcb *);
-voidin_pcbdetach_tag(struct ifnet *ifp, struct m_snd_tag *mst);
+voidin_pcbdetach_tag(struct m_snd_tag *);
 intin_pcbmodify_txrtlmt(struct inpcb *, uint32_t);
 intin_pcbquery_txrtlmt(struct inpcb *, uint32_t *);
 intin_pcbquery_txrlevel(struct inpcb *, uint32_t *);

Modified: head/sys/netinet/tcp_ratelimit.c
==
--- head/sys/netinet/tcp_ratelimit.cThu Oct 29 22:16:59 2020
(r367147)
+++ head/sys/netinet/tcp_ratelimit.cThu Oct 29 22:18:56 2020
(r367148)
@@ -1028,7 +1028,7 @@ rt_find_real_interface(struct ifnet *ifp, struct inpcb
return (NULL);
}
tifp = tag->ifp;
-   tifp->if_snd_tag_free(tag);
+   m_snd_tag_rele(tag);
return (tifp);
 }
 
@@ -1161,7 +1161,6 @@ static void
 tcp_rl_ifnet_departure(void *arg __unused, struct ifnet *ifp)
 {
struct tcp_rate_set *rs, *nrs;
-   struct ifnet *tifp;
int i;
 
mtx_lock(_mtx);
@@ -1173,8 +1172,7 @@ tcp_rl_ifnet_departure(void *arg __unused, struct ifne
rs->rs_flags |= RS_IS_DEAD;
for (i = 0; i < rs->rs_rate_cnt; i++) {
if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) {
-   tifp = rs->rs_rlt[i].tag->ifp;
-   in_pcbdetach_tag(tifp, 
rs->rs_rlt[i].tag);
+   in_pcbdetach_tag(rs->rs_rlt[i].tag);
rs->rs_rlt[i].tag = NULL;
}
rs->rs_rlt[i].flags = HDWRPACE_IFPDEPARTED;
@@ -1191,7 +1189,6 @@ static void
 tcp_rl_shutdown(void *arg __unused, int howto __unused)
 {
struct tcp_rate_set *rs, *nrs;
-   struct ifnet *tifp;
int i;
 
mtx_lock(_mtx);
@@ -1201,8 +1198,7 @@ tcp_rl_shutdown(void *arg __unused, int howto __unused
rs->rs_flags |= RS_IS_DEAD;
for (i = 0; i < rs->rs_rate_cnt; i++) {
if (rs->rs_rlt[i].flags & HDWRPACE_TAGPRESENT) {
-   tifp = rs->rs_rlt[i].tag->ifp;
-   in_pcbdetach_tag(tifp, rs->rs_rlt[i].tag);
+   in_pcbdetach_tag(rs->rs_rlt[i].tag);
rs->rs_rlt[i].tag = NULL;
}
rs->rs_rlt[i].flags = HDWRPACE_IFPDEPARTED;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367147 - head/sys/netinet

2020-10-29 Thread John Baldwin
Author: jhb
Date: Thu Oct 29 22:16:59 2020
New Revision: 367147
URL: https://svnweb.freebsd.org/changeset/base/367147

Log:
  Remove an extra if_ref().
  
  In r348254, if_snd_tag_alloc() routines were changed to bump the ifp
  refcount via m_snd_tag_init().  This function wasn't in the tree at
  the time and wasn't updated for the new semantics, so was still doing
  a separate bump after if_snd_tag_alloc() returned.
  
  Reviewed by:  gallatin
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D26999

Modified:
  head/sys/netinet/tcp_ratelimit.c

Modified: head/sys/netinet/tcp_ratelimit.c
==
--- head/sys/netinet/tcp_ratelimit.cThu Oct 29 22:14:34 2020
(r367146)
+++ head/sys/netinet/tcp_ratelimit.cThu Oct 29 22:16:59 2020
(r367147)
@@ -470,7 +470,6 @@ rl_attach_txrtlmt(struct ifnet *ifp,
error = ifp->if_snd_tag_alloc(ifp, , tag);
 #ifdef INET
if (error == 0) {
-   if_ref((*tag)->ifp);
counter_u64_add(rate_limit_set_ok, 1);
counter_u64_add(rate_limit_active, 1);
} else
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367146 - head/sys/netinet

2020-10-29 Thread John Baldwin
Author: jhb
Date: Thu Oct 29 22:14:34 2020
New Revision: 367146
URL: https://svnweb.freebsd.org/changeset/base/367146

Log:
  Store the new send tag in the right place.
  
  r350501 added the 'st' parameter, but did not pass it down to
  if_snd_tag_alloc().
  
  Reviewed by:  gallatin
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D26997

Modified:
  head/sys/netinet/in_pcb.c

Modified: head/sys/netinet/in_pcb.c
==
--- head/sys/netinet/in_pcb.c   Thu Oct 29 22:00:15 2020(r367145)
+++ head/sys/netinet/in_pcb.c   Thu Oct 29 22:14:34 2020(r367146)
@@ -,7 +,7 @@ in_pcbattach_txrtlmt(struct inpcb *inp, struct ifnet *
if (ifp->if_snd_tag_alloc == NULL) {
error = EOPNOTSUPP;
} else {
-   error = ifp->if_snd_tag_alloc(ifp, , >inp_snd_tag);
+   error = ifp->if_snd_tag_alloc(ifp, , st);
 
 #ifdef INET
if (error == 0) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r367141 - head/usr.bin/fetch

2020-10-29 Thread Steffen Nurpmeso
Hey.

Fernando Apesteguía wrote in
 <202010291834.09tiylrb040...@repo.freebsd.org>:
 |Author: fernape (ports committer)
 |Date: Thu Oct 29 18:34:47 2020
 |New Revision: 367141
 |URL: https://svnweb.freebsd.org/changeset/base/367141
 |
 |Log:
 |  fetch(1): Add EXAMPLES section
 |  
 |  Add a few examples covering flags: 1, R, a, o, q, r, s, v
 |  
 |  Approved by:manpages (bcr@)
 |  Differential Revision:  https://reviews.freebsd.org/D26946
 |
 |Modified:
 |  head/usr.bin/fetch/fetch.1
 ...
 |+$ fetch -1 -q https://www.freebsd.org/bad.html \\
 |+ ftp.freebsd.org/pub/FreeBSD/README.TXT \\

groff(7) says

   \\ reduces  to  a single backslash; useful to delay its interpreta‐
  tion as escape character in copy mode.  For  a  printable  back‐
  slash,  use \e, or even better \[rs], to be independent from the
  current escape character.

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r367141 - head/usr.bin/fetch

2020-10-29 Thread xtouqh--- via svn-src-head

Fernando Apesteguía wrote:

Author: fernape (ports committer)
Date: Thu Oct 29 18:34:47 2020
New Revision: 367141
URL: https://svnweb.freebsd.org/changeset/base/367141

Log:
   fetch(1): Add EXAMPLES section
   
   Add a few examples covering flags: 1, R, a, o, q, r, s, v
   
   Approved by:	manpages (bcr@)

   Differential Revision:   https://reviews.freebsd.org/D26946

Modified:
   head/usr.bin/fetch/fetch.1

Modified: head/usr.bin/fetch/fetch.1
==
--- head/usr.bin/fetch/fetch.1  Thu Oct 29 18:29:22 2020(r367140)
+++ head/usr.bin/fetch/fetch.1  Thu Oct 29 18:34:47 2020(r367141)
@@ -30,7 +30,7 @@
  .\"
  .\" $FreeBSD$
  .\"
-.Dd May 6, 2018
+.Dd October 29, 2020
  .Dt FETCH 1
  .Os
  .Sh NAME
@@ -384,6 +384,51 @@ If the
  argument is used and the remote file is not newer than the
  specified file then the command will still return success,
  although no file is transferred.
+.Sh EXAMPLES
+Silently try to fetch the URLs passed as parameters.
+The first one will fail.
+If the second URL succeeds the third one will not be tried:
+.Bd -literal -offset indent
+$ fetch -1 -q https://www.freebsd.org/bad.html \\
+   ftp.freebsd.org/pub/FreeBSD/README.TXT \\
+   https://www.fake.url
+fetch: https://www.freebsd.org/bad.html: Not Found
+.Ed
+.Pp
+Be verbose when retrieving the
+.Ql README.TXT
+file:
+.Bd -literal -offset indent
+$ fetch -v ftp.freebsd.org/pub/FreeBSD/README.TXT
+resolving server address: ftp.freebsd.org:80
+requesting http://ftp.freebsd.org/pub/FreeBSD/README.TXT
+local size / mtime: 4259 / 1431015519
+remote size / mtime: 4259 / 1431015519
+README.TXT4259  B   44 MBps00s
+.Ed
+.Pp
+Quietly save the
+.Ql README.TXT file as


"file as" should be on separate line, otherwise it's treated as part of 
.Ql argument.  BTW, why are we not using .Pa for these?



+.Ql myreadme.txt
+and do not delete the output file under any circumstances:
+.Bd -literal -offset indent
+fetch -o myreadme.txt -q -R ftp.freebsd.org/pub/FreeBSD/README.TXT
+.Ed
+.Pp
+Print the size of the requested file and identify the request with a custom 
user
+agent string:
+.Bd -literal -offset indent
+$ fetch -s ftp.freebsd.org/pub/FreeBSD/README.TXT
+--user-agent="Mozilla/5.0 (X11; FreeBSD x86_64; rv:78.0) Gecko/20100101"
+3513231
+.Ed
+.Pp
+Restart the transfer of the
+.Ql README.TXT
+file and retry the transfer upon soft failures:
+.Bd -literal -offset indent
+$ fetch -a -r http://ftp.freebsd.org/pub/FreeBSD/README.TXT
+.Ed
  .Sh SEE ALSO
  .Xr fetch 3 ,
  .Xr phttpget 8


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


Re: svn commit: r367142 - head/usr.bin/fmt

2020-10-29 Thread xtouqh--- via svn-src-head

Fernando Apesteguía wrote:

Author: fernape (ports committer)
Date: Thu Oct 29 18:37:20 2020
New Revision: 367142
URL: https://svnweb.freebsd.org/changeset/base/367142

Log:
   fmt(1): Add EXAMPLES section
   
   Very small EXAMPLES section.
   
   While here, remove reference to nroff(1).
   
   Approved by:	manpages (bcr@)

   Differential Revision:   https://reviews.freebsd.org/D26947

Modified:
   head/usr.bin/fmt/fmt.1

Modified: head/usr.bin/fmt/fmt.1
==
--- head/usr.bin/fmt/fmt.1  Thu Oct 29 18:34:47 2020(r367141)
+++ head/usr.bin/fmt/fmt.1  Thu Oct 29 18:37:20 2020(r367142)
@@ -30,7 +30,7 @@
  .\"
  .\" Modified by Gareth McCaughan to describe the new version of `fmt'
  .\" rather than the old one.
-.Dd December 1, 2017
+.Dd October 29, 2020
  .Dt FMT 1
  .Os
  .Sh NAME
@@ -89,10 +89,6 @@ Try to format mail header lines contained in the input
  Format lines beginning with a
  .Ql \&.
  (dot) character.
-Normally,
-.Nm
-does not fill these lines, for compatibility with
-.Xr nroff 1 .


Was the behavior of fmt(1) really changed? If not, you could just 
replace ".Xr nroff 1 ." with ".Nm nroff . ".



  .It Fl p
  Allow indented paragraphs.
  Without the
@@ -159,10 +155,23 @@ environment variables affect the execution of
  .Nm
  as described in
  .Xr environ 7 .
+.Sh EXAMPLES
+Center the text in standard input:
+.Bd -literal -offset indent
+$ echo -e 'The merit of all things\enlies\enin their difficulty' | fmt -c
+ The merit of all things
+   lies
+   in their difficulty
+.Ed
+.Pp
+Format the text in standard input collapsing spaces:
+.Bd -literal -offset indent
+$ echo -e 'Multiple   spaceswill be collapsed' | fmt -s
+Multiple spaces will be collapsed
+.Ed
  .Sh SEE ALSO
  .Xr fold 1 ,
-.Xr mail 1 ,
-.Xr nroff 1
+.Xr mail 1
  .Sh HISTORY
  The
  .Nm

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


svn commit: r367144 - head/sys/kern

2020-10-29 Thread Mateusz Guzik
Author: mjg
Date: Thu Oct 29 18:43:37 2020
New Revision: 367144
URL: https://svnweb.freebsd.org/changeset/base/367144

Log:
  vfs: add NAMEI_DBG_HADSTARTDIR handling lost in rewrite
  
  Noted by: rpokala

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Thu Oct 29 18:39:04 2020(r367143)
+++ head/sys/kern/vfs_lookup.c  Thu Oct 29 18:43:37 2020(r367144)
@@ -507,6 +507,8 @@ namei(struct nameidata *ndp)
KASSERT(ndp->ni_debugflags == NAMEI_DBG_INITED,
("%s: bad debugflags %d", __func__, ndp->ni_debugflags));
ndp->ni_debugflags |= NAMEI_DBG_CALLED;
+   if (ndp->ni_startdir != NULL)
+   ndp->ni_debugflags |= NAMEI_DBG_HADSTARTDIR;
/*
 * For NDVALIDATE.
 *
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2020-10-29 Thread Mateusz Guzik
Indeed! Fixed in r367144, thanks.

On 10/29/20, Ravi Pokala  wrote:
> Hi Mateusz,
>
> You define NAMEI_DBG_HADSTARTDIR, you check for it being set, but it doesn't
> look like you actually set it anywhere...?
>
> Thanks,
>
> Ravi (rpokala@)
>
> -Original Message-
> From:  on behalf of Mateusz Guzik
> 
> Date: 2020-10-29, Thursday at 05:56
> To: , ,
> 
> Subject: svn commit: r367130 - in head/sys: kern sys
>
> Author: mjg
> Date: Thu Oct 29 12:56:02 2020
> New Revision: 367130
> URL: https://svnweb.freebsd.org/changeset/base/367130
>
> Log:
>   vfs: add NDREINIT to facilitate repeated namei calls
>
>   struct nameidata mixes caller arguments, internal state and output,
> which
>   can be quite error prone.
>
>   Recent addition of valdiating ni_resflags uncovered a caller which
> could
>   repeatedly call namei, effectively operating on partially populated
> state.
>
>   Add bare minimium validation this does not happen. The real fix would
>   decouple aforementioned state.
>
>   Reported by:pho
>   Tested by:  pho (different variant)
>
> Modified:
>   head/sys/kern/vfs_lookup.c
>   head/sys/kern/vfs_vnops.c
>   head/sys/sys/namei.h
>
> Modified: head/sys/kern/vfs_lookup.c
>
> ==
> --- head/sys/kern/vfs_lookup.cThu Oct 29 11:19:47 2020
> (r367129)
> +++ head/sys/kern/vfs_lookup.cThu Oct 29 12:56:02 2020
> (r367130)
> @@ -502,6 +502,11 @@ namei(struct nameidata *ndp)
>   cnp = >ni_cnd;
>   td = cnp->cn_thread;
>  #ifdef INVARIANTS
> + KASSERT((ndp->ni_debugflags & NAMEI_DBG_CALLED) == 0,
> + ("%s: repeated call to namei without NDREINIT", __func__));
> + KASSERT(ndp->ni_debugflags == NAMEI_DBG_INITED,
> + ("%s: bad debugflags %d", __func__, ndp->ni_debugflags));
> + ndp->ni_debugflags |= NAMEI_DBG_CALLED;
>   /*
>* For NDVALIDATE.
>*
>
> Modified: head/sys/kern/vfs_vnops.c
>
> ==
> --- head/sys/kern/vfs_vnops.c Thu Oct 29 11:19:47 2020
> (r367129)
> +++ head/sys/kern/vfs_vnops.c Thu Oct 29 12:56:02 2020
> (r367130)
> @@ -259,6 +259,7 @@ restart:
>   if ((error = vn_start_write(NULL, ,
>   V_XSLEEP | PCATCH)) != 0)
>   return (error);
> + NDREINIT(ndp);
>   goto restart;
>   }
>   if ((vn_open_flags & VN_OPEN_NAMECACHE) != 0)
>
> Modified: head/sys/sys/namei.h
>
> ==
> --- head/sys/sys/namei.h  Thu Oct 29 11:19:47 2020(r367129)
> +++ head/sys/sys/namei.h  Thu Oct 29 12:56:02 2020(r367130)
> @@ -95,11 +95,15 @@ struct nameidata {
>*/
>   u_int   ni_resflags;
>   /*
> +  * Debug for validating API use by the callers.
> +  */
> + u_short ni_debugflags;
> + /*
>* Shared between namei and lookup/commit routines.
>*/
> + u_short ni_loopcnt; /* count of symlinks encountered */
>   size_t  ni_pathlen; /* remaining chars in path */
>   char*ni_next;   /* next location in pathname */
> - u_int   ni_loopcnt; /* count of symlinks encountered */
>   /*
>* Lookup parameters: this structure describes the subset of
>* information from the nameidata structure that is passed
> @@ -122,7 +126,15 @@ int  cache_fplookup(struct nameidata *ndp, enum
> cache_f
>   *
>   * If modifying the list make sure to check whether NDVALIDATE needs
> updating.
>   */
> +
>  /*
> + * Debug.
> + */
> +#define  NAMEI_DBG_INITED0x0001
> +#define  NAMEI_DBG_CALLED0x0002
> +#define  NAMEI_DBG_HADSTARTDIR   0x0004
> +
> +/*
>   * namei operational modifier flags, stored in ni_cnd.flags
>   */
>  #define  NC_NOMAKEENTRY  0x0001  /* name must not be added to cache */
> @@ -215,8 +227,18 @@ int  cache_fplookup(struct nameidata *ndp, enum
> cache_f
>   */
>  #ifdef INVARIANTS
>  #define NDINIT_PREFILL(arg)  memset(arg, 0xff, sizeof(*arg))
> +#define NDINIT_DBG(arg)  { (arg)->ni_debugflags = 
> NAMEI_DBG_INITED; }
> +#define NDREINIT_DBG(arg){   
> \
> + if (((arg)->ni_debugflags & NAMEI_DBG_INITED) == 0) 
> \
> + panic("namei data not inited"); 
> \
> + if (((arg)->ni_debugflags & NAMEI_DBG_HADSTARTDIR) != 0)
> \
> + panic("NDREINIT on namei data with NAMEI_DBG_HADSTARTDIR"); 
> \
> 

svn commit: r367143 - head/usr.bin/fold

2020-10-29 Thread Fernando Apesteguía
Author: fernape (ports committer)
Date: Thu Oct 29 18:39:04 2020
New Revision: 367143
URL: https://svnweb.freebsd.org/changeset/base/367143

Log:
  fold(1): Add EXAMPLES section
  
  A couple of examples covering -s and -w flags.
  
  Approved by:  manpages (bcr@)
  Differential Revision:https://reviews.freebsd.org/D26948

Modified:
  head/usr.bin/fold/fold.1

Modified: head/usr.bin/fold/fold.1
==
--- head/usr.bin/fold/fold.1Thu Oct 29 18:37:20 2020(r367142)
+++ head/usr.bin/fold/fold.1Thu Oct 29 18:39:04 2020(r367143)
@@ -28,7 +28,7 @@
 .\"@(#)fold.1  8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd June 6, 2015
+.Dd October 29, 2020
 .Dt FOLD 1
 .Os
 .Sh NAME
@@ -76,6 +76,22 @@ environment variables affect the execution of
 .Nm
 as described in
 .Xr environ 7 .
+.Sh EXAMPLES
+Fold text in standard input with a width of 20 columns:
+.Bd -literal -offset indent
+$ echo "I am smart enough to know that I am dumb" | fold -w 15
+I am smart enou
+gh to know that
+ I am dumb
+.Ed
+.Pp
+Same as above but breaking lines after the last blank character:
+.Bd -literal -offset indent
+$ echo "I am smart enough to know that I am dumb" | fold -s -w 15
+I am smart
+enough to know
+that I am dumb
+.Ed
 .Sh SEE ALSO
 .Xr expand 1 ,
 .Xr fmt 1
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367142 - head/usr.bin/fmt

2020-10-29 Thread Fernando Apesteguía
Author: fernape (ports committer)
Date: Thu Oct 29 18:37:20 2020
New Revision: 367142
URL: https://svnweb.freebsd.org/changeset/base/367142

Log:
  fmt(1): Add EXAMPLES section
  
  Very small EXAMPLES section.
  
  While here, remove reference to nroff(1).
  
  Approved by:  manpages (bcr@)
  Differential Revision:https://reviews.freebsd.org/D26947

Modified:
  head/usr.bin/fmt/fmt.1

Modified: head/usr.bin/fmt/fmt.1
==
--- head/usr.bin/fmt/fmt.1  Thu Oct 29 18:34:47 2020(r367141)
+++ head/usr.bin/fmt/fmt.1  Thu Oct 29 18:37:20 2020(r367142)
@@ -30,7 +30,7 @@
 .\"
 .\" Modified by Gareth McCaughan to describe the new version of `fmt'
 .\" rather than the old one.
-.Dd December 1, 2017
+.Dd October 29, 2020
 .Dt FMT 1
 .Os
 .Sh NAME
@@ -89,10 +89,6 @@ Try to format mail header lines contained in the input
 Format lines beginning with a
 .Ql \&.
 (dot) character.
-Normally,
-.Nm
-does not fill these lines, for compatibility with
-.Xr nroff 1 .
 .It Fl p
 Allow indented paragraphs.
 Without the
@@ -159,10 +155,23 @@ environment variables affect the execution of
 .Nm
 as described in
 .Xr environ 7 .
+.Sh EXAMPLES
+Center the text in standard input:
+.Bd -literal -offset indent
+$ echo -e 'The merit of all things\enlies\enin their difficulty' | fmt -c
+ The merit of all things
+   lies
+   in their difficulty
+.Ed
+.Pp
+Format the text in standard input collapsing spaces:
+.Bd -literal -offset indent
+$ echo -e 'Multiple   spaceswill be collapsed' | fmt -s
+Multiple spaces will be collapsed
+.Ed
 .Sh SEE ALSO
 .Xr fold 1 ,
-.Xr mail 1 ,
-.Xr nroff 1
+.Xr mail 1
 .Sh HISTORY
 The
 .Nm
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2020-10-29 Thread Ravi Pokala
Hi Mateusz,

You define NAMEI_DBG_HADSTARTDIR, you check for it being set, but it doesn't 
look like you actually set it anywhere...?

Thanks,

Ravi (rpokala@)

-Original Message-
From:  on behalf of Mateusz Guzik 

Date: 2020-10-29, Thursday at 05:56
To: , , 

Subject: svn commit: r367130 - in head/sys: kern sys

Author: mjg
Date: Thu Oct 29 12:56:02 2020
New Revision: 367130
URL: https://svnweb.freebsd.org/changeset/base/367130

Log:
  vfs: add NDREINIT to facilitate repeated namei calls

  struct nameidata mixes caller arguments, internal state and output, which
  can be quite error prone.

  Recent addition of valdiating ni_resflags uncovered a caller which could
  repeatedly call namei, effectively operating on partially populated state.

  Add bare minimium validation this does not happen. The real fix would
  decouple aforementioned state.

  Reported by:  pho
  Tested by:pho (different variant)

Modified:
  head/sys/kern/vfs_lookup.c
  head/sys/kern/vfs_vnops.c
  head/sys/sys/namei.h

Modified: head/sys/kern/vfs_lookup.c

==
--- head/sys/kern/vfs_lookup.c  Thu Oct 29 11:19:47 2020
(r367129)
+++ head/sys/kern/vfs_lookup.c  Thu Oct 29 12:56:02 2020
(r367130)
@@ -502,6 +502,11 @@ namei(struct nameidata *ndp)
cnp = >ni_cnd;
td = cnp->cn_thread;
 #ifdef INVARIANTS
+   KASSERT((ndp->ni_debugflags & NAMEI_DBG_CALLED) == 0,
+   ("%s: repeated call to namei without NDREINIT", __func__));
+   KASSERT(ndp->ni_debugflags == NAMEI_DBG_INITED,
+   ("%s: bad debugflags %d", __func__, ndp->ni_debugflags));
+   ndp->ni_debugflags |= NAMEI_DBG_CALLED;
/*
 * For NDVALIDATE.
 *

Modified: head/sys/kern/vfs_vnops.c

==
--- head/sys/kern/vfs_vnops.c   Thu Oct 29 11:19:47 2020
(r367129)
+++ head/sys/kern/vfs_vnops.c   Thu Oct 29 12:56:02 2020
(r367130)
@@ -259,6 +259,7 @@ restart:
if ((error = vn_start_write(NULL, ,
V_XSLEEP | PCATCH)) != 0)
return (error);
+   NDREINIT(ndp);
goto restart;
}
if ((vn_open_flags & VN_OPEN_NAMECACHE) != 0)

Modified: head/sys/sys/namei.h

==
--- head/sys/sys/namei.hThu Oct 29 11:19:47 2020(r367129)
+++ head/sys/sys/namei.hThu Oct 29 12:56:02 2020(r367130)
@@ -95,11 +95,15 @@ struct nameidata {
 */
u_int   ni_resflags;
/*
+* Debug for validating API use by the callers.
+*/
+   u_short ni_debugflags;
+   /*
 * Shared between namei and lookup/commit routines.
 */
+   u_short ni_loopcnt; /* count of symlinks encountered */
size_t  ni_pathlen; /* remaining chars in path */
char*ni_next;   /* next location in pathname */
-   u_int   ni_loopcnt; /* count of symlinks encountered */
/*
 * Lookup parameters: this structure describes the subset of
 * information from the nameidata structure that is passed
@@ -122,7 +126,15 @@ intcache_fplookup(struct nameidata *ndp, enum 
cache_f
  *
  * If modifying the list make sure to check whether NDVALIDATE needs 
updating.
  */
+
 /*
+ * Debug.
+ */
+#defineNAMEI_DBG_INITED0x0001
+#defineNAMEI_DBG_CALLED0x0002
+#defineNAMEI_DBG_HADSTARTDIR   0x0004
+
+/*
  * namei operational modifier flags, stored in ni_cnd.flags
  */
 #defineNC_NOMAKEENTRY  0x0001  /* name must not be added to cache */
@@ -215,8 +227,18 @@ intcache_fplookup(struct nameidata *ndp, enum 
cache_f
  */
 #ifdef INVARIANTS
 #define NDINIT_PREFILL(arg)memset(arg, 0xff, sizeof(*arg))
+#define NDINIT_DBG(arg){ (arg)->ni_debugflags = 
NAMEI_DBG_INITED; }
+#define NDREINIT_DBG(arg)  {   
\
+   if (((arg)->ni_debugflags & NAMEI_DBG_INITED) == 0) 
\
+   panic("namei data not inited"); 
\
+   if (((arg)->ni_debugflags & NAMEI_DBG_HADSTARTDIR) != 0)
\
+   panic("NDREINIT on namei data with NAMEI_DBG_HADSTARTDIR"); 
\
+   (arg)->ni_debugflags = NAMEI_DBG_INITED;
\
+}
 #else
 #define NDINIT_PREFILL(arg)do { } while (0)
+#define NDINIT_DBG(arg)do { } while (0)
 

svn commit: r367141 - head/usr.bin/fetch

2020-10-29 Thread Fernando Apesteguía
Author: fernape (ports committer)
Date: Thu Oct 29 18:34:47 2020
New Revision: 367141
URL: https://svnweb.freebsd.org/changeset/base/367141

Log:
  fetch(1): Add EXAMPLES section
  
  Add a few examples covering flags: 1, R, a, o, q, r, s, v
  
  Approved by:  manpages (bcr@)
  Differential Revision:https://reviews.freebsd.org/D26946

Modified:
  head/usr.bin/fetch/fetch.1

Modified: head/usr.bin/fetch/fetch.1
==
--- head/usr.bin/fetch/fetch.1  Thu Oct 29 18:29:22 2020(r367140)
+++ head/usr.bin/fetch/fetch.1  Thu Oct 29 18:34:47 2020(r367141)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 6, 2018
+.Dd October 29, 2020
 .Dt FETCH 1
 .Os
 .Sh NAME
@@ -384,6 +384,51 @@ If the
 argument is used and the remote file is not newer than the
 specified file then the command will still return success,
 although no file is transferred.
+.Sh EXAMPLES
+Silently try to fetch the URLs passed as parameters.
+The first one will fail.
+If the second URL succeeds the third one will not be tried:
+.Bd -literal -offset indent
+$ fetch -1 -q https://www.freebsd.org/bad.html \\
+   ftp.freebsd.org/pub/FreeBSD/README.TXT \\
+   https://www.fake.url
+fetch: https://www.freebsd.org/bad.html: Not Found
+.Ed
+.Pp
+Be verbose when retrieving the
+.Ql README.TXT
+file:
+.Bd -literal -offset indent
+$ fetch -v ftp.freebsd.org/pub/FreeBSD/README.TXT
+resolving server address: ftp.freebsd.org:80
+requesting http://ftp.freebsd.org/pub/FreeBSD/README.TXT
+local size / mtime: 4259 / 1431015519
+remote size / mtime: 4259 / 1431015519
+README.TXT4259  B   44 MBps00s
+.Ed
+.Pp
+Quietly save the
+.Ql README.TXT file as
+.Ql myreadme.txt
+and do not delete the output file under any circumstances:
+.Bd -literal -offset indent
+fetch -o myreadme.txt -q -R ftp.freebsd.org/pub/FreeBSD/README.TXT
+.Ed
+.Pp
+Print the size of the requested file and identify the request with a custom 
user
+agent string:
+.Bd -literal -offset indent
+$ fetch -s ftp.freebsd.org/pub/FreeBSD/README.TXT
+--user-agent="Mozilla/5.0 (X11; FreeBSD x86_64; rv:78.0) Gecko/20100101"
+3513231
+.Ed
+.Pp
+Restart the transfer of the
+.Ql README.TXT
+file and retry the transfer upon soft failures:
+.Bd -literal -offset indent
+$ fetch -a -r http://ftp.freebsd.org/pub/FreeBSD/README.TXT
+.Ed
 .Sh SEE ALSO
 .Xr fetch 3 ,
 .Xr phttpget 8
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r367123 - in head: sbin/ifconfig sys/dev/mlx5/mlx5_en sys/kern sys/net sys/netinet sys/sys

2020-10-29 Thread John Baldwin
On 10/28/20 5:23 PM, John Baldwin wrote:
> Author: jhb
> Date: Thu Oct 29 00:23:16 2020
> New Revision: 367123
> URL: https://svnweb.freebsd.org/changeset/base/367123
> 
> Log:
>   Support hardware rate limiting (pacing) with TLS offload.
>   
> ...
> 
> Modified: head/sys/net/if.h
> ==
> --- head/sys/net/if.h Thu Oct 29 00:03:19 2020(r367122)
> +++ head/sys/net/if.h Thu Oct 29 00:23:16 2020(r367123)
> @@ -250,6 +250,7 @@ struct if_data {
>  #define  IFCAP_TXTLS60x1000 /* can do TLS encryption and 
> segmentation for TCP6 */
>  #define  IFCAP_VXLAN_HWCSUM  0x2000 /* can do IFCAN_HWCSUM on 
> VXLANs */
>  #define  IFCAP_VXLAN_HWTSO   0x4000 /* can do IFCAP_TSO on 
> VXLANs */
> +#define  IFCAP_TXTLS_RTLMT   0x8000 /* can do TLS with rate 
> limiting */

FYI, this is the last available bit in if_capabilities/if_capenable.

We will probably have to think about extending these to an array at some
point.

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


Re: svn commit: r366748 - head/sys/fs/pseudofs

2020-10-29 Thread Edward Napierala
On Fri, 16 Oct 2020 at 11:47, Konstantin Belousov  wrote:
>
> On Fri, Oct 16, 2020 at 09:58:11AM +, Edward Tomasz Napierala wrote:
> > Author: trasz
> > Date: Fri Oct 16 09:58:10 2020
> > New Revision: 366748
> > URL: https://svnweb.freebsd.org/changeset/base/366748
> >
> > Log:
> >   Bump pseudofs size limit from 128kB to 1MB.  The old limit could result
> >   in process' memory maps being truncated.
> New limit could as well.

True.  With r367139 we'll at least emit a warning when that happens.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367139 - head/sys/compat/linprocfs

2020-10-29 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Oct 29 15:44:44 2020
New Revision: 367139
URL: https://svnweb.freebsd.org/changeset/base/367139

Log:
  Make linprocfs(4) print a warning when there's not enough room to fill
  /proc/self/maps.
  
  Submitted by: dchagin (earlier version)
  Reviewed by:  emaste (earlier version)
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D20576

Modified:
  head/sys/compat/linprocfs/linprocfs.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==
--- head/sys/compat/linprocfs/linprocfs.c   Thu Oct 29 15:36:20 2020
(r367138)
+++ head/sys/compat/linprocfs/linprocfs.c   Thu Oct 29 15:44:44 2020
(r367139)
@@ -1252,6 +1252,10 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
*name ? " " : " ",
name
);
+   if (error == -1) {
+   linux_msg(td, "cannot fill /proc/self/maps; "
+   "consider bumping PFS_MAXBUFSIZ");
+   }
if (freename)
free(freename, M_TEMP);
vm_map_lock_read(map);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367138 - head/sys/riscv/riscv

2020-10-29 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Oct 29 15:36:20 2020
New Revision: 367138
URL: https://svnweb.freebsd.org/changeset/base/367138

Log:
  Optimize set_syscall_retval for riscv by predicting the return
  value to be zero.
  
  Reviewed by:  mhorne, kp
  MFC after:2 weeks
  Sponsored by: EPSRC
  Differential Revision:https://reviews.freebsd.org/D26990

Modified:
  head/sys/riscv/riscv/vm_machdep.c

Modified: head/sys/riscv/riscv/vm_machdep.c
==
--- head/sys/riscv/riscv/vm_machdep.c   Thu Oct 29 15:28:15 2020
(r367137)
+++ head/sys/riscv/riscv/vm_machdep.c   Thu Oct 29 15:36:20 2020
(r367138)
@@ -132,12 +132,14 @@ cpu_set_syscall_retval(struct thread *td, int error)
 
frame = td->td_frame;
 
-   switch (error) {
-   case 0:
+   if (__predict_true(error == 0)) {
frame->tf_a[0] = td->td_retval[0];
frame->tf_a[1] = td->td_retval[1];
frame->tf_t[0] = 0; /* syscall succeeded */
-   break;
+   return;
+   }
+
+   switch (error) {
case ERESTART:
frame->tf_sepc -= 4;/* prev instruction */
break;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367137 - head/sys/fs/nullfs

2020-10-29 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Oct 29 15:28:15 2020
New Revision: 367137
URL: https://svnweb.freebsd.org/changeset/base/367137

Log:
  Make it possible to mount nullfs(5) using plain mount(8)
  instead of mount_nullfs(8).
  
  Obviously you'd need to force mount(8) to not call
  mount_nullfs(8) to make use of it.
  
  Reviewed by:  kib
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26934

Modified:
  head/sys/fs/nullfs/null_vfsops.c

Modified: head/sys/fs/nullfs/null_vfsops.c
==
--- head/sys/fs/nullfs/null_vfsops.cThu Oct 29 14:44:09 2020
(r367136)
+++ head/sys/fs/nullfs/null_vfsops.cThu Oct 29 15:28:15 2020
(r367137)
@@ -104,7 +104,9 @@ nullfs_mount(struct mount *mp)
/*
 * Get argument
 */
-   error = vfs_getopt(mp->mnt_optnew, "target", (void **), );
+   error = vfs_getopt(mp->mnt_optnew, "from", (void **), );
+   if (error != 0)
+   error = vfs_getopt(mp->mnt_optnew, "target", (void **), 
);
if (error || target[len - 1] != '\0')
return (EINVAL);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367136 - head/bin/echo

2020-10-29 Thread Li-Wen Hsu
Author: lwhsu
Date: Thu Oct 29 14:44:09 2020
New Revision: 367136
URL: https://svnweb.freebsd.org/changeset/base/367136

Log:
  Whitespace cleanup
  
  MFC after:3 days

Modified:
  head/bin/echo/echo.c

Modified: head/bin/echo/echo.c
==
--- head/bin/echo/echo.cThu Oct 29 14:42:51 2020(r367135)
+++ head/bin/echo/echo.cThu Oct 29 14:44:09 2020(r367136)
@@ -71,7 +71,7 @@ errexit(const char *prog, const char *reason)
write(STDERR_FILENO, "\n", 1);
exit(1);
 }
-   
+
 int
 main(int argc, char *argv[])
 {
@@ -100,13 +100,12 @@ main(int argc, char *argv[])
 
while (argv[0] != NULL) {
size_t len;
-   
+
len = strlen(argv[0]);
 
/*
-* If the next argument is NULL then this is
-* the last argument, therefore we need to check
-* for a trailing \c.
+* If the next argument is NULL then this is the last argument,
+* therefore we need to check for a trailing \c.
 */
if (argv[1] == NULL) {
/* is there room for a '\c' and is there one? */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367135 - head/sys/compat/linux

2020-10-29 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Oct 29 14:42:51 2020
New Revision: 367135
URL: https://svnweb.freebsd.org/changeset/base/367135

Log:
  Fix typo.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/compat/linux/linux_errno.h

Modified: head/sys/compat/linux/linux_errno.h
==
--- head/sys/compat/linux/linux_errno.h Thu Oct 29 14:42:02 2020
(r367134)
+++ head/sys/compat/linux/linux_errno.h Thu Oct 29 14:42:51 2020
(r367135)
@@ -88,7 +88,7 @@
 #defineLINUX_EUNATCH   49
 
 #defineLINUX_ENOCSI50
-#defineLINUX_L2HLT 51
+#defineLINUX_EL2HLT51
 #defineLINUX_EBADE 52
 #defineLINUX_EBADR 53
 #defineLINUX_EXFULL54
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367134 - head/bin/echo

2020-10-29 Thread Li-Wen Hsu
Author: lwhsu
Date: Thu Oct 29 14:42:02 2020
New Revision: 367134
URL: https://svnweb.freebsd.org/changeset/base/367134

Log:
  Remove superfluous `this` in comment
  
  PR:   250721
  Submitted by: Hiroya EBINE 
  MFC after:3 days

Modified:
  head/bin/echo/echo.c

Modified: head/bin/echo/echo.c
==
--- head/bin/echo/echo.cThu Oct 29 14:28:27 2020(r367133)
+++ head/bin/echo/echo.cThu Oct 29 14:42:02 2020(r367134)
@@ -104,7 +104,7 @@ main(int argc, char *argv[])
len = strlen(argv[0]);
 
/*
-* If the next argument is NULL then this is this
+* If the next argument is NULL then this is
 * the last argument, therefore we need to check
 * for a trailing \c.
 */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367132 - in head: lib/libsysdecode sys/compat/linux

2020-10-29 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Oct 29 14:23:52 2020
New Revision: 367132
URL: https://svnweb.freebsd.org/changeset/base/367132

Log:
  Add defines for Linux errno values and use them to make linux_errtbl[]
  more readable.  While here, add linux_check_errtbl() function to make
  sure we don't leave holes.
  
  No objections:emaste (earlier version)
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26972

Added:
  head/sys/compat/linux/linux_errno.h   (contents, props changed)
Modified:
  head/lib/libsysdecode/errno.c
  head/sys/compat/linux/linux.h
  head/sys/compat/linux/linux_common.c
  head/sys/compat/linux/linux_errno.c
  head/sys/compat/linux/linux_errno.inc

Modified: head/lib/libsysdecode/errno.c
==
--- head/lib/libsysdecode/errno.c   Thu Oct 29 14:21:25 2020
(r367131)
+++ head/lib/libsysdecode/errno.c   Thu Oct 29 14:23:52 2020
(r367132)
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #if defined(__aarch64__) || defined(__amd64__) || defined(__i386__)
+#include 
 static
 #include 
 #endif

Modified: head/sys/compat/linux/linux.h
==
--- head/sys/compat/linux/linux.h   Thu Oct 29 14:21:25 2020
(r367131)
+++ head/sys/compat/linux/linux.h   Thu Oct 29 14:23:52 2020
(r367132)
@@ -197,5 +197,6 @@ int linux_to_bsd_bits_(int value, struct bsd_to_linux_
 #defineBITMAP_1t1_LINUX(_name) BITMAP_EASY_LINUX(_name, LINUX_##_name)
 
 int bsd_to_linux_errno(int error);
+void linux_check_errtbl(void);
 
 #endif /* _LINUX_MI_H_ */

Modified: head/sys/compat/linux/linux_common.c
==
--- head/sys/compat/linux/linux_common.cThu Oct 29 14:21:25 2020
(r367131)
+++ head/sys/compat/linux/linux_common.cThu Oct 29 14:23:52 2020
(r367132)
@@ -67,6 +67,9 @@ linux_common_modevent(module_t mod, int type, void *da
 
switch(type) {
case MOD_LOAD:
+#ifdef INVARIANTS
+   linux_check_errtbl();
+#endif
linux_dev_shm_create();
linux_osd_jail_register();
linux_exit_tag = EVENTHANDLER_REGISTER(process_exit,

Modified: head/sys/compat/linux/linux_errno.c
==
--- head/sys/compat/linux/linux_errno.c Thu Oct 29 14:21:25 2020
(r367131)
+++ head/sys/compat/linux/linux_errno.c Thu Oct 29 14:23:52 2020
(r367132)
@@ -8,6 +8,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 
 int
@@ -19,3 +20,16 @@ bsd_to_linux_errno(int error)
 
return (linux_errtbl[error]);
 }
+
+#ifdef INVARIANTS
+void
+linux_check_errtbl(void)
+{
+   int i;
+
+   for (i = 1; i < sizeof(linux_errtbl); i++) {
+   KASSERT(linux_errtbl[i] != 0,
+   ("%s: linux_errtbl[%d] == 0", __func__, i));
+   }
+}
+#endif

Added: head/sys/compat/linux/linux_errno.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linux/linux_errno.h Thu Oct 29 14:23:52 2020
(r367132)
@@ -0,0 +1,183 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2020 The FreeBSD Foundation
+ *
+ * This software was developed by Edward Tomasz Napierala under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LINUX_ERRNO_H_
+#define 

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

2020-10-29 Thread Li-Wen Hsu
Author: lwhsu
Date: Thu Oct 29 14:21:25 2020
New Revision: 367131
URL: https://svnweb.freebsd.org/changeset/base/367131

Log:
  Update the due date of the quarterly status report
  
  While here, move the date to keep 2 weeks ahead notificaion
  and fix the part of speech.
  
  Reviewed by:  debdrup
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26998

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

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdThu Oct 29 12:56:02 
2020(r367130)
+++ head/usr.bin/calendar/calendars/calendar.freebsdThu Oct 29 14:21:25 
2020(r367131)
@@ -122,6 +122,7 @@
 03/14  Eric Turgeon  born in Edmundston, New Brunswick, 
Canada, 1982
 03/15  Paolo Pisati  born in Lodi, Italy, 1977
 03/15  Brian Fundakowski Feldman  born in Alexandria, 
Virginia, United States, 1983
+03/15  First quarterly status reports are due on 03/31
 03/17  Michael Smith  born in Bankstown, New South Wales, 
Australia, 1971
 03/17  Alexander Motin  born in Simferopol, Ukraine, 1979
 03/18  Koop Mast  born in Dokkum, the Netherlands, 1981
@@ -142,7 +143,6 @@
 03/29  Dave Cottlehuber  born in Christchurch, New Zealand, 
1973
 03/29  Thierry Thomas  born in Luxeuil les Bains, France, 
1961
 03/30  Po-Chuan Hsieh  born in Taipei, Taiwan, Republic 
of China, 1978
-03/31  First quarter status reports are due on 04/15
 04/01  Matthew Jacob  born in San Francisco, California, 
United States, 1958
 04/01  Alexander V. Chernikov  born in Moscow, Russian 
Federation, 1984
 04/01  Bill Fenner  born in Bellefonte, Pennsylvania, 
United States, 1971
@@ -249,6 +249,7 @@
 06/09  Stanislav Galabov  born in Sofia, Bulgaria, 1978
 06/11  Alonso Cardenas Marquez  born in Arequipa, Peru, 1979
 06/14  Josh Paetzel  born in Minneapolis, Minnesota, 
United States, 1973
+06/15  Second quarterly status reports are due on 06/30
 06/17  Tilman Linneweh  born in Weinheim, 
Baden-Wuerttemberg, Germany, 1978
 06/18  Li-Wen Hsu  born in Taipei, Taiwan, Republic of 
China, 1984
 06/18  Roman Bogorodskiy  born in Saratov, Russian 
Federation, 1986
@@ -265,7 +266,6 @@
 06/29  Daniel Harris  born in Lubbock, Texas, United 
States, 1985
 06/29  Andrew Pantyukhin  born in Moscow, Russian 
Federation, 1985
 06/30  Guido van Rooij  born in Best, Noord-Brabant, the 
Netherlands, 1965
-06/30  Second quarter status reports are due on 07/15
 07/01  Matthew Dillon  born in San Francisco, 
California, United States, 1966
 07/01  Mateusz Guzik  born in Dołki Górne, Poland, 1986
 07/02  Mark Christopher Ovens  born in Preston, Lancashire, 
United Kingdom, 1958
@@ -364,6 +364,7 @@
 09/14  Matthew Seaman  born in Bristol, United Kingdom, 
1965
 09/15  Aleksandr Rybalko  born in Odessa, Ukraine, 1977
 09/15  Dima Panov  born in Khabarovsk, Russian Federation, 
1978
+09/15  Third quarterly status reports are due on 09/30
 09/16  Maksim Yevmenkin  born in Taganrog, USSR, 1974
 09/17  Maxim Bolotin  born in Rostov-on-Don, Russian 
Federation, 1976
 09/18  Matthew Fleming  born in Cleveland, Ohio, United 
States, 1975
@@ -384,7 +385,6 @@
 09/29  Matthew Hunt  born in Johnstown, Pennsylvania, United 
States, 1976
 09/30  Mark Felder  born in Prairie du Chien, Wisconsin, 
United States, 1985
 09/30  Hiten M. Pandya  born in Dar-es-Salaam, Tanzania, 
East Africa, 1986
-09/30  Third quarter status reports are due on 10/15
 10/02  Beat Gaetzi  born in Zurich, Switzerland, 1980
 10/02  Grzegorz Blach  born in Starachowice, Poland, 1985
 10/05  Hiroki Sato  born in Yamagata, Japan, 1977
@@ -464,6 +464,7 @@
 12/11  Koichiro Iwao  born in Oita, Japan, 1987
 12/15  James FitzGibbon  born in Amersham, Buckinghamshire, 
United Kingdom, 1974
 12/15  Timur I. Bakeyev  born in Kazan, Republic of 
Tatarstan, USSR, 1974
+12/15  Fourth quarterly status reports are due on 12/31
 12/18  Chris Timmons  born in Ellensburg, Washington, United 
States, 1964
 12/18  Dag-Erling Smorgrav  born in Brussels, Belgium, 1977
 12/18  Muhammad Moinur Rahman  born in Dhaka, Bangladesh, 
1983
@@ -484,6 +485,5 @@
 12/28  Marius Strobl  born in Cham, Bavaria, Germany, 1978
 12/30  Sean Eric Fagan  born in Los Angeles, California, 
United States, 1967
 12/31  Edwin Groothuis  born in Geldrop, the Netherlands, 
1970
-12/31  Fourth quarter status reports are due on 01/15
 
 #endif /* !_calendar_freebsd_ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367130 - in head/sys: kern sys

2020-10-29 Thread Mateusz Guzik
Author: mjg
Date: Thu Oct 29 12:56:02 2020
New Revision: 367130
URL: https://svnweb.freebsd.org/changeset/base/367130

Log:
  vfs: add NDREINIT to facilitate repeated namei calls
  
  struct nameidata mixes caller arguments, internal state and output, which
  can be quite error prone.
  
  Recent addition of valdiating ni_resflags uncovered a caller which could
  repeatedly call namei, effectively operating on partially populated state.
  
  Add bare minimium validation this does not happen. The real fix would
  decouple aforementioned state.
  
  Reported by:  pho
  Tested by:pho (different variant)

Modified:
  head/sys/kern/vfs_lookup.c
  head/sys/kern/vfs_vnops.c
  head/sys/sys/namei.h

Modified: head/sys/kern/vfs_lookup.c
==
--- head/sys/kern/vfs_lookup.c  Thu Oct 29 11:19:47 2020(r367129)
+++ head/sys/kern/vfs_lookup.c  Thu Oct 29 12:56:02 2020(r367130)
@@ -502,6 +502,11 @@ namei(struct nameidata *ndp)
cnp = >ni_cnd;
td = cnp->cn_thread;
 #ifdef INVARIANTS
+   KASSERT((ndp->ni_debugflags & NAMEI_DBG_CALLED) == 0,
+   ("%s: repeated call to namei without NDREINIT", __func__));
+   KASSERT(ndp->ni_debugflags == NAMEI_DBG_INITED,
+   ("%s: bad debugflags %d", __func__, ndp->ni_debugflags));
+   ndp->ni_debugflags |= NAMEI_DBG_CALLED;
/*
 * For NDVALIDATE.
 *

Modified: head/sys/kern/vfs_vnops.c
==
--- head/sys/kern/vfs_vnops.c   Thu Oct 29 11:19:47 2020(r367129)
+++ head/sys/kern/vfs_vnops.c   Thu Oct 29 12:56:02 2020(r367130)
@@ -259,6 +259,7 @@ restart:
if ((error = vn_start_write(NULL, ,
V_XSLEEP | PCATCH)) != 0)
return (error);
+   NDREINIT(ndp);
goto restart;
}
if ((vn_open_flags & VN_OPEN_NAMECACHE) != 0)

Modified: head/sys/sys/namei.h
==
--- head/sys/sys/namei.hThu Oct 29 11:19:47 2020(r367129)
+++ head/sys/sys/namei.hThu Oct 29 12:56:02 2020(r367130)
@@ -95,11 +95,15 @@ struct nameidata {
 */
u_int   ni_resflags;
/*
+* Debug for validating API use by the callers.
+*/
+   u_short ni_debugflags;
+   /*
 * Shared between namei and lookup/commit routines.
 */
+   u_short ni_loopcnt; /* count of symlinks encountered */
size_t  ni_pathlen; /* remaining chars in path */
char*ni_next;   /* next location in pathname */
-   u_int   ni_loopcnt; /* count of symlinks encountered */
/*
 * Lookup parameters: this structure describes the subset of
 * information from the nameidata structure that is passed
@@ -122,7 +126,15 @@ intcache_fplookup(struct nameidata *ndp, enum 
cache_f
  *
  * If modifying the list make sure to check whether NDVALIDATE needs updating.
  */
+
 /*
+ * Debug.
+ */
+#defineNAMEI_DBG_INITED0x0001
+#defineNAMEI_DBG_CALLED0x0002
+#defineNAMEI_DBG_HADSTARTDIR   0x0004
+
+/*
  * namei operational modifier flags, stored in ni_cnd.flags
  */
 #defineNC_NOMAKEENTRY  0x0001  /* name must not be added to cache */
@@ -215,8 +227,18 @@ intcache_fplookup(struct nameidata *ndp, enum 
cache_f
  */
 #ifdef INVARIANTS
 #define NDINIT_PREFILL(arg)memset(arg, 0xff, sizeof(*arg))
+#define NDINIT_DBG(arg){ (arg)->ni_debugflags = 
NAMEI_DBG_INITED; }
+#define NDREINIT_DBG(arg)  {   
\
+   if (((arg)->ni_debugflags & NAMEI_DBG_INITED) == 0) 
\
+   panic("namei data not inited"); 
\
+   if (((arg)->ni_debugflags & NAMEI_DBG_HADSTARTDIR) != 0)
\
+   panic("NDREINIT on namei data with NAMEI_DBG_HADSTARTDIR"); 
\
+   (arg)->ni_debugflags = NAMEI_DBG_INITED;
\
+}
 #else
 #define NDINIT_PREFILL(arg)do { } while (0)
+#define NDINIT_DBG(arg)do { } while (0)
+#define NDREINIT_DBG(arg)  do { } while (0)
 #endif
 
 #define NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, startdir, rightsp, 
td)\
@@ -225,6 +247,7 @@ do {
\
cap_rights_t *_rightsp = (rightsp); 
\
MPASS(_rightsp != NULL);
\
NDINIT_PREFILL(_ndp);   
\
+   NDINIT_DBG(_ndp);   

svn commit: r367127 - head/usr.bin/calendar

2020-10-29 Thread Stefan Eßer
Author: se
Date: Thu Oct 29 08:31:47 2020
New Revision: 367127
URL: https://svnweb.freebsd.org/changeset/base/367127

Log:
  Simplify test for closing delimiter of #include argument (no functional
  change).
  
  While here: Fix invalid parameters of a commented-out debug printf() found
  when testing with this code enabled.
  
  MFC after:3 days

Modified:
  head/usr.bin/calendar/events.c
  head/usr.bin/calendar/io.c

Modified: head/usr.bin/calendar/events.c
==
--- head/usr.bin/calendar/events.c  Thu Oct 29 08:26:38 2020
(r367126)
+++ head/usr.bin/calendar/events.c  Thu Oct 29 08:31:47 2020
(r367127)
@@ -207,8 +207,9 @@ event_print_all(FILE *fp)
 
while (walkthrough_dates() != 0) {
 #ifdef DEBUG
-   fprintf(stderr, "event_print_allmonth: %d, day: %d\n",
-   month, day);
+   if (e)
+   fprintf(stderr, "event_print_all month: %d, day: %d\n",
+   e->month, e->day);
 #endif
 
/*

Modified: head/usr.bin/calendar/io.c
==
--- head/usr.bin/calendar/io.c  Thu Oct 29 08:26:38 2020(r367126)
+++ head/usr.bin/calendar/io.c  Thu Oct 29 08:31:47 2020(r367127)
@@ -215,26 +215,12 @@ token(char *line, FILE *out, int *skip)
return (T_ERR);
}
 
-   a = *walk;
+   a = *walk == '<' ? '>' : '\"';
walk++;
c = walk[strlen(walk) - 1];
 
-   switch(c) {
-   case '>':
-   if (a != '<') {
-   warnx("Unterminated include expecting '\"'");
-   return (T_ERR);
-   }
-   break;
-   case '\"':
-   if (a != '\"') {
-   warnx("Unterminated include expecting '>'");
-   return (T_ERR);
-   }
-   break;
-   default:
-   warnx("Unterminated include expecting '%c'",
-   a == '<' ? '>' : '\"' );
+   if (a != c) {
+   warnx("Unterminated include expecting '%c'", a);
return (T_ERR);
}
walk[strlen(walk) - 1] = '\0';
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r367126 - head/usr.bin/calendar

2020-10-29 Thread Stefan Eßer
Author: se
Date: Thu Oct 29 08:26:38 2020
New Revision: 367126
URL: https://svnweb.freebsd.org/changeset/base/367126

Log:
  Fix calendar -a processing of files included in the user's home directory
  
  The existing code performed a chdir() into the home directory, but the
  parser fell back to using the invoking user's home directory as the base
  directory for the search for an include file.
  
  Since use of the -a option is limited to UID==0, the directory searched
  was typically ~root/.calendar, not the .calendar directory of the user
  whose file is being processed.
  
  PR:   205580
  Reported by:  greg.b...@gmail.com (Greg Balfour)
  MFC after:3 days

Modified:
  head/usr.bin/calendar/calendar.c

Modified: head/usr.bin/calendar/calendar.c
==
--- head/usr.bin/calendar/calendar.cThu Oct 29 02:02:30 2020
(r367125)
+++ head/usr.bin/calendar/calendar.cThu Oct 29 08:26:38 2020
(r367126)
@@ -228,6 +228,7 @@ main(int argc, char *argv[])
if (setusercontext(lc, pw, pw->pw_uid,
LOGIN_SETALL) != 0)
errx(1, "setusercontext");
+   setenv("HOME", pw->pw_dir, 1);
cal();
exit(0);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"