WSL2-Linux-Kernel/drivers/net/ipa
Alex Elder c2dc533a7e net: ipa: properly limit modem routing table use
[ Upstream commit cf412ec333 ]

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: 530f9216a9 ("soc: qcom: ipa: AP/modem communications")
Signed-off-by: Alex Elder <elder@linaro.org>
Link: https://lore.kernel.org/r/20220913204602.1803004-1-elder@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-09-28 11:11:50 +02:00
..
Kconfig net: ipa: fix a build dependency 2022-04-20 09:34:21 +02:00
Makefile net: ipa: rename "ipa_clock.c" 2021-08-22 09:44:17 +01:00
gsi.c net: ipa: record proper RX transaction count 2022-05-25 09:57:30 +02:00
gsi.h
gsi_private.h
gsi_reg.h
gsi_trans.c
gsi_trans.h
ipa.h net: ipa: rename ipa_clock_* symbols 2021-08-22 09:44:17 +01:00
ipa_cmd.c net: ipa: kill ipa_cmd_pipeline_clear() 2021-12-01 09:04:51 +01:00
ipa_cmd.h net: ipa: kill ipa_cmd_pipeline_clear() 2021-12-01 09:04:51 +01:00
ipa_data-v3.1.c net: ipa: rename ipa_clock_* symbols 2021-08-22 09:44:17 +01:00
ipa_data-v3.5.1.c net: ipa: rename ipa_clock_* symbols 2021-08-22 09:44:17 +01:00
ipa_data-v4.2.c net: ipa: rename ipa_clock_* symbols 2021-08-22 09:44:17 +01:00
ipa_data-v4.5.c net: ipa: rename ipa_clock_* symbols 2021-08-22 09:44:17 +01:00
ipa_data-v4.9.c net: ipa: rename ipa_clock_* symbols 2021-08-22 09:44:17 +01:00
ipa_data-v4.11.c net: ipa: rename ipa_clock_* symbols 2021-08-22 09:44:17 +01:00
ipa_data.h net: ipa: rename ipa_clock_* symbols 2021-08-22 09:44:17 +01:00
ipa_endpoint.c net: ipa: fix page free in ipa_endpoint_replenish_one() 2022-06-09 10:23:30 +02:00
ipa_endpoint.h net: ipa: prevent concurrent replenish 2022-02-05 12:38:56 +01:00
ipa_gsi.c
ipa_gsi.h
ipa_interrupt.c net: ipa: use autosuspend 2021-08-22 09:44:17 +01:00
ipa_interrupt.h
ipa_main.c net: ipa: separate disabling setup from modem stop 2021-12-01 09:04:51 +01:00
ipa_mem.c net: ipa: don't assume SMEM is page-aligned 2022-08-31 17:16:39 +02:00
ipa_mem.h
ipa_modem.c net: ipa: separate disabling setup from modem stop 2021-12-01 09:04:51 +01:00
ipa_modem.h
ipa_power.c net: ipa: request IPA register values be retained 2022-04-20 09:34:05 +02:00
ipa_power.h net: ipa: request IPA register values be retained 2022-04-20 09:34:05 +02:00
ipa_qmi.c net: ipa: properly limit modem routing table use 2022-09-28 11:11:50 +02:00
ipa_qmi.h
ipa_qmi_msg.c net: ipa: properly limit modem routing table use 2022-09-28 11:11:50 +02:00
ipa_qmi_msg.h net: ipa: properly limit modem routing table use 2022-09-28 11:11:50 +02:00
ipa_reg.c
ipa_reg.h
ipa_resource.c net/ipa: ipa_resource: Fix wrong for loop range 2021-11-25 09:48:34 +01:00
ipa_resource.h
ipa_smp2p.c net: ipa: separate disabling setup from modem stop 2021-12-01 09:04:51 +01:00
ipa_smp2p.h net: ipa: separate disabling setup from modem stop 2021-12-01 09:04:51 +01:00
ipa_sysfs.c
ipa_sysfs.h
ipa_table.c net: ipa: properly limit modem routing table use 2022-09-28 11:11:50 +02:00
ipa_table.h net: ipa: properly limit modem routing table use 2022-09-28 11:11:50 +02:00
ipa_uc.c net: ipa: request IPA register values be retained 2022-04-20 09:34:05 +02:00
ipa_uc.h net: ipa: rename ipa_clock_* symbols 2021-08-22 09:44:17 +01:00
ipa_version.h