OSDN Git Service

net: ipa: determine route table size from memory region
authorAlex Elder <elder@linaro.org>
Tue, 25 Oct 2022 19:51:41 +0000 (14:51 -0500)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 27 Oct 2022 11:38:12 +0000 (13:38 +0200)
commit0439e6743c5c77520e91bf52a0d16da586214753
tree0734c71384a36852dc1fec51fe6369cdfc6c9365
parentfc094058ce01984aa4cb8b580812b16f5429c7e7
net: ipa: determine route table size from memory region

Currently we assume that any routing table contains a fixed number
of entries.  The number of entries in a routing table can actually
vary, depending only on the size of the IPA-local memory region used
to hold the table.

Stop assuming that a routing table has exactly 15 entries.  Instead,
determine the number of entries in a routing table by dividing its
memory region size by the size of an entry.

The number of entries is computed early, when ipa_table_mem_valid()
is called by ipa_table_init().

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ipa/ipa_cmd.c
drivers/net/ipa/ipa_table.c
drivers/net/ipa/ipa_table.h