Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6005127pxu; Wed, 23 Dec 2020 10:43:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdSuMtXdNHcaBxslnvkPz+WAgFJbgTASAkIGgbDFGgnTvLuRGRdhwpZqGVBb9vnRLueAf6 X-Received: by 2002:a17:906:8292:: with SMTP id h18mr26094737ejx.481.1608749036172; Wed, 23 Dec 2020 10:43:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608749036; cv=none; d=google.com; s=arc-20160816; b=Xm1PQ1MHm+CbE1CXF/9ERRKgO1pGmmjdLZC1a4t1f/GqCX+urUUCbdORA+rmEef7xR tUs92kenBFvk5a5yEOVp53rWQeBHmuGYgMRArdfajJzL/EjZ1+NU+v3PMgEFGcBBs61t TamBtJToSWubkf9dmfmCvK1AYGoJNqyuCEYLMKzLb+PWhGkOioH9ahkYvWu45oeGE67F pGvggpe1NqBE7/LwbXYVM1TK54MCvEfgiWSTJXCIZ6KOHG/zbrbD0oBwI0V7vk0MFFRN nb55It80lMLlxFlG4Jdrwtn3MKsP+1aomD1AxLFKJaPvwiKzOXtryDktIhnReOhhgqb4 N1sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=1TPp6hevPlKXGej/HglTkZRVc+jJvRT/P5hFB/pmpgk=; b=LvvLV2f7724jOKNcMMfpYmCEYNI2U6xOueajZ0tBh2K8ykToDAgblLMSn7nDiWLeEp cvy5+H/vq+BmincrFzd08N88Dr1dyTu9FnlvoujsTbKfKwt0ilkEaRKp6x7rklZH7blr /jJkFAmV+ollFIGfrqKHvmyzSiXitqCocRKAgsBbjmUl34qOYjLyrDTwGSwi6lQT0DcI 9XiqhDaC3chjzEt8ufzNn00rkwKXDLyRev/uPr8U/iwHPgLY1uf1suhSz9uh2kdCp4w4 zpGtsMzfV6kmYrADOsc7IoX27pumFkm2HhwqNseMU36ngMXjqODpcD+WyrcX1xGQmf/D iXJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t19si12201916eji.402.2020.12.23.10.43.32; Wed, 23 Dec 2020 10:43:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727410AbgLWSml (ORCPT + 99 others); Wed, 23 Dec 2020 13:42:41 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:38948 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726903AbgLWSml (ORCPT ); Wed, 23 Dec 2020 13:42:41 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1ks959-00DdSo-C0; Wed, 23 Dec 2020 19:41:55 +0100 Date: Wed, 23 Dec 2020 19:41:55 +0100 From: Andrew Lunn To: Horatiu Vultur Cc: Rasmus Villemoes , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jakub Kicinski , "David S. Miller" Subject: Re: [PATCH net 1/2] net: mrp: fix definitions of MRP test packets Message-ID: <20201223184155.GT3107610@lunn.ch> References: <20201223144533.4145-1-rasmus.villemoes@prevas.dk> <20201223144533.4145-2-rasmus.villemoes@prevas.dk> <20201223175910.2ipmowhcn63mqtqt@soft-dev3.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201223175910.2ipmowhcn63mqtqt@soft-dev3.localdomain> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > @@ -96,7 +96,7 @@ struct br_mrp_ring_test_hdr { > > __be16 state; > > __be16 transitions; > > __be32 timestamp; > > -}; > > +} __attribute__((__packed__)); > > Yes, I agree that this should be packed but it also needs to be 32 bit > alligned, so extra 2 bytes are needed. The full structure is: struct br_mrp_ring_test_hdr { __be16 prio; __u8 sa[ETH_ALEN]; __be16 port_role; __be16 state; __be16 transitions; __be32 timestamp; }; If i'm looking at this correctly, the byte offsets are: 0-1 prio 2-7 sa 8-9 port_role 10-11 state 12-13 transition With packed you get 14-17 timestamp which is not 32 bit aligned. Do you mean the whole structure must be 32 bit aligned? We need to add two reserved bytes to the end of the structure? Andrew