Date: Thu, 24 May 2018 07:38:46 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334136 - head/sys/dev/cxgbe Message-ID: <201805240738.w4O7ckeL096025@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Thu May 24 07:38:46 2018 New Revision: 334136 URL: https://svnweb.freebsd.org/changeset/base/334136 Log: cxgbe(4): Slightly simpler needs_<foo> functions. Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu May 24 07:18:49 2018 (r334135) +++ head/sys/dev/cxgbe/t4_sge.c Thu May 24 07:38:46 2018 (r334136) @@ -2062,14 +2062,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 @@ -2078,9 +2071,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 @@ -2089,10 +2080,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 @@ -2101,13 +2090,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?201805240738.w4O7ckeL096025>