git: 8209a085c701 - stable/13 - ixgbe: Clarify index name in ixgbe_mc_filter_apply

2021-04-25 Thread Kevin Bowling
The branch stable/13 has been updated by kbowling (ports committer):

URL: 
https://cgit.FreeBSD.org/src/commit/?id=8209a085c7016e62e97a9c756d656a41b4d9827e

commit 8209a085c7016e62e97a9c756d656a41b4d9827e
Author: Kevin Bowling 
AuthorDate: 2021-04-17 01:17:43 +
Commit: Kevin Bowling 
CommitDate: 2021-04-25 07:44:09 +

ixgbe: Clarify index name in ixgbe_mc_filter_apply

"It looks like it would be less confusing to rename 'count' to
something like 'idx', since that's what it's used for in this
function."

Reviewed by:erj
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D29798

(cherry picked from commit 21afed4b1d18578aa8c9fa31e9e677971f8b4300)
---
 sys/dev/ixgbe/if_ix.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index 6e65f6bae55a..77ef118493a2 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -3262,15 +3262,15 @@ ixgbe_config_delay_values(struct adapter *adapter)
  *   Called whenever multicast address list is updated.
  /
 static u_int
-ixgbe_mc_filter_apply(void *arg, struct sockaddr_dl *sdl, u_int count)
+ixgbe_mc_filter_apply(void *arg, struct sockaddr_dl *sdl, u_int idx)
 {
struct adapter *adapter = arg;
struct ixgbe_mc_addr *mta = adapter->mta;
 
-   if (count == MAX_NUM_MULTICAST_ADDRESSES)
+   if (idx == MAX_NUM_MULTICAST_ADDRESSES)
return (0);
-   bcopy(LLADDR(sdl), mta[count].addr, IXGBE_ETH_LENGTH_OF_ADDRESS);
-   mta[count].vmdq = adapter->pool;
+   bcopy(LLADDR(sdl), mta[idx].addr, IXGBE_ETH_LENGTH_OF_ADDRESS);
+   mta[idx].vmdq = adapter->pool;
 
return (1);
 } /* ixgbe_mc_filter_apply */
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 2d8adf9cc000 - stable/12 - ixgbe: Clarify index name in ixgbe_mc_filter_apply

2021-04-25 Thread Kevin Bowling
The branch stable/12 has been updated by kbowling (ports committer):

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2d8adf9ccd29d330d2ce06f659b207c0d11b

commit 2d8adf9ccd29d330d2ce06f659b207c0d11b
Author: Kevin Bowling 
AuthorDate: 2021-04-17 01:17:43 +
Commit: Kevin Bowling 
CommitDate: 2021-04-25 07:47:06 +

ixgbe: Clarify index name in ixgbe_mc_filter_apply

"It looks like it would be less confusing to rename 'count' to
something like 'idx', since that's what it's used for in this
function."

Reviewed by:erj
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D29798

(cherry picked from commit 21afed4b1d18578aa8c9fa31e9e677971f8b4300)
---
 sys/dev/ixgbe/if_ix.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index 80f812336d2c..b987369aefde 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -3239,18 +3239,18 @@ ixgbe_config_delay_values(struct adapter *adapter)
  *   Called whenever multicast address list is updated.
  /
 static int
-ixgbe_mc_filter_apply(void *arg, struct ifmultiaddr *ifma, int count)
+ixgbe_mc_filter_apply(void *arg, struct ifmultiaddr *ifma, int idx)
 {
struct adapter *adapter = arg;
struct ixgbe_mc_addr *mta = adapter->mta;
 
if (ifma->ifma_addr->sa_family != AF_LINK)
return (0);
-   if (count == MAX_NUM_MULTICAST_ADDRESSES)
+   if (idx == MAX_NUM_MULTICAST_ADDRESSES)
return (0);
bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr),
-   mta[count].addr, IXGBE_ETH_LENGTH_OF_ADDRESS);
-   mta[count].vmdq = adapter->pool;
+   mta[idx].addr, IXGBE_ETH_LENGTH_OF_ADDRESS);
+   mta[idx].vmdq = adapter->pool;
 
return (1);
 } /* ixgbe_mc_filter_apply */
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 6409e594272f - main - Fix build with gcc

2021-04-25 Thread Stefan Eßer
The branch main has been updated by se:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=6409e594272f66ce3896706ac705bbd465ce233e

commit 6409e594272f66ce3896706ac705bbd465ce233e
Author: Stefan Eßer 
AuthorDate: 2021-04-25 08:15:17 +
Commit: Stefan Eßer 
CommitDate: 2021-04-25 08:15:17 +

Fix build with gcc

Correctly declare function without arguments as f(void) instead of f().
---
 sys/net/route/fib_algo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c
index 91565d727a9c..cd7abd282728 100644
--- a/sys/net/route/fib_algo.c
+++ b/sys/net/route/fib_algo.c
@@ -365,7 +365,7 @@ fib_error_clear_flm(struct fib_lookup_module *flm)
  * Clears all errors in current VNET.
  */
 static void
