[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220917110013.78710782@fedora>
Date: Sat, 17 Sep 2022 11:00:13 +0200
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: "davem@...emloft.net" <davem@...emloft.net>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"thomas.petazzoni@...tlin.com" <thomas.petazzoni@...tlin.com>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Luka Perkov <luka.perkov@...tura.hr>,
Robert Marko <robert.marko@...tura.hr>
Subject: Re: [PATCH net-next v4 2/5] net: dsa: add out-of-band tagging
protocol
Hello Vladimir,
Thanks for the comment :)
On Sat, 17 Sep 2022 00:15:22 +0000
Vladimir Oltean <vladimir.oltean@....com> wrote:
> Hi Maxime,
>
> On Fri, Sep 09, 2022 at 05:24:51PM +0200, Maxime Chevallier wrote:
> > +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;
> > +
> > + return 0;
> > +}
> > +EXPORT_SYMBOL(dsa_oob_tag_push);
> > +
> > +int dsa_oob_tag_pop(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;
> > +
> > + if (tag_info->proto != DSA_TAG_PROTO_OOB)
> > + return -EINVAL;
> > +
> > + ti->proto = tag_info->proto;
> > + ti->dp = tag_info->dp;
> > +
> > + return 0;
> > +}
> > +EXPORT_SYMBOL(dsa_oob_tag_pop);
> > +
> > +static struct sk_buff *oob_tag_xmit(struct sk_buff *skb,
> > + struct net_device *dev)
> > +{
> > + struct dsa_port *dp = dsa_slave_to_port(dev);
> > + struct dsa_oob_tag_info tag_info;
> > +
> > + tag_info.dp = dp->index;
> > + tag_info.proto = DSA_TAG_PROTO_OOB;
> > +
> > + if (dsa_oob_tag_push(skb, &tag_info))
> > + return NULL;
> > +
> > + return skb;
> > +}
>
> I don't have too many comments on this patch set, except for a very
> fundamental one. It is impossible to pass a DSA out of band header
> between the switch tagging protocol driver and the host Ethernet
> controller via the beginning of skb->head, and just putting some magic
> bytes there and hoping that no random junk in the buffer will have the
> same value (and that skb_push() calls will not eat into your tag_info
> structure which isn't accounted for in any way by skb->data).
>
> Please create an skb extension for this, it is the only unambiguous
> way to deal with the given hardware, which will not give lots of
> headaches in the future.
I have no problem with the skb extension approach, my goal from the
start was to find the correct way to approach this tagging process.
I'll spin a new version with the skb extension approach then, unless
someone else sees a problem with using skb extensions ?
Thanks,
Maxime
Powered by blists - more mailing lists