From owner-svn-src-head@freebsd.org Fri Aug 19 10:35:37 2016 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 54F3FBBFC53; Fri, 19 Aug 2016 10:35:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (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 1B37F1453; Fri, 19 Aug 2016 10:35:36 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 62E191FE023; Fri, 19 Aug 2016 12:35:28 +0200 (CEST) Subject: Re: svn commit: r304439 - head/sys/dev/usb/net To: pyunyh@gmail.com References: <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> <20160819085511.GF1186@michelle.fasterthan.co.kr> <2e8143d4-eb32-693d-e5a4-49c380c100df@selasky.org> <20160819092223.GG1186@michelle.fasterthan.co.kr> Cc: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <63a25b6b-4503-b136-7765-7744108db1a1@selasky.org> Date: Fri, 19 Aug 2016 12:39:58 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160819092223.GG1186@michelle.fasterthan.co.kr> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Fri, 19 Aug 2016 10:35:37 -0000 On 08/19/16 11:22, YongHyeon PYUN wrote: > On Fri, Aug 19, 2016 at 11:11:56AM +0200, Hans Petter Selasky wrote: >> On 08/19/16 10:55, YongHyeon PYUN wrote: >>> I think the order is right but it was not tested on big-endian >>> systems. >> >> Hi, >> >> I'm pretty sure the ifdef is wrong, because you write the fields one at >> a time, using htole32(): >> >> txhdr.mss = 0; >> txhdr.len = htole32(AXGE_TXBYTES(m->m_pkthdr.len)); >> >> Big endian machines don't re-order variables like this. >> >> You should remove the #else part. > > Wouldn't USB stack pass txhdr structure without any > modification? And controller want to see len (low 32bits address) > first and then mss (high 32bits address). On big endian systems I > guess this should be reversed in host memory layout. This is so > confusing so I could be wrong. The USB stack passes TXHDR as-is and the host controller is byte oriented, not 64-bit word oriented. That's why the layout is the same as long as you assign per 32-bit field. --HPS