* Compute the least common TSO limit. */
| 807 | * Compute the least common TSO limit. |
| 808 | */ |
| 809 | void |
| 810 | if_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. |
no outgoing calls
no test coverage detected