-fib_error_clear()
+fib_error_clear(void)
 {
struct fib_error *fe, *fe_tmp;
 
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: a81e2e7890c2 - main - Make gcc happy by initializing error in rib_handle_ifaddr_info().

2021-04-25 Thread Alexander V. Chernikov
The branch main has been updated by melifaro:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a81e2e7890c2fce2a74dbb859e6855e0414a6ea1

commit a81e2e7890c2fce2a74dbb859e6855e0414a6ea1
Author: Alexander V. Chernikov 
AuthorDate: 2021-04-25 08:44:20 +
Commit: Alexander V. Chernikov 
CommitDate: 2021-04-25 08:44:59 +

Make gcc happy by initializing error in rib_handle_ifaddr_info().
---
 sys/net/route/route_ifaddrs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/net/route/route_ifaddrs.c b/sys/net/route/route_ifaddrs.c
index e6d97f3c74f0..15ee13201059 100644
--- a/sys/net/route/route_ifaddrs.c
+++ b/sys/net/route/route_ifaddrs.c
@@ -100,7 +100,7 @@ rib_handle_ifaddr_one(uint32_t fibnum, int cmd, struct 
rt_addrinfo *info)
 int
 rib_handle_ifaddr_info(uint32_t fibnum, int cmd, struct rt_addrinfo *info)
 {
-   int error, last_error = 0;
+   int error = 0, last_error = 0;
bool didwork = false;
 
if (V_rt_add_addr_allfibs == 0) {
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: c23385612da5 - main - [fib algo] Do not print algo attach/detach message on boot

2021-04-25 Thread Alexander V. Chernikov
The branch main has been updated by melifaro:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c23385612da5dd3195a9b73bfb22bd969dbd26c2

commit c23385612da5dd3195a9b73bfb22bd969dbd26c2
Author: Alexander V. Chernikov 
AuthorDate: 2021-04-25 08:51:57 +
Commit: Alexander V. Chernikov 
CommitDate: 2021-04-25 08:58:06 +

[fib algo] Do not print algo attach/detach message on boot

MFC after:  1 day
---
 sys/net/route/fib_algo.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c
index cd7abd282728..43db482d73da 100644
--- a/sys/net/route/fib_algo.c
+++ b/sys/net/route/fib_algo.c
@@ -239,7 +239,9 @@ SYSCTL_INT(_net_route_algo, OID_AUTO, debug_level, 
CTLFLAG_RW | CTLFLAG_RWTUN,
 #endif
 
 #define_PASS_MSG(_l)   (flm_debug_level >= (_l))
-#defineALGO_PRINTF(_fmt, ...)  printf("[fib_algo] %s: " _fmt "\n", 
__func__, ##__VA_ARGS__)
+#defineALGO_PRINTF(_l, _fmt, ...)  if (_PASS_MSG(_l)) {
\
+   printf("[fib_algo] %s: " _fmt "\n", __func__, ##__VA_ARGS__);   \
+}
 #define_ALGO_PRINTF(_fib, _fam, _aname, _gen, _func, _fmt, ...) \
 printf("[fib_algo] %s.%u (%s#%u) %s: " _fmt "\n",\
 print_family(_fam), _fib, _aname, _gen, _func, ## __VA_ARGS__)
@@ -1971,7 +1973,7 @@ fib_module_register(struct fib_lookup_module *flm)
 {
 
FIB_MOD_LOCK();
-   ALGO_PRINTF("attaching %s to %s", flm->flm_name,
+   ALGO_PRINTF(LOG_INFO, "attaching %s to %s", flm->flm_name,
print_family(flm->flm_family));
TAILQ_INSERT_TAIL(&all_algo_list, flm, entries);
FIB_MOD_UNLOCK();
@@ -1995,7 +1997,7 @@ fib_module_unregister(struct fib_lookup_module *flm)
return (EBUSY);
}
fib_error_clear_flm(flm);
-   ALGO_PRINTF("detaching %s from %s", flm->flm_name,
+   ALGO_PRINTF(LOG_INFO, "detaching %s from %s", flm->flm_name,
print_family(flm->flm_family));
TAILQ_REMOVE(&all_algo_list, flm, entries);
FIB_MOD_UNLOCK();
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 67372fb3e06e - main - Fix NOINET[6] build after enabling FIB_ALGO in GENERIC.

2021-04-25 Thread Alexander V. Chernikov
The branch main has been updated by melifaro:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=67372fb3e06ebaccfe7c093aa78009d161fa58e6

commit 67372fb3e06ebaccfe7c093aa78009d161fa58e6
Author: Alexander V. Chernikov 
AuthorDate: 2021-04-21 01:45:49 +
Commit: Alexander V. Chernikov 
CommitDate: 2021-04-21 01:49:18 +

Fix NOINET[6] build after enabling FIB_ALGO in GENERIC.

Submitted by:   jbeich
PR: 255389
---
 sys/net/route/fib_algo.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c
index 43db482d73da..83fff1ec43e0 100644
--- a/sys/net/route/fib_algo.c
+++ b/sys/net/route/fib_algo.c
@@ -706,12 +706,16 @@ fill_change_entry(struct fib_data *fd, struct 
fib_change_entry *ce, struct rib_c
int plen = 0;
 
switch (fd->fd_family) {
+#ifdef INET
case AF_INET:
rt_get_inet_prefix_plen(rc->rc_rt, &ce->addr4, &plen, 
&ce->scopeid);
break;
+#endif
+#ifdef INET6
case AF_INET6:
rt_get_inet6_prefix_plen(rc->rc_rt, &ce->addr6, &plen, 
&ce->scopeid);
break;
+#endif
}
 
ce->plen = plen;
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: b68e6569221e - main - rc: improve dependencies for growfs

2021-04-25 Thread Edward Tomasz Napierala
The branch main has been updated by trasz:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b68e6569221ecade8899eaab8e1b088947ef2f8a

commit b68e6569221ecade8899eaab8e1b088947ef2f8a
Author: Edward Tomasz Napierala 
AuthorDate: 2021-04-25 12:41:36 +
Commit: Edward Tomasz Napierala 
CommitDate: 2021-04-25 12:41:44 +

rc: improve dependencies for growfs

Previously it depended on sysctl, which itself has no dependencies,
so rcorder(8) had a bit too much flexibility when choosing when to run
it.  Make sure it runs just between 'fsck' and 'root'.

Reviewed By:jmg, imp
Sponsored By:   EPSRC
Differential Revision:  https://reviews.freebsd.org/D29748
---
 libexec/rc/rc.d/growfs | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libexec/rc/rc.d/growfs b/libexec/rc/rc.d/growfs
index 54bab2a60dfb..c2955c740d43 100755
--- a/libexec/rc/rc.d/growfs
+++ b/libexec/rc/rc.d/growfs
@@ -28,15 +28,17 @@
 #
 
 # PROVIDE: growfs
-# BEFORE: sysctl
+# REQUIRE: fsck
+# BEFORE: root
 # KEYWORD: firstboot
 
 # This allows us to distribute an image
 # and have it work on essentially any size drive.
-#
-# TODO: Figure out where this should really be ordered.
-# I suspect it should go just after fsck but before mountcritlocal.
-# 
+
+# Note that this uses awk(1), and thus will not work if /usr is on a separate
+# filesystem.  We need to run early, because there might be not enough free
+# space on rootfs for the boot to succeed, and on images we ship - which are
+# the primary purpose of this script - there is no separate /usr anyway.
 
 . /etc/rc.subr
 
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 5d1d844a7762 - main - kern_linkat: modify to accept AT_ flags instead of FOLLOW/NOFOLLOW

2021-04-25 Thread Edward Tomasz Napierala
The branch main has been updated by trasz:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5d1d844a77622878cd05478d4ab504f70e067248

commit 5d1d844a77622878cd05478d4ab504f70e067248
Author: Edward Tomasz Napierala 
AuthorDate: 2021-04-25 13:13:02 +
Commit: Edward Tomasz Napierala 
CommitDate: 2021-04-25 13:13:12 +

kern_linkat: modify to accept AT_ flags instead of FOLLOW/NOFOLLOW

This makes this API match other kern_xxxat() functions.

Reviewed By:kib
Sponsored By:   EPSRC
Differential Revision:  https://reviews.freebsd.org/D29776
---
 sys/compat/cloudabi/cloudabi_file.c |  2 +-
 sys/compat/linux/linux_file.c   | 15 ---
 sys/kern/vfs_syscalls.c | 12 ++--
 sys/sys/syscallsubr.h   |  2 +-
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/sys/compat/cloudabi/cloudabi_file.c 
b/sys/compat/cloudabi/cloudabi_file.c
index f7d93bc85cad..83987b79aa0c 100644
--- a/sys/compat/cloudabi/cloudabi_file.c
+++ b/sys/compat/cloudabi/cloudabi_file.c
@@ -185,7 +185,7 @@ cloudabi_sys_file_link(struct thread *td,
 
error = kern_linkat(td, uap->fd1.fd, uap->fd2, path1, path2,
UIO_SYSSPACE, (uap->fd1.flags & CLOUDABI_LOOKUP_SYMLINK_FOLLOW) ?
-   FOLLOW : NOFOLLOW);
+   AT_SYMLINK_FOLLOW : 0);
cloudabi_freestr(path1);
cloudabi_freestr(path2);
return (error);
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index 6b02c2efb88e..1febb11b0131 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -,7 +,7 @@ linux_link(struct thread *td, struct linux_link_args 
*args)
 
if (!LUSECONVPATH(td)) {
return (kern_linkat(td, AT_FDCWD, AT_FDCWD, args->path, 
args->to,
-   UIO_USERSPACE, FOLLOW));
+   UIO_USERSPACE, AT_SYMLINK_FOLLOW));
}
LCONVPATHEXIST(td, args->path, &path);
/* Expand LCONVPATHCREATE so that `path' can be freed on errors */
@@ -1121,7 +1121,7 @@ linux_link(struct thread *td, struct linux_link_args 
*args)
return (error);
}
error = kern_linkat(td, AT_FDCWD, AT_FDCWD, path, to, UIO_SYSSPACE,
-   FOLLOW);
+   AT_SYMLINK_FOLLOW);
LFREEPATH(path);
LFREEPATH(to);
return (error);
@@ -1132,18 +1132,19 @@ int
 linux_linkat(struct thread *td, struct linux_linkat_args *args)
 {
char *path, *to;
-   int error, olddfd, newdfd, follow;
+   int error, olddfd, newdfd, flag;
 
if (args->flag & ~LINUX_AT_SYMLINK_FOLLOW)
return (EINVAL);
 
+   flag = (args->flag & LINUX_AT_SYMLINK_FOLLOW) == 0 ? AT_SYMLINK_FOLLOW :
+   0;
+
olddfd = (args->olddfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->olddfd;
newdfd = (args->newdfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->newdfd;
-   follow = (args->flag & LINUX_AT_SYMLINK_FOLLOW) == 0 ? NOFOLLOW :
-   FOLLOW;
if (!LUSECONVPATH(td)) {
return (kern_linkat(td, olddfd, newdfd, args->oldname,
-   args->newname, UIO_USERSPACE, follow));
+   args->newname, UIO_USERSPACE, flag));
}
LCONVPATHEXIST_AT(td, args->oldname, &path, olddfd);
/* Expand LCONVPATHCREATE so that `path' can be freed on errors */
@@ -1152,7 +1153,7 @@ linux_linkat(struct thread *td, struct linux_linkat_args 
*args)
LFREEPATH(path);
return (error);
}
-   error = kern_linkat(td, olddfd, newdfd, path, to, UIO_SYSSPACE, follow);
+   error = kern_linkat(td, olddfd, newdfd, path, to, UIO_SYSSPACE, flag);
LFREEPATH(path);
LFREEPATH(to);
return (error);
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 26a8d31e4456..32e4c8688762 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1495,7 +1495,7 @@ sys_link(struct thread *td, struct link_args *uap)
 {
 
return (kern_linkat(td, AT_FDCWD, AT_FDCWD, uap->path, uap->link,
-   UIO_USERSPACE, FOLLOW));
+   UIO_USERSPACE, AT_SYMLINK_FOLLOW));
 }
 
 #ifndef _SYS_SYSPROTO_H_
@@ -1518,8 +1518,7 @@ sys_linkat(struct thread *td, struct linkat_args *uap)
return (EINVAL);
 
return (kern_linkat(td, uap->fd1, uap->fd2, uap->path1, uap->path2,
-   UIO_USERSPACE, at2cnpflags(flag, AT_SYMLINK_FOLLOW |
-   AT_RESOLVE_BENEATH | AT_EMPTY_PATH)));
+   UIO_USERSPACE, flag));
 }
 
 int hardlink_check_uid = 0;
