Date: Sat, 14 Jan 2017 10:39:00 +0000 (UTC) From: Andrew Rybchenko <arybchik@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r312165 - stable/10/sys/dev/sfxge Message-ID: <201701141039.v0EAd0EH005687@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arybchik Date: Sat Jan 14 10:39:00 2017 New Revision: 312165 URL: https://svnweb.freebsd.org/changeset/base/312165 Log: MFC r311877 sfxge(4): avoid unnecessary mbuf data prefetch Unnecessary prefetch just loads HW prefetcher and displaces other cache entries (which could be really useful). If we parse mbuf for TSO early and use firmware-assisted TSO, we do not expect mbuf data access when we compose firmware-assisted TSO (v1 or v2) option descriptors. If packet header needs to be linearized or finally FATSO cannot be used because of, for example, too big header, we do not care about a bit more performance degradation because of prefetch absence (it is better to optimize more common case). Sponsored by: Solarflare Communications, Inc. Modified: stable/10/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Sat Jan 14 10:38:39 2017 (r312164) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Sat Jan 14 10:39:00 2017 (r312165) @@ -356,8 +356,22 @@ static int sfxge_tx_queue_mbuf(struct sf KASSERT(!txq->blocked, ("txq->blocked")); +#if SFXGE_TX_PARSE_EARLY + /* + * If software TSO is used, we still need to copy packet header, + * even if we have already parsed it early before enqueue. + */ + if ((mbuf->m_pkthdr.csum_flags & CSUM_TSO) && + (txq->tso_fw_assisted == 0)) + prefetch_read_many(mbuf->m_data); +#else + /* + * Prefetch packet header since we need to parse it and extract + * IP ID, TCP sequence number and flags. + */ if (mbuf->m_pkthdr.csum_flags & CSUM_TSO) prefetch_read_many(mbuf->m_data); +#endif if (__predict_false(txq->init_state != SFXGE_TXQ_STARTED)) { rc = EINTR;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701141039.v0EAd0EH005687>