From nobody Sat May 9 09:32:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6D14C433EF for ; Thu, 19 May 2022 15:12:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240560AbiESPMg (ORCPT ); Thu, 19 May 2022 11:12:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237745AbiESPMX (ORCPT ); Thu, 19 May 2022 11:12:23 -0400 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EDE8CC142 for ; Thu, 19 May 2022 08:12:22 -0700 (PDT) Received: by mail-io1-xd2a.google.com with SMTP id e3so6075592ios.6 for ; Thu, 19 May 2022 08:12:22 -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=fYUM9Hp1d5sabbtZb6luJU4yZ+5byuqgyPQE1mhLONs=; b=JzSMmah+FxGQaRWTBuVsfP27ouH5MKBWWdI1leSNqmZTJ6wdLKx8B+IEgV/XqZ1kCm v4rb3edqpdympwyK/AWfiM+xDFsz3Nj+cIlHP8zGwWhMIidXjnCCwb5fxwFyz7c8kgxR /kTBjmOg7OxyS3Gp4Geux+kRGD2d30Y3rcke207uYv45+toVudUM1CTeZd8OMsMQUKQ9 GZm1muZTB3jEVSj5TlupQoeEYdVoFKNLsImibnsE0LqMI8vF5em1asnbWuX6aOQ5WQUh Mpg8v3reJ7a1XWT51TS9As18JZzNlFuRAlUMsYZ7IysEZs8qhVMafA9qqscXZyOqsCKj mYNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fYUM9Hp1d5sabbtZb6luJU4yZ+5byuqgyPQE1mhLONs=; b=3iKuG+LuRRtSV/Z9TARuOAbFw3qhiNLfoR77yMJWPOeSrjlkiFsZnpfFikIu8RN2m7 1oqrtrV0SJArUqGL9RW5gXDTbA89NmwAKgDlbeAZIJU2laQ1ySBKgC+9Q3GrzFgRydnH 3XUT0M/tZEjmIhsH6sxwIsPV1CKpcIFPWJp+Z9VXs5urlawggo3VqlKKe3joZ6XULs08 zqmbaMS254mMuUuHBVWMbpcNEBPTVgtcOkId1+olLy90fJPG3cNkDKaJj3h09McFCTU6 Axp0Vq5h67hl++aqwgrYbn8FkeBLZhM36aPMKuyxCF1/hLwWAddXKf20Dzi2VGBeNDx6 WoHw== X-Gm-Message-State: AOAM532eQeJulOA7SkWBMNoVVdPrmxZx2vBf7jEB80DdH1yJUfu7pa+L MiKnc09cIGmcPFO1mU0nJRfv6w== X-Google-Smtp-Source: ABdhPJzTKkd0m7xtwQWy7LWH7Epps7ucmg/bNPXVPLgzjldn2w6B2u3+tKGUU34CN8dGFfPbDNKnJg== X-Received: by 2002:a05:6602:1507:b0:65a:9eef:74d8 with SMTP id g7-20020a056602150700b0065a9eef74d8mr2862909iow.140.1652973141927; Thu, 19 May 2022 08:12:21 -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 g6-20020a025b06000000b0032e271a558csm683887jab.168.2022.05.19.08.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 08:12:21 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.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 1/7] net: ipa: drop an unneeded transaction reference Date: Thu, 19 May 2022 10:12:11 -0500 Message-Id: <20220519151217.654890-2-elder@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220519151217.654890-1-elder@linaro.org> References: <20220519151217.654890-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" In gsi_channel_update(), a reference count is taken on the last completed transaction "to keep it from completing" before we give the event back to the hardware. Completion processing for that transaction (and any other "new" ones) will not occur until after this function returns, so there's no risk it completing early. So there's no need to take and drop the additional transaction reference. Use local variables in the call to gsi_evt_ring_doorbell(). Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index db4cb2de218c0..5eb30113974cd 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -1490,12 +1490,8 @@ static struct gsi_trans *gsi_channel_update(struct g= si_channel *channel) if (index =3D=3D ring->index % ring->count) return NULL; =20 - /* Get the transaction for the latest completed event. Take a - * reference to keep it from completing before we give the events - * for this and previous transactions back to the hardware. - */ + /* Get the transaction for the latest completed event. */ trans =3D gsi_event_trans(channel, gsi_ring_virt(ring, index - 1)); - refcount_inc(&trans->refcount); =20 /* For RX channels, update each completed transaction with the number * of bytes that were actually received. For TX channels, report @@ -1510,9 +1506,7 @@ static struct gsi_trans *gsi_channel_update(struct gs= i_channel *channel) gsi_trans_move_complete(trans); =20 /* Tell the hardware we've handled these events */ - gsi_evt_ring_doorbell(channel->gsi, channel->evt_ring_id, index); - - gsi_trans_free(trans); + gsi_evt_ring_doorbell(gsi, evt_ring_id, index); =20 return gsi_channel_trans_complete(channel); } --=20 2.32.0 From nobody Sat May 9 09:32:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A244AC433EF for ; Thu, 19 May 2022 15:12:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240610AbiESPMq (ORCPT ); Thu, 19 May 2022 11:12:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240491AbiESPMY (ORCPT ); Thu, 19 May 2022 11:12:24 -0400 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4525D6832 for ; Thu, 19 May 2022 08:12:23 -0700 (PDT) Received: by mail-io1-xd2e.google.com with SMTP id z18so6084588iob.5 for ; Thu, 19 May 2022 08:12:23 -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=u9qaIWyA9uNywpEUw7kTE6d95X5zg1e5QyGsV1unQNs=; b=okV+OY5euXuUWRW1si2pG28tdFBUY7vhVb7WYWnyrGBhrNVAfcSFvDfG0qlYQIEhGD K7nXTFzPiRehg7ZsJRAKzE1jJYVJA+5b4TAqntjRrez/WEp2OUHPdKvrzCu1LIqa0/RQ GBfDLdLf/Ah+UqEKu2q1WVB7NXr63FvFbWOthjXzPxFYOyeBjGfRLLXdfrJP2Y/7ETvk SKx6CdZnHBaHOrXKl5IZih/VnQIny+PHcYfbZM1N473MMpmbbmpBrRauCcQWCPQCyYPr ArOtrFR7VNavyBLKQpeslg0qNDK1Waw41/LAQcV6QY0+vJr+zrkLiPhW+iVN+qLhlH2m dvFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u9qaIWyA9uNywpEUw7kTE6d95X5zg1e5QyGsV1unQNs=; b=i2Knzv6ZaFvZwX3O1dUbzLMbqWEfwI3h4vNllC1yvKLs/fPu2HpWREWb4n2RZYR8LV zRo51CD7YFJ1XURPrlP7QL9TXeCPO8A++xsh2P8HuR5VtZy0V/sWAbzoka9CLGOe/mq9 HurfxBbhUGHQ4AicZqhV68LC46lar55u0NqW7kXelIXQVKDeh/dGrGVEEO0c90w8V6qE +48XLV2ZGxCZmL+HxDR03VVrqICwZ7OoSJXLYblU68kWgROQPm6QOn+ujYI4XUcJjLjK IL0/jtzAD0C4y5ISvLGoVk3hni0G4hYEAjsL+W1QoBgRdPVq/2xdc2bEP5CdRNJ/buM9 6ZXA== X-Gm-Message-State: AOAM532OAZ5WvxtyQSlaEU4gJL3iV9bfDtR4ibxo+JppWFtCTM8htD4D 26AI/RskrDnXvrTUCMi6KDGdnA== X-Google-Smtp-Source: ABdhPJyl/3ypaRK71Jb3RHvfLfN5sSszW8m9VQgGjTht5UuB8uGREUs/faTrM+Qt+UxtZOZhzTCiiQ== X-Received: by 2002:a05:6602:2c4b:b0:65a:c92a:d3eb with SMTP id x11-20020a0566022c4b00b0065ac92ad3ebmr2688164iov.138.1652973143233; Thu, 19 May 2022 08:12:23 -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 g6-20020a025b06000000b0032e271a558csm683887jab.168.2022.05.19.08.12.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 08:12:22 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.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 2/7] net: ipa: rename a GSI error code Date: Thu, 19 May 2022 10:12:12 -0500 Message-Id: <20220519151217.654890-3-elder@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220519151217.654890-1-elder@linaro.org> References: <20220519151217.654890-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The CHANNEL_NOT_RUNNING error condition has been generalized, so rename it to be INCORRECT_CHANNEL_STATE. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 6 +++--- drivers/net/ipa/gsi_reg.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 5eb30113974cd..d47ba16465d29 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -1179,15 +1179,15 @@ static void gsi_isr_gp_int1(struct gsi *gsi) * Similarly, we could get an error back when updating flow control * on a channel because it's not in the proper state. * - * In either case, we silently ignore a CHANNEL_NOT_RUNNING error - * if we receive it. + * In either case, we silently ignore a INCORRECT_CHANNEL_STATE + * error if we receive it. */ val =3D ioread32(gsi->virt + GSI_CNTXT_SCRATCH_0_OFFSET); result =3D u32_get_bits(val, GENERIC_EE_RESULT_FMASK); =20 switch (result) { case GENERIC_EE_SUCCESS: - case GENERIC_EE_CHANNEL_NOT_RUNNING: + case GENERIC_EE_INCORRECT_CHANNEL_STATE: gsi->result =3D 0; break; =20 diff --git a/drivers/net/ipa/gsi_reg.h b/drivers/net/ipa/gsi_reg.h index 8906f4381032e..5bd8b31656d30 100644 --- a/drivers/net/ipa/gsi_reg.h +++ b/drivers/net/ipa/gsi_reg.h @@ -515,7 +515,7 @@ enum gsi_err_type { /** enum gsi_generic_ee_result - GENERIC_EE_RESULT field values in SCRATCH= _0 */ enum gsi_generic_ee_result { GENERIC_EE_SUCCESS =3D 0x1, - GENERIC_EE_CHANNEL_NOT_RUNNING =3D 0x2, + GENERIC_EE_INCORRECT_CHANNEL_STATE =3D 0x2, GENERIC_EE_INCORRECT_DIRECTION =3D 0x3, GENERIC_EE_INCORRECT_CHANNEL_TYPE =3D 0x4, GENERIC_EE_INCORRECT_CHANNEL =3D 0x5, --=20 2.32.0 From nobody Sat May 9 09:32:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0903FC433EF for ; Thu, 19 May 2022 15:12:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240615AbiESPMv (ORCPT ); Thu, 19 May 2022 11:12:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240526AbiESPMZ (ORCPT ); Thu, 19 May 2022 11:12:25 -0400 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89C9CC9EFB for ; Thu, 19 May 2022 08:12:24 -0700 (PDT) Received: by mail-io1-xd35.google.com with SMTP id m6so6089006iob.4 for ; Thu, 19 May 2022 08:12:24 -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=6+Fem4lozWtl3MTEsgHhD7kgm6g1Bv+TgSucDp8qwU4=; b=r8lduLPLV/+WJPs6xI0z67kdZYr4bhBq7UBDVx0J2I2/QhR92iwg/faGLrSIQp+SVc oPqcaYoq8nQwo3b727CCcKbujGQw8gtgmSR8zdRhRFgzrjxAm0nwezkpDCMjGN8cC3Tj gr2UnFJuvASHof5uaMd7mQ6nOJYcKFfwYi8fwh+K94DO4eluJqd53qqbAACScC+Gy/2r UF+d3O0iP/pqmA3smXJjUQyQOkDEWp1e5C8FRqD74EMDkR6fKblLTMwIqKqEBEC4mqHc vQtQsSoikiNSAJ0i+bynrEb5QLUJnx1GXrkYtL1GZPI8IMARs5QUtVqB6bjdpmX1jKbs XG7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6+Fem4lozWtl3MTEsgHhD7kgm6g1Bv+TgSucDp8qwU4=; b=Ng1XkU2P/h5/3i1VUfPKzgru0LF23Pu3ciE3dPR7P0x3TykSLBq38RZE00mWIBajBW t9/jFbM4vA3F7L5FTSKsc+LBoSPvwPKd0t4dLP87cHpe1dSzxefHHZyx/6EESDEYZ0lt +yZKN/NFmJwQJH0/BwvDhFGzFK+rCLHYfGa+b7Me6ELUBxB2m0DOkGLX/K0OYF25TbWa bmrhikihIH7naMRG5SSPCeQU524LE/r8RGsq9cPfXg0koMYmczzvagZA2ZnycU0+nkCS 9zMVuSJBQl7QOX992mRb0TqBfyWCjpCzb05XzivJpBYddD9+R6MrRpUl82ihWQrmXAE4 p3Ig== X-Gm-Message-State: AOAM532f0LTHnfZJdXlVuN5iyNGk5OP5Ff5ahCEgE/wGGJSv0OXgj1MB 2Z0Qy1iRNk6FyvwduCe5SmiIABIJEeYKvA== X-Google-Smtp-Source: ABdhPJxBWtqaGJIJb1L/gDMiDvisXZovCsnyBQNBra6+I7P0WT7dPYuwficRbqp0p8zoo1epJtVNzQ== X-Received: by 2002:a6b:5017:0:b0:65b:aa4:96cf with SMTP id e23-20020a6b5017000000b0065b0aa496cfmr2820248iob.47.1652973144210; Thu, 19 May 2022 08:12:24 -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 g6-20020a025b06000000b0032e271a558csm683887jab.168.2022.05.19.08.12.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 08:12:23 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.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 3/7] net: ipa: ignore endianness if there is no header Date: Thu, 19 May 2022 10:12:13 -0500 Message-Id: <20220519151217.654890-4-elder@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220519151217.654890-1-elder@linaro.org> References: <20220519151217.654890-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" If we program an RX endpoint to have no header (header length is 0), header-related endpoint configuration values are meaningless and are ignored. The only case we support that defines a header is QMAP endpoints. In ipa_endpoint_init_hdr_ext() we set the endianness mask value unconditionally, but it should not be done if there is no header (meaning it is not configured for QMAP). Set the endianness conditionally, and rearrange the logic in that function slightly to avoid testing the qmap flag twice. Delete an incorrect comment in ipa_endpoint_init_aggr(). Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_endpoint.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index e133eb2bebcfb..3fcd7c64c9bba 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -587,19 +587,23 @@ static void ipa_endpoint_init_hdr_ext(struct ipa_endp= oint *endpoint) struct ipa *ipa =3D endpoint->ipa; u32 val =3D 0; =20 - val |=3D HDR_ENDIANNESS_FMASK; /* big endian */ + if (endpoint->data->qmap) { + /* We have a header, so we must specify its endianness */ + val |=3D HDR_ENDIANNESS_FMASK; /* big endian */ =20 - /* A QMAP header contains a 6 bit pad field at offset 0. The RMNet - * driver assumes this field is meaningful in packets it receives, - * and assumes the header's payload length includes that padding. - * The RMNet driver does *not* pad packets it sends, however, so - * the pad field (although 0) should be ignored. - */ - if (endpoint->data->qmap && !endpoint->toward_ipa) { - val |=3D HDR_TOTAL_LEN_OR_PAD_VALID_FMASK; - /* HDR_TOTAL_LEN_OR_PAD is 0 (pad, not total_len) */ - val |=3D HDR_PAYLOAD_LEN_INC_PADDING_FMASK; - /* HDR_TOTAL_LEN_OR_PAD_OFFSET is 0 */ + /* A QMAP header contains a 6 bit pad field at offset 0. + * The RMNet driver assumes this field is meaningful in + * packets it receives, and assumes the header's payload + * length includes that padding. The RMNet driver does + * *not* pad packets it sends, however, so the pad field + * (although 0) should be ignored. + */ + if (!endpoint->toward_ipa) { + val |=3D HDR_TOTAL_LEN_OR_PAD_VALID_FMASK; + /* HDR_TOTAL_LEN_OR_PAD is 0 (pad, not total_len) */ + val |=3D HDR_PAYLOAD_LEN_INC_PADDING_FMASK; + /* HDR_TOTAL_LEN_OR_PAD_OFFSET is 0 */ + } } =20 /* HDR_PAYLOAD_LEN_INC_PADDING is 0 */ @@ -759,8 +763,6 @@ static void ipa_endpoint_init_aggr(struct ipa_endpoint = *endpoint) =20 close_eof =3D rx_data->aggr_close_eof; val |=3D aggr_sw_eof_active_encoded(version, close_eof); - - /* AGGR_HARD_BYTE_LIMIT_ENABLE is 0 */ } else { val |=3D u32_encode_bits(IPA_ENABLE_DEAGGR, AGGR_EN_FMASK); --=20 2.32.0 From nobody Sat May 9 09:32:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20745C433F5 for ; Thu, 19 May 2022 15:12:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237745AbiESPM4 (ORCPT ); Thu, 19 May 2022 11:12:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240475AbiESPM0 (ORCPT ); Thu, 19 May 2022 11:12:26 -0400 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E65D0D412B for ; Thu, 19 May 2022 08:12:25 -0700 (PDT) Received: by mail-io1-xd35.google.com with SMTP id m6so6089006iob.4 for ; Thu, 19 May 2022 08:12:25 -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=nxAxEwpYxRir5k7Jix50x061l0SV3yP8iku6r8UOnSA=; b=GyyvoV+ytXOA2P3NDeGlTeLxNHXyVMiiYsn1E0p9TKjM0y/A7rGysu5MzWAXgrv+pI bjwi0hYOxRIQLw3rrLghEtc5k/k1nE/DL+tOVB7Bc/OIg1Wys+0dci+S11biuhuzVFi6 0IoIP6Q14G0KH2gUM8a8d5+olWg195t5bK/3TUDA4tApBgaNS+4OH1JK/hoxUlAmsZmU E7ie1HplfnGNAb+O6kiKT2xYSa/x+ymbV97h6OF134q++epAPCgtdpA3eY8urg5ci1cW gB6ODaaTqf9dgZC5syipKoJz8c3BIdI886kVNi9SExCCm8XF8KWbBKMeLffdc+GEy8+Y hNCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nxAxEwpYxRir5k7Jix50x061l0SV3yP8iku6r8UOnSA=; b=Q1/2uOQHxVVdJSermmWzYAUTnic+RukabEeuYCraSDGWU5mLQdiS/hnASqte84Ivrn vknKG3sT6d9nScHnnN8GjnodpPwBtyEO2WkXLkMv9YrC/qGXpP1seQgySrv68CCCEZA7 uszhnZrmi1fyyM8ASnob7BFq6FvunRZsCaBMogD8QrsR6mz+IdUYbWUhVq35ToOzlvyX gMLb16yPj11ZvgTfiyEHABZvPAcmGttEAwkHh1ygQSq/tb/02Fg70YxI2a6qRvjHp9Mt oaHOl+2ZzuG+9uuJ9jDOLkUPdnwjvE9btQGMgZQHyR3H4cubFwpcWHv92F1RgE6MqkyZ ThLw== X-Gm-Message-State: AOAM530bhwqczJbNHpSVuOvpv6T5fcyrIV0dOPFIFQ7fI2uGAIdZOa+J WkyYBhQfuei5PTw37ZfM80Qr4g== X-Google-Smtp-Source: ABdhPJyyOlkq7X/Nwk1VOwKXMx7MI5/Mg1ETxQfe2iRM/hPc6uGSFVFek5Obl/7c1xpP8f37E7Ogtg== X-Received: by 2002:a5d:9bd9:0:b0:65e:1a97:fa70 with SMTP id d25-20020a5d9bd9000000b0065e1a97fa70mr2738456ion.48.1652973145598; Thu, 19 May 2022 08:12:25 -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 g6-20020a025b06000000b0032e271a558csm683887jab.168.2022.05.19.08.12.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 08:12:24 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.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 4/7] net: ipa: open-code ether_setup() Date: Thu, 19 May 2022 10:12:14 -0500 Message-Id: <20220519151217.654890-5-elder@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220519151217.654890-1-elder@linaro.org> References: <20220519151217.654890-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" About half of the fields set by the call in ipa_modem_netdev_setup() are overwritten after the call. Instead, just skip the call, and open-code the (other) assignments it makes to the net_device structure fields. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_modem.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ipa/ipa_modem.c b/drivers/net/ipa/ipa_modem.c index 27d87097433f0..dd6464ced2546 100644 --- a/drivers/net/ipa/ipa_modem.c +++ b/drivers/net/ipa/ipa_modem.c @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include =20 @@ -203,15 +205,20 @@ static const struct net_device_ops ipa_modem_ops =3D { static void ipa_modem_netdev_setup(struct net_device *netdev) { netdev->netdev_ops =3D &ipa_modem_ops; - ether_setup(netdev); - /* No header ops (override value set by ether_setup()) */ + netdev->header_ops =3D NULL; netdev->type =3D ARPHRD_RAWIP; netdev->hard_header_len =3D 0; + netdev->min_header_len =3D ETH_HLEN; + netdev->min_mtu =3D ETH_MIN_MTU; netdev->max_mtu =3D IPA_MTU; netdev->mtu =3D netdev->max_mtu; netdev->addr_len =3D 0; + netdev->tx_queue_len =3D DEFAULT_TX_QUEUE_LEN; netdev->flags &=3D ~(IFF_BROADCAST | IFF_MULTICAST); + netdev->priv_flags |=3D IFF_TX_SKB_SHARING; + eth_broadcast_addr(netdev->broadcast); + /* The endpoint is configured for QMAP */ netdev->needed_headroom =3D sizeof(struct rmnet_map_header); netdev->needed_tailroom =3D IPA_NETDEV_TAILROOM; --=20 2.32.0 From nobody Sat May 9 09:32:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C99CBC433F5 for ; Thu, 19 May 2022 15:13:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240628AbiESPNC (ORCPT ); Thu, 19 May 2022 11:13:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240543AbiESPM2 (ORCPT ); Thu, 19 May 2022 11:12:28 -0400 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23632DFF56 for ; Thu, 19 May 2022 08:12:27 -0700 (PDT) Received: by mail-io1-xd2d.google.com with SMTP id p74so2455126iod.8 for ; Thu, 19 May 2022 08:12: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=nbIZD+eoLSn0L8X0zyj/qmXa/fzoJP3zSwgdy7KECVg=; b=q54BrRgQWioyhoc8iuz7fHMH3hMXaFg7jG4TGl0HUtFCoSKT+KoOUKYBoDVLdKhxvu 0JBxRqnupyCtfw5gER3200BzDZv9rkq4gx+1vywa+R1Mg4ozDV1eA2345KiDsA7M8vJq RvRMxd1ftl+DSe9Uk3Pj2qlAV4dScrl5ggoin17P3+4ad8JuGzfPNbEPaO0MiD22FqjG /PswocZ5eWNZnayUX/tn7kkZtNEuul0OWzohWPeXRvP0p1c8KMNdfoifvMNB/v5Gx/EJ 3fFmIQ38QrE+SDEXrwUQf5lSdTxDVXTCgpiMcUzIReJlX8j5DAlFy3p+yDB2EcNHuIW8 ch8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nbIZD+eoLSn0L8X0zyj/qmXa/fzoJP3zSwgdy7KECVg=; b=eQHLi4i/kEzjs/Y56to3rqoZAyylzxYXU1pTMcc5BD0ibz4TNLSoM73ZaiHTu2fhT9 a91k6FyGwSe9bXPy7DiPbYqow59ChnaCMLS1ZTcYZna91zNFU/QX4fXBBD1q2hwvVvi6 Pw48QIYyBdYlnLiltWxEKBaGYoBZgeG5C48097k9whBLlaS3TD545xN+RqhY0lo7AXfi PvP13hRTmIIw+SBLIgujFm7OOoktbUbsOIAmnuHGvXLxRUNjDYt5+xVupYvI5TMjF1yI EwoZbgV21vnLMbvtebKE1NfiBpCDkHryzJ8kQLbYCoRzh049zrcH7mr9J+vVtkUKAtZ1 SnRA== X-Gm-Message-State: AOAM533XZ+JgLblNpJfIp2+/xSg0ERun3QNJnQMjQwatfmkzVxHcKF66 dGsUxrrQL/snDcMMQ13W/Wh5nw== X-Google-Smtp-Source: ABdhPJydnFT1mIcYtH7F0ehbjr+Ud6VSXTfoT1EiMYSzyYxkKJRw+Kz8DRD7GB/HsbeX9C0B7mPD4A== X-Received: by 2002:a5d:96d0:0:b0:654:91d3:97b7 with SMTP id r16-20020a5d96d0000000b0065491d397b7mr2743476iol.164.1652973146816; Thu, 19 May 2022 08:12:26 -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 g6-20020a025b06000000b0032e271a558csm683887jab.168.2022.05.19.08.12.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 08:12:26 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.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/7] net: ipa: move endpoint configuration data definitions Date: Thu, 19 May 2022 10:12:15 -0500 Message-Id: <20220519151217.654890-6-elder@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220519151217.654890-1-elder@linaro.org> References: <20220519151217.654890-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Move the definitions of the structures defining endpoint-specific configuration data out of "ipa_data.h" and into "ipa_endpoint.h". This is a trivial movement of code without any other change, to prepare for the next few patches. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_data.h | 62 ---------------------------------- drivers/net/ipa/ipa_endpoint.h | 62 ++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 62 deletions(-) diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index dbbeecf6df298..d611b5e96497c 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -95,68 +95,6 @@ struct gsi_channel_data { u8 tlv_count; }; =20 -/** - * struct ipa_endpoint_tx_data - configuration data for TX endpoints - * @seq_type: primary packet processing sequencer type - * @seq_rep_type: sequencer type for replication processing - * @status_endpoint: endpoint to which status elements are sent - * - * The @status_endpoint is only valid if the endpoint's @status_enable - * flag is set. - */ -struct ipa_endpoint_tx_data { - enum ipa_seq_type seq_type; - enum ipa_seq_rep_type seq_rep_type; - enum ipa_endpoint_name status_endpoint; -}; - -/** - * struct ipa_endpoint_rx_data - configuration data for RX endpoints - * @buffer_size: requested receive buffer size (bytes) - * @pad_align: power-of-2 boundary to which packet payload is aligned - * @aggr_close_eof: whether aggregation closes on end-of-frame - * - * With each packet it transfers, the IPA hardware can perform certain - * transformations of its packet data. One of these is adding pad bytes - * to the end of the packet data so the result ends on a power-of-2 bounda= ry. - * - * It is also able to aggregate multiple packets into a single receive buf= fer. - * Aggregation is "open" while a buffer is being filled, and "closes" when - * certain criteria are met. One of those criteria is the sender indicati= ng - * a "frame" consisting of several transfers has ended. - */ -struct ipa_endpoint_rx_data { - u32 buffer_size; - u32 pad_align; - bool aggr_close_eof; -}; - -/** - * struct ipa_endpoint_config_data - IPA endpoint hardware configuration - * @resource_group: resource group to assign endpoint to - * @checksum: whether checksum offload is enabled - * @qmap: whether endpoint uses QMAP protocol - * @aggregation: whether endpoint supports aggregation - * @status_enable: whether endpoint uses status elements - * @dma_mode: whether endpoint operates in DMA mode - * @dma_endpoint: peer endpoint, if operating in DMA mode - * @tx: TX-specific endpoint information (see above) - * @rx: RX-specific endpoint information (see above) - */ -struct ipa_endpoint_config_data { - u32 resource_group; - bool checksum; - bool qmap; - bool aggregation; - bool status_enable; - bool dma_mode; - enum ipa_endpoint_name dma_endpoint; - union { - struct ipa_endpoint_tx_data tx; - struct ipa_endpoint_rx_data rx; - }; -}; - /** * struct ipa_endpoint_data - IPA endpoint configuration data * @filter_support: whether endpoint supports filtering diff --git a/drivers/net/ipa/ipa_endpoint.h b/drivers/net/ipa/ipa_endpoint.h index 12fd5b16c18eb..85fe15b5d983e 100644 --- a/drivers/net/ipa/ipa_endpoint.h +++ b/drivers/net/ipa/ipa_endpoint.h @@ -40,6 +40,68 @@ enum ipa_endpoint_name { =20 #define IPA_ENDPOINT_MAX 32 /* Max supported by driver */ =20 +/** + * struct ipa_endpoint_tx_data - configuration data for TX endpoints + * @seq_type: primary packet processing sequencer type + * @seq_rep_type: sequencer type for replication processing + * @status_endpoint: endpoint to which status elements are sent + * + * The @status_endpoint is only valid if the endpoint's @status_enable + * flag is set. + */ +struct ipa_endpoint_tx_data { + enum ipa_seq_type seq_type; + enum ipa_seq_rep_type seq_rep_type; + enum ipa_endpoint_name status_endpoint; +}; + +/** + * struct ipa_endpoint_rx_data - configuration data for RX endpoints + * @buffer_size: requested receive buffer size (bytes) + * @pad_align: power-of-2 boundary to which packet payload is aligned + * @aggr_close_eof: whether aggregation closes on end-of-frame + * + * With each packet it transfers, the IPA hardware can perform certain + * transformations of its packet data. One of these is adding pad bytes + * to the end of the packet data so the result ends on a power-of-2 bounda= ry. + * + * It is also able to aggregate multiple packets into a single receive buf= fer. + * Aggregation is "open" while a buffer is being filled, and "closes" when + * certain criteria are met. One of those criteria is the sender indicati= ng + * a "frame" consisting of several transfers has ended. + */ +struct ipa_endpoint_rx_data { + u32 buffer_size; + u32 pad_align; + bool aggr_close_eof; +}; + +/** + * struct ipa_endpoint_config_data - IPA endpoint hardware configuration + * @resource_group: resource group to assign endpoint to + * @checksum: whether checksum offload is enabled + * @qmap: whether endpoint uses QMAP protocol + * @aggregation: whether endpoint supports aggregation + * @status_enable: whether endpoint uses status elements + * @dma_mode: whether endpoint operates in DMA mode + * @dma_endpoint: peer endpoint, if operating in DMA mode + * @tx: TX-specific endpoint information (see above) + * @rx: RX-specific endpoint information (see above) + */ +struct ipa_endpoint_config_data { + u32 resource_group; + bool checksum; + bool qmap; + bool aggregation; + bool status_enable; + bool dma_mode; + enum ipa_endpoint_name dma_endpoint; + union { + struct ipa_endpoint_tx_data tx; + struct ipa_endpoint_rx_data rx; + }; +}; + /** * enum ipa_replenish_flag: RX buffer replenish flags * --=20 2.32.0 From nobody Sat May 9 09:32:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C702BC433F5 for ; Thu, 19 May 2022 15:13:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240654AbiESPNH (ORCPT ); Thu, 19 May 2022 11:13:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240548AbiESPMa (ORCPT ); Thu, 19 May 2022 11:12:30 -0400 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABBB8C1EC8 for ; Thu, 19 May 2022 08:12:28 -0700 (PDT) Received: by mail-il1-x135.google.com with SMTP id i15so3858130ilk.5 for ; Thu, 19 May 2022 08:12: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=9K81zor/vNDWgLyjh1MeLD26Ld7TFFkGmFoi2TJ8/oY=; b=Gm42HtkEfQVMVaJCoQGabbSxtw/s7sExdQrcf2jkmLuikqMTfTX4x3I0E2dWPb+Y5p ffuw+YnUIJO9tcAgWqwiceyzeUMDa5rxVQ0gqPfkGpU0jwBNpy5OXySTNWdK3NqmPbj4 WwAkMW57clvqO4HCbUHf4RkSQPs1FKgRZxg7DKL93eoSbHDKUdlKK5e+GwGdyRaNS9wl gVp+3fjXPKYJfh/vZXQEYxWG+ksz10WsfCEu7eNnYKFR7VKgxOrjAo9jg4CS+jH0CBhA LmaxC5icO9bF7WePJMz45wBn+7Pc+OeHvMSuJJ4SMle41eivAj+0R71KGAgdpLFGIwQj y+lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9K81zor/vNDWgLyjh1MeLD26Ld7TFFkGmFoi2TJ8/oY=; b=5NljwzdiGcRgcv7naQRPtUWrUmni8/6azYRCTtgOzo4+bsm/tZfb42zm1F38VkYMlW M5YUOVebQ3/JK4hbccDpJJ0N120R+JnmHCH8Q4syXnBjvfW5v+LIGVndpyn8iWBF+rH/ VTpt43ARBt1SPA4BoubdvIehGrM5CKAR7snmvFWc7qSV3BElQW3UFbL5rCVhib0rvPuH Pmwpr0geoG57Ss/j+5FfTlu7Zp4eIZ/5knvr9cr7c/btrQN9X7LR6LncW7HR5N4y4hNu a+KdD9B4S2uMsJzoGwaT4ftJYm1vCNxIn0zoA1drY3niI0xA4ky3nFQAxczxVQ9pV9Lu rUUw== X-Gm-Message-State: AOAM531M0XJZ5Vq9MGCNZ0g8Ud3OZKzZTwuBB3uUhE9kJvxe/xqI/o19 g3XNga+ODaRK6XcTt0tWsuUBhA== X-Google-Smtp-Source: ABdhPJwcAoSAMJ1T1o0E2qxdlZhqlb2mFulSas6P+uDGqaJdj28xraWqADuzIH2oYmqiInTg2u2R+w== X-Received: by 2002:a05:6e02:be8:b0:2cf:b8d:5fa with SMTP id d8-20020a056e020be800b002cf0b8d05famr3087951ilu.93.1652973147973; Thu, 19 May 2022 08:12: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 g6-20020a025b06000000b0032e271a558csm683887jab.168.2022.05.19.08.12.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 08:12:27 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.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 6/7] net: ipa: rename a few endpoint config data types Date: Thu, 19 May 2022 10:12:16 -0500 Message-Id: <20220519151217.654890-7-elder@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220519151217.654890-1-elder@linaro.org> References: <20220519151217.654890-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Rename the just-moved data structure types to drop the "_data" suffix, to make it more obvious they are no longer meant to be used just as read-only initialization data. Rename the fields and variables of these types to use "config" instead of "data" in the name. This is another small step meant to facilitate review. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_data.h | 8 ++--- drivers/net/ipa/ipa_endpoint.c | 58 +++++++++++++++++----------------- drivers/net/ipa/ipa_endpoint.h | 26 +++++++-------- drivers/net/ipa/ipa_modem.c | 2 +- 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index d611b5e96497c..e15eb3cd3e333 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -98,7 +98,7 @@ struct gsi_channel_data { /** * struct ipa_endpoint_data - IPA endpoint configuration data * @filter_support: whether endpoint supports filtering - * @config: hardware configuration (see above) + * @config: hardware configuration * * Not all endpoints support the IPA filtering capability. A filter table * defines the filters to apply for those endpoints that support it. The @@ -106,12 +106,12 @@ struct gsi_channel_data { * for non-AP endpoints. For this reason we define *all* endpoints used * in the system, and indicate whether they support filtering. * - * The remaining endpoint configuration data applies only to AP endpoints. + * The remaining endpoint configuration data specifies default hardware + * configuration values that apply only to AP endpoints. */ struct ipa_endpoint_data { bool filter_support; - /* Everything else is specified only for AP endpoints */ - struct ipa_endpoint_config_data config; + struct ipa_endpoint_config config; }; =20 /** diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 3fcd7c64c9bba..bc95c71d80fc2 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -333,7 +333,7 @@ static void ipa_endpoint_suspend_aggr(struct ipa_endpoi= nt *endpoint) { struct ipa *ipa =3D endpoint->ipa; =20 - if (!endpoint->data->aggregation) + if (!endpoint->config->aggregation) return; =20 /* Nothing to do if the endpoint doesn't have aggregation open */ @@ -453,7 +453,7 @@ static void ipa_endpoint_init_cfg(struct ipa_endpoint *= endpoint) u32 val =3D 0; =20 /* FRAG_OFFLOAD_EN is 0 */ - if (endpoint->data->checksum) { + if (endpoint->config->checksum) { enum ipa_version version =3D endpoint->ipa->version; =20 if (endpoint->toward_ipa) { @@ -502,7 +502,7 @@ ipa_qmap_header_size(enum ipa_version version, struct i= pa_endpoint *endpoint) u32 header_size =3D sizeof(struct rmnet_map_header); =20 /* Without checksum offload, we just have the MAP header */ - if (!endpoint->data->checksum) + if (!endpoint->config->checksum) return header_size; =20 if (version < IPA_VERSION_4_5) { @@ -544,7 +544,7 @@ static void ipa_endpoint_init_hdr(struct ipa_endpoint *= endpoint) struct ipa *ipa =3D endpoint->ipa; u32 val =3D 0; =20 - if (endpoint->data->qmap) { + if (endpoint->config->qmap) { enum ipa_version version =3D ipa->version; size_t header_size; =20 @@ -583,11 +583,11 @@ static void ipa_endpoint_init_hdr(struct ipa_endpoint= *endpoint) static void ipa_endpoint_init_hdr_ext(struct ipa_endpoint *endpoint) { u32 offset =3D IPA_REG_ENDP_INIT_HDR_EXT_N_OFFSET(endpoint->endpoint_id); - u32 pad_align =3D endpoint->data->rx.pad_align; + u32 pad_align =3D endpoint->config->rx.pad_align; struct ipa *ipa =3D endpoint->ipa; u32 val =3D 0; =20 - if (endpoint->data->qmap) { + if (endpoint->config->qmap) { /* We have a header, so we must specify its endianness */ val |=3D HDR_ENDIANNESS_FMASK; /* big endian */ =20 @@ -615,7 +615,7 @@ static void ipa_endpoint_init_hdr_ext(struct ipa_endpoi= nt *endpoint) */ if (ipa->version >=3D IPA_VERSION_4_5) { /* HDR_TOTAL_LEN_OR_PAD_OFFSET is 0, so MSB is 0 */ - if (endpoint->data->qmap && !endpoint->toward_ipa) { + if (endpoint->config->qmap && !endpoint->toward_ipa) { u32 offset; =20 offset =3D offsetof(struct rmnet_map_header, pkt_len); @@ -640,7 +640,7 @@ static void ipa_endpoint_init_hdr_metadata_mask(struct = ipa_endpoint *endpoint) offset =3D IPA_REG_ENDP_INIT_HDR_METADATA_MASK_N_OFFSET(endpoint_id); =20 /* Note that HDR_ENDIANNESS indicates big endian header fields */ - if (endpoint->data->qmap) + if (endpoint->config->qmap) val =3D (__force u32)cpu_to_be32(IPA_ENDPOINT_QMAP_METADATA_MASK); =20 iowrite32(val, endpoint->ipa->reg_virt + offset); @@ -654,8 +654,8 @@ static void ipa_endpoint_init_mode(struct ipa_endpoint = *endpoint) if (!endpoint->toward_ipa) return; /* Register not valid for RX endpoints */ =20 - if (endpoint->data->dma_mode) { - enum ipa_endpoint_name name =3D endpoint->data->dma_endpoint; + if (endpoint->config->dma_mode) { + enum ipa_endpoint_name name =3D endpoint->config->dma_endpoint; u32 dma_endpoint_id; =20 dma_endpoint_id =3D endpoint->ipa->name_map[name]->endpoint_id; @@ -741,18 +741,18 @@ static void ipa_endpoint_init_aggr(struct ipa_endpoin= t *endpoint) enum ipa_version version =3D endpoint->ipa->version; u32 val =3D 0; =20 - if (endpoint->data->aggregation) { + if (endpoint->config->aggregation) { if (!endpoint->toward_ipa) { - const struct ipa_endpoint_rx_data *rx_data; + const struct ipa_endpoint_rx *rx_config; u32 buffer_size; bool close_eof; u32 limit; =20 - rx_data =3D &endpoint->data->rx; + rx_config =3D &endpoint->config->rx; val |=3D u32_encode_bits(IPA_ENABLE_AGGR, AGGR_EN_FMASK); val |=3D u32_encode_bits(IPA_GENERIC, AGGR_TYPE_FMASK); =20 - buffer_size =3D rx_data->buffer_size; + buffer_size =3D rx_config->buffer_size; limit =3D ipa_aggr_size_kb(buffer_size - NET_SKB_PAD); val |=3D aggr_byte_limit_encoded(version, limit); =20 @@ -761,7 +761,7 @@ static void ipa_endpoint_init_aggr(struct ipa_endpoint = *endpoint) =20 /* AGGR_PKT_LIMIT is 0 (unlimited) */ =20 - close_eof =3D rx_data->aggr_close_eof; + close_eof =3D rx_config->aggr_close_eof; val |=3D aggr_sw_eof_active_encoded(version, close_eof); } else { val |=3D u32_encode_bits(IPA_ENABLE_DEAGGR, @@ -947,7 +947,7 @@ static void ipa_endpoint_init_rsrc_grp(struct ipa_endpo= int *endpoint) struct ipa *ipa =3D endpoint->ipa; u32 val; =20 - val =3D rsrc_grp_encoded(ipa->version, endpoint->data->resource_group); + val =3D rsrc_grp_encoded(ipa->version, endpoint->config->resource_group); iowrite32(val, ipa->reg_virt + offset); } =20 @@ -960,10 +960,10 @@ static void ipa_endpoint_init_seq(struct ipa_endpoint= *endpoint) return; /* Register not valid for RX endpoints */ =20 /* Low-order byte configures primary packet processing */ - val |=3D u32_encode_bits(endpoint->data->tx.seq_type, SEQ_TYPE_FMASK); + val |=3D u32_encode_bits(endpoint->config->tx.seq_type, SEQ_TYPE_FMASK); =20 /* Second byte configures replicated packet processing */ - val |=3D u32_encode_bits(endpoint->data->tx.seq_rep_type, + val |=3D u32_encode_bits(endpoint->config->tx.seq_rep_type, SEQ_REP_TYPE_FMASK); =20 iowrite32(val, endpoint->ipa->reg_virt + offset); @@ -1021,13 +1021,13 @@ static void ipa_endpoint_status(struct ipa_endpoint= *endpoint) =20 offset =3D IPA_REG_ENDP_STATUS_N_OFFSET(endpoint_id); =20 - if (endpoint->data->status_enable) { + if (endpoint->config->status_enable) { val |=3D STATUS_EN_FMASK; if (endpoint->toward_ipa) { enum ipa_endpoint_name name; u32 status_endpoint_id; =20 - name =3D endpoint->data->tx.status_endpoint; + name =3D endpoint->config->tx.status_endpoint; status_endpoint_id =3D ipa->name_map[name]->endpoint_id; =20 val |=3D u32_encode_bits(status_endpoint_id, @@ -1051,7 +1051,7 @@ static int ipa_endpoint_replenish_one(struct ipa_endp= oint *endpoint, u32 len; int ret; =20 - buffer_size =3D endpoint->data->rx.buffer_size; + buffer_size =3D endpoint->config->rx.buffer_size; page =3D dev_alloc_pages(get_order(buffer_size)); if (!page) return -ENOMEM; @@ -1169,7 +1169,7 @@ static void ipa_endpoint_skb_copy(struct ipa_endpoint= *endpoint, static bool ipa_endpoint_skb_build(struct ipa_endpoint *endpoint, struct page *page, u32 len) { - u32 buffer_size =3D endpoint->data->rx.buffer_size; + u32 buffer_size =3D endpoint->config->rx.buffer_size; struct sk_buff *skb; =20 /* Nothing to do if there's no netdev */ @@ -1276,7 +1276,7 @@ static bool ipa_endpoint_status_drop(struct ipa_endpo= int *endpoint, static void ipa_endpoint_status_parse(struct ipa_endpoint *endpoint, struct page *page, u32 total_len) { - u32 buffer_size =3D endpoint->data->rx.buffer_size; + u32 buffer_size =3D endpoint->config->rx.buffer_size; void *data =3D page_address(page) + NET_SKB_PAD; u32 unused =3D buffer_size - total_len; u32 resid =3D total_len; @@ -1306,10 +1306,10 @@ static void ipa_endpoint_status_parse(struct ipa_en= dpoint *endpoint, * And if checksum offload is enabled a trailer containing * computed checksum information will be appended. */ - align =3D endpoint->data->rx.pad_align ? : 1; + align =3D endpoint->config->rx.pad_align ? : 1; len =3D le16_to_cpu(status->pkt_len); len =3D sizeof(*status) + ALIGN(len, align); - if (endpoint->data->checksum) + if (endpoint->config->checksum) len +=3D sizeof(struct rmnet_map_dl_csum_trailer); =20 if (!ipa_endpoint_status_drop(endpoint, status)) { @@ -1353,7 +1353,7 @@ static void ipa_endpoint_rx_complete(struct ipa_endpo= int *endpoint, =20 /* Parse or build a socket buffer using the actual received length */ page =3D trans->data; - if (endpoint->data->status_enable) + if (endpoint->config->status_enable) ipa_endpoint_status_parse(endpoint, page, trans->len); else if (ipa_endpoint_skb_build(endpoint, page, trans->len)) trans->data =3D NULL; /* Pages have been consumed */ @@ -1387,7 +1387,7 @@ void ipa_endpoint_trans_release(struct ipa_endpoint *= endpoint, struct page *page =3D trans->data; =20 if (page) { - u32 buffer_size =3D endpoint->data->rx.buffer_size; + u32 buffer_size =3D endpoint->config->rx.buffer_size; =20 __free_pages(page, get_order(buffer_size)); } @@ -1521,7 +1521,7 @@ static void ipa_endpoint_reset(struct ipa_endpoint *e= ndpoint) * All other cases just need to reset the underlying GSI channel. */ special =3D ipa->version < IPA_VERSION_4_0 && !endpoint->toward_ipa && - endpoint->data->aggregation; + endpoint->config->aggregation; if (special && ipa_endpoint_aggr_active(endpoint)) ret =3D ipa_endpoint_reset_rx_aggr(endpoint); else @@ -1836,7 +1836,7 @@ static void ipa_endpoint_init_one(struct ipa *ipa, en= um ipa_endpoint_name name, endpoint->channel_id =3D data->channel_id; endpoint->endpoint_id =3D data->endpoint_id; endpoint->toward_ipa =3D data->toward_ipa; - endpoint->data =3D &data->endpoint.config; + endpoint->config =3D &data->endpoint.config; =20 ipa->initialized |=3D BIT(endpoint->endpoint_id); } diff --git a/drivers/net/ipa/ipa_endpoint.h b/drivers/net/ipa/ipa_endpoint.h index 85fe15b5d983e..e8d1300a60022 100644 --- a/drivers/net/ipa/ipa_endpoint.h +++ b/drivers/net/ipa/ipa_endpoint.h @@ -41,7 +41,7 @@ enum ipa_endpoint_name { #define IPA_ENDPOINT_MAX 32 /* Max supported by driver */ =20 /** - * struct ipa_endpoint_tx_data - configuration data for TX endpoints + * struct ipa_endpoint_tx - Endpoint configuration for TX endpoints * @seq_type: primary packet processing sequencer type * @seq_rep_type: sequencer type for replication processing * @status_endpoint: endpoint to which status elements are sent @@ -49,17 +49,17 @@ enum ipa_endpoint_name { * The @status_endpoint is only valid if the endpoint's @status_enable * flag is set. */ -struct ipa_endpoint_tx_data { +struct ipa_endpoint_tx { enum ipa_seq_type seq_type; enum ipa_seq_rep_type seq_rep_type; enum ipa_endpoint_name status_endpoint; }; =20 /** - * struct ipa_endpoint_rx_data - configuration data for RX endpoints - * @buffer_size: requested receive buffer size (bytes) - * @pad_align: power-of-2 boundary to which packet payload is aligned - * @aggr_close_eof: whether aggregation closes on end-of-frame + * struct ipa_endpoint_rx - Endpoint configuration for RX endpoints + * @buffer_size: requested receive buffer size (bytes) + * @pad_align: power-of-2 boundary to which packet payload is aligned + * @aggr_close_eof: whether aggregation closes on end-of-frame * * With each packet it transfers, the IPA hardware can perform certain * transformations of its packet data. One of these is adding pad bytes @@ -70,14 +70,14 @@ struct ipa_endpoint_tx_data { * certain criteria are met. One of those criteria is the sender indicati= ng * a "frame" consisting of several transfers has ended. */ -struct ipa_endpoint_rx_data { +struct ipa_endpoint_rx { u32 buffer_size; u32 pad_align; bool aggr_close_eof; }; =20 /** - * struct ipa_endpoint_config_data - IPA endpoint hardware configuration + * struct ipa_endpoint_config - IPA endpoint hardware configuration * @resource_group: resource group to assign endpoint to * @checksum: whether checksum offload is enabled * @qmap: whether endpoint uses QMAP protocol @@ -88,7 +88,7 @@ struct ipa_endpoint_rx_data { * @tx: TX-specific endpoint information (see above) * @rx: RX-specific endpoint information (see above) */ -struct ipa_endpoint_config_data { +struct ipa_endpoint_config { u32 resource_group; bool checksum; bool qmap; @@ -97,8 +97,8 @@ struct ipa_endpoint_config_data { bool dma_mode; enum ipa_endpoint_name dma_endpoint; union { - struct ipa_endpoint_tx_data tx; - struct ipa_endpoint_rx_data rx; + struct ipa_endpoint_tx tx; + struct ipa_endpoint_rx rx; }; }; =20 @@ -122,7 +122,7 @@ enum ipa_replenish_flag { * @channel_id: GSI channel used by the endpoint * @endpoint_id: IPA endpoint number * @toward_ipa: Endpoint direction (true =3D TX, false =3D RX) - * @data: Endpoint configuration data + * @config: Default endpoint configuration * @trans_tre_max: Maximum number of TRE descriptors per transaction * @evt_ring_id: GSI event ring used by the endpoint * @netdev: Network device pointer, if endpoint uses one @@ -136,7 +136,7 @@ struct ipa_endpoint { u32 channel_id; u32 endpoint_id; bool toward_ipa; - const struct ipa_endpoint_config_data *data; + const struct ipa_endpoint_config *config; =20 u32 trans_tre_max; u32 evt_ring_id; diff --git a/drivers/net/ipa/ipa_modem.c b/drivers/net/ipa/ipa_modem.c index dd6464ced2546..7975e324690bb 100644 --- a/drivers/net/ipa/ipa_modem.c +++ b/drivers/net/ipa/ipa_modem.c @@ -129,7 +129,7 @@ ipa_start_xmit(struct sk_buff *skb, struct net_device *= netdev) goto err_drop_skb; =20 endpoint =3D ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]; - if (endpoint->data->qmap && skb->protocol !=3D htons(ETH_P_MAP)) + if (endpoint->config->qmap && skb->protocol !=3D htons(ETH_P_MAP)) goto err_drop_skb; =20 /* The hardware must be powered for us to transmit */ --=20 2.32.0 From nobody Sat May 9 09:32:25 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A80A5C433EF for ; Thu, 19 May 2022 15:13:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240703AbiESPNP (ORCPT ); Thu, 19 May 2022 11:13:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240561AbiESPMi (ORCPT ); Thu, 19 May 2022 11:12:38 -0400 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD81DE15D7 for ; Thu, 19 May 2022 08:12:29 -0700 (PDT) Received: by mail-io1-xd34.google.com with SMTP id f4so6111578iov.2 for ; Thu, 19 May 2022 08:12: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=13kniv4nVSRdkSAo1CohAXB/QL3EO5C2jWevaBVW0i4=; b=p+fxlW29U7Jzb6Cl/cXawPgTEjWIF51q5kqqtgzzBNsQ0uJNt4p7X4VtAMu8DEjExr i80lZgvqJEptxX++GVRCpzVgGH3BpuID7MRmxdy/FnBZk8JSuOcuRU8M3YzsA6cGr0gl 41cxG3Xf6eosI3Jnzx7Iibji47egDZxbQgZTbaBTn88hHyvEchC/B2Xvp7HkFxGSxWrn e1aM2JMWGOCfuQBVOnIvshyEZhk3nLStCqfFYINBjuf+ZTfUUfzVxhfm4kzafP4Sl9Pc asBPObw7h4zp7BTze089HLwDsN7FwKsPsGvCFnvCX1mbMHv6M98nObvT4wsNjOqz8BH3 RgWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=13kniv4nVSRdkSAo1CohAXB/QL3EO5C2jWevaBVW0i4=; b=Hgr/pQBBxM1h6Zp+lpxHtB9p/fOxV2fVS9cAQaDsYVc9ix0ynRKXukir7iCRs9QZQp M3paTMDKwaRluu/YWcGqot/l64vLZ61IWPxa8gSuE27j2K4c3Iha+IW5Oy3cYAWzGwop 0roo3koYMKCEJi8KREM+WKjssXuy07DQmhR5OKPt1uIpExKUiQz0rknx4CW+pfFxMPSB QwRz9VVHKSRtNLeg8HdSYMU5nukUKJz4BeayURQZyxAQEODhDKAM+vrLOdjNRsqz22rL kV4kSR6A5aHTks+BnbaTlDOo1aYWqgut/c/WsHC/YS1jvOXgtwzUuC7VAw+zMH4MPdHO +yKg== X-Gm-Message-State: AOAM532/bca0oWhCTIPqcGLjeBUif//539+C7a2t6nxJvEJVZxdA786k WBP/tpY2WoRfXAQMOudKAgSl8Q== X-Google-Smtp-Source: ABdhPJxCrx6nP6zhkA3WFb4u0CZDrl4WuDTl4G1meqRL77moprAT2iD5KXIR3ke8E5+V+woM3wYNEQ== X-Received: by 2002:a05:6638:3792:b0:32b:5cd3:50cd with SMTP id w18-20020a056638379200b0032b5cd350cdmr2932737jal.118.1652973149007; Thu, 19 May 2022 08:12: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 g6-20020a025b06000000b0032e271a558csm683887jab.168.2022.05.19.08.12.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 08:12:28 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.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 7/7] net: ipa: save a copy of endpoint default config Date: Thu, 19 May 2022 10:12:17 -0500 Message-Id: <20220519151217.654890-8-elder@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220519151217.654890-1-elder@linaro.org> References: <20220519151217.654890-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" All elements of the default endpoint configuration are used in the code when programming an endpoint for use. But none of the other configuration data is ever needed once things are initialized. So rather than saving a pointer to *all* of the configuration data, save a copy of only the endpoint configuration portion. This will eventually allow endpoint configuration to be modifiable at runtime. But even before that it means we won't keep a pointer to configuration data after when no longer needed. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_endpoint.c | 52 +++++++++++++++++----------------- drivers/net/ipa/ipa_endpoint.h | 2 +- drivers/net/ipa/ipa_modem.c | 2 +- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index bc95c71d80fc2..6010990690bb4 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -333,7 +333,7 @@ static void ipa_endpoint_suspend_aggr(struct ipa_endpoi= nt *endpoint) { struct ipa *ipa =3D endpoint->ipa; =20 - if (!endpoint->config->aggregation) + if (!endpoint->config.aggregation) return; =20 /* Nothing to do if the endpoint doesn't have aggregation open */ @@ -453,7 +453,7 @@ static void ipa_endpoint_init_cfg(struct ipa_endpoint *= endpoint) u32 val =3D 0; =20 /* FRAG_OFFLOAD_EN is 0 */ - if (endpoint->config->checksum) { + if (endpoint->config.checksum) { enum ipa_version version =3D endpoint->ipa->version; =20 if (endpoint->toward_ipa) { @@ -502,7 +502,7 @@ ipa_qmap_header_size(enum ipa_version version, struct i= pa_endpoint *endpoint) u32 header_size =3D sizeof(struct rmnet_map_header); =20 /* Without checksum offload, we just have the MAP header */ - if (!endpoint->config->checksum) + if (!endpoint->config.checksum) return header_size; =20 if (version < IPA_VERSION_4_5) { @@ -544,7 +544,7 @@ static void ipa_endpoint_init_hdr(struct ipa_endpoint *= endpoint) struct ipa *ipa =3D endpoint->ipa; u32 val =3D 0; =20 - if (endpoint->config->qmap) { + if (endpoint->config.qmap) { enum ipa_version version =3D ipa->version; size_t header_size; =20 @@ -583,11 +583,11 @@ static void ipa_endpoint_init_hdr(struct ipa_endpoint= *endpoint) static void ipa_endpoint_init_hdr_ext(struct ipa_endpoint *endpoint) { u32 offset =3D IPA_REG_ENDP_INIT_HDR_EXT_N_OFFSET(endpoint->endpoint_id); - u32 pad_align =3D endpoint->config->rx.pad_align; + u32 pad_align =3D endpoint->config.rx.pad_align; struct ipa *ipa =3D endpoint->ipa; u32 val =3D 0; =20 - if (endpoint->config->qmap) { + if (endpoint->config.qmap) { /* We have a header, so we must specify its endianness */ val |=3D HDR_ENDIANNESS_FMASK; /* big endian */ =20 @@ -615,7 +615,7 @@ static void ipa_endpoint_init_hdr_ext(struct ipa_endpoi= nt *endpoint) */ if (ipa->version >=3D IPA_VERSION_4_5) { /* HDR_TOTAL_LEN_OR_PAD_OFFSET is 0, so MSB is 0 */ - if (endpoint->config->qmap && !endpoint->toward_ipa) { + if (endpoint->config.qmap && !endpoint->toward_ipa) { u32 offset; =20 offset =3D offsetof(struct rmnet_map_header, pkt_len); @@ -640,7 +640,7 @@ static void ipa_endpoint_init_hdr_metadata_mask(struct = ipa_endpoint *endpoint) offset =3D IPA_REG_ENDP_INIT_HDR_METADATA_MASK_N_OFFSET(endpoint_id); =20 /* Note that HDR_ENDIANNESS indicates big endian header fields */ - if (endpoint->config->qmap) + if (endpoint->config.qmap) val =3D (__force u32)cpu_to_be32(IPA_ENDPOINT_QMAP_METADATA_MASK); =20 iowrite32(val, endpoint->ipa->reg_virt + offset); @@ -654,8 +654,8 @@ static void ipa_endpoint_init_mode(struct ipa_endpoint = *endpoint) if (!endpoint->toward_ipa) return; /* Register not valid for RX endpoints */ =20 - if (endpoint->config->dma_mode) { - enum ipa_endpoint_name name =3D endpoint->config->dma_endpoint; + if (endpoint->config.dma_mode) { + enum ipa_endpoint_name name =3D endpoint->config.dma_endpoint; u32 dma_endpoint_id; =20 dma_endpoint_id =3D endpoint->ipa->name_map[name]->endpoint_id; @@ -741,14 +741,14 @@ static void ipa_endpoint_init_aggr(struct ipa_endpoin= t *endpoint) enum ipa_version version =3D endpoint->ipa->version; u32 val =3D 0; =20 - if (endpoint->config->aggregation) { + if (endpoint->config.aggregation) { if (!endpoint->toward_ipa) { const struct ipa_endpoint_rx *rx_config; u32 buffer_size; bool close_eof; u32 limit; =20 - rx_config =3D &endpoint->config->rx; + rx_config =3D &endpoint->config.rx; val |=3D u32_encode_bits(IPA_ENABLE_AGGR, AGGR_EN_FMASK); val |=3D u32_encode_bits(IPA_GENERIC, AGGR_TYPE_FMASK); =20 @@ -947,7 +947,7 @@ static void ipa_endpoint_init_rsrc_grp(struct ipa_endpo= int *endpoint) struct ipa *ipa =3D endpoint->ipa; u32 val; =20 - val =3D rsrc_grp_encoded(ipa->version, endpoint->config->resource_group); + val =3D rsrc_grp_encoded(ipa->version, endpoint->config.resource_group); iowrite32(val, ipa->reg_virt + offset); } =20 @@ -960,10 +960,10 @@ static void ipa_endpoint_init_seq(struct ipa_endpoint= *endpoint) return; /* Register not valid for RX endpoints */ =20 /* Low-order byte configures primary packet processing */ - val |=3D u32_encode_bits(endpoint->config->tx.seq_type, SEQ_TYPE_FMASK); + val |=3D u32_encode_bits(endpoint->config.tx.seq_type, SEQ_TYPE_FMASK); =20 /* Second byte configures replicated packet processing */ - val |=3D u32_encode_bits(endpoint->config->tx.seq_rep_type, + val |=3D u32_encode_bits(endpoint->config.tx.seq_rep_type, SEQ_REP_TYPE_FMASK); =20 iowrite32(val, endpoint->ipa->reg_virt + offset); @@ -1021,13 +1021,13 @@ static void ipa_endpoint_status(struct ipa_endpoint= *endpoint) =20 offset =3D IPA_REG_ENDP_STATUS_N_OFFSET(endpoint_id); =20 - if (endpoint->config->status_enable) { + if (endpoint->config.status_enable) { val |=3D STATUS_EN_FMASK; if (endpoint->toward_ipa) { enum ipa_endpoint_name name; u32 status_endpoint_id; =20 - name =3D endpoint->config->tx.status_endpoint; + name =3D endpoint->config.tx.status_endpoint; status_endpoint_id =3D ipa->name_map[name]->endpoint_id; =20 val |=3D u32_encode_bits(status_endpoint_id, @@ -1051,7 +1051,7 @@ static int ipa_endpoint_replenish_one(struct ipa_endp= oint *endpoint, u32 len; int ret; =20 - buffer_size =3D endpoint->config->rx.buffer_size; + buffer_size =3D endpoint->config.rx.buffer_size; page =3D dev_alloc_pages(get_order(buffer_size)); if (!page) return -ENOMEM; @@ -1169,7 +1169,7 @@ static void ipa_endpoint_skb_copy(struct ipa_endpoint= *endpoint, static bool ipa_endpoint_skb_build(struct ipa_endpoint *endpoint, struct page *page, u32 len) { - u32 buffer_size =3D endpoint->config->rx.buffer_size; + u32 buffer_size =3D endpoint->config.rx.buffer_size; struct sk_buff *skb; =20 /* Nothing to do if there's no netdev */ @@ -1276,7 +1276,7 @@ static bool ipa_endpoint_status_drop(struct ipa_endpo= int *endpoint, static void ipa_endpoint_status_parse(struct ipa_endpoint *endpoint, struct page *page, u32 total_len) { - u32 buffer_size =3D endpoint->config->rx.buffer_size; + u32 buffer_size =3D endpoint->config.rx.buffer_size; void *data =3D page_address(page) + NET_SKB_PAD; u32 unused =3D buffer_size - total_len; u32 resid =3D total_len; @@ -1306,10 +1306,10 @@ static void ipa_endpoint_status_parse(struct ipa_en= dpoint *endpoint, * And if checksum offload is enabled a trailer containing * computed checksum information will be appended. */ - align =3D endpoint->config->rx.pad_align ? : 1; + align =3D endpoint->config.rx.pad_align ? : 1; len =3D le16_to_cpu(status->pkt_len); len =3D sizeof(*status) + ALIGN(len, align); - if (endpoint->config->checksum) + if (endpoint->config.checksum) len +=3D sizeof(struct rmnet_map_dl_csum_trailer); =20 if (!ipa_endpoint_status_drop(endpoint, status)) { @@ -1353,7 +1353,7 @@ static void ipa_endpoint_rx_complete(struct ipa_endpo= int *endpoint, =20 /* Parse or build a socket buffer using the actual received length */ page =3D trans->data; - if (endpoint->config->status_enable) + if (endpoint->config.status_enable) ipa_endpoint_status_parse(endpoint, page, trans->len); else if (ipa_endpoint_skb_build(endpoint, page, trans->len)) trans->data =3D NULL; /* Pages have been consumed */ @@ -1387,7 +1387,7 @@ void ipa_endpoint_trans_release(struct ipa_endpoint *= endpoint, struct page *page =3D trans->data; =20 if (page) { - u32 buffer_size =3D endpoint->config->rx.buffer_size; + u32 buffer_size =3D endpoint->config.rx.buffer_size; =20 __free_pages(page, get_order(buffer_size)); } @@ -1521,7 +1521,7 @@ static void ipa_endpoint_reset(struct ipa_endpoint *e= ndpoint) * All other cases just need to reset the underlying GSI channel. */ special =3D ipa->version < IPA_VERSION_4_0 && !endpoint->toward_ipa && - endpoint->config->aggregation; + endpoint->config.aggregation; if (special && ipa_endpoint_aggr_active(endpoint)) ret =3D ipa_endpoint_reset_rx_aggr(endpoint); else @@ -1836,7 +1836,7 @@ static void ipa_endpoint_init_one(struct ipa *ipa, en= um ipa_endpoint_name name, endpoint->channel_id =3D data->channel_id; endpoint->endpoint_id =3D data->endpoint_id; endpoint->toward_ipa =3D data->toward_ipa; - endpoint->config =3D &data->endpoint.config; + endpoint->config =3D data->endpoint.config; =20 ipa->initialized |=3D BIT(endpoint->endpoint_id); } diff --git a/drivers/net/ipa/ipa_endpoint.h b/drivers/net/ipa/ipa_endpoint.h index e8d1300a60022..39a12c249f66d 100644 --- a/drivers/net/ipa/ipa_endpoint.h +++ b/drivers/net/ipa/ipa_endpoint.h @@ -136,7 +136,7 @@ struct ipa_endpoint { u32 channel_id; u32 endpoint_id; bool toward_ipa; - const struct ipa_endpoint_config *config; + struct ipa_endpoint_config config; =20 u32 trans_tre_max; u32 evt_ring_id; diff --git a/drivers/net/ipa/ipa_modem.c b/drivers/net/ipa/ipa_modem.c index 7975e324690bb..c8b1c4d9c5073 100644 --- a/drivers/net/ipa/ipa_modem.c +++ b/drivers/net/ipa/ipa_modem.c @@ -129,7 +129,7 @@ ipa_start_xmit(struct sk_buff *skb, struct net_device *= netdev) goto err_drop_skb; =20 endpoint =3D ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]; - if (endpoint->config->qmap && skb->protocol !=3D htons(ETH_P_MAP)) + if (endpoint->config.qmap && skb->protocol !=3D htons(ETH_P_MAP)) goto err_drop_skb; =20 /* The hardware must be powered for us to transmit */ --=20 2.32.0