From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Michal Krawczyk <mk@semihalf.com>, <dev@dpdk.org>
Cc: <shaibran@amazon.com>, <upstream@semihalf.com>,
Stanislaw Kardach <kda@semihalf.com>,
Dawid Gorecki <dgr@semihalf.com>
Subject: Re: [PATCH v2 10/21] net/ena: proxy AQ calls to primary process
Date: Wed, 23 Feb 2022 00:50:46 +0000 [thread overview]
Message-ID: <3a3fccd1-af2a-dee4-475c-879385f4b2e5@intel.com> (raw)
In-Reply-To: <c7a8fd19-3f4d-9892-4a26-83725df5e460@intel.com>
On 2/22/2022 10:24 PM, Ferruh Yigit wrote:
> On 2/22/2022 6:11 PM, Michal Krawczyk wrote:
>> From: Stanislaw Kardach <kda@semihalf.com>
>>
>> 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>
>
> <...>
>
>> + */
>> +#define ENA_PROXY(a, f, ...) \
>> +({ \
>> + struct ena_adapter *_a = (a); \
>> + struct timespec ts = { .tv_sec = ENA_MP_REQ_TMO }; \
>> + struct ena_mp_body *req, *rsp; \
>> + struct rte_mp_reply mp_rep; \
>> + struct rte_mp_msg mp_req; \
>> + int ret; \
>> + \
>> + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { \
>> + ret = f(__VA_ARGS__); \
>> + } else { \
>> + /* Prepare and send request */ \
>> + req = (struct ena_mp_body *)&mp_req.param; \
>> + mp_msg_init(&mp_req, mp_type_ ## f, _a->edev_data->port_id); \
>> + mp_prep_ ## f(_a, req, ## __VA_ARGS__); \
>> + \
>> + ret = rte_mp_request_sync(&mp_req, &mp_rep, &ts); \
>> + if (likely(!ret)) { \
>> + RTE_ASSERT(mp_rsp.nb_received == 1); \
>
> 'mp_rsp' is not defined, I assume intention is to use 'mp_rep'.
>
> Build error can be reproduced by enabling RTE_ASSERT (by setting
> 'RTE_ENABLE_ASSERT').
>
>> + rsp = (struct ena_mp_body *)&mp_rep.msgs[0].param; \
>> + ret = rsp->result; \
>> + if (ret == 0) { \
>> + mp_proc_##f(_a, rsp, ## __VA_ARGS__); \
>> + } else { \
>> + PMD_DRV_LOG(ERR, \
>> + "%s returned error: %d\n", \
>> + mp_name_ ## f, rsp->result);\
>> + } \
>> + free(mp_rep.msgs); \
>> + } else if (rte_errno == ENOTSUP) { \
>> + PMD_DRV_LOG(ERR, \
>> + "No IPC, can't proxy to primary\n");\
>> + ret = -rte_errno; \
>> + } else { \
>> + PMD_DRV_LOG(ERR, "Request %s failed: %s\n", \
>> + mp_name_ ## f, \
>> + rte_strerror(rte_errno)); \
>> + ret = -ECOMM; \
Also 'ECOMM' seems only defined for Linux, so it breaks the
FreeBSD build:
http://mails.dpdk.org/archives/test-report/2022-February/263131.html
>> + } \
>> + } \
>> + ret; \
>> +})
>>
> <...>
next prev parent reply other threads:[~2022-02-23 0:51 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 16:06 [PATCH 00/21] net/ena: v2.6.0 driver update Michal Krawczyk
2022-02-22 16:06 ` [PATCH 01/21] net/ena: remove linearization function Michal Krawczyk
2022-02-22 16:06 ` [PATCH 02/21] net/ena: add assertion on Tx info mbuf Michal Krawczyk
2022-02-22 16:06 ` [PATCH 03/21] net/ena: remove unused enumeration Michal Krawczyk
2022-02-22 16:06 ` [PATCH 04/21] net/ena: remove unused offloads variables Michal Krawczyk
2022-02-22 16:06 ` [PATCH 05/21] net/ena: add extra Rx checksum related xstats Michal Krawczyk
2022-02-22 16:06 ` [PATCH 06/21] net/ena: make LSC configurable Michal Krawczyk
2022-02-22 16:06 ` [PATCH 07/21] net/ena: skip timer if the reset is triggered Michal Krawczyk
2022-02-22 16:06 ` [PATCH 08/21] net/ena: perform Tx cleanup before sending pkts Michal Krawczyk
2022-02-22 16:06 ` [PATCH 09/21] net/ena/base: use optimized memcpy version also on Arm Michal Krawczyk
2022-02-22 16:06 ` [PATCH 10/21] net/ena: proxy AQ calls to primary process Michal Krawczyk
2022-02-22 16:06 ` [PATCH 11/21] net/ena: enable stats get function for MP mode Michal Krawczyk
2022-02-22 16:06 ` [PATCH 12/21] net/ena/base: make IO memzone unique per port Michal Krawczyk
2022-02-22 16:06 ` [PATCH 13/21] net/ena: expose Tx cleanup function Michal Krawczyk
2022-02-22 16:06 ` [PATCH 14/21] net/ena: add API for probing xstat names by ID Michal Krawczyk
2022-02-22 16:06 ` [PATCH 15/21] net/ena: check if reset was already triggered Michal Krawczyk
2022-02-22 16:06 ` [PATCH 16/21] net/ena: make Tx completion timeout configurable Michal Krawczyk
2022-02-22 16:06 ` [PATCH 17/21] net/ena: fix meta-desc DF flag setup Michal Krawczyk
2022-02-22 16:06 ` [PATCH 18/21] net/ena: extend debug prints for invalid req ID resets Michal Krawczyk
2022-02-22 16:06 ` [PATCH 19/21] net/ena: don't initialize LLQ when membar isn't exposed Michal Krawczyk
2022-02-22 16:06 ` [PATCH 20/21] net/ena: don't indicate bad csum for L4 csum error Michal Krawczyk
2022-02-22 16:06 ` [PATCH 21/21] net/ena: update version to 2.6.0 Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 00/21] net/ena: v2.6.0 driver update Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 01/21] net/ena: remove linearization function Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 02/21] net/ena: add assertion on Tx info mbuf Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 03/21] net/ena: remove unused enumeration Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 04/21] net/ena: remove unused offloads variables Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 05/21] net/ena: add extra Rx checksum related xstats Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 06/21] net/ena: make LSC configurable Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 07/21] net/ena: skip timer if the reset is triggered Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 08/21] net/ena: perform Tx cleanup before sending pkts Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 09/21] net/ena/base: use optimized memcpy version also on Arm Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 10/21] net/ena: proxy AQ calls to primary process Michal Krawczyk
2022-02-22 22:24 ` Ferruh Yigit
2022-02-23 0:50 ` Ferruh Yigit [this message]
2022-02-22 18:11 ` [PATCH v2 11/21] net/ena: enable stats get function for MP mode Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 12/21] net/ena/base: make IO memzone unique per port Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 13/21] net/ena: expose Tx cleanup function Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 14/21] net/ena: add API for probing xstat names by ID Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 15/21] net/ena: check if reset was already triggered Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 16/21] net/ena: make Tx completion timeout configurable Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 17/21] net/ena: fix meta-desc DF flag setup Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 18/21] net/ena: extend debug prints for invalid req ID resets Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 19/21] net/ena: don't initialize LLQ when membar isn't exposed Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 20/21] net/ena: don't indicate bad csum for L4 csum error Michal Krawczyk
2022-02-22 18:11 ` [PATCH v2 21/21] net/ena: update version to 2.6.0 Michal Krawczyk
2022-02-22 22:21 ` [PATCH v2 00/21] net/ena: v2.6.0 driver update Ferruh Yigit
2022-02-23 10:07 ` Michał Krawczyk
2022-02-23 12:19 ` [PATCH v3 " Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 01/21] net/ena: remove linearization function Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 02/21] net/ena: add assertion on Tx info mbuf Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 03/21] net/ena: remove unused enumeration Michal Krawczyk
2022-02-23 17:25 ` Ferruh Yigit
2022-02-23 12:19 ` [PATCH v3 04/21] net/ena: remove unused offloads variables Michal Krawczyk
2022-02-23 17:25 ` Ferruh Yigit
2022-02-23 17:47 ` Michał Krawczyk
2022-02-23 18:12 ` Ferruh Yigit
2022-02-23 12:19 ` [PATCH v3 05/21] net/ena: add extra Rx checksum related xstats Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 06/21] net/ena: make LSC configurable Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 07/21] net/ena: skip timer if the reset is triggered Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 08/21] net/ena: perform Tx cleanup before sending pkts Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 09/21] net/ena/base: use optimized memcpy version also on Arm Michal Krawczyk
2022-02-23 17:25 ` Ferruh Yigit
2022-02-23 17:40 ` Michał Krawczyk
2022-02-23 12:19 ` [PATCH v3 10/21] net/ena: proxy AQ calls to primary process Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 11/21] net/ena: enable stats get function for MP mode Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 12/21] net/ena/base: make IO memzone unique per port Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 13/21] net/ena: expose Tx cleanup function Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 14/21] net/ena: add API for probing xstat names by ID Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 15/21] net/ena: check if reset was already triggered Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 16/21] net/ena: make Tx completion timeout configurable Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 17/21] net/ena: fix meta-desc DF flag setup Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 18/21] net/ena: extend debug prints for invalid req ID resets Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 19/21] net/ena: don't initialize LLQ when membar isn't exposed Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 20/21] net/ena: don't indicate bad csum for L4 csum error Michal Krawczyk
2022-02-23 12:19 ` [PATCH v3 21/21] net/ena: update version to 2.6.0 Michal Krawczyk
2022-02-23 18:12 ` [PATCH v3 00/21] net/ena: v2.6.0 driver update Ferruh Yigit
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=3a3fccd1-af2a-dee4-475c-879385f4b2e5@intel.com \
--to=ferruh.yigit@intel.com \
--cc=dev@dpdk.org \
--cc=dgr@semihalf.com \
--cc=kda@semihalf.com \
--cc=mk@semihalf.com \
--cc=shaibran@amazon.com \
--cc=upstream@semihalf.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).