From patchwork Wed Sep 9 03:42:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Bauer X-Patchwork-Id: 1360318 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=david-bauer.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=g1ObbLNl; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BmSZt3gXzz9sRK for ; Wed, 9 Sep 2020 13:45:10 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=8M+M8Box8IAABHXOLlINAApsH4SmF0IR2YF0Z43T7a0=; b=g1ObbLNlnI7gf3lo8kp/0daknH dAjUvLjMi1kLVRiaBYqg4Y42BkljhhCD5dUXTFbDX2NBU3+sN5Xy2fP3puuBpAm7AzaKMP33xGYrn yFY6U2priYdqO14Br/5YKYIrWZLDGOPtK0yNXHfFDFOySwAkaCSyFnh9FbdLA+lWTVAn5nhlIS7Yx hsxmwT8HNefIMwDZx9qtNXDKev4sA0i5bfE6LfgKdJXea7JKnpEN4+vbx+GpLVafWm8sheR62B8wR I2exqx4k9NjyhTHoP3pr921BQB1+9hhwFLkCDR9CtAT2OaD1Cg5IP+J6cgaeLBTid0YedJqaqYyIE Ef2QtH0Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFr0s-0004Zi-7d; Wed, 09 Sep 2020 03:43:14 +0000 Received: from mars.blocktrron.ovh ([51.254.112.43] helo=mail.blocktrron.ovh) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFr0p-0004Yv-AJ for openwrt-devel@lists.openwrt.org; Wed, 09 Sep 2020 03:43:12 +0000 Received: from localhost.localdomain (p200300e53f0ffb0090adcdeb275d14b6.dip0.t-ipconnect.de [IPv6:2003:e5:3f0f:fb00:90ad:cdeb:275d:14b6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.blocktrron.ovh (Postfix) with ESMTPSA id 8947623E71 for ; Wed, 9 Sep 2020 05:43:03 +0200 (CEST) From: David Bauer To: openwrt-devel@lists.openwrt.org Subject: [PATCH] ipq40xx: essedma: enable VLAN tag offload for single-port Date: Wed, 9 Sep 2020 05:42:48 +0200 Message-Id: <20200909034248.77949-1-mail@david-bauer.net> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200908_234311_451474_1B87A6D8 X-CRM114-Status: GOOD ( 14.86 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Enable the VLAN tag offloading mechanism for RGMII single-port devices. This allows those devices to use 802.1Q VLANs on the ethernet port. Previously, RX frames were double tagged, as the RX TAG removal flag was not enabled and an additional 802.1Q header was inserted elsewhere in the code. On the TX side, tagging was completely not present for single-port devices. Enable tagging if an 802.1Q frame should be transmitted and disable the default tagging mechanism for single-port devices. Tested on Aruba AP-303 Signed-off-by: David Bauer --- .../drivers/net/ethernet/qualcomm/essedma/edma.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/target/linux/ipq40xx/files-5.4/drivers/net/ethernet/qualcomm/essedma/edma.c b/target/linux/ipq40xx/files-5.4/drivers/net/ethernet/qualcomm/essedma/edma.c index 5561cc23ea..5f2630ae50 100644 --- a/target/linux/ipq40xx/files-5.4/drivers/net/ethernet/qualcomm/essedma/edma.c +++ b/target/linux/ipq40xx/files-5.4/drivers/net/ethernet/qualcomm/essedma/edma.c @@ -164,10 +164,8 @@ static void edma_configure_rx(struct edma_common_info *edma_cinfo) /* Set Rx FIFO threshold to start to DMA data to host */ rxq_ctrl_data = EDMA_FIFO_THRESH_128_BYTE; - if (!edma_cinfo->is_single_phy) { /* Set RX remove vlan bit */ rxq_ctrl_data |= EDMA_RXQ_CTRL_RMV_VLAN; - } edma_write_reg(EDMA_REG_RXQ_CTRL, rxq_ctrl_data); } @@ -1411,12 +1409,10 @@ netdev_tx_t edma_xmit(struct sk_buff *skb, } /* Check and mark VLAN tag offload */ - if (!adapter->edma_cinfo->is_single_phy) { - if (unlikely(skb_vlan_tag_present(skb))) - flags_transmit |= EDMA_VLAN_TX_TAG_INSERT_FLAG; - else if (adapter->default_vlan_tag) - flags_transmit |= EDMA_VLAN_TX_TAG_INSERT_DEFAULT_FLAG; - } + if (unlikely(skb_vlan_tag_present(skb))) + flags_transmit |= EDMA_VLAN_TX_TAG_INSERT_FLAG; + else if (!adapter->edma_cinfo->is_single_phy && adapter->default_vlan_tag) + flags_transmit |= EDMA_VLAN_TX_TAG_INSERT_DEFAULT_FLAG; /* Check and mark checksum offload */ if (likely(skb->ip_summed == CHECKSUM_PARTIAL))