@@ -1563,15 +1562,16 @@ can_hardlink(struct vnode *vp, struct ucred *cred)
 
 int
 kern_linkat(struct thread *td, int fd1, int fd2, const char *path1,
-const char *path2, enum uio_seg segflag, int follow)
+const char *path2, enum uio_seg segflag, int flag)
 {
struct nameidata nd;
int error;
 
do {
bwillwrite();
-   NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITV

git: 8e491aaeac6e - main - Add code examples to cpuset(2), and improve cross referencing.

2021-04-25 Thread Robert Watson
The branch main has been updated by rwatson:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=8e491aaeac6eab92b1ba8f077f75cebac39adb1c

commit 8e491aaeac6eab92b1ba8f077f75cebac39adb1c
Author: Robert Watson 
AuthorDate: 2021-04-25 14:22:00 +
Commit: Robert Watson 
CommitDate: 2021-04-25 14:22:00 +

Add code examples to cpuset(2), and improve cross referencing.

MFC after:  1 week
Reviewed by:jeff, jrtc27, kevans, bcr (manpages)
Differential revision:  https://reviews.freebsd.org/D27803
---
 lib/libc/sys/cpuset.2 | 66 +++
 1 file changed, 66 insertions(+)

diff --git a/lib/libc/sys/cpuset.2 b/lib/libc/sys/cpuset.2
index a2e5269ac042..8b17f537e7fa 100644
--- a/lib/libc/sys/cpuset.2
+++ b/lib/libc/sys/cpuset.2
@@ -1,5 +1,6 @@
 .\" Copyright (c) 2008 Christian Brueffer
 .\" Copyright (c) 2008 Jeffrey Roberson
+.\" Copyright (c) 2021 Robert N. M. Watson
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -180,9 +181,72 @@ The actual contents of the sets may be retrieved or 
manipulated using
 .Xr cpuset_setaffinity 2 ,
 .Xr cpuset_getdomain 2 , and
 .Xr cpuset_setdomain 2 .
+The
+.Xr cpuset 9
+macros may be used to manipulate masks of type
+.Ft cpuset_t
+get and set using those APIs.
 See those manual pages for more detail.
 .Sh RETURN VALUES
 .Rv -std
+.Sh EXAMPLES
+In this example, a CPU set mask is configured to limit execution to the first
+CPU using
+.Xr CPU_ZERO 9
+and
+.Xr CPU_SET 9 ,
+members of the
+.Xr cpuset 9
+programming interface.
+Then, the mask is applied to a new anonymous CPU set associated with the
+current process using
+.Xr cpuset_setaffinity 2 .
+This mask will be used by the current process, and inherited by any new
+child processes.
+.Bd  -literal -offset indent
+#include 
+#include 
+
+#include 
+
+cpuset_t cpuset_mask;
+
+/* Initialize a CPU mask and enable CPU 0. */
+CPU_ZERO(&cpuset_mask);
+CPU_SET(0, &cpuset_mask);
+
+/* Set affinity for the CPU set for the current process. */
+if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1,
+sizeof(cpuset_mask), &cpuset_mask) < 0)
+   err(EX_OSERR, "cpuset_setaffinity");
+.Ed
+.Pp
+In the next example, a named CPU set is created containing the current
+process, and its affinity similarly configured.
+The resulting CPU set ID can then be used for further external management of
+the affinity of the set.
+.Bd  -literal -offset indent
+#include 
+#include 
+
+#include 
+
+cpusetid_t cpuset_id;
+cpuset_t cpuset_mask;
+
+/* Create new cpuset for the current process. */
+if (cpuset(&cpuset_id) < 0)
+   err(EX_OSERR, "cpuset");
+
+/* Initialize a CPU mask and enable CPU 0. */
+CPU_ZERO(&cpuset_mask);
+CPU_SET(0, &cpuset_mask);
+
+/* Set affinity for the CPU set for the current process. */
+if (cpuset_setaffinity(CPU_LEVEL_SET, CPU_WHICH_CPUSET, cpuset_id,
+sizeof(cpuset_mask), &cpuset_mask) < 0)
+   err(EX_OSERR, "cpuset_setaffinity");
+.Ed
 .Sh ERRORS
 The following error codes may be set in
 .Va errno :
