From patchwork Fri Oct 23 12:31:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 7472701 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CB469BEEA4 for ; Fri, 23 Oct 2015 12:31:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB9D720585 for ; Fri, 23 Oct 2015 12:31:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6C01B20576 for ; Fri, 23 Oct 2015 12:31:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751616AbbJWMbo (ORCPT ); Fri, 23 Oct 2015 08:31:44 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:9864 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751043AbbJWMbm (ORCPT ); Fri, 23 Oct 2015 08:31:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1445603502; x=1477139502; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=2ZRVxbKqn9da9AcNrDsNS+rTMLBBcB1yuMNM8MnwqrU=; b=otTriFzCG0bDJecN/bfX2mjS8ppu950/slztUNwqjB9/yqZCc2t10xIg 4FZ/UYD8oiGrlMzGwu+gcfqlszEM0/c6uFp8rmlAgw5w58qY3cqmFozdK NrwB7uxU6cNXyC1NcAaCw2sGZ4I4xi+EwvxF/rB3WBqeqwR46j4PNAKVA c=; X-IronPort-AV: E=McAfee;i="5700,7163,7962"; a="238503081" Received: from ironmsg03-r-new.qualcomm.com (HELO Ironmsg03-R.qualcomm.com) ([10.53.140.107]) by wolverine02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 23 Oct 2015 05:31:41 -0700 X-IronPort-AV: E=Sophos;i="5.20,186,1444719600"; d="scan'208";a="1020418654" Received: from nasanexm01h.na.qualcomm.com ([10.85.0.34]) by Ironmsg03-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 23 Oct 2015 05:31:41 -0700 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by NASANEXM01H.na.qualcomm.com (10.85.0.34) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Fri, 23 Oct 2015 05:31:40 -0700 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.252.127.11) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Fri, 23 Oct 2015 18:01:23 +0530 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Fri, 23 Oct 2015 18:01:24 +0530 From: Rajkumar Manoharan To: CC: , Rajkumar Manoharan Subject: [PATCH v2 1/4] ath10k: use local memory instead of shadow descriptor in ce_send Date: Fri, 23 Oct 2015 18:01:03 +0530 Message-ID: <1445603466-14138-2-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1445603466-14138-1-git-send-email-rmanohar@qti.qualcomm.com> References: <1445603466-14138-1-git-send-email-rmanohar@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To aphydexm01b.ap.qualcomm.com (10.252.127.11) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently to avoid uncached memory access while filling up copy engine descriptors, shadow descriptors are used. This can be optimized further by removing shadow descriptors. To achieve that first shadow ring dependency in ce_send is removed by creating local copy of the descriptor on stack and make a one-shot copy into the "uncached" descriptor. Signed-off-by: Rajkumar Manoharan --- v2: * Since ce_send is not using shadow, fix send completion as well. drivers/net/wireless/ath/ath10k/ce.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c index 84220c3..f63376b 100644 --- a/drivers/net/wireless/ath/ath10k/ce.c +++ b/drivers/net/wireless/ath/ath10k/ce.c @@ -274,7 +274,7 @@ int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state, { struct ath10k *ar = ce_state->ar; struct ath10k_ce_ring *src_ring = ce_state->src_ring; - struct ce_desc *desc, *sdesc; + struct ce_desc *desc, sdesc; unsigned int nentries_mask = src_ring->nentries_mask; unsigned int sw_index = src_ring->sw_index; unsigned int write_index = src_ring->write_index; @@ -294,7 +294,6 @@ int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state, desc = CE_SRC_RING_TO_DESC(src_ring->base_addr_owner_space, write_index); - sdesc = CE_SRC_RING_TO_DESC(src_ring->shadow_base, write_index); desc_flags |= SM(transfer_id, CE_DESC_FLAGS_META_DATA); @@ -303,11 +302,11 @@ int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state, if (flags & CE_SEND_FLAG_BYTE_SWAP) desc_flags |= CE_DESC_FLAGS_BYTE_SWAP; - sdesc->addr = __cpu_to_le32(buffer); - sdesc->nbytes = __cpu_to_le16(nbytes); - sdesc->flags = __cpu_to_le16(desc_flags); + sdesc.addr = __cpu_to_le32(buffer); + sdesc.nbytes = __cpu_to_le16(nbytes); + sdesc.flags = __cpu_to_le16(desc_flags); - *desc = *sdesc; + *desc = sdesc; src_ring->per_transfer_context[write_index] = per_transfer_context; @@ -614,7 +613,7 @@ int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state, if (read_index == sw_index) return -EIO; - sbase = src_ring->shadow_base; + sbase = src_ring->base_addr_owner_space; sdesc = CE_SRC_RING_TO_DESC(sbase, sw_index); /* Return data from completed source descriptor */