From owner-svn-src-head@freebsd.org Wed Nov 15 06:45:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B8D3DC133E; Wed, 15 Nov 2017 06:45:34 +0000 (UTC) (envelope-from wma@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 mx1.freebsd.org (Postfix) with ESMTPS id 560B7801F5; Wed, 15 Nov 2017 06:45:34 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAF6jXUn096878; Wed, 15 Nov 2017 06:45:33 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAF6jXdS096877; Wed, 15 Nov 2017 06:45:33 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201711150645.vAF6jXdS096877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Wed, 15 Nov 2017 06:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325840 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: wma X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 325840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Nov 2017 06:45:34 -0000 Author: wma Date: Wed Nov 15 06:45:33 2017 New Revision: 325840 URL: https://svnweb.freebsd.org/changeset/base/325840 Log: 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 Modified: head/sys/dev/cxgbe/adapter.h Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Wed Nov 15 03:46:59 2017 (r325839) +++ head/sys/dev/cxgbe/adapter.h Wed Nov 15 06:45:33 2017 (r325840) @@ -424,7 +424,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 */ @@ -695,7 +695,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; @@ -807,7 +807,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;