MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ng_source_store_output_ifp

Function ng_source_store_output_ifp

freebsd/netgraph/ng_source.c:615–641  ·  view source on GitHub ↗

* Set sc->output_ifp to point to the struct ifnet of the interface * reached via our output hook. */

Source from the content-addressed store, hash-verified

613 * reached via our output hook.
614 */
615static int
616ng_source_store_output_ifp(sc_p sc, char *ifname)
617{
618 struct ifnet *ifp;
619
620 ifp = ifunit(ifname);
621
622 if (ifp == NULL) {
623 printf("%s: can't find interface %s\n", __func__, ifname);
624 return (EINVAL);
625 }
626 sc->output_ifp = ifp;
627
628#if 1
629 /* XXX mucking with a drivers ifqueue size is ugly but we need it
630 * to queue a lot of packets to get close to line rate on a gigabit
631 * interface with small packets.
632 * XXX we should restore the original value at stop or disconnect
633 */
634 if (ifp->if_snd.ifq_maxlen < NG_SOURCE_DRIVER_IFQ_MAXLEN) {
635 printf("ng_source: changing ifq_maxlen from %d to %d\n",
636 ifp->if_snd.ifq_maxlen, NG_SOURCE_DRIVER_IFQ_MAXLEN);
637 ifp->if_snd.ifq_maxlen = NG_SOURCE_DRIVER_IFQ_MAXLEN;
638 }
639#endif
640 return (0);
641}
642
643/*
644 * Set the attached ethernet node's ethernet source address override flag.

Callers 1

ng_source_rcvmsgFunction · 0.85

Calls 2

ifunitFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected