[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YwpoXpcRickYzD9K@lunn.ch>
Date: Sat, 27 Aug 2022 20:54:22 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
Cc: davem@...emloft.net, Rob Herring <robh+dt@...nel.org>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, thomas.petazzoni@...tlin.com,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
linux-arm-kernel@...ts.infradead.org,
Vladimir Oltean <vladimir.oltean@....com>,
Luka Perkov <luka.perkov@...tura.hr>,
Robert Marko <robert.marko@...tura.hr>
Subject: Re: [PATCH net-next v3 2/5] net: dsa: add out-of-band tagging
protocol
> +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
Powered by blists - more mailing lists