From owner-svn-src-stable-11@freebsd.org Wed Oct 17 00:45:02 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E40E10E66CA; Wed, 17 Oct 2018 00:45:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 394FA88ACC; Wed, 17 Oct 2018 00:45:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A39824304; Wed, 17 Oct 2018 00:45:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9H0j1Aw054122; Wed, 17 Oct 2018 00:45:01 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9H0j1dw054119; Wed, 17 Oct 2018 00:45:01 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810170045.w9H0j1dw054119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 17 Oct 2018 00:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339396 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 339396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2018 00:45:02 -0000 Author: np Date: Wed Oct 17 00:45:01 2018 New Revision: 339396 URL: https://svnweb.freebsd.org/changeset/base/339396 Log: MFC r325840, r327811, and r329701. r325840: CXGBE: fix big-endian behaviour The setbit/clearbit pair casts the bitfield pointer to uint8_t* which effectively treats its contents as little-endian variable. The ffs() function accepts int as the parameter, which is big-endian. Use uint8_t here to avoid mismatch, as we have only 4 doorbells. Submitted by: Wojciech Macek Reviewed by: np Obtained from: Semihalf Sponsored by: QCM Technologies Differential revision: https://reviews.freebsd.org/D13084 r327811: CXGBE: fix get_filt to be endianness-aware Unconditional 32-bit shift is not endianness-safe. Modify the logic to work both on LE and BE. Submitted by: Wojciech Macek Reviewed by: np Obtained from: Semihalf Sponsored by: IBM, QCM Technologies Differential revision: https://reviews.freebsd.org/D13102 r329701: CXGBE: implement prefetch on non-Intel architectures Submitted by: Michal Stanek Obtained from: Semihalf Reviewed by: np, pdk@semihalf.com Sponsored by: IBM, QCM Technologies Differential revision: https://reviews.freebsd.org/D14452 Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Wed Oct 17 00:27:21 2018 (r339395) +++ stable/11/sys/dev/cxgbe/adapter.h Wed Oct 17 00:45:01 2018 (r339396) @@ -70,7 +70,7 @@ prefetch(void *x) __asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x)); } #else -#define prefetch(x) +#define prefetch(x) __builtin_prefetch(x) #endif #ifndef SYSCTL_ADD_UQUAD @@ -422,7 +422,7 @@ struct sge_eq { struct mtx eq_lock; struct tx_desc *desc; /* KVA of descriptor ring */ - uint16_t doorbells; + uint8_t doorbells; volatile uint32_t *udb; /* KVA of doorbell (lies within BAR2) */ u_int udb_qid; /* relative qid within the doorbell page */ uint16_t sidx; /* index of the entry with the status page */ @@ -692,7 +692,7 @@ struct sge_nm_txq { uint16_t equiqidx; /* EQUIQ last requested at this pidx */ uint16_t equeqidx; /* EQUEQ last requested at this pidx */ uint16_t dbidx; /* pidx of the most recent doorbell */ - uint16_t doorbells; + uint8_t doorbells; volatile uint32_t *udb; u_int udb_qid; u_int cntxt_id; @@ -804,7 +804,7 @@ struct adapter { struct l2t_data *l2t; /* L2 table */ struct tid_info tids; - uint16_t doorbells; + uint8_t doorbells; int offload_map; /* ports with IFCAP_TOE enabled */ int active_ulds; /* ULDs activated on this adapter */ int flags; Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Wed Oct 17 00:27:21 2018 (r339395) +++ stable/11/sys/dev/cxgbe/t4_sge.c Wed Oct 17 00:45:01 2018 (r339396) @@ -4731,13 +4731,13 @@ get_flit(struct sglist_seg *segs, int nsegs, int idx) switch (idx % 3) { case 0: { - __be64 rc; + uint64_t rc; - rc = htobe32(segs[i].ss_len); + rc = (uint64_t)segs[i].ss_len << 32; if (i + 1 < nsegs) - rc |= (uint64_t)htobe32(segs[i + 1].ss_len) << 32; + rc |= (uint64_t)(segs[i + 1].ss_len); - return (rc); + return (htobe64(rc)); } case 1: return (htobe64(segs[i].ss_paddr));