@@ -226,6 +290,8 @@ for allocation.
 .Xr cpuset_setdomain 2 ,
 .Xr pthread_affinity_np 3 ,
 .Xr pthread_attr_affinity_np 3 ,
+.Xr CPU_SET 9 ,
+.Xr CPU_ZERO 9 ,
 .Xr cpuset 9
 .Sh HISTORY
 The
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 7d222ce3c10b - main - Fix NOINET[6], !VIMAGE builds after FIB_ALGO addition to GENERIC

2021-04-25 Thread Alexander V. Chernikov
The branch main has been updated by melifaro:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=7d222ce3c10bdc23c8dc92d6b13e376ede5840d5

commit 7d222ce3c10bdc23c8dc92d6b13e376ede5840d5
Author: Alexander V. Chernikov 
AuthorDate: 2021-04-21 04:52:38 +
Commit: Alexander V. Chernikov 
CommitDate: 2021-04-21 04:53:42 +

Fix NOINET[6],!VIMAGE builds after FIB_ALGO addition to GENERIC

Reported by:jbeich
PR: 255390
---
 sys/net/route/fib_algo.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/sys/net/route/fib_algo.c b/sys/net/route/fib_algo.c
index 83fff1ec43e0..5dff2690454d 100644
--- a/sys/net/route/fib_algo.c
+++ b/sys/net/route/fib_algo.c
@@ -108,19 +108,19 @@ SYSCTL_NODE(_net_route, OID_AUTO, algo, CTLFLAG_RW | 
CTLFLAG_MPSAFE, 0,
 /* Algorithm sync policy */
 
 /* Time interval to bucket updates */
-VNET_DEFINE(unsigned int, bucket_time_ms) = 50;
-#defineV_bucket_time_msVNET(bucket_time_ms)
+VNET_DEFINE_STATIC(unsigned int, update_bucket_time_ms) = 50;
+#defineV_update_bucket_time_ms VNET(update_bucket_time_ms)
 SYSCTL_UINT(_net_route_algo, OID_AUTO, bucket_time_ms, CTLFLAG_RW | 
CTLFLAG_VNET,
-&VNET_NAME(bucket_time_ms), 0, "Time interval to calculate update rate");
+&VNET_NAME(update_bucket_time_ms), 0, "Time interval to calculate update 
rate");
 
 /* Minimum update rate to delay sync */
-VNET_DEFINE(unsigned int, bucket_change_threshold_rate) = 500;
+VNET_DEFINE_STATIC(unsigned int, bucket_change_threshold_rate) = 500;
 #defineV_bucket_change_threshold_rate  
VNET(bucket_change_threshold_rate)
 SYSCTL_UINT(_net_route_algo, OID_AUTO, bucket_change_threshold_rate, 
CTLFLAG_RW | CTLFLAG_VNET,
 &VNET_NAME(bucket_change_threshold_rate), 0, "Minimum update rate to delay 
sync");
 
 /* Max allowed delay to sync */
-VNET_DEFINE(unsigned int, fib_max_sync_delay_ms) = 1000;
+VNET_DEFINE_STATIC(unsigned int, fib_max_sync_delay_ms) = 1000;
 #defineV_fib_max_sync_delay_ms VNET(fib_max_sync_delay_ms)
 SYSCTL_UINT(_net_route_algo, OID_AUTO, fib_max_sync_delay_ms, CTLFLAG_RW | 
CTLFLAG_VNET,
 &VNET_NAME(fib_max_sync_delay_ms), 0, "Maximum time to delay sync (ms)");
@@ -589,7 +589,7 @@ update_rebuild_delay(struct fib_data *fd, enum 
fib_callout_action action)
struct timeval tv;
 
/* Fetch all variables at once to ensure consistent reads */
-   uint32_t bucket_time_ms = V_bucket_time_ms;
+   uint32_t bucket_time_ms = V_update_bucket_time_ms;
uint32_t threshold_rate = V_bucket_change_threshold_rate;
uint32_t max_delay_ms = V_fib_max_sync_delay_ms;
 
@@ -1618,10 +1618,14 @@ static struct fib_dp **
 get_family_dp_ptr(int family)
 {
switch (family) {
+#ifdef INET
case AF_INET:
return (&V_inet_dp);
+#endif
+#ifdef INET6
case AF_INET6:
return (&V_inet6_dp);
+#endif
}
return (NULL);
 }
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: 02695ea8909d - main - nfscl: fix delegation recall when the file is not open

2021-04-25 Thread Rick Macklem
The branch main has been updated by rmacklem:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=02695ea8909d818ceaa726f90f889889dfd39fac

commit 02695ea8909d818ceaa726f90f889889dfd39fac
Author: Rick Macklem 
AuthorDate: 2021-04-25 19:52:48 +
Commit: Rick Macklem 
CommitDate: 2021-04-25 19:55:00 +

nfscl: fix delegation recall when the file is not open

Without this patch, if a NFSv4 server recalled a
delegation when the file is not open, the renew
thread would block in the NFS VOP_INACTIVE()
trying to acquire the client state lock that it
already holds.

This patch fixes the problem by delaying the
vrele() call until after the client state
lock is released.

This bug has been in the NFSv4 client for
a long time, but since it only affects
delegation when recalled due to another
client opening the file, it got missed
during previous testing.

Until you have this patch in your client,
you should avoid the use of delegations.

MFC after:  2 weeks
---
 sys/fs/nfsclient/nfs_clstate.c | 53 --
 1 file changed, 30 insertions(+), 23 deletions(-)

diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c
index e310deff6cf9..6cff58331c97 100644
--- a/sys/fs/nfsclient/nfs_clstate.c
+++ b/sys/fs/nfsclient/nfs_clstate.c
@@ -156,7 +156,8 @@ static void nfscl_freedeleg(struct nfscldeleghead *, struct 
nfscldeleg *);
 static int nfscl_errmap(struct nfsrv_descript *, u_int32_t);
 static void nfscl_cleanup_common(struct nfsclclient *, u_int8_t *);
 static int nfscl_recalldeleg(struct nfsclclient *, struct nfsmount *,
-struct nfscldeleg *, vnode_t, struct ucred *, NFSPROC_T *, int);
+struct nfscldeleg *, vnode_t, struct ucred *, NFSPROC_T *, int,
+vnode_t *);
 static void nfscl_freeopenowner(struct nfsclowner *, int);
 static void nfscl_cleandeleg(struct nfscldeleg *);
 static int nfscl_trydelegreturn(struct nfscldeleg *, struct ucred *,
@@ -2562,6 +2563,7 @@ nfscl_renewthread(struct nfsclclient *clp, NFSPROC_T *p)
struct nfsclds *dsp;
bool retok;
struct mount *mp;
+   vnode_t vp;
 
cred = newnfs_getcred();
NFSLOCKCLSTATE();
@@ -2683,7 +2685,7 @@ tryagain:
NFSUNLOCKCLSTATE();
newnfs_copycred(&dp->nfsdl_cred, cred);
ret = nfscl_recalldeleg(clp, clp->nfsc_nmp, dp,
-   NULL, cred, p, 1);
+   NULL, cred, p, 1, &vp);
if (!ret) {
nfscl_cleandeleg(dp);
TAILQ_REMOVE(&clp->nfsc_deleg, dp,
@@ -2694,6 +2696,22 @@ tryagain:
nfsstatsv1.cldelegates--;
}
NFSLOCKCLSTATE();
+   /*
+* The nfsc_lock must be released before doing
+* vrele(), since it might call nfs_inactive().
+* For the unlikely case where the vnode failed
+* to be acquired by nfscl_recalldeleg(), a
+* VOP_RECLAIM() should be in progress and it
+* will return the delegation.
+*/
+   nfsv4_unlock(&clp->nfsc_lock, 0);
+   igotlock = 0;
+   if (vp != NULL) {
+   NFSUNLOCKCLSTATE();
+   vrele(vp);
+   NFSLOCKCLSTATE();
+   }
+   goto tryagain;
}
dp = ndp;
}
@@ -3943,16 +3961,18 @@ nfscl_lockt(vnode_t vp, struct nfsclclient *clp, 
u_int64_t off,
 static int
 nfscl_recalldeleg(struct nfsclclient *clp, struct nfsmount *nmp,
 struct nfscldeleg *dp, vnode_t vp, struct ucred *cred, NFSPROC_T *p,
-int called_from_renewthread)
+int called_from_renewthread, vnode_t *vpp)
 {
struct nfsclowner *owp, *lowp, *nowp;
struct nfsclopen *op, *lop;
struct nfscllockowner *lp;
struct nfscllock *lckp;
struct nfsnode *np;
-   int error = 0, ret, gotvp = 0;
+   int error = 0, ret;
 
if (vp == NULL) {
+   KASSERT(vpp != NULL, ("nfscl_recalldeleg: vpp NULL"));
+   *vpp = NULL;
/*
 * First, get a vnode for the file. This is needed to do RPCs.
 */
@@ -3966,7 +3986,7 @@ nfscl_recalldeleg(struct nfsclclient *clp, struct 
nfsmount *nmp,
return (0);
}
vp = NFSTOV(np);
-   gotvp = 1;
+

git: d55bf492f8f5 - main - Revert "Add workaround for a QoS-related bug in VMWare Workstation."

2021-04-25 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d55bf492f8f587e4a99f4dcb39a96159b4431782

commit d55bf492f8f587e4a99f4dcb39a96159b4431782
Author: Ed Maste 
AuthorDate: 2021-04-25 21:14:23 +
Commit: Ed Maste 
CommitDate: 2021-04-25 21:17:22 +

Revert "Add workaround for a QoS-related bug in VMWare Workstation."

This reverts commit 77c2fe20df6a9a7c1a353e1a4ab2ba80fefab881.

The VMware Workstation issue was fixed in 2019[1], and we'd rather not
carry unnecessary local changes in OpenSSH.

[1] 
https://communities.vmware.com/t5/VMware-Workstation-Pro/Regression-ssh-results-in-broken-pipe-upon-connecting-in-Vmware/m-p/486105/highlight/true#M25470

PR: 234426
Discussed with: yuripv
Approved by:des
MFC after:  2 weeks
Sponsored by:   The FreeBSD Foundation
---
 crypto/openssh/readconf.c   | 22 --
 secure/usr.bin/ssh/Makefile |  3 ---
 2 files changed, 25 deletions(-)

diff --git a/crypto/openssh/readconf.c b/crypto/openssh/readconf.c
index 75fbd4ca222f..c1147a9e2e5f 100644
--- a/crypto/openssh/readconf.c
+++ b/crypto/openssh/readconf.c
@@ -16,9 +16,6 @@
 __RCSID("$FreeBSD$");
 
 #include 
-#ifdef VMWARE_GUEST_WORKAROUND
-#include 
-#endif
 #include 
 #include 
 #include 
@@ -1983,15 +1980,6 @@ fill_default_options(Options * options)
 {
char *all_cipher, *all_mac, *all_kex, *all_key, *all_sig;
int r;
-#ifdef VMWARE_GUEST_WORKAROUND
-   char scval[7];  /* "vmware\0" */
-   size_t scsiz = sizeof(scval);
-   int vmwguest = 0;
-
-   if (sysctlbyname("kern.vm_guest", scval, &scsiz, NULL, 0) == 0 &&
-   strcmp(scval, "vmware") == 0)
-   vmwguest = 1;
-#endif
 
if (options->forward_agent == -1)
options->forward_agent = 0;
@@ -2126,18 +2114,8 @@ fill_default_options(Options * options)
if (options->visual_host_key == -1)
options->visual_host_key = 0;
if (options->ip_qos_interactive == -1)
-#ifdef VMWARE_GUEST_WORKAROUND
-   if (vmwguest)
-   options->ip_qos_interactive = IPTOS_LOWDELAY;
-   else
-#endif
options->ip_qos_interactive = IPTOS_DSCP_AF21;
if (options->ip_qos_bulk == -1)
-#ifdef VMWARE_GUEST_WORKAROUND
-   if (vmwguest)
-   options->ip_qos_bulk = IPTOS_THROUGHPUT;
-   else
-#endif
options->ip_qos_bulk = IPTOS_DSCP_CS1;
if (options->request_tty == -1)
options->request_tty = REQUEST_TTY_AUTO;
diff --git a/secure/usr.bin/ssh/Makefile b/secure/usr.bin/ssh/Makefile
index 023fa4a55be9..614cc7627fc5 100644
--- a/secure/usr.bin/ssh/Makefile
+++ b/secure/usr.bin/ssh/Makefile
@@ -37,9 +37,6 @@ LIBADD+=  crypto
 CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\"
 .endif
 
-# Workaround VMware Workstation NAT bug
-CFLAGS+=-DVMWARE_GUEST_WORKAROUND
-
 .include 
 
 .PATH: ${SSHDIR}
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: aad780464fad - main - nfscl: return delegations in the NFS VOP_RECLAIM()

2021-04-25 Thread Rick Macklem
The branch main has been updated by rmacklem:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=aad780464fad1e32c97316515a4044d661413a6b

commit aad780464fad1e32c97316515a4044d661413a6b
Author: Rick Macklem 
AuthorDate: 2021-04-26 00:57:55 +
Commit: Rick Macklem 
CommitDate: 2021-04-26 00:57:55 +

nfscl: return delegations in the NFS VOP_RECLAIM()

After a vnode is recycled it can no longer be
acquired via vfs_hash_get() and, as such,
a delegation for the vnode cannot be recalled.

In the unlikely event that a delegation still
exists when the vnode is being recycled, return
the delegation since it will no longer be
recallable.

Until you have this patch in your NFSv4 client,
you should consider avoiding the use of delegations.

MFC after:  2 weeks
---
 sys/fs/nfs/nfs_var.h   |  1 +
 sys/fs/nfsclient/nfs_clnode.c  | 10 -
 sys/fs/nfsclient/nfs_clstate.c | 49 ++
 3 files changed, 50 insertions(+), 10 deletions(-)

diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h
index 0297b52015f8..201c5a5fc2b5 100644
--- a/sys/fs/nfs/nfs_var.h
+++ b/sys/fs/nfs/nfs_var.h
@@ -604,6 +604,7 @@ void nfscl_lockinit(struct nfsv4lock *);
 void nfscl_lockexcl(struct nfsv4lock *, void *);
 void nfscl_lockunlock(struct nfsv4lock *);
 void nfscl_lockderef(struct nfsv4lock *);
+void nfscl_delegreturnvp(vnode_t, NFSPROC_T *);
 void nfscl_docb(struct nfsrv_descript *, NFSPROC_T *);
 void nfscl_releasealllocks(struct nfsclclient *, vnode_t, NFSPROC_T *, void *,
 int);
diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c
index a59b96bf3c8b..43c2286726f7 100644
--- a/sys/fs/nfsclient/nfs_clnode.c
+++ b/sys/fs/nfsclient/nfs_clnode.c
@@ -303,7 +303,7 @@ ncl_reclaim(struct vop_reclaim_args *ap)
ncl_releasesillyrename(vp, td);
NFSUNLOCKNODE(np);
 
-   if (NFS_ISV4(vp) && vp->v_type == VREG)
+   if (NFS_ISV4(vp) && vp->v_type == VREG) {
/*
 * We can now safely close any remaining NFSv4 Opens for
 * this file. Most opens will have already been closed by
@@ -311,6 +311,14 @@ ncl_reclaim(struct vop_reclaim_args *ap)
 * called, so we need to do it again here.
 */
(void) nfsrpc_close(vp, 1, td);
+   /*
+* It it unlikely a delegation will still exist, but
+* if one does, it must be returned before calling
+* vfs_hash_remove(), since it cannot be recalled once the
+* nfs node is no longer available.
+*/
+   nfscl_delegreturnvp(vp, td);
+   }
 
vfs_hash_remove(vp);
 
diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c
index 6cff58331c97..bbc1c6ccbc2f 100644
--- a/sys/fs/nfsclient/nfs_clstate.c
+++ b/sys/fs/nfsclient/nfs_clstate.c
@@ -152,7 +152,8 @@ static int nfscl_trylock(struct nfsmount *, vnode_t , 
u_int8_t *,
 struct ucred *, NFSPROC_T *);
 static int nfsrpc_reopen(struct nfsmount *, u_int8_t *, int, u_int32_t,
 struct nfsclopen *, struct nfscldeleg **, struct ucred *, NFSPROC_T *);
-static void nfscl_freedeleg(struct nfscldeleghead *, struct nfscldeleg *);
+static void nfscl_freedeleg(struct nfscldeleghead *, struct nfscldeleg *,
+bool);
 static int nfscl_errmap(struct nfsrv_descript *, u_int32_t);
 static void nfscl_cleanup_common(struct nfsclclient *, u_int8_t *);
 static int nfscl_recalldeleg(struct nfsclclient *, struct nfsmount *,
@@ -1622,12 +1623,13 @@ nfscl_cleandeleg(struct nfscldeleg *dp)
  * Free a delegation.
  */
 static void
-nfscl_freedeleg(struct nfscldeleghead *hdp, struct nfscldeleg *dp)
+nfscl_freedeleg(struct nfscldeleghead *hdp, struct nfscldeleg *dp, bool freeit)
 {
 
TAILQ_REMOVE(hdp, dp, nfsdl_list);
LIST_REMOVE(dp, nfsdl_hash);
-   free(dp, M_NFSCLDELEG);
+   if (freeit)
+   free(dp, M_NFSCLDELEG);
nfsstatsv1.cldelegates--;
nfscl_delegcnt--;
 }
@@ -1725,7 +1727,7 @@ nfscl_expireclient(struct nfsclclient *clp, struct 
nfsmount *nmp,
printf("nfsv4 expired locks lost\n");
}
nfscl_cleandeleg(dp);
-   nfscl_freedeleg(&clp->nfsc_deleg, dp);
+   nfscl_freedeleg(&clp->nfsc_deleg, dp, true);
dp = ndp;
}
if (!TAILQ_EMPTY(&clp->nfsc_deleg))
@@ -2257,7 +2259,7 @@ nfscl_recover(struct nfsclclient *clp, bool *retokp, 
struct ucred *cred,
 * away. Ouch!!
 */
nfscl_cleandeleg(dp);
-   nfscl_freedeleg(&clp->nfsc_deleg, dp);
+   nfscl_freedeleg(&clp->nfsc_deleg, dp, true);
} else {
LIST_INSERT_HEAD(&extra_open, nop, nfso_list);
}
@@ -3280,11 +3282,40 @@ nfscl_delegreturnall(struct nfsclclient *clp, NFSPROC_T 
*p)
TAILQ_FOREACH_

git: 4b84b4cca472 - main - zfs: fix non-functional mismerges from vendor/openzfs

2021-04-25 Thread Martin Matuska
The branch main has been updated by mm:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4b84b4cca472e482bc22d5e5c7928be5a1393c84

commit 4b84b4cca472e482bc22d5e5c7928be5a1393c84
Author: Martin Matuska 
AuthorDate: 2021-04-26 01:05:13 +
Commit: Martin Matuska 
CommitDate: 2021-04-26 01:05:13 +

zfs: fix non-functional mismerges from vendor/openzfs

- fix copyright in module/os/freebsd/spl/spl_acl.c
- fix mismerge in non-processed module/os/linux/zfs/zfs_uio.c

MFC after:  3 days
Obtained from:  OpenZFS
---
 sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c | 1 +
 sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c   | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c 
b/sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c
index 74c26d03f87f..18188ca0adec 100644
--- a/sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c
+++ b/sys/contrib/openzfs/module/os/freebsd/spl/spl_acl.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2008, 2009 Edward Tomasz Napierała 
+ * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
diff --git a/sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c 
b/sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c
index 3e3fda20c72c..a3d5d5f83b6f 100644
--- a/sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c
+++ b/sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c
@@ -261,9 +261,6 @@ zfs_uio_prefaultpages(ssize_t n, zfs_uio_t *uio)
}
}
 
-   if (iterp && iov_iter_fault_in_readable(iterp, n))
-   return (EFAULT);
-#endif
return (0);
 }
 EXPORT_SYMBOL(zfs_uio_prefaultpages);
