Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1639246rwe; Sat, 27 Aug 2022 12:48:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR6zje45KS1nbEerej5AQvHN9VwlgbFc5J4dmAMUzTBr8xeAnLAUscYSD+GvpeojEzOvrsUV X-Received: by 2002:a05:6402:35d2:b0:446:b50d:ac56 with SMTP id z18-20020a05640235d200b00446b50dac56mr10717525edc.316.1661629715477; Sat, 27 Aug 2022 12:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661629715; cv=none; d=google.com; s=arc-20160816; b=PHWWsIYyBKWN1wv4H4uDiAF11aeGUMalWaUee9L7BHQc8TM84aqGVXe0YYyoXexAYO wVcXW8ob5kuOcCNomYwiuNMdhZXoR1IN5zmf7nEph9xmEvmvYYnEa6f0djLqJoMpGO+x 29BSY7SrYuAgDqTe4+C9TnULTMA0bUY7wXcHajbeen8jRFG5asWdZSXSBEu5FuDSVfEv FU3GosjsUnEuyWx7ePdQpmHA2qD3Cf0Fo8D5mN2CSywCqy3NUirULF8e/ACRBFtPXVsn Rs1NC6cEeFn4zz7cZJG1wsh8grJB1ayNu2gPqFeg5ObYELcUoU5jT1K/81n+0erLQAj7 ZSVQ== 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:dkim-signature; bh=uD+63HgUhkxXVowO2tofksrYfh23EPdwjmkCclgm85w=; b=ioET/pD65VrNT365UHTfoCV+TWPQ/Had27QfsXcNbvkSi85zLt6TL0dxH/UQ2OoSOo BSu9XVzMCc/5X1M0VRHO3+qzCBTjAQhIl92z3867n9OCwbHKU1dOaHprGDRy34SoU8qb GJlvc5pcOvHmBzYjfCVgEuxmdhAqkjovRBWy+kiRrB2/AlOVKeznVMrQKxUxCUV7hjlo lJO3rbYKC0v/T0wVg9c9BK4f0ngMvJHaxzEpoWz5n8RCiR3PdL607zqPu9ALtAzqBvFc aVZnIxIjeQEuHQZHO2TgCt7yK2ssAHr2V+s/RLpHDCj55acoVDOru6AeFDf2VAAhZ+el Kn2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=XVfFEUef; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z12-20020a05640240cc00b0044711ea363esi4127546edb.21.2022.08.27.12.48.09; Sat, 27 Aug 2022 12:48:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=XVfFEUef; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229893AbiH0Sy3 (ORCPT + 99 others); Sat, 27 Aug 2022 14:54:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbiH0Sy2 (ORCPT ); Sat, 27 Aug 2022 14:54:28 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26EB5D633E; Sat, 27 Aug 2022 11:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=uD+63HgUhkxXVowO2tofksrYfh23EPdwjmkCclgm85w=; b=XVfFEUefrVqEyL+98Sem+QqvbG OsGS9RpYK3yVwK7ZGi9DwhKyEhqgim1o/b7WyaAr1eOIR+/0Od6epWPjWx+oq8qUlrtHuMPXnFeFE ioZ130J1jdCEW+rjY+IoREn0N+uNJ/kDw8rE//i4TCLFZbKMP/JMYmRxIk+cHXtVhLiw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1oS0wo-00EnUE-NA; Sat, 27 Aug 2022 20:54:22 +0200 Date: Sat, 27 Aug 2022 20:54:22 +0200 From: Andrew Lunn To: Maxime Chevallier Cc: davem@davemloft.net, Rob Herring , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, thomas.petazzoni@bootlin.com, Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Vladimir Oltean , Luka Perkov , Robert Marko Subject: Re: [PATCH net-next v3 2/5] net: dsa: add out-of-band tagging protocol Message-ID: References: <20220826154650.615582-1-maxime.chevallier@bootlin.com> <20220826154650.615582-3-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220826154650.615582-3-maxime.chevallier@bootlin.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +struct dsa_oob_tag_info { > + u16 proto; > + u16 dp; > +}; > +#define DSA_OOB_TAG_LEN 4 > + > +int dsa_oob_tag_push(struct sk_buff *skb, struct dsa_oob_tag_info *ti) > +{ > + struct dsa_oob_tag_info *tag_info; > + > + tag_info = (struct dsa_oob_tag_info *)skb->head; > + > + tag_info->proto = ti->proto; > + tag_info->dp = ti->dp; Do you need to be worried about alignment here? Is skb->head guaranteed to be at least 16 bit aligned? I think you would be safer to use get_unaligned_le16(val, tag); Andrew