Date: Mon, 29 Apr 2019 00:22:35 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346861 - stable/11/sys/dev/cxgbe Message-ID: <201904290022.x3T0MZUc071445@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Mon Apr 29 00:22:34 2019 New Revision: 346861 URL: https://svnweb.freebsd.org/changeset/base/346861 Log: MFC r334136: cxgbe(4): Slightly simpler needs_<foo> functions. Modified: stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 00:16:20 2019 (r346860) +++ stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 00:22:34 2019 (r346861) @@ -2053,14 +2053,7 @@ needs_tso(struct mbuf *m) M_ASSERTPKTHDR(m); - if (m->m_pkthdr.csum_flags & CSUM_TSO) { - KASSERT(m->m_pkthdr.tso_segsz > 0, - ("%s: TSO requested in mbuf %p but MSS not provided", - __func__, m)); - return (1); - } - - return (0); + return (m->m_pkthdr.csum_flags & CSUM_TSO); } static inline int @@ -2069,9 +2062,7 @@ needs_l3_csum(struct mbuf *m) M_ASSERTPKTHDR(m); - if (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO)) - return (1); - return (0); + return (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO)); } static inline int @@ -2080,10 +2071,8 @@ needs_l4_csum(struct mbuf *m) M_ASSERTPKTHDR(m); - if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_UDP_IPV6 | - CSUM_TCP_IPV6 | CSUM_TSO)) - return (1); - return (0); + return (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_UDP_IPV6 | + CSUM_TCP_IPV6 | CSUM_TSO)); } static inline int @@ -2092,13 +2081,7 @@ needs_vlan_insertion(struct mbuf *m) M_ASSERTPKTHDR(m); - if (m->m_flags & M_VLANTAG) { - KASSERT(m->m_pkthdr.ether_vtag != 0, - ("%s: HWVLAN requested in mbuf %p but tag not provided", - __func__, m)); - return (1); - } - return (0); + return (m->m_flags & M_VLANTAG); } static void *
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904290022.x3T0MZUc071445>