| 2496 | } |
| 2497 | |
| 2498 | static int |
| 2499 | lagg_lb_start(struct lagg_softc *sc, struct mbuf *m) |
| 2500 | { |
| 2501 | struct lagg_lb *lb = (struct lagg_lb *)sc->sc_psc; |
| 2502 | struct lagg_port *lp = NULL; |
| 2503 | uint32_t p = 0; |
| 2504 | |
| 2505 | if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) && |
| 2506 | M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) |
| 2507 | p = m->m_pkthdr.flowid >> sc->flowid_shift; |
| 2508 | else |
| 2509 | p = m_ether_tcpip_hash(sc->sc_flags, m, lb->lb_key); |
| 2510 | p %= sc->sc_count; |
| 2511 | lp = lb->lb_ports[p]; |
| 2512 | |
| 2513 | /* |
| 2514 | * Check the port's link state. This will return the next active |
| 2515 | * port if the link is down or the port is NULL. |
| 2516 | */ |
| 2517 | if ((lp = lagg_link_active(sc, lp)) == NULL) { |
| 2518 | if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); |
| 2519 | m_freem(m); |
| 2520 | return (ENETDOWN); |
| 2521 | } |
| 2522 | |
| 2523 | /* Send mbuf */ |
| 2524 | return (lagg_enqueue(lp->lp_ifp, m)); |
| 2525 | } |
| 2526 | |
| 2527 | static struct mbuf * |
| 2528 | lagg_lb_input(struct lagg_softc *sc, struct lagg_port *lp, struct mbuf *m) |
nothing calls this directly
no test coverage detected