From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 18:34:11 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AD656993 for ; Mon, 29 Jul 2013 18:34:11 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-oa0-f43.google.com (mail-oa0-f43.google.com [209.85.219.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 73A8027A2 for ; Mon, 29 Jul 2013 18:34:10 +0000 (UTC) Received: by mail-oa0-f43.google.com with SMTP id i10so8720889oag.16 for ; Mon, 29 Jul 2013 11:34:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:x-priority :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=bmz94YyDrTpr9oVE2lz+bEsdSfVB/dcjpy11m+d8Eic=; b=HqiQiTCFZxnM6q723f+oxMSL0J488jlEABXwdm+mSzyEhjeXqQNWMV7C3e4HNsXN7X PHMgcdV6gm5k2ZXjF1KbNmzzSxfzwbfrjQ9MYHZCRfP1KM4qWt2YOkL513XHUjZOoGm2 f3pLZOAhdNAt6vuYjXbJ7ENIvP7Qv64naUB5n8bGgssw3WCPt7JS49UM4wuttFESMNGv r8X9yhbIgvhICnAzfYO+Q40S9/izB4/IRLGfJI4l64WyWFTBmnWrpLsrMJZykKAt80pl ykpkvH+K64x4gj36GU3/plxZUNbFYHAXRNl43UPRfmSzNbK1F/3hvWwBOgUO/OWy/fh2 o7hw== X-Received: by 10.182.142.129 with SMTP id rw1mr4554697obb.67.1375122844546; Mon, 29 Jul 2013 11:34:04 -0700 (PDT) Received: from monkey-bot.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPSA id fk3sm89036646obb.2.2013.07.29.11.34.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Jul 2013 11:34:03 -0700 (PDT) Sender: Warner Losh Subject: Re: My WLI-UC-GNM up crash Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh X-Priority: 3 (Normal) In-Reply-To: Date: Mon, 29 Jul 2013 12:34:00 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <3571E4A7-D153-448E-A234-302C9C5603E9@bsdimp.com> References: To: Hans Petter Selasky X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQnZfLCem9top0/maCiGMWkHhWdOb+wwikxL0obgXetzyM08tR3I4JGsmCc05U5e5CWYNyju Cc: freebsd-wireless@freebsd.org, freebsd-arm X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 18:34:11 -0000 On Jul 29, 2013, at 11:58 AM, Hans Petter Selasky wrote: > The aligned will make sure that the structure gets padded properly to = the size specified. Only on ARM/MIPS etc, structures get automatically = aligned according to the element in the structure requiring the greatest = alignment. I'd turn this around and say only on x86 do structures not get aligned = this way. On any riscy architecture, unaligned accesses are expensive, = which is why the ABI there mandates this. > I've test-compiled the USB WLAN drivers, and the aligned makes a = difference. The problem is that the radiotap header skews some following = elements, so that they are no longer aligned. The radiotap header itself = is packed, and this is not a problem. This suggests a bigger problem. How is the radiotap header being = popualted? Is it by DMA or programmatically? If by DMA then we have = cache line sharing, which is bad. If by program, why is it packed to = start with? Warner > --HPS >=20 > =20 > -----Original message----- > > From:Warner Losh > > Sent: Monday 29th July 2013 17:04 > > To: Adrian Chadd > > Cc: Hans Petter Selasky ; = freebsd-arm ; freebsd-wireless@freebsd.org > > Subject: Re: My WLI-UC-GNM up crash > >=20 > > Aren't structures already aligned to 4 bytes when placed inside = other structures (unless marked __packed)? > >=20 > > Warner > >=20 > > On Jul 28, 2013, at 11:50 AM, Adrian Chadd wrote: > >=20 > > > As long as that results in the radiotap structures being 4 or 8 = byte > > > padded when it's embedded in the softc - then yes, indeed. > > >=20 > > > Xiao, can you try? > > >=20 > > >=20 > > > -adrian > > >=20 > > > On 28 July 2013 03:35, Hans Petter Selasky = wrote: > > >> Hi, > > >>=20 > > >> Can you try the attached patch? > > >>=20 > > >> --HPS > > > _______________________________________________ > > > freebsd-arm@freebsd.org mailing list > > > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > > > To unsubscribe, send any mail to = "freebsd-arm-unsubscribe@freebsd.org" > >=20 > >=20