Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753925AbdLGPaX (ORCPT ); Thu, 7 Dec 2017 10:30:23 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:51285 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752793AbdLGPaV (ORCPT ); Thu, 7 Dec 2017 10:30:21 -0500 Date: Thu, 7 Dec 2017 16:30:16 +0100 From: Andrew Lunn To: sean.wang@mediatek.com Cc: davem@davemloft.net, f.fainelli@gmail.com, vivien.didelot@savoirfairelinux.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH net-next 2/3] net: dsa: mediatek: combine MediaTek tag with VLAN tag Message-ID: <20171207153016.GC24750@lunn.ch> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 885 Lines: 33 > @@ -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