From patchwork Tue Apr 17 09:24:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Pillai X-Patchwork-Id: 10344623 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A340860216 for ; Tue, 17 Apr 2018 09:25:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BA9128A2E for ; Tue, 17 Apr 2018 09:25:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 901BB28A30; Tue, 17 Apr 2018 09:25:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F364328A2E for ; Tue, 17 Apr 2018 09:25:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=q+hZIeX/1ruSGSy7A8Y/sowmaZs7gSwBdEkigfeV8m8=; b=mxE SbwsASOCfSvg7LMHHhH2Ni7kmE/6vQToo2z06tbVlYX8GztC32O+/Cq/d43PnUqyF7FnRBqVNtzex WrBCYI3qoQc5ShrBVcvbT88nyZFL0pQvQeoiCdbi4NGIF9s/1wTnTJTt7D1i7OvJ9dfx0DpEaI06d Tzt/HdGeWT9fGx08yj5+DrmQVZLzirFY7/N9h4V0JOvLTNXyMgTDdwqix47dicMeV7lKIuuAiAMmv 1jJm+rEXiJE/j2wk2ATf6HTLSGh1Vi6joVRELui1LEbvklQ4B+2iiNFHYCnfUXOm7CVfAls4EP/YU ahPuJA3NjD1ED8UfLKhfaZYpNE3gN8Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f8MrA-0002Ze-Rh; Tue, 17 Apr 2018 09:24:56 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f8Mr7-0002YT-WA for ath10k@lists.infradead.org; Tue, 17 Apr 2018 09:24:55 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2067160AE0; Tue, 17 Apr 2018 09:24:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523957083; bh=etUhahtEo9UDQGC13p6tXNMI3L5o6Y95/Ut/Ocd4YDA=; h=From:To:Cc:Subject:Date:From; b=Wn7zRV3uk41X/KNVJtSRrTsAG7z0VJAIbzl10M/B3MMh4sOkRQODOPLqLl2fxZ8ik tOJjBH1j7OnOzTHNRnMy3TWR8gc+NEVVAU+NqgKOMT+2DFTVw1fAXQof12pJDowShP W58KySgjoVjzrSd2ikqQSJYgk3UswfmKM1NYV3yw= Received: from pillair-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pillair@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 771A16076A; Tue, 17 Apr 2018 09:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523957082; bh=etUhahtEo9UDQGC13p6tXNMI3L5o6Y95/Ut/Ocd4YDA=; h=From:To:Cc:Subject:Date:From; b=QwYSIaRitvqD6Xkn86KYzHjwUIMq1H2D/QZhgmG5nzh9DgEvUEBsVgnPtwiyzCrRu k8lXeIwsWNlyNxES5KJRpzmvtRXg2DLTQnS+HVGfAtKteOQMnJkfLPLoWULhFJeWkU GrGzoSusHDGX8thwYufiVfxNjkxbEZw2n1Xr0XUI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 771A16076A Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=pillair@codeaurora.org From: pillair@codeaurora.org To: ath10k@lists.infradead.org Subject: [PATCH v2] ath10k: Enable hw checksum for wcn3990 Date: Tue, 17 Apr 2018 14:54:26 +0530 Message-Id: <1523957066-12585-1-git-send-email-pillair@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180417_022454_073883_6C61143E X-CRM114-Status: GOOD ( 11.35 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rakesh Pillai , linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rakesh Pillai By default ath10k driver enables the support for HW_CHECKSUM (NETIF_F_HW_CSUM). Since the TCP/UDP checksum calculation is not enabled in the wcn3990 firmware the checksum is incorrect in the TCP/UDP packets and all patckets are dropped. But due note that wcn3990 support in ath10k is still incomplete so this isn't a critical fix (yet). Enable hw checksum calculations in wcn3990 hardware by setting the proper flags in msdu descriptor tso flags. Signed-off-by: Rakesh Pillai --- drivers/net/wireless/ath/ath10k/htt.h | 13 +++++++++++++ drivers/net/wireless/ath/ath10k/htt_tx.c | 7 +++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h index 8cc2a8b..11f52df 100644 --- a/drivers/net/wireless/ath/ath10k/htt.h +++ b/drivers/net/wireless/ath/ath10k/htt.h @@ -127,6 +127,19 @@ struct htt_msdu_ext_desc_64 { | HTT_MSDU_EXT_DESC_FLAG_TCP_IPV4_CSUM_ENABLE \ | HTT_MSDU_EXT_DESC_FLAG_TCP_IPV6_CSUM_ENABLE) +#define HTT_MSDU_EXT_DESC_FLAG_IPV4_CSUM_ENABLE_64 BIT(16) +#define HTT_MSDU_EXT_DESC_FLAG_UDP_IPV4_CSUM_ENABLE_64 BIT(17) +#define HTT_MSDU_EXT_DESC_FLAG_UDP_IPV6_CSUM_ENABLE_64 BIT(18) +#define HTT_MSDU_EXT_DESC_FLAG_TCP_IPV4_CSUM_ENABLE_64 BIT(19) +#define HTT_MSDU_EXT_DESC_FLAG_TCP_IPV6_CSUM_ENABLE_64 BIT(20) +#define HTT_MSDU_EXT_DESC_FLAG_PARTIAL_CSUM_ENABLE_64 BIT(21) + +#define HTT_MSDU_CHECKSUM_ENABLE_64 (HTT_MSDU_EXT_DESC_FLAG_IPV4_CSUM_ENABLE_64 \ + | HTT_MSDU_EXT_DESC_FLAG_UDP_IPV4_CSUM_ENABLE_64 \ + | HTT_MSDU_EXT_DESC_FLAG_UDP_IPV6_CSUM_ENABLE_64 \ + | HTT_MSDU_EXT_DESC_FLAG_TCP_IPV4_CSUM_ENABLE_64 \ + | HTT_MSDU_EXT_DESC_FLAG_TCP_IPV6_CSUM_ENABLE_64) + enum htt_data_tx_desc_flags0 { HTT_DATA_TX_DESC_FLAGS0_MAC_HDR_PRESENT = 1 << 0, HTT_DATA_TX_DESC_FLAGS0_NO_AGGR = 1 << 1, diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index d334b7b..ad49d06 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -1475,8 +1475,11 @@ static int ath10k_htt_tx_64(struct ath10k_htt *htt, !test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags)) { flags1 |= HTT_DATA_TX_DESC_FLAGS1_CKSUM_L3_OFFLOAD; flags1 |= HTT_DATA_TX_DESC_FLAGS1_CKSUM_L4_OFFLOAD; - if (ar->hw_params.continuous_frag_desc) - ext_desc->flags |= HTT_MSDU_CHECKSUM_ENABLE; + if (ar->hw_params.continuous_frag_desc) { + memset(ext_desc->tso_flag, 0, sizeof(ext_desc->tso_flag)); + ext_desc->tso_flag[3] |= + __cpu_to_le32(HTT_MSDU_CHECKSUM_ENABLE_64); + } } /* Prevent firmware from sending up tx inspection requests. There's