___
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"


git: ca7005f1893d - main - iflib: Improve mapping of TX/RX queues to CPUs

2021-04-25 Thread Patrick Kelsey
The branch main has been updated by pkelsey:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ca7005f1893d199b7c28d5b159e1bdbb55e74543

commit ca7005f1893d199b7c28d5b159e1bdbb55e74543
Author: Patrick Kelsey 
AuthorDate: 2021-04-26 04:25:59 +
Commit: Patrick Kelsey 
CommitDate: 2021-04-26 05:06:34 +

iflib: Improve mapping of TX/RX queues to CPUs

iflib now supports mapping each (TX,RX) queue pair to the same CPU
(default), to separate CPUs, or to a pair of physical and logical CPUs
that share the same L2 cache.  The mapping mechanism supports unequal
numbers of TX and RX queues, with the excess queues always being
mapped to consecutive physical CPUs.  When the platform cannot
distinguish between physical and logical CPUs, all are treated as
physical CPUs.  See the comment on get_cpuid_for_queue() for the
entire matrix.

The following device-specific tunables influence the mapping process:
dev...iflib.core_offset   (existing)
dev...iflib.separate_txrx (existing)
dev...iflib.use_logical_cores (new)

The following new, read-only sysctls provide visibility of the mapping
results:
dev...iflib.{t,r}xq.cpu

