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

Function if_hw_tsomax_common

freebsd/net/if.c:809–831  ·  view source on GitHub ↗

* Compute the least common TSO limit. */

Source from the content-addressed store, hash-verified

807 * Compute the least common TSO limit.
808 */
809void
810if_hw_tsomax_common(if_t ifp, struct ifnet_hw_tsomax *pmax)
811{
812 /*
813 * 1) If there is no limit currently, take the limit from
814 * the network adapter.
815 *
816 * 2) If the network adapter has a limit below the current
817 * limit, apply it.
818 */
819 if (pmax->tsomaxbytes == 0 || (ifp->if_hw_tsomax != 0 &&
820 ifp->if_hw_tsomax < pmax->tsomaxbytes)) {
821 pmax->tsomaxbytes = ifp->if_hw_tsomax;
822 }
823 if (pmax->tsomaxsegcount == 0 || (ifp->if_hw_tsomaxsegcount != 0 &&
824 ifp->if_hw_tsomaxsegcount < pmax->tsomaxsegcount)) {
825 pmax->tsomaxsegcount = ifp->if_hw_tsomaxsegcount;
826 }
827 if (pmax->tsomaxsegsize == 0 || (ifp->if_hw_tsomaxsegsize != 0 &&
828 ifp->if_hw_tsomaxsegsize < pmax->tsomaxsegsize)) {
829 pmax->tsomaxsegsize = ifp->if_hw_tsomaxsegsize;
830 }
831}
832
833/*
834 * Update TSO limit of a network adapter.

Callers 2

lagg_capabilitiesFunction · 0.85
vlan_capabilitiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected