From patchwork Mon Jan 30 21:01:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 50490 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2396558wrn; Mon, 30 Jan 2023 13:06:23 -0800 (PST) X-Google-Smtp-Source: AK7set8rAvoMOM+TcOsULfxW50DJHmCIMBIc8sXxfhmNh/8/GtDM/HQyGk+BMH2oBMFgTbZnqD1P X-Received: by 2002:aa7:8482:0:b0:593:b0f7:8734 with SMTP id u2-20020aa78482000000b00593b0f78734mr6488120pfn.20.1675112782739; Mon, 30 Jan 2023 13:06:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675112782; cv=none; d=google.com; s=arc-20160816; b=vpzHyOnnANgi5pQfnSNCJTWlFrX54scbAmRebMdxnke3tArATkgElLTIBqFpMjRprw mXmjxIVlCol2CwKh7poReoNxUCyAsriHchJDmLQ3wdJ3q/fMAqifG/rcOuCDo1GFQmwx OJi8YorS32WbuonlljNGFIc+56FhBgj8H6rhk8ZmYFjmAtqHIQjZMRHSjjOdwBAl4H1E N7qLBCaRGh65rsYSUQGyZ9/HczDzj21/3YXb9syLNJVad5WwWcaF0mEAWNczv5v9gk7i jjXc4gCkKCv7FDVoiy4JQYssi0XQuqK9To01h7pcil1apmzFlLN8RfrDuadSxbHe7kJG Pt1w== 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=6Q3ZO5XASIsXMpDUmQAaU+Lb+omH36X+YOT42bBfC3M=; b=U/BUfqHGAeTXgMYVXk4zZDJ1nE8se2rxj2zOY6kokPq/lBQE9UaezBkNUyyqzq8SY4 /lqZ5qiyhQpYSNYsI58PEx7aABhpXi4UbUb5lQzsKVU+TajZfXGxuKCmdzDqsWJWNzGO zqXMYsYK9LXQi+fqrf5mOweK8Sh9W1iNcVxkf//HCPGrj1FJrYcR6nmTErh+Jzw2gLql /nwuHbKYG2SKYNNIIZznuepKl01qtlXtQQr9ZuGv+lnd4chbJk+7xnfutO/EMc3rOZ6m V6RfDceeTOdxDCWs5Bgf6kkV7TX9DWr5wfFQ76IHUGgAPEs+vOTZ8Pzvax9kEyLXGD7W csVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M7Q2dK7B; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q20-20020aa79834000000b00593cc8f94c7si3514287pfl.328.2023.01.30.13.06.10; Mon, 30 Jan 2023 13:06:22 -0800 (PST) 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=@linaro.org header.s=google header.b=M7Q2dK7B; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230346AbjA3VEN (ORCPT + 99 others); Mon, 30 Jan 2023 16:04:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230320AbjA3VD7 (ORCPT ); Mon, 30 Jan 2023 16:03:59 -0500 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39E6E166F7 for ; Mon, 30 Jan 2023 13:03:52 -0800 (PST) Received: by mail-io1-xd33.google.com with SMTP id q6so2264284ior.12 for ; Mon, 30 Jan 2023 13:03:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6Q3ZO5XASIsXMpDUmQAaU+Lb+omH36X+YOT42bBfC3M=; b=M7Q2dK7BE8v+7dbB8GTF7HUnrgbQGlROg82yKcEvudTV+UfIq3Y8ju26ZYuTHDSE7c JAdF2DqZRDYjtj7uRfMdlA0JvI8kLKN1/Vn5URq884CUxFtDymJrroy+TKkZkGXO4hKg oUnYXJhjciLZkLsRUrrs0E907EUBcsEjgyDUr3iEYpzyML+W9MMFZ5xkUGj7uDMYd5CS WfIfx9x5/JaAZcOKs6yagr7rTPVhVv20Cx1fTcNGEYbaVCKGQPSd1tm1QB7pw/PjZ29j 1Km14Uv7xNuifDhlxwYLRn6wdI34h1k82CLfpaNNRzWdHKu9QvpIJQlWjeLZzsfxCH1m 3qyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6Q3ZO5XASIsXMpDUmQAaU+Lb+omH36X+YOT42bBfC3M=; b=ShZYgtyE9NCbabEoWMVmZUltWsHdJnpZeqJFywKtNJ5PlZz5zAPuOgs6r2thIqZ3LN k1X3G/2wMx+kOtSoGNnx/P/lLOIZ7HdXDlUib5sqE4uVti08/jWNjHROiVlvcWXxxw1F VXYAOL+m55fgFBLmxbBRB6TDWZ3FtSSkFxPGQuHKzx5rNZ7XTdq+WA8f4JUD0vRFmyrJ 5KofFQJk//eAPRy+OVwAF/hYnthjxxmwq6ZQlXUnUzhdUmQKlX/lLJ975uht8gYIosnI d20aSNmmBQY5W+SiogDAvtER5I9uyVvxZ/dtM2q9Fn7jVR+hBiIV9xr90cNVeJVhtRRg T4yA== X-Gm-Message-State: AO0yUKUNbRdl9ASybYcy8b2LuO19j73O5ALIH56HvlAW9TURSd17QzZx jo8rxQ8E5+Au97jCsLyjpKBPJg== X-Received: by 2002:a05:6602:22d8:b0:71f:2e0b:5c64 with SMTP id e24-20020a05660222d800b0071f2e0b5c64mr1882223ioe.3.1675112631552; Mon, 30 Jan 2023 13:03:51 -0800 (PST) Received: from presto.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id a30-20020a02735e000000b003aef8fded9asm1992046jae.127.2023.01.30.13.03.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 13:03:51 -0800 (PST) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: caleb.connolly@linaro.org, mka@chromium.org, evgreen@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 5/8] net: ipa: support zeroing new cache tables Date: Mon, 30 Jan 2023 15:01:55 -0600 Message-Id: <20230130210158.4126129-6-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230130210158.4126129-1-elder@linaro.org> References: <20230130210158.4126129-1-elder@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756483061290282352?= X-GMAIL-MSGID: =?utf-8?q?1756483061290282352?= IPA v5.0+ separates the configuration of entries in the cached (previously "hashed") routing and filtering tables into distinct registers. Previously a single "filter and router" register updated entries in both tables at once; now the routing and filter table caches have separate registers that define their content. This patch updates the code that zeroes entries in the cached filter and router tables to support IPA versions including v5.0+. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_table.c | 38 +++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/drivers/net/ipa/ipa_table.c b/drivers/net/ipa/ipa_table.c index 32ed9fec2ca74..b9d505191f884 100644 --- a/drivers/net/ipa/ipa_table.c +++ b/drivers/net/ipa/ipa_table.c @@ -499,13 +499,22 @@ static void ipa_filter_tuple_zero(struct ipa_endpoint *endpoint) u32 offset; u32 val; - reg = ipa_reg(ipa, ENDP_FILTER_ROUTER_HSH_CFG); + if (ipa->version < IPA_VERSION_5_0) { + reg = ipa_reg(ipa, ENDP_FILTER_ROUTER_HSH_CFG); - offset = ipa_reg_n_offset(reg, endpoint_id); - val = ioread32(endpoint->ipa->reg_virt + offset); + offset = ipa_reg_n_offset(reg, endpoint_id); + val = ioread32(endpoint->ipa->reg_virt + offset); - /* Zero all filter-related fields, preserving the rest */ - val &= ~ipa_reg_fmask(reg, FILTER_HASH_MSK_ALL); + /* Zero all filter-related fields, preserving the rest */ + val &= ~ipa_reg_fmask(reg, FILTER_HASH_MSK_ALL); + } else { + /* IPA v5.0 separates filter and router cache configuration */ + reg = ipa_reg(ipa, ENDP_FILTER_CACHE_CFG); + offset = ipa_reg_n_offset(reg, endpoint_id); + + /* Zero all filter-related fields */ + val = 0; + } iowrite32(val, endpoint->ipa->reg_virt + offset); } @@ -549,13 +558,22 @@ static void ipa_route_tuple_zero(struct ipa *ipa, u32 route_id) u32 offset; u32 val; - reg = ipa_reg(ipa, ENDP_FILTER_ROUTER_HSH_CFG); - offset = ipa_reg_n_offset(reg, route_id); + if (ipa->version < IPA_VERSION_5_0) { + reg = ipa_reg(ipa, ENDP_FILTER_ROUTER_HSH_CFG); + offset = ipa_reg_n_offset(reg, route_id); - val = ioread32(ipa->reg_virt + offset); + val = ioread32(ipa->reg_virt + offset); - /* Zero all route-related fields, preserving the rest */ - val &= ~ipa_reg_fmask(reg, ROUTER_HASH_MSK_ALL); + /* Zero all route-related fields, preserving the rest */ + val &= ~ipa_reg_fmask(reg, ROUTER_HASH_MSK_ALL); + } else { + /* IPA v5.0 separates filter and router cache configuration */ + reg = ipa_reg(ipa, ENDP_ROUTER_CACHE_CFG); + offset = ipa_reg_n_offset(reg, route_id); + + /* Zero all route-related fields */ + val = 0; + } iowrite32(val, ipa->reg_virt + offset); }