linux-stable/drivers/net/ipa
Alex Elder cf412ec333 net: ipa: properly limit modem routing table use
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>
2022-09-20 08:11:13 -07:00
..
data net: ipa: fix build 2022-07-21 16:53:26 -07:00
Kconfig
Makefile net: ipa: move configuration data files into a subdirectory 2022-07-20 21:05:41 -07:00
gsi.c net: ipa: add a transaction committed list 2022-07-20 21:04:35 -07:00
gsi.h net: ipa: rearrange transaction initialization 2022-07-20 21:04:36 -07:00
gsi_private.h net: ipa: don't assume one channel per event ring 2022-06-16 20:44:03 -07:00
gsi_reg.h net: ipa: rename a GSI error code 2022-05-20 11:12:23 +01:00
gsi_trans.c net: ipa: fix an outdated comment 2022-07-20 21:04:36 -07:00
gsi_trans.h net: ipa: introduce gsi_trans_tx_committed() 2022-06-15 09:07:58 +01:00
ipa.h net: ipa: count the number of modem TX endpoints 2022-05-22 20:46:12 +01:00
ipa_cmd.c net: ipa: rename channel->tlv_count 2022-06-13 12:01:58 +01:00
ipa_cmd.h net: ipa: remove command info pool 2022-05-22 20:46:12 +01:00
ipa_data.h net: ipa: rename a few endpoint config data types 2022-05-20 11:12:24 +01:00
ipa_endpoint.c net: ipa: simplify endpoint transaction completion 2022-06-13 12:01:58 +01:00
ipa_endpoint.h net: ipa: rename endpoint->trans_tre_max 2022-06-13 12:01:58 +01:00
ipa_gsi.c
ipa_gsi.h
ipa_interrupt.c net: ipa: don't proceed to out-of-bound write 2022-05-19 18:44:51 -07:00
ipa_interrupt.h
ipa_main.c net: ipa: report when the driver has been removed 2022-07-20 21:04:36 -07:00
ipa_mem.c net: ipa: don't assume SMEM is page-aligned 2022-08-22 18:10:48 -07:00
ipa_mem.h
ipa_modem.c net: ipa: save a copy of endpoint default config 2022-05-20 11:12:24 +01:00
ipa_modem.h
ipa_power.c
ipa_power.h
ipa_qmi.c net: ipa: properly limit modem routing table use 2022-09-20 08:11:13 -07:00
ipa_qmi.h
ipa_qmi_msg.c net: ipa: properly limit modem routing table use 2022-09-20 08:11:13 -07:00
ipa_qmi_msg.h net: ipa: properly limit modem routing table use 2022-09-20 08:11:13 -07:00
ipa_reg.c
ipa_reg.h net: ipa: Fix comment typo 2022-08-12 11:28:14 +01:00
ipa_resource.c
ipa_resource.h
ipa_smp2p.c
ipa_smp2p.h
ipa_sysfs.c net: ipa: add an endpoint device attribute group 2022-07-20 21:03:26 -07:00
ipa_sysfs.h net: ipa: add an endpoint device attribute group 2022-07-20 21:03:26 -07:00
ipa_table.c net: ipa: properly limit modem routing table use 2022-09-20 08:11:13 -07:00
ipa_table.h net: ipa: properly limit modem routing table use 2022-09-20 08:11:13 -07:00
ipa_uc.c
ipa_uc.h
ipa_version.h