From patchwork Fri Mar 26 15:11:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 409519 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1519020jai; Fri, 26 Mar 2021 08:12:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoIAAozTI/s+tV0JGN/JLRZz0gdN/7e7Vh1A6a1YMdDH1Caf9t0Wlbdo0pGBh5oFqhsUez X-Received: by 2002:a17:906:4747:: with SMTP id j7mr15694849ejs.221.1616771559913; Fri, 26 Mar 2021 08:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616771559; cv=none; d=google.com; s=arc-20160816; b=vlqfUxp+pgLdc9n7iw8XEZKflM2CpOqWEJp6LobBNB0zSQZGlgfN45J5tXe0pCT6u1 Ley5ZcfqgTJ4sEYtHaLMR6SM2v4UDNXR8stED4kMdEyeqTl7qo9ORNJJDLjGSNlXLTBa 4xC2QkYVlbBzijgFC2tAhKqIoBY6BFKuIcIxvGIIjuL4I3X+xQIOM58OIEFWD7SZBX9j XjOSNAiT/dZbkEvPPxHsHA1UHSjfvQ77/Mxwmhx+ZcXWd80yv6q2Bv2GZElzO1v8t8DT IapCN9zvAPu3tKWWKrVucJfPxOCczU3Ka3COMozlKxHImajiJZZnCnTB08NuFey+Ju2S LByA== 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=r8MCXM9rweH39xKCcaLePx4yJlcBdDekCxD8KpCehno=; b=EktXVzfAnqwz8ZvrsKTeuNHbAbrfuGRscjnD0DkjnRf/BWIzt+I6JiCzS0U/nBqGET KEQukcvdJNWJPRaJl5lRUmgxyKgP+YFQ/KhZK1NGXnmWTvkdbw8s7Q+rCmKmMP3JPyDl uX+z7zcYxgdUTb8StEsyosY5qiFF4VuVP4bGDCYI3YP1tVrDgs/ga37g0XeUZ3h0xMZ/ ghTy9UhcmjE5lRa+qLBSScNpfBy0sqNJ4BYUg9Wp0fdYy44l8DYfXYXmgQhfuW6qtW2c UU4sNeQ3cEmCD6SUYjWdmaUddn3uW6yRL4MrfJky1H5q8gNWBvBDpG8m3BPSiLXuqf3q wi1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FoGSzOJj; 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.39; Fri, 26 Mar 2021 08:12:39 -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=FoGSzOJj; 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 S231197AbhCZPMQ (ORCPT + 8 others); Fri, 26 Mar 2021 11:12:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230339AbhCZPLg (ORCPT ); Fri, 26 Mar 2021 11:11:36 -0400 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 681BDC0613AA for ; Fri, 26 Mar 2021 08:11:36 -0700 (PDT) Received: by mail-il1-x12b.google.com with SMTP id c17so5298292ilj.7 for ; Fri, 26 Mar 2021 08:11:36 -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=r8MCXM9rweH39xKCcaLePx4yJlcBdDekCxD8KpCehno=; b=FoGSzOJjyXBWowm3oGpug3mjAbOr+Qoo5WNMpnOnqGRqBh+yVQwzVexrvRrcfsKIrR KYXnEjyHC+sc6P7lLoabkx0Jca/PS+43CuYWuyfa9a4E++j/ZrIQ5C9gENlMopYDkf/k HYjeNduL55MCO6IeGGyPwYjnS8QLNeZV2lYMPq8qkbKrJrHLL1rXgQny+OqC0EilpIOI maHsBeK6JrHptQV0b2mNBZKkcpOb1vOSZK7i0nU94kBpP4/BFHkYVTFe7JtmJKYZz/56 sZgj6Tf0ma0Ym7EsyGq5MmTqedpQTip8LKZn2nH2MOA+aSlkcDKyONl7HBpjFCeb2IXW Pufw== 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=r8MCXM9rweH39xKCcaLePx4yJlcBdDekCxD8KpCehno=; b=s6/hGrIXgrBJMcoGyR9uWjLgNvUfg8YWAnXammBGbKn0MTx20rzxdyPWC6ZehsEvSi k8rWQ/UHn4N5w4lLo9NayV+LHztbOkbNesZL8PhWcqvEI+I2lWQB+F4RivkQvsHgD73n HS2HYQ8Z7JPqjGPGegfkq84P7PVLyjf9au39RGbeLvboUGsvDQ5FGbzkavhvudlm6fpu 262sWXKz3Mk7UyBJPBYiUqgJzv1HoSj/PKwjvhGcn6Mlh/0pMaEommxseU0CWhVCn0A6 RMI8lKwWDUF9r4aiuwJAbzh7NcAaSVhQLybQZozZ6yocVVnwjuu0ILauDWM3piHmUblq gzaw== X-Gm-Message-State: AOAM531IQHPjThD/xEpFR3z7pVWzUr0rUcMujosriN0sHGpAbYX4ETJO su+FJhQc9Ig41g0t+RBtqBr2pA== X-Received: by 2002:a05:6e02:781:: with SMTP id q1mr10855183ils.59.1616771495867; Fri, 26 Mar 2021 08:11:35 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Mar 2021 08:11:35 -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 10/12] net: ipa: pass data for source and dest resource config Date: Fri, 26 Mar 2021 10:11:20 -0500 Message-Id: <20210326151122.3121383-11-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210326151122.3121383-1-elder@linaro.org> References: <20210326151122.3121383-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Pass the resource data pointer to ipa_resource_config_src() and ipa_resource_config_dst() to be used for configuring resource limits. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_resource.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_resource.c b/drivers/net/ipa/ipa_resource.c index c7edacfa7d19d..3db4dd3bda9cc 100644 --- a/drivers/net/ipa/ipa_resource.c +++ b/drivers/net/ipa/ipa_resource.c @@ -129,12 +129,15 @@ ipa_resource_config_common(struct ipa *ipa, u32 offset, } static void ipa_resource_config_src(struct ipa *ipa, u32 resource_type, - const struct ipa_resource *resource) + const struct ipa_resource_data *data) { u32 group_count = ipa_resource_group_src_count(ipa->version); const struct ipa_resource_limits *ylimits; + const struct ipa_resource *resource; u32 offset; + resource = &data->resource_src[resource_type]; + offset = IPA_REG_SRC_RSRC_GRP_01_RSRC_TYPE_N_OFFSET(resource_type); ylimits = group_count == 1 ? NULL : &resource->limits[1]; ipa_resource_config_common(ipa, offset, &resource->limits[0], ylimits); @@ -155,12 +158,15 @@ static void ipa_resource_config_src(struct ipa *ipa, u32 resource_type, } static void ipa_resource_config_dst(struct ipa *ipa, u32 resource_type, - const struct ipa_resource *resource) + const struct ipa_resource_data *data) { u32 group_count = ipa_resource_group_dst_count(ipa->version); const struct ipa_resource_limits *ylimits; + const struct ipa_resource *resource; u32 offset; + resource = &data->resource_dst[resource_type]; + offset = IPA_REG_DST_RSRC_GRP_01_RSRC_TYPE_N_OFFSET(resource_type); ylimits = group_count == 1 ? NULL : &resource->limits[1]; ipa_resource_config_common(ipa, offset, &resource->limits[0], ylimits); @@ -189,10 +195,10 @@ int ipa_resource_config(struct ipa *ipa, const struct ipa_resource_data *data) return -EINVAL; for (i = 0; i < data->resource_src_count; i++) - ipa_resource_config_src(ipa, i, &data->resource_src[i]); + ipa_resource_config_src(ipa, i, data); for (i = 0; i < data->resource_dst_count; i++) - ipa_resource_config_dst(ipa, i, &data->resource_dst[i]); + ipa_resource_config_dst(ipa, i, data); return 0; }