From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 93AB3ECAAD5 for ; Sat, 27 Aug 2022 18:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Uf8GW+cVzGg5GopjGH/NMPF5RWnsqnlpn14OPkWdDOc=; b=GnYB1PfQucl+qw G0C8EOLw+WxHpDA+MzeA/47zB43FOHolFgvaE5zx8JJ+8WPOfoLg955HNzUd9noiXUzClqqDm3iGJ JTFnL3N54mXJfLBt/uzqlsW2MyVr5N0ywnjwfue0M3knpjIaK3HznsIcUBya/F6E3CWHrvFw7V4S6 cnzhPp231fVYVJmxv6+atl50C9t9NEWC5dT7jOzcwGbOyfWlAHSlUeep3A0BF4NvBlMfeiQ6swfz2 hT/Tt946Qf08ex7fY1yBrWG2gRvjqZLj87qr1yoQ2oic6C/9Yt4C7D8jSdWvpr7SCrF9xdiLjOgd+ U5Ub25EuW2zCXmHVVuBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oS0wz-00HFgK-U3; Sat, 27 Aug 2022 18:54:34 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oS0ww-00HFXT-3H for linux-arm-kernel@lists.infradead.org; Sat, 27 Aug 2022 18:54:31 +0000 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-Disposition: inline In-Reply-To: <20220826154650.615582-3-maxime.chevallier@bootlin.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220827_115430_156184_6567F938 X-CRM114-Status: UNSURE ( 7.90 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B4F7ECAAD1 for ; Sat, 27 Aug 2022 18:54:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229490AbiH0Sy3 (ORCPT ); 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> Precedence: bulk List-ID: X-Mailing-List: devicetree@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