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 EF501A0C41; Tue, 11 May 2021 08:48:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5EB9F4117F; Tue, 11 May 2021 08:46:40 +0200 (CEST) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by mails.dpdk.org (Postfix) with ESMTP id C766341162 for ; Tue, 11 May 2021 08:46:34 +0200 (CEST) Received: by mail-lj1-f170.google.com with SMTP id e11so10241470ljn.13 for ; Mon, 10 May 2021 23:46:34 -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=G2HyLIHoZazCvzTFlYBXx4zZ/V7CBxA8sV1aOimPvJo=; b=casnfBE1jRJyu0hSobUk3+yan1qdSyAWWzZBKy8vqceW1qeXbmNDek/gCNo7rR59e8 1TzdkgsvPVLHyBudNwcxWEAI+rRXxQyJbd2Oj94kgeSaQN+WVKxW+hJqVXCb27Z0vTPY EwEY9cOrKie7P6QeV7csbqwSlNJDcMPJKwnRtEFhX00szfI6YaPFF83lWYIlIJ7Y71lc Dyl72vXH2b8u1ajMKOjpkO/+CsVQelMCQCZ3O9PIQ8AetJWOPAJPBNPJtn1X1a5Rb+FT g395rCzbzUeM2GWpr5M3CfnhvJUPAl/to5ctB7j4Hs9ck0FIRu52Py0HAImmn/GkxgHl LkFg== 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=G2HyLIHoZazCvzTFlYBXx4zZ/V7CBxA8sV1aOimPvJo=; b=WbLpVOZgwCcm8wz708X4cFTMRNVlkwc/qopcDYcdDwVyKOhZfmJYE7Wz39hX6yYZYe oquoxmhDrA4uQvuPT3qWBLDhO2Fp402vq9coCq1B1JctkD91g8/n9u/abOsoiSd+Ayis KX6SPY9p7rn67MNtEGQjuLgUHH7XMDYmcM0nsl+kAZeM7Kbm8O8o3nHQF0SlGG0txDAV MChUjBD7RDSrm8PC0CYUMIbf+rBo5tJpAZQT3LJCGHl3zxX7fyC5/Fb9HrwxD+zDp+6p H86/MalCT1HQ2vb79M0Ty6zKM4FoEoD6zrUkIrTiqdndR9H4ovVRMF6rl80+qLQaD2xw /ISA== X-Gm-Message-State: AOAM533lj1D7r2qnX5dtd5IVrWiW5ZWX4ch5Qu0iZRkQ05tGUkOWYlGZ 2SE7Y3N81ZmMtJfDnwHUUK86Bw== X-Google-Smtp-Source: ABdhPJxr7JnUJBA7ic74BqIgzcxi1A8pt6eB7Z3mposjKvjaXXQ1l+A3NkNWTy0cRT4K4rxsweLRAQ== X-Received: by 2002:a2e:9251:: with SMTP id v17mr23334152ljg.507.1620715594447; Mon, 10 May 2021 23:46:34 -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 v20sm2496776lfd.92.2021.05.10.23.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 23:46:33 -0700 (PDT) From: Michal Krawczyk To: ferruh.yigit@intel.com Cc: dev@dpdk.org, ndagan@amazon.com, gtzalik@amazon.com, igorch@amazon.com, upstream@semihalf.com, Stanislaw Kardach , Michal Krawczyk , Shay Agroskin Date: Tue, 11 May 2021 08:45:52 +0200 Message-Id: <20210511064554.10656-18-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210511064554.10656-1-mk@semihalf.com> References: <87e65a42-4ae5-1a81-8f8e-74759fc14999@intel.com> <20210511064554.10656-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 17/19] 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 --- 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); -- 2.25.1