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 32F9AC54EE9 for ; Sat, 17 Sep 2022 09:01:58 +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:MIME-Version:References:In-Reply-To: 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=fLLmr21ApycysBQf4/L5nJHdb1T5SLaHeeqX8WQ4CMU=; b=Ie5n4w2M5sIgs/ AiHWLJdsp3BtKqM/uOD/MVuLwmJnTPFoHvkCHV3nAutWRGSEy8v1o/mLZcUHXqHpC9ElCP9D6TOMF 1M+Q3Rrj0RB7zYpkhhpO6o+C100OnXHKN/fvNnjST2z0zeZgrgOhgcTz83Ua4PajqJrWHTy8SynMi CtM6syKDqoc3W1LKlZhaLWd06paC6aPFgOkck4hdZsVVUnpOQ+H5dJuUE44J00o7HR8OHlAAYTdzk psudtgwVjmvblEx9+cphAUythIZWTaKSxHVaj0cdGhFzmtahaOMrowxvWqsetDokd3RPtQIxjwNtT R69pv0cppSYGnRDarn7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZTgj-004kRa-Ez; Sat, 17 Sep 2022 09:00:37 +0000 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oZTgf-004kMT-66 for linux-arm-kernel@lists.infradead.org; Sat, 17 Sep 2022 09:00:35 +0000 Received: (Authenticated sender: maxime.chevallier@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 673A340004; Sat, 17 Sep 2022 09:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1663405216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8VEyWt/RYAY3zpkgir+Y3PaZ3FmEx5dtQi+QxOJw0aA=; b=MYG1Db67qpNBXmwj+s8DOP/MOl01Z07609no99A8mJAxaRtZcejq34G2SZrChj95Y+giJW uk5EwjOv1ZTYoh7Ea9Yr4+QXn7Iss1lqY0FqsYwP5psD2dF+KrcgDTehqa8W3rAhG1akX1 NtBXkYiz0TzXu+YlWJHw7oOCjYQoNsC3+xeTUjOTdVjTYkCT7ClJaVnbmUdNtNy4KUJWTm sdrOanqjcsFST0uHAEkqlmr1IDgYuA3KuQnT6LFhMhn0zrBoIcTI4IIsU5NJhuwF+AyteM 9JIMTHO/ajk07RpsxySEj2yUf7Srm0yh9KRtK8iYHr8iYBckUCHHDvb2y2xStw== Date: Sat, 17 Sep 2022 11:00:13 +0200 From: Maxime Chevallier To: Vladimir Oltean Cc: "davem@davemloft.net" , Rob Herring , Krzysztof Kozlowski , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "thomas.petazzoni@bootlin.com" , Andrew Lunn , Florian Fainelli , Heiner Kallweit , Russell King , "linux-arm-kernel@lists.infradead.org" , Luka Perkov , Robert Marko Subject: Re: [PATCH net-next v4 2/5] net: dsa: add out-of-band tagging protocol Message-ID: <20220917110013.78710782@fedora> In-Reply-To: <20220917001521.wskocisy53vozska@skbuf> References: <20220909152454.7462-1-maxime.chevallier@bootlin.com> <20220909152454.7462-3-maxime.chevallier@bootlin.com> <20220917001521.wskocisy53vozska@skbuf> Organization: Bootlin X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220917_020033_558656_5ACD6865 X-CRM114-Status: GOOD ( 20.49 ) 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 Hello Vladimir, Thanks for the comment :) On Sat, 17 Sep 2022 00:15:22 +0000 Vladimir Oltean 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel