Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp135861pxy; Wed, 21 Apr 2021 21:16:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwohOCjoMyZsUU2ndTtqoNdZBGxhjqXz2pC5uSZ7ZuVMGBKNpSzC3NFksZbBMOfrVhgB6u8 X-Received: by 2002:a17:906:1101:: with SMTP id h1mr1212620eja.179.1619064986557; Wed, 21 Apr 2021 21:16:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619064986; cv=none; d=google.com; s=arc-20160816; b=TDEB2fkwQ08waGVYbRmOc/m/lwvzXPZ7yhFAaOVVOuJy8XZU6RLVD3KiRrgF0vkefl r8BVIU1Q/6YaH7wdO9LOCmb7k9440pZlmwTqavE6pkA6A0v6Q7PQZqfJuJoJVVLuxRnC 9mUYxYfO0mFDS/IJB8rHICS/ancjCnhl1Fxf/VNN0W/teCQf/k9g4zAjysO7BPrX595M k13Y5AgJ14EqaJWYfVPjpzTjiPGcrUmqj+ZEUaMQXOYgzHgtg9GcAUB7tekBh049cDSe XvjbGaPI/SwCHFrBqlbXKqFJJwFX+Sepg/C9QEWk9QyxXmL/DeqH4UbDL6+SwcQASfwT 0ilQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Z+GoIGK0ASypWzKq72OR9x8SOdqUZq5a0/koCWBmuF4=; b=U0ldczAEVspNmU5eOKC419kJrEc06cjxAGlGkrfGJpqCbJyhhUgRSLai5jnwngjUbQ /ts+Y9PUimpmy/OaJX73Xw6blugCnF2Jy6SXqa3U/K15RjwBxjN2t23sl5F4cCum2GZu LRuJ291R4VeaFItZD1JEdqVckKkqLw4CK+Rp5YO+Ik7E2jmQt4+ohxN05izWqEzhWEdG 4r0Ab4m7bOM00GlQtgOTsEQvLi5ssFuLQa/W3g/7+TIxIwqAJk7JLHyQYEgdxHVqZa0X oqT1PIbfFFIOF1FxtFkzEabWK6a53wL/Zov+MCz8RTwxr4vIQDdnwlFaEXdYvPY34E9r gWlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AprUGNkG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p23si1199190ejg.550.2021.04.21.21.16.03; Wed, 21 Apr 2021 21:16:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AprUGNkG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235181AbhDVEL3 (ORCPT + 99 others); Thu, 22 Apr 2021 00:11:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234739AbhDVEKX (ORCPT ); Thu, 22 Apr 2021 00:10:23 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 054A3C06138C; Wed, 21 Apr 2021 21:09:49 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id p12so31918090pgj.10; Wed, 21 Apr 2021 21:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z+GoIGK0ASypWzKq72OR9x8SOdqUZq5a0/koCWBmuF4=; b=AprUGNkG4iniX7gYV9sc0nkIUpaw4DobJ3++iTN7JS1NrwMyOKGGVaf1e30tNIa2fS 9Y6nYK+mNrT+XNGmGy7DRF+fGYtEm14LyCfV0Fx9FEO8gBU4ik38GOv1jcJuLGLXaD5F iBwjY25Oxbsp2K6ujWm3YM8eXHcTWlk2AuujaGh48a6d3DqDr5fTUpnwUTMpGHo9JZUk Ecc2BqqOrxpsAH4/ufHOPDgaeab6jBSNFcEBFh0epEuGDlNV2C6mkO5s871Ebdi9aq4V rekaU3kfYEudV5imStEtUGcGERNtIqjWQfL3JfUvfrGz/1x7gJWp2voSN6PItH0wgTEA wYFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Z+GoIGK0ASypWzKq72OR9x8SOdqUZq5a0/koCWBmuF4=; b=e3LiU4sq4jFcWEXd5a4UaXh3lTM5InMNE7gEq/KOUJ/Gxb2tpQCDuVJxvx8xnmfeCU TqUoe8GtxBmO2c8QgJGSYdjwpIqBqW0QUxl2L+dC8dwweWpJEkLkp6thfK8GIWRnDf7n YvqR3fowdz7vi3W6DUwHXe7zmKbp3LHAmDgV41f0rG+gP7tkD8zwMVUad+hNPeg4D5nL yIORKMzMwRIaCrJ2lEIchgsK8QY9onpV6KwaHzU8fOWvXjNdC3GADBclFiT0afHCbgBQ nF/VTB+0E2DeEVRpZhinbVtaxdCKFdlHkz56qITW98ZcXtbWepQ7yI6qAy5d80freMiS pt7A== X-Gm-Message-State: AOAM530i2je5MPimEjQQnZSNRbnrr6mW1zI9RZuTdUIGjf9DhSGpi+pK j/+cat+LS2ebWvQ5GUq0AdY= X-Received: by 2002:a63:4866:: with SMTP id x38mr1518318pgk.135.1619064588652; Wed, 21 Apr 2021 21:09:48 -0700 (PDT) Received: from z640-arch.lan ([2602:61:7344:f100::678]) by smtp.gmail.com with ESMTPSA id i17sm635354pfd.84.2021.04.21.21.09.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Apr 2021 21:09:48 -0700 (PDT) From: Ilya Lipnitskiy To: Felix Fietkau , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Jakub Kicinski , Matthias Brugger , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Ilya Lipnitskiy Subject: [PATCH net-next 13/14] net: ethernet: mtk_eth_soc: set PPE flow hash as skb hash if present Date: Wed, 21 Apr 2021 21:09:13 -0700 Message-Id: <20210422040914.47788-14-ilya.lipnitskiy@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210422040914.47788-1-ilya.lipnitskiy@gmail.com> References: <20210422040914.47788-1-ilya.lipnitskiy@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Felix Fietkau This improves GRO performance Signed-off-by: Felix Fietkau [Ilya: Use MTK_RXD4_FOE_ENTRY instead of GENMASK(13, 0)] Signed-off-by: Ilya Lipnitskiy --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 88a437f478fd..8c863322587e 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "mtk_eth_soc.h" @@ -1248,6 +1249,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, struct net_device *netdev; unsigned int pktlen; dma_addr_t dma_addr; + u32 hash; int mac; ring = mtk_get_rx_ring(eth); @@ -1317,6 +1319,12 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, skb->protocol = eth_type_trans(skb, netdev); bytes += pktlen; + hash = trxd.rxd4 & MTK_RXD4_FOE_ENTRY; + if (hash != MTK_RXD4_FOE_ENTRY) { + hash = jhash_1word(hash, 0); + skb_set_hash(skb, hash, PKT_HASH_TYPE_L4); + } + if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX && (trxd.rxd2 & RX_DMA_VTAG)) __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), -- 2.31.1