From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9AC62A0524; Thu, 6 May 2021 16:28:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC9CC4118D; Thu, 6 May 2021 16:26:14 +0200 (CEST) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mails.dpdk.org (Postfix) with ESMTP id 0CF9641134 for ; Thu, 6 May 2021 16:26:10 +0200 (CEST) Received: by mail-lf1-f52.google.com with SMTP id j10so8019560lfb.12 for ; Thu, 06 May 2021 07:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XqLFWwFfQzvhqGVnyC/bfONOpaXwYUdQmB1U7FEKRIU=; b=HJgLkvEvjQE7IBxeC/z0FT6CHQdNb2lJtwHL1hpkEw3MP4Ix0vgZ3vRwNRF7fCovju Yb1A+szLy/01kE0rHNF/muxBDKX8i8Ommiy5vh4vG5J3QSZaeHmrV4ONYKAwwFqIXqgm 9e4R7x1qW3AUDtCYG8IFLigIDSeTrZ6iuJrMLwbmpDk/f7Cnaw2ibmtlxIE4NZPtRpyw fvDtil5XicjBFsdWCqFfF2W7CoR5J9tYoWS8/vgSS0jpwHr+ocyXMGiXWyjkOgiT0E2n pTmF5lsjWKxKPwdq1oK2Kg9BtUtG2wG/0iJj2PFsjGtaGi+sVU401QeZKdzPl4rHXd9i yukw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XqLFWwFfQzvhqGVnyC/bfONOpaXwYUdQmB1U7FEKRIU=; b=ljBYGQIRzwmSrGLb73sE6++886DP9itUk6YSYQwSKcWohpnvOWHp48SrSn8+qGam4C tZI5/b+K+4vJRqabX62oxYdNWgIGxqNv8ZcXfrtuKy/XWzS1+U3vKOEqNgUxMgkOt0hc A0s6/IIQtCZizT81wBTtXHbA1r+ifH852my64Gj7o8AG78e7e2krUmkUZ7eIt02qlJeD LUHgIEADLkUZM5I9gE6SOMDePJ6lnZ8dwQ1SFU0J+DDzM/HrSpTArgyr4D1t4lNmFTW9 XGnj82TBZNn/6TUh9ypDJp2IhZhqt7Q5288nlsNvVJkszih2N8TWq7EFdE717d4UEom5 AgDQ== X-Gm-Message-State: AOAM532UXCfSHf4wBCUi3iOAIkLyH3SZN+4CDPunzHzfI+fW1C3wgUib layxBM+0VNoJT2iwCA278QMTDtgqJm5joyXy X-Google-Smtp-Source: ABdhPJxC40/fyBV7Hab0s8kWF0iZXLWJRNY4VWuCElR5Ea1mv9AymRB/DJzUlv5KPysQsrYBg73UJw== X-Received: by 2002:ac2:5059:: with SMTP id a25mr3045121lfm.484.1620311169247; Thu, 06 May 2021 07:26:09 -0700 (PDT) Received: from DESKTOP-U5LNN3J.localdomain (89-79-189-199.dynamic.chello.pl. [89.79.189.199]) by smtp.gmail.com with ESMTPSA id b40sm892908ljr.101.2021.05.06.07.26.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 07:26:08 -0700 (PDT) From: Michal Krawczyk To: dev@dpdk.org Cc: ndagan@amazon.com, gtzalik@amazon.com, igorch@amazon.com, upstream@semihalf.com, Stanislaw Kardach , Michal Krawczyk , Shay Agroskin Date: Thu, 6 May 2021 16:25:24 +0200 Message-Id: <20210506142526.28245-21-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210506142526.28245-1-mk@semihalf.com> References: <20210505073348.6394-1-mk@semihalf.com> <20210506142526.28245-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 20/22] net/ena: disable dev_ops not supported in SMP X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Stanislaw Kardach For dev_ops not supported in SMP, either return -EPERM or return without doing anything. In both cases log a warning. Signed-off-by: Stanislaw Kardach Reviewed-by: Michal Krawczyk Reviewed-by: Igor Chauskin Reviewed-by: Shay Agroskin --- 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 90ea40513a..73e99e956a 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -529,6 +529,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) @@ -1052,6 +1058,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; @@ -1098,6 +1110,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); -- 2.25.1