[dpdk-dev] [PATCH v4 17/19] net/ena: disable dev ops not supported in SMP
Ferruh Yigit
ferruh.yigit at intel.com
Tue May 11 14:29:10 CEST 2021
On 5/11/2021 7:45 AM, Michal Krawczyk wrote:
> From: Stanislaw Kardach <kda at semihalf.com>
>
> For dev_ops not supported in SMP, either return -EPERM or return without
> doing anything. In both cases log a warning.
>
'SMP' can be confusing in this context, this is not exactly related to SMP. In
DPDK we tend to call this multi process support, or for this patch it is more
likely secondary process, like:
net/ena: disable dev ops not supported by secondary process
btw, some device operations not supported by secondary process independent from
driver, it is possible to handle them in ethdev layer. Right now responsibility
is mostly pushed to the application.
> Signed-off-by: Stanislaw Kardach <kda at semihalf.com>
> Reviewed-by: Michal Krawczyk <mk at semihalf.com>
> Reviewed-by: Igor Chauskin <igorch at amazon.com>
> Reviewed-by: Shay Agroskin <shayagr at amazon.com>
> ---
> v4:
> * Fix commit heading style.
>
> drivers/net/ena/ena_ethdev.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
> index 055fa6d514..21bea98007 100644
> --- a/drivers/net/ena/ena_ethdev.c
> +++ b/drivers/net/ena/ena_ethdev.c
> @@ -535,6 +535,12 @@ ena_dev_reset(struct rte_eth_dev *dev)
> {
> int rc = 0;
>
> + /* Cannot release memory in secondary process */
> + if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
> + PMD_DRV_LOG(WARNING, "dev_reset not supported in secondary.\n");
> + return -EPERM;
> + }
> +
> ena_destroy_device(dev);
> rc = eth_ena_dev_init(dev);
> if (rc)
> @@ -1058,6 +1064,12 @@ static int ena_start(struct rte_eth_dev *dev)
> uint64_t ticks;
> int rc = 0;
>
> + /* Cannot allocate memory in secondary process */
> + if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
> + PMD_DRV_LOG(WARNING, "dev_start not supported in secondary.\n");
> + return -EPERM;
> + }
> +
> rc = ena_check_valid_conf(adapter);
> if (rc)
> return rc;
> @@ -1104,6 +1116,12 @@ static int ena_stop(struct rte_eth_dev *dev)
> struct ena_com_dev *ena_dev = &adapter->ena_dev;
> int rc;
>
> + /* Cannot free memory in secondary process */
> + if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
> + PMD_DRV_LOG(WARNING, "dev_stop not supported in secondary.\n");
> + return -EPERM;
> + }
> +
> rte_timer_stop_sync(&adapter->timer_wd);
> ena_queue_stop_all(dev, ENA_RING_TYPE_TX);
> ena_queue_stop_all(dev, ENA_RING_TYPE_RX);
>
More information about the dev
mailing list