* Set sc->output_ifp to point to the struct ifnet of the interface * reached via our output hook. */
| 613 | * reached via our output hook. |
| 614 | */ |
| 615 | static int |
| 616 | ng_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. |
no test coverage detected