Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F164387966
D38609.id117301.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D38609.id117301.diff
View Options
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -1498,7 +1498,7 @@
{
struct linux_ifname_cb_s arg;
- IFNET_RLOCK_ASSERT();
+ NET_EPOCH_ASSERT();
arg.ifp = ifp;
arg.buffer = buffer;
@@ -1557,6 +1557,8 @@
static int
linprocfs_donetdev(PFS_FILL_ARGS)
{
+ struct epoch_tracker et;
+
sbuf_printf(sb, "%6s|%58s|%s\n"
"%6s|%58s|%58s\n",
"Inter-", " Receive", " Transmit",
@@ -1565,9 +1567,9 @@
"bytes packets errs drop fifo colls carrier compressed");
CURVNET_SET(TD_TO_VNET(curthread));
- IFNET_RLOCK();
+ NET_EPOCH_ENTER(et);
if_foreach(linprocfs_donetdev_cb, sb);
- IFNET_RUNLOCK();
+ NET_EPOCH_EXIT(et);
CURVNET_RESTORE();
return (0);
@@ -1630,15 +1632,16 @@
.sb = sb
};
uint32_t fibnum = curthread->td_proc->p_fibnum;
+ struct epoch_tracker et;
sbuf_printf(w.sb, "%-127s\n", "Iface\tDestination\tGateway "
"\tFlags\tRefCnt\tUse\tMetric\tMask\t\tMTU"
"\tWindow\tIRTT");
CURVNET_SET(TD_TO_VNET(curthread));
- IFNET_RLOCK();
+ NET_EPOCH_ENTER(et);
rib_walk(fibnum, AF_INET, false, linux_route_print, &w);
- IFNET_RUNLOCK();
+ NET_EPOCH_EXIT(et);
CURVNET_RESTORE();
return (0);
diff --git a/sys/compat/linux/linux.c b/sys/compat/linux/linux.c
--- a/sys/compat/linux/linux.c
+++ b/sys/compat/linux/linux.c
@@ -280,6 +280,7 @@
struct ifnet *
ifname_linux_to_bsd(struct thread *td, const char *lxname, char *bsdname)
{
+ struct epoch_tracker et;
struct ifname_linux_to_bsd_cb_s cbs = {};
int len;
char *ep;
@@ -300,9 +301,9 @@
cbs.is_eth = (len == 3 && strncmp(lxname, "eth", len) == 0);
CURVNET_SET(TD_TO_VNET(td));
- IFNET_RLOCK();
+ NET_EPOCH_ENTER(et);
if_foreach(ifname_linux_to_bsd_cb, &cbs);
- IFNET_RUNLOCK();
+ NET_EPOCH_EXIT(et);
CURVNET_RESTORE();
if (cbs.ifp != NULL && bsdname != NULL)
strlcpy(bsdname, if_name(cbs.ifp), IFNAMSIZ);
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
--- a/sys/compat/linux/linux_ioctl.c
+++ b/sys/compat/linux/linux_ioctl.c
@@ -2117,6 +2117,7 @@
static int
linux_ioctl_ifname(struct thread *td, struct l_ifreq *uifr)
{
+ struct epoch_tracker et;
struct linux_ioctl_ifname_cb_s cbs;
struct l_ifreq ifr;
int error;
@@ -2126,14 +2127,14 @@
return (error);
CURVNET_SET(TD_TO_VNET(curthread));
- IFNET_RLOCK();
+ NET_EPOCH_ENTER(et);
cbs.index = 1; /* ifr.ifr_ifindex starts from 1 */
cbs.ethno = 0;
error = if_foreach(linux_ioctl_ifname_cb, &cbs);
if (error == 0)
error = ENODEV;
- IFNET_RUNLOCK();
+ NET_EPOCH_EXIT(et);
if (error == -1)
error = copyout(&ifr, uifr, sizeof(ifr));
CURVNET_RESTORE();
@@ -2231,6 +2232,7 @@
#else
struct ifconf ifc;
#endif
+ struct epoch_tracker et;
struct linux_ifconfig_ifaddr_cb2_s cbs;
struct sbuf *sb;
int error, full = 0;
@@ -2245,9 +2247,9 @@
/* handle the 'request buffer size' case */
if ((l_uintptr_t)ifc.ifc_buf == PTROUT(NULL)) {
ifc.ifc_len = 0;
- IFNET_RLOCK();
+ NET_EPOCH_ENTER(et);
if_foreach(linux_ifconf_ifnet_cb, &ifc);
- IFNET_RUNLOCK();
+ NET_EPOCH_EXIT(et);
error = copyout(&ifc, uifc, sizeof(ifc));
CURVNET_RESTORE();
return (error);
@@ -2271,9 +2273,9 @@
cbs.sb = sb;
/* Return all AF_INET addresses of all interfaces */
- IFNET_RLOCK();
+ NET_EPOCH_ENTER(et);
if_foreach(linux_ifconf_ifnet_cb2, &cbs);
- IFNET_RUNLOCK();
+ NET_EPOCH_EXIT(et);
if (cbs.valid_len != cbs.max_len && !full) {
sbuf_delete(sb);
diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
--- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
+++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
@@ -3150,17 +3150,18 @@
static int mlx5_enable_roce(struct mlx5_ib_dev *dev)
{
+ struct epoch_tracker et;
VNET_ITERATOR_DECL(vnet_iter);
int err;
/* Check if mlx5en net device already exists */
VNET_LIST_RLOCK();
VNET_FOREACH(vnet_iter) {
- IFNET_RLOCK();
+ NET_EPOCH_ENTER(et);
CURVNET_SET_QUIET(vnet_iter);
if_foreach(mlx5_enable_roce_if_cb, dev);
CURVNET_RESTORE();
- IFNET_RUNLOCK();
+ NET_EPOCH_EXIT(et);
}
VNET_LIST_RUNLOCK();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Aug 1, 10:30 AM (1 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35819538
Default Alt Text
D38609.id117301.diff (4 KB)
Attached To
Mode
D38609: linux: Enter network epoch before iterating over interfaces.
Attached
Detach File
Event Timeline
Log In to Comment