From patchwork Fri Mar 26 15:11:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 409511 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1518435jai; Fri, 26 Mar 2021 08:12:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB2me+2r/V4CrLI75KZcpg0QDDQFOBUr9Ttcz8yTyNlpIcwy5RBwXw+5/59YzBpig4bdQY X-Received: by 2002:a17:907:33cd:: with SMTP id zk13mr15805658ejb.224.1616771520621; Fri, 26 Mar 2021 08:12:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616771520; cv=none; d=google.com; s=arc-20160816; b=JrnGi9+x3I4U+QTzCwvdjlRgpaLSlXr4wayNpZpawmKgwWVkaQMfKuiuk2HBI0ibap giAzAx8NDilvfXNqCLB26b6Ld59THagrlSsXwSJUYfp5/zKa3nYF5ctDpMnGHL90wz60 9SlMEBNwutz3inTIPh+5E05mAsZJjT1pVPWiSvU8SLwq7mNC8Tv8qFs6URIubyb8iQ+k lrXYww7lpo2Y0EnyQHwvOirJ82BzSeh1CrVs/kwZql0JU2Bhh3+Rzv00u8s1z3mSI86Z JYXi8a+vvnHJ+S1EogiFS3j/rmSgdCiJgX+3XefdaiAkKMzGln7vq67/0LfS0jvWI6NF kcNQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=pPbyh2/n0MvOIkXLJmahFB/CN/U6m46NpyC/vQAi3ec=; b=QVIdR0lUm9lctH0bGlpohYoKeEnm7dnrhIMSUt4vFhXOnIC4Apa/XzdbWKQ0nGYaE+ Bz/KdJlRPzl75PRcN6vScmX4y3kPMx2cNF9Z+Oilq2Ola4EP1xIaqoSf+TAPSZiEFQA0 AuI5m7gJhaS1ww8j6sTcxd1MJtd+Tt7K37XBitbRV1NX40qZIrNTcZ75hcSt9eplvzNt xbZ8ZIwZcXrWSHf04IHzeTv4k4Tz8WpFfXNOTWIaWgmmrF6lFC0L+gqBIVaa5cJWUWxF 0RWNbnQ9YElUXT1YzO+rJZBT0DUP9584UcyBuhVhpSawshbFNdzpKzgvHuq/PuFQKSZ2 SJLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sse2O1nQ; 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 lw25si6533712ejb.357.2021.03.26.08.12.00; Fri, 26 Mar 2021 08:12:00 -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=sse2O1nQ; 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 S230281AbhCZPLa (ORCPT + 8 others); Fri, 26 Mar 2021 11:11:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230297AbhCZPL1 (ORCPT ); Fri, 26 Mar 2021 11:11:27 -0400 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 325A1C0613B1 for ; Fri, 26 Mar 2021 08:11:27 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id j11so5252421ilu.13 for ; Fri, 26 Mar 2021 08:11: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:mime-version :content-transfer-encoding; bh=pPbyh2/n0MvOIkXLJmahFB/CN/U6m46NpyC/vQAi3ec=; b=sse2O1nQL88L0N2KQLGe1gWwkY7/c3qUljkhRzNM/IIWE2lGFSjpeAUIHxJo1zWwZ7 PmLQ1TzjSu4iR4oZlPTVF8cW19/1VhLvyRWpSzFzfRkPm4Yix1jD5mPvDA/9u37QY64w hDG5W8Ql+qLqrKOwrTthAdTR0tLbGeYfujB9Ic7ZPjGxIhhXZ9THuIYsKBj0XdbdhnSf DWoSccnBvNDQbs5MyUCxc5RH/6zfDJMhwe0Fh7yIs3eZv7cDGO48W9GybNIn6AuBmBTQ 7Yru96OOElFze4h4bUynoXcIakTPaKAox5gmgIx1QqrTNkeNTK0DP6JnZ4GjbOMJHDiH Xh/w== 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:mime-version :content-transfer-encoding; bh=pPbyh2/n0MvOIkXLJmahFB/CN/U6m46NpyC/vQAi3ec=; b=OVpajZmim3vp5KE4Dyx51loYIXSNKphjtg90mU6/eqdu3mOjIn4qy/rVEhkbUi/rfX XkeakU76sFUyAGQNR7AvNsyAqLaVc2oRWo4GGKQNCXdn6krQqQVCvwvAHUsC0GyyBI/h 4p6GNP/t8ezrXqDsJra0CIA9eE1xAFjvOpUqWOLpPcy+DSLnw+4RhzPm/hMDaH9nAhcV 357hJWEs2KewWt0dzxU9bH6qohvvcdZlSq4UNTC5HH21jQ5P7oAPiqc82KF/SrjQIgv/ RzW08HpJuuhj/hcS22j9i1rMZ0HnL+hPrtfzA4O3fyJ9tfNGsdobshWrKTlAs7RSttBj Xiwg== X-Gm-Message-State: AOAM533vUQppreXDZGwMP7u/l2DSXVAnyygWHptsRVldA2KJQ2NNy22m 5YqiXjIM+VLgV8tkZrHNYfXZyA== X-Received: by 2002:a92:db43:: with SMTP id w3mr5702334ilq.150.1616771486507; Fri, 26 Mar 2021 08:11:26 -0700 (PDT) Received: from localhost.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id j17sm4537706iok.37.2021.03.26.08.11.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Mar 2021 08:11:26 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, evgreen@chromium.org, cpratapa@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 00/12] net: ipa: rework resource programming Date: Fri, 26 Mar 2021 10:11:10 -0500 Message-Id: <20210326151122.3121383-1-elder@linaro.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This series reworks the way IPA resources are defined and programmed. It is a little long--and I apologize for that--but I think the patches are best taken together as a single unit. The IPA hardware operates with a set of distinct "resources." Each hardware instance has a fixed number of each resource type available. Available resources are divided into smaller pools, with each pool shared by endpoints in a "resource group." Each endpoint is thus assigned to a resource group that determines which pools supply resources the IPA hardware uses to handle the endpoint's processing. The exact set of resources used can differ for each version of IPA. Except for IPA v3.0 and v3.1, there are 5 source and 2 destination resource types, but there's no reason to assume this won't change. The number of resource groups used *does* typically change based on the hardware version. For example, some versions target reduced functionality and support fewer resource groups. With that as background... The net result of this series is to improve the flexibility with which IPA resources and resource groups are defined, permitting each version of IPA to define its own set of resources and groups. Along the way it isolates the resource-related code, and fixes a few bugs related to resource handling. The first patch moves resource-related code to a new C file (and header). It generates a checkpatch warning about updating MAINTAINERS, which can be ignored. The second patch fixes a bug, but the bug does not affect SDM845 or SC7180. The third patch defines an enumerated type whose members provide symbolic names for resource groups. The fourth defines some resource limits for SDM845 that were not previously being programmed. That platform "works" without this, but to be correct, these limits should really be programmed. The fifth patch uses a single enumerated type to define both source and destination resource type IDs, and the sixth uses those IDs to index the resource limit arrays. The seventh moves the definition of that enumerated type into the platform data files, allowing each platform to define its own set of resource types. The eighth and ninth are fairly trivial changes. One replaces two "max" symbols having the same value with a single symbol. And the other replaces two distinct but otherwise identical structure types with a single common one. The 10th is a small preparatory patch for the 11th, passing a different argument to a function that programs resource values. The 11th allows the actual number of source and destination resource groups for a platform to be specified in its configuration data. That way the number is based on the actual number of groups defined. This removes the need for a sort of clunky pair of functions that defined that information previously. Finally, the last patch just increases the number of resource groups that can be defined to 8. -Alex Alex Elder (12): net: ipa: introduce ipa_resource.c net: ipa: fix bug in resource group limit programming net: ipa: identify resource groups net: ipa: add some missing resource limits net: ipa: combine resource type definitions net: ipa: index resource limits with type net: ipa: move ipa_resource_type definition net: ipa: combine source and destination group limits net: ipa: combine source and destation resource types net: ipa: pass data for source and dest resource config net: ipa: record number of groups in data net: ipa: support more than 6 resource groups drivers/net/ipa/Makefile | 2 +- drivers/net/ipa/ipa_data-sc7180.c | 102 +++++++++-------- drivers/net/ipa/ipa_data-sdm845.c | 169 ++++++++++++++++----------- drivers/net/ipa/ipa_data.h | 62 ++++------ drivers/net/ipa/ipa_main.c | 148 +----------------------- drivers/net/ipa/ipa_reg.h | 46 +------- drivers/net/ipa/ipa_resource.c | 182 ++++++++++++++++++++++++++++++ drivers/net/ipa/ipa_resource.h | 27 +++++ 8 files changed, 393 insertions(+), 345 deletions(-) create mode 100644 drivers/net/ipa/ipa_resource.c create mode 100644 drivers/net/ipa/ipa_resource.h -- 2.27.0