Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3052285rwe; Mon, 29 Aug 2022 05:11:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR4N80GTAqedFCD52eGjsjtHN91TPZBwXp/rSCNXsu8GidBgUyV5BIXEuRh9JIYoG5OfJxVo X-Received: by 2002:a17:902:b207:b0:16f:2349:6116 with SMTP id t7-20020a170902b20700b0016f23496116mr16226727plr.80.1661775066808; Mon, 29 Aug 2022 05:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661775066; cv=none; d=google.com; s=arc-20160816; b=b/nQ9ebHM6md4p3wehlv3PG6N8b/7AA+bELQI8SvnqQqL/YG+haL0giboQxUWwIags vAYDQGa6urcmvype199CNwvBgsNOyTzLWR9lezUOo0Oo0A8j/l55nAe2TqSZnjPCpfKb ZWxyMnbXL664GBj56ExWqO9Ald3fH7qlJNGHWatqxcDgAF+/p0WnwbgvyLIU3tpHcRnL ruHw1orR+OgxA9kOtPLKyQ2M6UTK1/4dk6AIW1qnyY3hUtod2iFxjxo4BR6GLJEJJHFe 7o6Uw9YfT6VwujHOd2U4/FYuGOl2n5bz5vurW7uibq64nXRt+0fRI+0yxZT0q6QbmyIY IJYw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YddYYp7FhDB+OB2fVLBV+GaxkGOKjn5yGcmorUETlHg=; b=YLMMYzSKxfNkab9QDuXoMRZLslSDRFxicJhqD0tRDNxZo9qU6OO3H8Zgysw2CJXi/c 3NTlfKKEloOxxl+eZCJhYDX4rGOPoc6W1lh0PI9vnLKvB6Ce2YCY+9653c1KkA3lYkuv H39fsso40y/WqaezUEMLh/6p+ek0MZJAou0bMVzM4Usfhr30ET7W256DIJn03t8aw42B aSMpeqActCNAsHyTyKkcUqJ4jVxHyHCaKojOrvy1PN10cQ8+rmOPjOF4+VuZ1xYkgnEP h6rF3D3sUq08hrxV7gsbvMZ61mwz92Oj8jpd8ac3rT9L9a1tkk9R05VkjB8M8jh6azrI JlAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iVh0YsVQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e123-20020a621e81000000b0052adcf5e6dasi559232pfe.186.2022.08.29.05.10.55; Mon, 29 Aug 2022 05:11:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iVh0YsVQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232310AbiH2Lbf (ORCPT + 99 others); Mon, 29 Aug 2022 07:31:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232608AbiH2L3Y (ORCPT ); Mon, 29 Aug 2022 07:29:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 000E86C740; Mon, 29 Aug 2022 04:17:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 66119B80FA8; Mon, 29 Aug 2022 11:17:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B004AC433B5; Mon, 29 Aug 2022 11:17:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771851; bh=fu51cPml/zweYYB/F7Mk2HqtdVHoi5XycmFY9Fmsyqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iVh0YsVQ9P2K/kgPm9Q+PV53Xcn0b6CQ99dgRbZx3GBIjFCek6SEWytRDUlMuAVw+ Jio4KsSBtbpwba675Lir+9FqMtm2DQMIGAspEKEyWd9f4WJ6vy4FB39+HHti2hobG9 wOAtzgBy7A1oT9nD3vjPIHJjqwryrL9KdQqfIBNk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lorenzo Bianconi , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.19 084/158] net: ethernet: mtk_eth_soc: enable rx cksum offload for MTK_NETSYS_V2 Date: Mon, 29 Aug 2022 12:58:54 +0200 Message-Id: <20220829105812.576260888@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220829105808.828227973@linuxfoundation.org> References: <20220829105808.828227973@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lorenzo Bianconi [ Upstream commit da6e113ff010815fdd21ee1e9af2e8d179a2680f ] Enable rx checksum offload for mt7986 chipset. Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/c8699805c18f7fd38315fcb8da2787676d83a32c.1654544585.git.lorenzo@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 59c9a10f83ba5..6beb3d4873a37 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -1444,8 +1444,8 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, int done = 0, bytes = 0; while (done < budget) { + unsigned int pktlen, *rxdcsum; struct net_device *netdev; - unsigned int pktlen; dma_addr_t dma_addr; u32 hash, reason; int mac = 0; @@ -1512,7 +1512,13 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, pktlen = RX_DMA_GET_PLEN0(trxd.rxd2); skb->dev = netdev; skb_put(skb, pktlen); - if (trxd.rxd4 & eth->soc->txrx.rx_dma_l4_valid) + + if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) + rxdcsum = &trxd.rxd3; + else + rxdcsum = &trxd.rxd4; + + if (*rxdcsum & eth->soc->txrx.rx_dma_l4_valid) skb->ip_summed = CHECKSUM_UNNECESSARY; else skb_checksum_none_assert(skb); @@ -3761,6 +3767,7 @@ static const struct mtk_soc_data mt7986_data = { .txd_size = sizeof(struct mtk_tx_dma_v2), .rxd_size = sizeof(struct mtk_rx_dma_v2), .rx_irq_done_mask = MTK_RX_DONE_INT_V2, + .rx_dma_l4_valid = RX_DMA_L4_VALID_V2, .dma_max_len = MTK_TX_DMA_BUF_LEN_V2, .dma_len_offset = 8, }, -- 2.35.1