From patchwork Thu Jun 10 19:23:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 457867 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp752252jae; Thu, 10 Jun 2021 12:24:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw76dqZRCUR+mAschSH7qQOzzNh/XiV2TLvZKrXXcnurZPkwFZZQR/nClsG9Xu/XhtSZtRp X-Received: by 2002:a50:8751:: with SMTP id 17mr60852edv.340.1623353090742; Thu, 10 Jun 2021 12:24:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623353090; cv=none; d=google.com; s=arc-20160816; b=mPLDur7dux42d2dSjGlnyBp2/w5mU3GQpKtc0dhoFiZuxbSivOFLfgIy3Yrm9dbERt ruhzwchfi1o5oG7lVAMJ6A0zz2yQqW7fS9TR59moZQSxQha2UBrAYgexwj88Pck5ev9e +x+mmmGgQqLFDfJAA6XmlATvIgoZ2IWV75fEdzx+mCjf/86IMqsHCiQ5aL0StlNg9hSl ZUJYLYQCyucqk6/dFVV5VXFkNsfMDoCOnVzZCDgdUKnZ9pNUqa3Er7alSocC0PU9PL3E gMGteY+mypNCzSpEaivExpRrsDl+Rc0xp+7JV/Hs5dTouDyVb1lRTiNFBEpCyMfQ4MbP j10g== 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=0LR/OcJQA5f3nDTdvxLJUu8ZyXktmwHl0RJH9FX7qQU=; b=fu7DPiCRhk+cAFKRHsykfBhxNOF5tbCr6AfhFhOrPo2s+PVD2mZIpO0Q2xFTmjb+aq jI8UR97pUt0ANZnn6knz068L8GqiGAIZvIjVE4d9GUE0a6BtdmLn3t02fGVwyc69tdbK /IrrRMcrBNJ9/n2/W5QfuY8L/mPFPXAop2LgcThlOm41WRL1HrhdQyIeKWj2jqT3qrNB ZUP5EJoPculuEzQcAgXHI4/Jo26Po4vi1c/dUvTer0ANssqCrYroVkt0zAPin9wYTEbs P1jBnHXp4ivTYUEiK7boLCFKl+VlNMNWQNYnEDD7GZ/1g/OCuFpXLUWxv5BbHRERRHPN W7hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p8bKXIRy; 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 l2si2813531eji.562.2021.06.10.12.24.50; Thu, 10 Jun 2021 12:24:50 -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=p8bKXIRy; 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 S231200AbhFJT0Z (ORCPT + 8 others); Thu, 10 Jun 2021 15:26:25 -0400 Received: from mail-io1-f54.google.com ([209.85.166.54]:38619 "EHLO mail-io1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230368AbhFJT0V (ORCPT ); Thu, 10 Jun 2021 15:26:21 -0400 Received: by mail-io1-f54.google.com with SMTP id b25so28242719iot.5 for ; Thu, 10 Jun 2021 12:24:13 -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=0LR/OcJQA5f3nDTdvxLJUu8ZyXktmwHl0RJH9FX7qQU=; b=p8bKXIRy/IYNOEsQHxYEIA9Gjl3E5CCO326wvJDzLigfgsJXy7ISwuK1xQauRVmvjN 6KcUXBGDXZJ4/UxE1TpcGAj9HIfEIVAtBOlizxO3wXy/VekaZlNeNQ0WBMwvrKGLeBjd tggx/s7Ky5VmyD+8uFpROFz6v6wgz6FCCPBBlXqgyU/081ycJMfM5trSt9q+oMIA26rg O9dx5NYFoZ1YzkZaJ5/EOdUa+gd/IGff5dtje9OsyJBHBea5UQwi3EzAEvz3JF9k6iY5 2ePr1RKBXQvuOBqLuFmatvVA5EAFIFCpA/9V46i9MocEBL7EMMoN24j3NlsrLj1hNLHE 7kqQ== 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=0LR/OcJQA5f3nDTdvxLJUu8ZyXktmwHl0RJH9FX7qQU=; b=oholwY85DlZ1MzIzFxOEfE9mPbWjV0jA+MjcsXO8A+fMkaVsCUcnK7CgG1YL6rlZHs ecnvy9c7sTlfo76wpEBnOMOenRSGnTUkwlFGmzyMhVDerwhcJy3yqXCdNNTuLWI/midm 64UzdiKETNGQSyc8tPe4XPkRU4L2UrWyxQ+B641pnIMH4MZNxRTkJGkCM79LYrfkpbKq uYq/aCIuoBvSlwSL4ibJ/d8uyYqnmr5O3nY0RL6ESLLLl2Ws7PdMM4nnIHrYrl8OfOU8 vlzTXQUCuru4wPWWfbsI36e5kGAfQAeHxkl24SM5RrXMZD4v5hJ7ySJCLuLaCpN03gLe SzaQ== X-Gm-Message-State: AOAM532y3+9iAdXY61p6n4lNwTblAsaXJpJfeMv2Mat+p9/XFkLB+oeV wSRBwSjwgHauqM3axYwxgNyWUg== X-Received: by 2002:a05:6638:144f:: with SMTP id l15mr169728jad.131.1623352992650; Thu, 10 Jun 2021 12:23:12 -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 w21sm2028684iol.52.2021.06.10.12.23.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 12:23:12 -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 0/8] net: ipa: memory region rework, part 2 Date: Thu, 10 Jun 2021 14:23:00 -0500 Message-Id: <20210610192308.2739540-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 is the second portion of a set of patches updating the IPA memory region code. In this portion (part 2), the focus is on adjusting the code so that it no longer assumes the memory region descriptor array is indexed by the region identifier. This brings with it some related cleanup. Three loops are changed so their loop index variable is an unsigned rather than an enumerated type. A set of functions is changed so a region identifier (rather than a memory region descriptor pointer) is passed as argument, to simplify their call sites. This isn't entirely related or required, but I think it improves the code. A validation function for filter and route table memory regions is changed to take memory region IDs, rather than determining which region to validate based on a set of Boolean flags. Finally, ipa_mem_find() is created to abstract getting a memory descriptor based on its ID, and it is used everywhere rather than indexing the array. With that implemented, all of the memory regions can be defined by arrays of entries defined without providing index designators. -Alex Alex Elder (8): net: ipa: don't assume mem array indexed by ID net: ipa: clean up header memory validation net: ipa: pass mem_id to ipa_filter_reset_table() net: ipa: pass mem ID to ipa_mem_zero_region_add() net: ipa: pass mem_id to ipa_table_reset_add() net: ipa: pass memory id to ipa_table_valid_one() net: ipa: introduce ipa_mem_find() net: ipa: don't index mem data array by ID drivers/net/ipa/ipa_cmd.c | 50 +++++++++----- drivers/net/ipa/ipa_data-v3.5.1.c | 30 ++++----- drivers/net/ipa/ipa_data-v4.11.c | 44 ++++++------ drivers/net/ipa/ipa_data-v4.2.c | 36 +++++----- drivers/net/ipa/ipa_data-v4.5.c | 46 ++++++------- drivers/net/ipa/ipa_data-v4.9.c | 46 ++++++------- drivers/net/ipa/ipa_mem.c | 108 ++++++++++++++++-------------- drivers/net/ipa/ipa_mem.h | 3 +- drivers/net/ipa/ipa_qmi.c | 32 ++++----- drivers/net/ipa/ipa_table.c | 94 ++++++++++---------------- drivers/net/ipa/ipa_uc.c | 3 +- 11 files changed, 247 insertions(+), 245 deletions(-) -- 2.27.0