From patchwork Mon Jun 29 21:55:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 192030 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3256372ilg; Mon, 29 Jun 2020 14:55:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgBZHhEatSJRlR3hllHI8fb3zml3Rl6wooiTOTV1M2qZP+C6NTsyliSEIxvMn6eCd/0oPY X-Received: by 2002:a50:ef08:: with SMTP id m8mr19524473eds.25.1593467734869; Mon, 29 Jun 2020 14:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593467734; cv=none; d=google.com; s=arc-20160816; b=KGvBDqN5bQKBkVuPx4g4a5R1A+OW4L3hbb5dS85wVRPcpglV8u7dOc9QRsZNIpcGoS MmvZbpSL89LHf10u/XXTSfgZ6I0gcxdhRmcnv0qQlCeJUo8dWIXnN+AUTQ6ctALDTVm5 HVAgUao8DIvjCIIPuH4poBNpCvzYlArcqflMHEgr9qTa+57KvRr1qpnLVKrASUfbi28/ sckLIMIHMdUc8+3nFhk5o2RGt1Q2QYvB0I3K8ZHUQdrx2tPw8VlKQ4pkkY0nswUfc8ol UWtMeUH6E1mYAdgtQCxYLJf0FoQPW921NNMjo0N09dYDjD8zw6NjK0QAwlX7gIVp0UlJ 7W3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zQuQWfZzfj1SDZzBIXoKjjE4U7nBLLgIi6SIHAdQ+GA=; b=BBr6g3kvz0suwSTwu8ErqlWSRwnEqZAv9LOHM8p0Zzp6YhT+kSg5znVFYS+5hhsqw7 ywv+sbO9w2qB60HWqebCIF6KyMFHGuBpGbyocXtorthWImmaM+lzSKpxsJGQU3qFXUIm xIghPzd/GDgDButID74xfRuTDnf2akeOzZmn/eTWNdn+5OE4tDitoYiplmK02Aj/eSTr r2qVW5dnTo9RzRSTw6cAYiuURYGOIJwDxL4b49sEWy5USfZ/iTQ9G2T/65LkYpuHAjPp hgXuJxiGVY/KBecHTNvLbAYc1ejQwpkeJmK9b/t1HNcEHEkWa4HMy+bIB0yt+sg3LBSr 1IVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nGp01w2n; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h22si534805ejj.363.2020.06.29.14.55.34; Mon, 29 Jun 2020 14:55:34 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=@linaro.org header.s=google header.b=nGp01w2n; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391513AbgF2Vzd (ORCPT + 9 others); Mon, 29 Jun 2020 17:55:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391559AbgF2Vz1 (ORCPT ); Mon, 29 Jun 2020 17:55:27 -0400 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A93BAC061755 for ; Mon, 29 Jun 2020 14:55:27 -0700 (PDT) Received: by mail-io1-xd41.google.com with SMTP id v8so18771442iox.2 for ; Mon, 29 Jun 2020 14:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zQuQWfZzfj1SDZzBIXoKjjE4U7nBLLgIi6SIHAdQ+GA=; b=nGp01w2niKYCt4PaDR03fsVvxKd2eC+s3Q3ZlNqyypP7ldsPagswtGN9KUM4XpbMIS Aa9+EGXM/XCYpLzhGgRDKGbNqzrCnxV387ZzSl/TfHcNQM0o3SykBipxtAeYnbQJbo1z h/C+KpByaLay7PG11dGkPSCVyYbYjkGT1aGqC84lQ90RyZg1H/i8zJd4M8ZfZh64WFbQ B7L//WshF43JDl7GAWd1uVvioE2U6lJSsSNNpRIHQ9dJMwXqBVDGEB5Nhbjsz44aJ4ly Odk/LQmZSPI3hCI8zXjT9mK+fzzOArU9EY9PiorANBPUC4Bjq5gnpn4UcexJh7T7mGOR 1Plg== 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=zQuQWfZzfj1SDZzBIXoKjjE4U7nBLLgIi6SIHAdQ+GA=; b=W2ArHTczmlivaxMY89jnrBHUnF+GXE0kjEaPeuHnHw1zKKf2qxcw6BfzF79fRml2nO 6rV8iH0Pq48M28v/zAYCwpklX6drpdUxYeiTnq30RxG7iIJpf+U8LvWYCRb33TbAJSKw jbcTSDZp4i7HLaSe2lA+qwXs9jsIp/SNAQqcfsKJUMLLlv40VN1J5jVGjOf4e6jNtj8R PvkKYYiLuSn/+Nu+GSrmSe3Kwj8V5C64IaVJIb1VoY+lyipWBqfkt80oj5OvfzCQ/7pC radcdyaOv16eAF7z8BHrKUL9LuYtMh64Th+KhmtVxo0hiW4f8nZqzjpqm+yH4zNo0Egt bNwQ== X-Gm-Message-State: AOAM5320D0PVfSlFGnM7YxIpoiRVl0TqX+XutOyxZrOJGvNGLet9GiZF kX5evFwZdHkW/+E0g1uWDHWL6A== X-Received: by 2002:a05:6602:491:: with SMTP id y17mr18551373iov.72.1593467727042; Mon, 29 Jun 2020 14:55:27 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id a187sm543221iog.2.2020.06.29.14.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 14:55:26 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: evgreen@chromium.org, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/3] net: ipa: rework ipa_aggr_granularity_val() Date: Mon, 29 Jun 2020 16:55:21 -0500 Message-Id: <20200629215523.1196263-2-elder@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629215523.1196263-1-elder@linaro.org> References: <20200629215523.1196263-1-elder@linaro.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The timer used for aggregation makes use of an internal 32 KHz clock. The granularity of the timer is programmed by a field whose value is computed by ipa_aggr_granularity_val(). Redefine the way that value is computed by using a new TIMER_FREQUENCY constant representing the underlying clock frequency. Add two BUILD_BUG_ON() calls to ensure the value used is valid. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_main.c | 5 +++++ drivers/net/ipa/ipa_reg.h | 17 ++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) -- 2.25.1 diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 76d5108b8403..27a869df3a4b 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -674,6 +674,11 @@ static void ipa_validate_build(void) /* This is used as a divisor */ BUILD_BUG_ON(!IPA_AGGR_GRANULARITY); + + /* Aggregation granularity value can't be 0, and must fit */ + BUILD_BUG_ON(!ipa_aggr_granularity_val(IPA_AGGR_GRANULARITY)); + BUILD_BUG_ON(ipa_aggr_granularity_val(IPA_AGGR_GRANULARITY) > + field_max(AGGR_GRANULARITY)); #endif /* IPA_VALIDATE */ } diff --git a/drivers/net/ipa/ipa_reg.h b/drivers/net/ipa/ipa_reg.h index 0a688d8c1d7c..7ae8015798ae 100644 --- a/drivers/net/ipa/ipa_reg.h +++ b/drivers/net/ipa/ipa_reg.h @@ -190,24 +190,23 @@ static inline u32 ipa_reg_bcr_val(enum ipa_version version) return 0x00000000; } - #define IPA_REG_LOCAL_PKT_PROC_CNTXT_BASE_OFFSET 0x000001e8 #define IPA_REG_AGGR_FORCE_CLOSE_OFFSET 0x000001ec /* ipa->available defines the valid bits in the AGGR_FORCE_CLOSE register */ +/* The internal inactivity timer clock is used for the aggregation timer */ +#define TIMER_FREQUENCY 32000 /* 32 KHz inactivity timer clock */ + #define IPA_REG_COUNTER_CFG_OFFSET 0x000001f0 #define AGGR_GRANULARITY GENMASK(8, 4) -/* Compute the value to use in the AGGR_GRANULARITY field representing - * the given number of microseconds (up to 1 millisecond). - * x = (32 * usec) / 1000 - 1 +/* Compute the value to use in the AGGR_GRANULARITY field representing the + * given number of microseconds. The value is one less than the number of + * timer ticks in the requested period. Zero not a valid granularity value. */ -static inline u32 ipa_aggr_granularity_val(u32 microseconds) +static inline u32 ipa_aggr_granularity_val(u32 usec) { - /* assert(microseconds >= 16); (?) */ - /* assert(microseconds <= 1015); */ - - return DIV_ROUND_CLOSEST(32 * microseconds, 1000) - 1; + return DIV_ROUND_CLOSEST(usec * TIMER_FREQUENCY, USEC_PER_SEC) - 1; } #define IPA_REG_TX_CFG_OFFSET 0x000001fc From patchwork Mon Jun 29 21:55:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 192032 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3256494ilg; Mon, 29 Jun 2020 14:55:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1g7FnZW7wr58Z80UyufFswOCtSt5rnoV6K3GVcApB/1iDpb1kl7j+MpP+EvceLv46a1xP X-Received: by 2002:a50:9a82:: with SMTP id p2mr19415849edb.130.1593467751318; Mon, 29 Jun 2020 14:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593467751; cv=none; d=google.com; s=arc-20160816; b=d14fIdi3ZSfW0BcdWYT2N7o8tpe2Q/FGAyO4oajtgyDEvcFL4gMjHmuYYcHIfRh0qv Bpf6WBAGV1pEKLGfY8Omu4TxfY2eXBvIUJiV2YNc4fWgUswqxeADI/CHRSiJU21lTQGe nE8qRaZWylFAzGWQ0IMFPbkOOkMhQx9xBAnBiq3XqtqS9n9o7cwU5pS5Bbi6/VxyIqlr juBVuSfA1cfXA+EYmbohlYQG4z4GXv5zGNqC6YP2wlnHoBZ1rhKAykq5D1jpEHAw33e/ lyhX94O1wDlkaISr3G4+eMdfmP936AMey2VdEUV+Docqr1B85Q9ild4vJ58BIYsY8MyA vRvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GAS+84BNIbLsBoPOP/ylzzb5xE9wpBU8i+/yA5WKgjE=; b=NGdgoAvmO4YzZ59Cn0la1k+WbZx7eFvx5QQckX1DicSk3KoNkDNBvA1zYkiBti0V/4 B6slBFmZcImi9bfWGNgy/qgFYvsl0Qf9oK8PKhc9e/LQVFRgxiUammetua5k0ouvZtkG ohFXa/KfR9aEX2u2coHGKFjhuHaDfAZ9SKnbS1dqWIdlwrt8fmdxRFNVkKu7MlUav3qL 8IhOyyVFSG2BwVYzFeHyU3yDOVuCon7nKrJbDXr7pBUqzsCDkbSGbrq3aRPJRGROANHz 4uedkhWSjHgXvY0Kd2cot6jTMW7f0TgKwFgeABqlmchQjs5ZXakO4J2JaRuLFM3TFEBe fYsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vCB2v743; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h22si563695ejf.599.2020.06.29.14.55.51; Mon, 29 Jun 2020 14:55:51 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=@linaro.org header.s=google header.b=vCB2v743; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732462AbgF2Vzu (ORCPT + 9 others); Mon, 29 Jun 2020 17:55:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730664AbgF2Vz2 (ORCPT ); Mon, 29 Jun 2020 17:55:28 -0400 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99B97C03E97A for ; Mon, 29 Jun 2020 14:55:28 -0700 (PDT) Received: by mail-io1-xd42.google.com with SMTP id k23so18810445iom.10 for ; Mon, 29 Jun 2020 14:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GAS+84BNIbLsBoPOP/ylzzb5xE9wpBU8i+/yA5WKgjE=; b=vCB2v743azwgqIowwzMAL+FtFFnERCwnY4oOtaXtn/0AWpKfwQozXTOuvxZaeims5T /JHKXdvlkmZGH1iDgnbJm9z6+TlkiAxMvLhUj0n2qq2R2YHlvn7VZfK3CE338lUhQdJb +U6WfvRQVWHVXW3sbb0JehxokRLyoZX8cXiIwtVW5amZ8JI3fj1iilw5nyUjdUbA80XS YWqGo/VPcvYEHxQdPYI66tKrbGa/ly8JDC5QQX+ggIKv06FcEb53o6BHO17sulG7hDij irXBHpCpdjKMjNBMepk4tee6oDf7BGSLEaAUVbdZFvU5YsVyFw8Wz17YUhWI+g8E41sx 2orw== 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=GAS+84BNIbLsBoPOP/ylzzb5xE9wpBU8i+/yA5WKgjE=; b=nwzQm17UqyErpGhYcCtSY5gYfvx3bMtqmZzEgiMXl2taX9zx7y6wy4I0FaQXD23niN 2wPv5aa2vLhXvlEd/my9OgzWBMLEgz/k1bvfTFtKYLFUrA024EPY7dsXJUSRdK8i1Z/M A97yOkJoBUxt0q7ja+f56kNzwoXkNaPzZJMKbOU/HOKD56h/Eux4qngjBfYsU2dNAFXg auOhwvPB7d7bP/PrKnxhwsJ30eFHUTpZfRs5XCZTXSr0YDHHKC7kIC/YgneLx1X3CrhO pton9dUfz6kXVDQbhlLcmU6CzUKga5LLsyo8BUFa9OAt8WZHXHL6b4OKYLH9xjrwZe3B +rsw== X-Gm-Message-State: AOAM531Q6fI+8OlygV5IjvnpllE6a9nvGBe2MCFD/SOyP6rVM65QATrq DBDLUOp5jrqH4mbRJfVAqQbuRw== X-Received: by 2002:a02:5e88:: with SMTP id h130mr20329835jab.116.1593467727986; Mon, 29 Jun 2020 14:55:27 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id a187sm543221iog.2.2020.06.29.14.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 14:55:27 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: evgreen@chromium.org, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/3] net: ipa: reduce aggregation time limit Date: Mon, 29 Jun 2020 16:55:22 -0500 Message-Id: <20200629215523.1196263-3-elder@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629215523.1196263-1-elder@linaro.org> References: <20200629215523.1196263-1-elder@linaro.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Halve the time limit used when aggregation is enabled on an RX endpoint, to half a millisecond. Use DIV_ROUND_CLOSEST() to compute the value that represents the time period, to get better accuracy in the event the time limit is not an even multiple of the granularity. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_endpoint.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 9f50d0d11704..93449366d7d8 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -36,7 +36,7 @@ #define IPA_ENDPOINT_QMAP_METADATA_MASK 0x000000ff /* host byte order */ #define IPA_ENDPOINT_RESET_AGGR_RETRY_MAX 3 -#define IPA_AGGR_TIME_LIMIT_DEFAULT 1000 /* microseconds */ +#define IPA_AGGR_TIME_LIMIT_DEFAULT 500 /* microseconds */ /** enum ipa_status_opcode - status element opcode hardware values */ enum ipa_status_opcode { @@ -583,9 +583,11 @@ static void ipa_endpoint_init_aggr(struct ipa_endpoint *endpoint) val |= u32_encode_bits(IPA_GENERIC, AGGR_TYPE_FMASK); val |= u32_encode_bits(aggr_size, AGGR_BYTE_LIMIT_FMASK); + limit = IPA_AGGR_TIME_LIMIT_DEFAULT; - val |= u32_encode_bits(limit / IPA_AGGR_GRANULARITY, - AGGR_TIME_LIMIT_FMASK); + limit = DIV_ROUND_CLOSEST(limit, IPA_AGGR_GRANULARITY); + val |= u32_encode_bits(limit, AGGR_TIME_LIMIT_FMASK); + val |= u32_encode_bits(0, AGGR_PKT_LIMIT_FMASK); if (endpoint->data->rx.aggr_close_eof) val |= AGGR_SW_EOF_ACTIVE_FMASK; From patchwork Mon Jun 29 21:55:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 192031 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3256396ilg; Mon, 29 Jun 2020 14:55:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZLcR/5BvmdHNYx7WyrE8PtESmtlQwHIGyxP3A4a3Loh3l+L8ibKGev1Dj5WJFeAJGlrtO X-Received: by 2002:a05:6402:1841:: with SMTP id v1mr6348564edy.198.1593467737529; Mon, 29 Jun 2020 14:55:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593467737; cv=none; d=google.com; s=arc-20160816; b=xRNXhmLt45QW/9cfiNDP3YDbjQxDuDkrM1JQwVHgvZdC180Q0Y/2wrzkldSe0F/4UD N4vnroht5scRhFvAh7Y2ryjIr8vYcLvEAzSWiuuCTVZgTCMYeSM/Oxc16EFBGjisO9pA GsF7OdndFuWPwT1gtKj6cFLuC4UWeIVEuoZ0eQOkBaMjslnwgS6CJ5eCoSir6VMnsVnd zAZ6K72Z41rYw4WytfjCX7Rjje06XaTcG7HIiFsUQrRiP+IfdJg/BDNGFzYapAnHNeEt uF+7OpI3M8n4/Oa88dzNHn3PuwpY7O6X4PzYfKvpJlesptxYkpYzCauwkHd43MnAGP5O t28A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MhXLf8hCPPQ+UdSoyfLtjbvzDTqGh8KFNg/omzR+iuI=; b=ow6kM2l4Q+yGJcr/mDHclOJvIaHcDjW6MImxo2u7fFK4SRoVVokPnWfAil6BneyeQ3 mRuwli6EExwTiS+LCQfcL7leg1KtF7xmY5Xc3ayQozfL02tXpBr5fUzHqe+oxdce1aqp UaqhUst5gfyM/6npWkaM2KH9tRTpE32ZNPoc7kzoc68w5OTIr51V3+E/SuCDsKpZ+DGG i84Xx644T7boWENTg6cGkQu7vEfq7DlrCgBkW6csSx2GKBtQfQ8cJ5wsj6bE9zrlkEDL 3/9WZIWYs8M9ZsTos7RHi9WWlDBxZUfbQaiEBIWeyzt0NzIraHaf9H+UCzY/i+Iem0WD cq5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H4LfHzCS; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h22si534805ejj.363.2020.06.29.14.55.37; Mon, 29 Jun 2020 14:55:37 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=@linaro.org header.s=google header.b=H4LfHzCS; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391582AbgF2Vzf (ORCPT + 9 others); Mon, 29 Jun 2020 17:55:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391566AbgF2Vz3 (ORCPT ); Mon, 29 Jun 2020 17:55:29 -0400 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA521C03E97E for ; Mon, 29 Jun 2020 14:55:29 -0700 (PDT) Received: by mail-io1-xd41.google.com with SMTP id o5so18801617iow.8 for ; Mon, 29 Jun 2020 14:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MhXLf8hCPPQ+UdSoyfLtjbvzDTqGh8KFNg/omzR+iuI=; b=H4LfHzCS2CW6/4yLINtVbSs0mFoQdgIJuZTVKx5VSUNSNAbwhnNbykExgW8yKLSesi //uiaPsrXlk8+bzgLVF8FN+ZfPNN/VB1YhCnM4POfqeCZXivOdIDYPMh4SP1InXwhiF9 SQ1XEx+PqUQhgF+iV/bQY8u7dqPusIEFtWdwCQN+ZuC2vpx2A0zAI37e4717c7XMNG1q P3zHdt7M6ErNQbZp+lQQUaW3PbVDZAnkoHCzpPioEQluORd0wvwfr9uePxO3cvDRiDGP Spv/Zd6ck01HJmBj+IE1+sG8l+dnsJI9SLZytSCzfMZrtRbMk5ygBuMVlX5IgfarHbFd fTRg== 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=MhXLf8hCPPQ+UdSoyfLtjbvzDTqGh8KFNg/omzR+iuI=; b=EIZaN/8/5i+dfDgP6hsGjv/s9aDlr997w5A6vK7sA5qyAGRLF7cqmn8OWnEIsk1TGo Zalkx1QKE6+zJbYVNh4ntOJewSBxd2pOPofele5f4ZEUlzYDG4N2j0F4aIyUDjHpuV5I 1iMHfrhZ1fFDo/BT1NC6z3TA8sLkNKO55WZ9huZ8q79K3CDxGELLhClA6mrftph1fVS3 lNhyxdLFptDZpXZr3yxFGt6j6njLWcaNbT6SDEhsAOfs3cIAo0jghJ3ZwjTkPANg5IlE OtNdEVCRZqOPHePmq6euifSSMCwklME9wvIEbztYActZ+iIyyMogHkEEEJTGF9VjzL38 OhHg== X-Gm-Message-State: AOAM533cYof+H3v+sbAlzGaIMeHGDC/xfqxo7UdgSnHX8nCuiOgCfBKD NS101Y+9N33Y1EQ/UUAdponz2g== X-Received: by 2002:a02:3f1f:: with SMTP id d31mr19739447jaa.76.1593467729091; Mon, 29 Jun 2020 14:55:29 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id a187sm543221iog.2.2020.06.29.14.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 14:55:28 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: evgreen@chromium.org, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/3] net: ipa: reuse a local variable in ipa_endpoint_init_aggr() Date: Mon, 29 Jun 2020 16:55:23 -0500 Message-Id: <20200629215523.1196263-4-elder@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629215523.1196263-1-elder@linaro.org> References: <20200629215523.1196263-1-elder@linaro.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Reuse the "limit" local variable in ipa_endpoint_init_aggr() when setting the aggregation size limit. Simple cleanup. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_endpoint.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.25.1 diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 93449366d7d8..2f56981b051e 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -576,19 +576,20 @@ static void ipa_endpoint_init_aggr(struct ipa_endpoint *endpoint) if (endpoint->data->aggregation) { if (!endpoint->toward_ipa) { - u32 aggr_size = ipa_aggr_size_kb(IPA_RX_BUFFER_SIZE); u32 limit; val |= u32_encode_bits(IPA_ENABLE_AGGR, AGGR_EN_FMASK); val |= u32_encode_bits(IPA_GENERIC, AGGR_TYPE_FMASK); - val |= u32_encode_bits(aggr_size, - AGGR_BYTE_LIMIT_FMASK); + + limit = ipa_aggr_size_kb(IPA_RX_BUFFER_SIZE); + val |= u32_encode_bits(limit, AGGR_BYTE_LIMIT_FMASK); limit = IPA_AGGR_TIME_LIMIT_DEFAULT; limit = DIV_ROUND_CLOSEST(limit, IPA_AGGR_GRANULARITY); val |= u32_encode_bits(limit, AGGR_TIME_LIMIT_FMASK); - val |= u32_encode_bits(0, AGGR_PKT_LIMIT_FMASK); + /* AGGR_PKT_LIMIT is 0 (unlimited) */ + if (endpoint->data->rx.aggr_close_eof) val |= AGGR_SW_EOF_ACTIVE_FMASK; /* AGGR_HARD_BYTE_LIMIT_ENABLE is 0 */