From: Jakub Kicinski <kuba@kernel.org>
To: Alex Elder <elder@linaro.org>
Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
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: Re: [PATCH net v2] net: ipa: properly limit modem routing table use
Date: Tue, 20 Sep 2022 08:14:00 -0700 [thread overview]
Message-ID: <20220920081400.0cbe44ff@kernel.org> (raw)
In-Reply-To: <20220913204602.1803004-1-elder@linaro.org>
On Tue, 13 Sep 2022 15:46:02 -0500 Alex Elder wrote:
> IPA can route packets between IPA-connected entities. The AP and
> modem are currently the only such entities supported, and no routing
> is required to transfer packets between them.
>
> The number of entries in each routing table is fixed, and defined at
> initialization time. Some of these entries are designated for use
> by the modem, and the rest are available for the AP to use. The AP
> sends a QMI message to the modem which describes (among other
> things) information about routing table memory available for the
> modem to use.
>
> Currently the QMI initialization packet gives wrong information in
> its description of routing tables. What *should* be supplied is the
> maximum index that the modem can use for the routing table memory
> located at a given location. The current code instead supplies the
> total *number* of routing table entries. Furthermore, the modem is
> granted the entire table, not just the subset it's supposed to use.
>
> This patch fixes this. First, the ipa_mem_bounds structure is
> generalized so its "end" field can be interpreted either as a final
> byte offset, or a final array index. Second, the IPv4 and IPv6
> (non-hashed and hashed) table information fields in the QMI
> ipa_init_modem_driver_req structure are changed to be ipa_mem_bounds
> rather than ipa_mem_array structures. Third, we set the "end" value
> for each routing table to be the last index, rather than setting the
> "count" to be the number of indices. Finally, instead of allowing
> the modem to use all of a routing table's memory, it is limited to
> just the portion meant to be used by the modem. In all versions of
> IPA currently supported, that is IPA_ROUTE_MODEM_COUNT (8) entries.
>
> Update a few comments for clarity.
>
> Fixes: 530f9216a9537 ("soc: qcom: ipa: AP/modem communications")
> Signed-off-by: Alex Elder <elder@linaro.org>
> ---
> v2: Update the element info arrays defining the modified QMI message
> so it uses the ipa_mem_bounds_ei structure rather than the
> ipa_mem_array_ei structure. The message format is identical,
> but the code was incorrect without that change.
Unclear to me why, ipa_mem_bounds_ei and ipa_mem_array_ei seem
identical, other than s/end/count/. Overall the patch feels
a touch too verbose for a fix, makes it harder to grasp the key
functional change IMHO. I could be misunderstanding but please
keep the goal of making fixes small and crisp in mind for the future.
next prev parent reply other threads:[~2022-09-20 15:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-13 20:46 [PATCH net v2] net: ipa: properly limit modem routing table use Alex Elder
2022-09-20 15:14 ` Jakub Kicinski [this message]
2022-09-20 16:16 ` Alex Elder
2022-09-20 17:05 ` Jakub Kicinski
2022-09-20 15:20 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220920081400.0cbe44ff@kernel.org \
--to=kuba@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=elder@kernel.org \
--cc=elder@linaro.org \
--cc=evgreen@chromium.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mka@chromium.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quic_avuyyuru@quicinc.com \
--cc=quic_cpratapa@quicinc.com \
--cc=quic_jponduru@quicinc.com \
--cc=quic_subashab@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).