Skip to content

Commit

Permalink
Introduce flag IFF_NEEDSEPOCH that marks Ethernet interfaces that
Browse files Browse the repository at this point in the history
supposedly may call into ether_input() without network epoch.

They all need to be reviewed before 13.0-RELEASE.  Some may need
be fixed.  The flag is not planned to be used in the kernel for
a long time.
  • Loading branch information
glebius committed Jan 23, 2020
1 parent 0786bfc commit f425ba9
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 10 deletions.
3 changes: 2 additions & 1 deletion sys/dev/altera/atse/if_atse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,8 @@ atse_attach(device_t dev)
}
ifp->if_softc = sc;
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
IFF_NEEDSEPOCH;
ifp->if_ioctl = atse_ioctl;
ifp->if_transmit = atse_transmit;
ifp->if_qflush = atse_qflush;
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/beri/virtio/network/if_vtbe.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ vtbe_attach(device_t dev)
ifp->if_softc = sc;
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX |
IFF_MULTICAST | IFF_PROMISC);
IFF_MULTICAST | IFF_PROMISC | IFF_NEEDSEPOCH);
ifp->if_capabilities = IFCAP_VLAN_MTU;
ifp->if_capenable = ifp->if_capabilities;
ifp->if_start = vtbe_txstart;
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/dpaa/if_dtsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ dtsec_attach(device_t dev)

ifp->if_softc = sc;
ifp->if_mtu = ETHERMTU; /* TODO: Configure */
ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST;
ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_NEEDSEPOCH;
ifp->if_init = dtsec_if_init;
ifp->if_start = dtsec_if_start;
ifp->if_ioctl = dtsec_if_ioctl;
Expand Down
3 changes: 2 additions & 1 deletion sys/dev/hyperv/netvsc/if_hn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2362,7 +2362,8 @@ hn_attach(device_t dev)
*/

ifp->if_baudrate = IF_Gbps(10);
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
IFF_NEEDSEPOCH;
ifp->if_ioctl = hn_ioctl;
ifp->if_init = hn_init;
#ifdef HN_IFSTART_SUPPORT
Expand Down
3 changes: 2 additions & 1 deletion sys/dev/if_ndis/if_ndis.c
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,8 @@ ndis_ifattach(struct ndis_softc *sc)

if_initname(ifp, device_get_name(sc->ndis_dev),
device_get_unit(sc->ndis_dev));
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
IFF_NEEDSEPOCH;
ifp->if_ioctl = ndis_ifioctl;
ifp->if_start = ndis_ifstart;
ifp->if_init = ndis_init;
Expand Down
3 changes: 2 additions & 1 deletion sys/dev/ntb/if_ntb/if_ntb.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ ntb_net_attach(device_t dev)

if_setinitfn(ifp, ntb_net_init);
if_setsoftc(ifp, sc);
if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST);
if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
IFF_NEEDSEPOCH);
if_setioctlfn(ifp, ntb_ioctl);
if_settransmitfn(ifp, ntb_transmit);
if_setqflushfn(ifp, ntb_qflush);
Expand Down
3 changes: 2 additions & 1 deletion sys/dev/sbni/if_sbni.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ sbni_attach(struct sbni_softc *sc, int unit, struct sbni_flags flags)
ifp->if_baudrate =
(csr0 & 0x01 ? 500000 : 2000000) / (1 << flags.rate);

ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
IFF_NEEDSEPOCH;

mtx_init(&sc->lock, ifp->if_xname, MTX_NETWORK_LOCK, MTX_DEF);
callout_init_mtx(&sc->wch, &sc->lock, 0);
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/xen/netback/netback.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ xnb_connect_comms(struct xnb_softc *xnb)
xnb->evtchn,
/*filter*/NULL,
xnb_intr, /*arg*/xnb,
INTR_TYPE_BIO | INTR_MPSAFE,
INTR_TYPE_NET | INTR_MPSAFE,
&xnb->xen_intr_handle);
if (error != 0) {
(void)xnb_disconnect(xnb);
Expand Down
3 changes: 2 additions & 1 deletion sys/mips/nlm/dev/net/xlpge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,8 @@ nlm_xlpge_ifinit(struct nlm_xlpge_softc *sc)
}
ifp->if_softc = sc;
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST |
IFF_NEEDSEPOCH;
sc->if_flags = ifp->if_flags;
/*ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_VLAN_HWTAGGING;*/
ifp->if_capabilities = 0;
Expand Down
2 changes: 1 addition & 1 deletion sys/net/if.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ struct if_data {
#define IFF_DEBUG 0x4 /* (n) turn on debugging */
#define IFF_LOOPBACK 0x8 /* (i) is a loopback net */
#define IFF_POINTOPOINT 0x10 /* (i) is a point-to-point link */
/* 0x20 was IFF_SMART */
#define IFF_NEEDSEPOCH 0x20 /* (i) calls if_input w/o epoch */
#define IFF_DRV_RUNNING 0x40 /* (d) resources allocated */
#define IFF_NOARP 0x80 /* (n) no address resolution protocol */
#define IFF_PROMISC 0x100 /* (n) receive all packets */
Expand Down

0 comments on commit f425ba9

Please sign in to comment.