net/ena: proxy AQ calls to primary process
authorStanislaw Kardach <kda@semihalf.com>
Wed, 23 Feb 2022 12:19:33 +0000 (13:19 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 23 Feb 2022 18:01:03 +0000 (19:01 +0100)
commite3595539e0e03f0dbb81904f8edaaef0447a4f62
tree2276d479f8a8f0b1765132834b8295ee8abe33d8
parentb2c1fe38ad9d6eb5f9208ef751384229442f9c6e
net/ena: proxy AQ calls to primary process

Due to how the ena_com compatibility layer is written, all AQ commands
triggering functions use stack to save results of AQ and then copy them
to user given function.
Therefore to keep the compatibility layer common, introduce ENA_PROXY
macro. It either calls the wrapped function directly (in primary
process) or proxies it to the primary via DPDK IPC mechanism. Since all
proxied calls are taken under a lock share the result data through
shared memory (in struct ena_adapter) to work around 256B IPC parameter
size limit.

New proxy calls can be added by
1. Adding a new message type at the end of enum ena_mp_req
2. Adding new message arguments to the struct ena_mp_body if needed
3. Defining proxy request descriptor with ENA_PROXY_DESC. Its arguments
   include handlers for request preparation and response processing.
   Any of those may be empty (aside of marking arguments as used).
4. Adding request handling logic to ena_mp_primary_handle()
5. Replacing proxied function calls with ENA_PROXY(adapter, <func>, ...)

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Dawid Gorecki <dgr@semihalf.com>
Reviewed-by: Shai Brandes <shaibran@amazon.com>
doc/guides/rel_notes/release_22_03.rst
drivers/net/ena/ena_ethdev.c
drivers/net/ena/ena_ethdev.h
drivers/net/ena/ena_rss.c