Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if_lagg.c
Show First 20 Lines • Show All 390 Lines • ▼ Show 20 Lines | lagg_proto_start(struct lagg_softc *sc, struct mbuf *m) | ||||
return (lagg_protos[sc->sc_proto].pr_start(sc, m)); | return (lagg_protos[sc->sc_proto].pr_start(sc, m)); | ||||
} | } | ||||
static inline struct mbuf * | static inline struct mbuf * | ||||
lagg_proto_input(struct lagg_softc *sc, struct lagg_port *lp, struct mbuf *m) | lagg_proto_input(struct lagg_softc *sc, struct lagg_port *lp, struct mbuf *m) | ||||
{ | { | ||||
return (lagg_protos[sc->sc_proto].pr_input(sc, lp, m)); | return (lagg_protos[sc->sc_proto].pr_input(sc, lp, m)); | ||||
melifaro: I'd suggest either removing the `lagg_proto_input()` altogether (as it just returns `m` in the… | |||||
} | } | ||||
static int | static int | ||||
lagg_proto_addport(struct lagg_softc *sc, struct lagg_port *lp) | lagg_proto_addport(struct lagg_softc *sc, struct lagg_port *lp) | ||||
{ | { | ||||
if (lagg_protos[sc->sc_proto].pr_addport == NULL) | if (lagg_protos[sc->sc_proto].pr_addport == NULL) | ||||
return (0); | return (0); | ||||
▲ Show 20 Lines • Show All 1,757 Lines • ▼ Show 20 Lines | lagg_input_ethernet(struct ifnet *ifp, struct mbuf *m) | ||||
NET_EPOCH_ASSERT(); | NET_EPOCH_ASSERT(); | ||||
if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || | if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || | ||||
lp->lp_detaching != 0 || | lp->lp_detaching != 0 || | ||||
sc->sc_proto == LAGG_PROTO_NONE) { | sc->sc_proto == LAGG_PROTO_NONE) { | ||||
m_freem(m); | m_freem(m); | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
m = lagg_proto_input(sc, lp, m); | |||||
Not Done Inline ActionsWhile testing lacp setup, tcpdump shows LACP packets on lagg interfaces. LACP packets should receive or be sent on lagg child interfaces but striped out from lagg interfaces. So bpf filter on lagg interfaces should not able to see them. I'm not certain about it. Can someone comment on it? zlei: While testing lacp setup, tcpdump shows LACP packets on lagg interfaces.
LACP packets should… | |||||
if (m != NULL) { | |||||
ETHER_BPF_MTAP(scifp, m); | ETHER_BPF_MTAP(scifp, m); | ||||
m = lagg_proto_input(sc, lp, m); | if ((scifp->if_flags & IFF_MONITOR) != 0) { | ||||
if (m != NULL && (scifp->if_flags & IFF_MONITOR) != 0) { | |||||
m_freem(m); | m_freem(m); | ||||
m = NULL; | m = NULL; | ||||
} | } | ||||
} | |||||
#ifdef DEV_NETMAP | #ifdef DEV_NETMAP | ||||
if (m != NULL && scifp->if_capenable & IFCAP_NETMAP) { | if (m != NULL && scifp->if_capenable & IFCAP_NETMAP) { | ||||
scifp->if_input(scifp, m); | scifp->if_input(scifp, m); | ||||
m = NULL; | m = NULL; | ||||
} | } | ||||
#endif /* DEV_NETMAP */ | #endif /* DEV_NETMAP */ | ||||
Show All 10 Lines | lagg_input_infiniband(struct ifnet *ifp, struct mbuf *m) | ||||
NET_EPOCH_ASSERT(); | NET_EPOCH_ASSERT(); | ||||
if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || | if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || | ||||
lp->lp_detaching != 0 || | lp->lp_detaching != 0 || | ||||
sc->sc_proto == LAGG_PROTO_NONE) { | sc->sc_proto == LAGG_PROTO_NONE) { | ||||
m_freem(m); | m_freem(m); | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
m = lagg_proto_input(sc, lp, m); | |||||
if (m != NULL) { | |||||
infiniband_bpf_mtap(scifp, m); | infiniband_bpf_mtap(scifp, m); | ||||
m = lagg_proto_input(sc, lp, m); | if ((scifp->if_flags & IFF_MONITOR) != 0) { | ||||
if (m != NULL && (scifp->if_flags & IFF_MONITOR) != 0) { | |||||
m_freem(m); | m_freem(m); | ||||
m = NULL; | m = NULL; | ||||
} | |||||
} | } | ||||
return (m); | return (m); | ||||
} | } | ||||
static int | static int | ||||
lagg_media_change(struct ifnet *ifp) | lagg_media_change(struct ifnet *ifp) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 484 Lines • Show Last 20 Lines |
I'd suggest either removing the lagg_proto_input() altogether (as it just returns m in the current code) OR
having a default handler function, so do you don't have the branch here.