Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752405AbdLLIkn (ORCPT ); Tue, 12 Dec 2017 03:40:43 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:34590 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751552AbdLLIkh (ORCPT ); Tue, 12 Dec 2017 03:40:37 -0500 X-UUID: d58c19b643ca4bc2893c02e5eda576b9-20171212 Message-ID: <1513068034.28444.31.camel@mtkswgap22> Subject: Re: [PATCH net-next 2/3] net: dsa: mediatek: combine MediaTek tag with VLAN tag From: Sean Wang To: Andrew Lunn CC: , , , , , Date: Tue, 12 Dec 2017 16:40:34 +0800 In-Reply-To: <20171212082837.GM28672@lunn.ch> References: <20171207153016.GC24750@lunn.ch> <1513063281.28444.25.camel@mtkswgap22> <20171212082837.GM28672@lunn.ch> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1713 Lines: 60 On Tue, 2017-12-12 at 09:28 +0100, Andrew Lunn wrote: > On Tue, Dec 12, 2017 at 03:21:21PM +0800, Sean Wang wrote: > > On Thu, 2017-12-07 at 16:30 +0100, Andrew Lunn wrote: > > > > @@ -25,20 +28,37 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb, > > > > { > > > > struct dsa_port *dp = dsa_slave_to_port(dev); > > > > u8 *mtk_tag; > > > > + bool is_vlan_skb = true; > > > > > > .. > > > > > > > + /* Mark tag attribute on special tag insertion to notify hardware > > > > + * whether that's a combined special tag with 802.1Q header. > > > > + */ > > > > + mtk_tag[0] = is_vlan_skb ? MTK_HDR_XMIT_TAGGED_TPID_8100 : > > > > + MTK_HDR_XMIT_UNTAGGED; > > > > mtk_tag[1] = (1 << dp->index) & MTK_HDR_XMIT_DP_BIT_MASK; > > > > - mtk_tag[2] = 0; > > > > - mtk_tag[3] = 0; > > > > + > > > > + /* Tag control information is kept for 802.1Q */ > > > > + if (!is_vlan_skb) { > > > > + mtk_tag[2] = 0; > > > > + mtk_tag[3] = 0; > > > > + } > > > > > > > > return skb; > > > > } > > > > > > Hi Sean > > > > > > So you can mark a packet for egress. What about ingress? How do you > > > know the VLAN/PORT combination for packets the CPU receives? I would > > > of expected a similar change to mtk_tag_rcv(). > > > > > > Andrew > > > > Hi, Andrew > > > > It's unnecessary for extra handling in mtk_tag_rcv() when VLAN tag is > > present since it is able to put the VLAN tag after the special tag and > > then follow the existing way to parse. > > Hi Sean > > O.K. Please mention this in the commit message. Since it was something > i was expecting, it should be documented why it is not needed. > > Thanks > Andrew Sure. I will add this in the commit message. Sean >