When an iflib driver allocates TX softirqs without providing reference
RX IRQs, iflib now binds those TX softirqs to CPUs using the above
mapping mechanism (that is, treats them as if they were TX IRQs).
Previously, such bindings were left up to the grouptaskqueue code and
thus fell outside of the iflib CPU mapping strategy.

Reviewed by:kbowling
Tested by:  olivier, pkelsey
MFC after:  3 weeks
Differential Revision:  https://reviews.freebsd.org/D24094
---
 sys/net/iflib.c  | 454 +++
 sys/sys/cpuset.h |   1 +
 2 files changed, 294 insertions(+), 161 deletions(-)

diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index fc0814d0fc19..faf58917c96b 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -195,6 +195,8 @@ struct iflib_ctx {
uint16_t ifc_sysctl_core_offset;
 #defineCORE_OFFSET_UNSPECIFIED 0x
uint8_t  ifc_sysctl_separate_txrx;
+   uint8_t  ifc_sysctl_use_logical_cores;
+   bool ifc_cpus_are_physical_cores;
 
qidx_t ifc_sysctl_ntxds[8];
qidx_t ifc_sysctl_nrxds[8];
@@ -725,7 +727,7 @@ struct cpu_offset {
SLIST_ENTRY(cpu_offset) entries;
cpuset_tset;
unsigned intrefcount;
-   uint16_toffset;
+   uint16_tnext_cpuid;
 };
 static struct mtx cpu_offset_mtx;
 MTX_SYSINIT(iflib_cpu_offset, &cpu_offset_mtx, "iflib_cpu_offset lock",
@@ -4682,41 +4684,291 @@ iflib_rem_pfil(if_ctx_t ctx)
pfil_head_unregister(pfil);
 }
 
+
+/*
+ * Advance forward by n members of the cpuset ctx->ifc_cpus starting from
+ * cpuid and wrapping as necessary.
+ */
+static unsigned int
+cpuid_advance(if_ctx_t ctx, unsigned int cpuid, unsigned int n)
+{
+   unsigned int first_valid;
+   unsigned int last_valid;
+
+   /* cpuid should always be in the valid set */
+   MPASS(CPU_ISSET(cpuid, &ctx->ifc_cpus));
+
+   /* valid set should never be empty */
+   MPASS(!CPU_EMPTY(&ctx->ifc_cpus));
+
+   first_valid = CPU_FFS(&ctx->ifc_cpus) - 1;
+   last_valid = CPU_FLS(&ctx->ifc_cpus) - 1;
+   n = n % CPU_COUNT(&ctx->ifc_cpus);
+   while (n > 0) {
+   do {
+   cpuid++;
+   if (cpuid > last_valid)
+   cpuid = first_valid;
+   } while (!CPU_ISSET(cpuid, &ctx->ifc_cpus));
+   n--;
+   }
+
+   return (cpuid);
+}
+
+#if defined(SMP) && defined(SCHED_ULE)
+extern struct cpu_group *cpu_top;  /* CPU topology */
+
+static int
+find_child_with_core(int cpu, struct cpu_group *grp)
+{
+   int i;
+
+   if (grp->cg_children == 0)
+   return -1;
+
+   MPASS(grp->cg_child);
+   for (i = 0; i < grp->cg_children; i++) {
+   if (CPU_ISSET(cpu, &grp->cg_child[i].cg_mask))
+   return i;
+   }
+
+   return -1;
+}
+
+
+/*
+ * Find an L2 neighbor of the given CPU or return -1 if none found.  This
+ * does not distinguish among multiple L2 neighbors if the given CPU has
+ * more than one (it will always return the same result in that case).
+ */
+static int
+find_l2_neighbor(int cpu)
+{
+   struct cpu_group *grp;
+   int i;
+
+   grp = cpu_top;
+   if (grp == NULL)
+   return -1;
+
+   /*
+* Find the smallest CPU group that contains the given core.
+*/
+   i = 0;
+   while ((i = find_child_with_core(cpu, grp)) != -1) {
+   /*
+* If the smallest group containing the given CPU has less
+* than two members, we conclude the given CPU has no
+* L2 neighbor.
+*/
+   if (grp->cg_child[i].cg_c

git: 0f6bea61edb4 - main - e1000: Improve device name strings

2021-04-25 Thread Kevin Bowling
The branch main has been updated by kbowling (ports committer):

URL: 
https://cgit.FreeBSD.org/src/commit/?id=0f6bea61edb4d055fe6e340aab3685054a582020

commit 0f6bea61edb4d055fe6e340aab3685054a582020
Author: Kevin Bowling 
AuthorDate: 2021-04-21 05:27:48 +
Commit: Kevin Bowling 
CommitDate: 2021-04-26 05:08:54 +

e1000: Improve device name strings

This is just clerical work to ease bug triage and may be used to set
expectations around the ability for anyone in the community to perform
testing and development on older parts (this driver covers over 20 years
of silicon)

Reviewed by:erj
Approved by:markj
Sponsored by:   Pink Floyd - Any Colour You Like (in kind)
Differential Revision:  https://reviews.freebsd.org/D29872
---
 sys/dev/e1000/if_em.c | 366 +-
 1 file changed, 183 insertions(+), 183 deletions(-)

diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index 6f711196c228..cd40d98819d0 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -51,195 +51,195 @@ char em_driver_version[] = "7.6.1-k";
 
 static pci_vendor_info_t em_vendor_info_array[] =
 {
-   /* Intel(R) PRO/1000 Network Connection - Legacy em*/
-   PVID(0x8086, E1000_DEV_ID_82540EM, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82540EM_LOM, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82540EP, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82540EP_LOM, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82540EP_LP, "Intel(R) PRO/1000 Network 
Connection"),
-
-   PVID(0x8086, E1000_DEV_ID_82541EI, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82541ER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82541ER_LOM, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82541EI_MOBILE, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82541GI, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82541GI_LF, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82541GI_MOBILE, "Intel(R) PRO/1000 Network 
Connection"),
-
-   PVID(0x8086, E1000_DEV_ID_82542, "Intel(R) PRO/1000 Network 
Connection"),
-
-   PVID(0x8086, E1000_DEV_ID_82543GC_FIBER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82543GC_COPPER, "Intel(R) PRO/1000 Network 
Connection"),
-
-   PVID(0x8086, E1000_DEV_ID_82544EI_COPPER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82544EI_FIBER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82544GC_COPPER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82544GC_LOM, "Intel(R) PRO/1000 Network 
Connection"),
-
-   PVID(0x8086, E1000_DEV_ID_82545EM_COPPER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82545EM_FIBER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82545GM_COPPER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82545GM_FIBER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82545GM_SERDES, "Intel(R) PRO/1000 Network 
Connection"),
-
-   PVID(0x8086, E1000_DEV_ID_82546EB_COPPER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82546EB_FIBER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82546EB_QUAD_COPPER, "Intel(R) PRO/1000 
Network Connection"),
-   PVID(0x8086, E1000_DEV_ID_82546GB_COPPER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82546GB_FIBER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82546GB_SERDES, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82546GB_PCIE, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82546GB_QUAD_COPPER, "Intel(R) PRO/1000 
Network Connection"),
-   PVID(0x8086, E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3, "Intel(R) PRO/1000 
Network Connection"),
-
-   PVID(0x8086, E1000_DEV_ID_82547EI, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82547EI_MOBILE, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82547GI, "Intel(R) PRO/1000 Network 
Connection"),
-
-   /* Intel(R) PRO/1000 Network Connection - em */
-   PVID(0x8086, E1000_DEV_ID_82571EB_COPPER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82571EB_FIBER, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82571EB_SERDES, "Intel(R) PRO/1000 Network 
Connection"),
-   PVID(0x8086, E1000_DEV_ID_82571EB_SERDES_DUAL, "Intel(R) PRO/1000 
Network Connection"),
-   PVID(0x8086, E1000_DEV_ID_82571E