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 5971DA0546; Fri, 30 Apr 2021 14:59:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1288341344; Fri, 30 Apr 2021 14:58:11 +0200 (CEST) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mails.dpdk.org (Postfix) with ESMTP id E5F3E412DE for ; Fri, 30 Apr 2021 14:58:03 +0200 (CEST) Received: by mail-wr1-f45.google.com with SMTP id d4so2051954wru.7 for ; Fri, 30 Apr 2021 05:58:03 -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=KZudZSgRl2uMcrfYDVxngpITYx2vnG5ku50CMjyRe11lXh3dKmcDR9cGfuzkop3szc hKMdAjGm/CZLpwrbXcQK6T6qSVDiR+f0Ut5DQT/N7LgB4o8rOxSFqgzW6ILRVifIclEW z60I2smT0enLXoAELxv7unDbLu+gLPzUK0lyq/dH1eo8Suf0AC2YeEmnXqv6wHI81YE7 XxSRnC4YGmv6cf1ltaR/CXj2xysBM7RKYKYStTYvnZ9UAYo+GcNhspJB9s8jDLCbG7ts Mo4vPDL9WnU92T4YVw/h6iXn7+kf+l6TbsvrJyBY0cXecfOMCqfY8W0yeF2PIaMdRC71 ENBA== 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=jkJUp2EtG58Ric9RN6LQrVNzdIIJ1v5eleUfGydVOtTq6b0mpHGd9LrOUqMXwAesl2 ss5mbJ9vkObbNkm9d21zziRpxUbrOgxWER34FRDExckpK2ZkGQ7E18Vbg15EWy9gx+76 9gmKZXPP/qAn7xDfXBW7OXK9hxmJ3yD9CpVSaJ1d9nwI3Nm0OI0fB/kEeHcA6yncbdvC WYp4h7UHTXrDuf3BtH7il38JLjTf/DHImY2L4DOmIeHOlw4XhlX0WzgfCDvV8+MNYSCu J4/VF10HKptE/Xi9o+spbibdTgOP82UloglcEO0SeNez1YLW3LbDL9Fje5dQA4Mfm7Ki 2Now== X-Gm-Message-State: AOAM532ZVDE5oUeiLuflCAmHachPBUl6VEntoAH4J1WwIfwTBtrYyyEU G3vFS8ORwE3YBli1QwYSqGQ+mRiSGGXLFCY/ X-Google-Smtp-Source: ABdhPJzXZW3xwAKgv92aACgSu6VF2skBTNeMdIUmpWV4B/345fQs3m1v8XYwa/HkAyk+pY0gs7J4Mg== X-Received: by 2002:adf:fe42:: with SMTP id m2mr6694588wrs.84.1619787483433; Fri, 30 Apr 2021 05:58:03 -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 l13sm13476245wmj.3.2021.04.30.05.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Apr 2021 05:58:02 -0700 (PDT) From: Michal Krawczyk To: dev@dpdk.org Cc: ndagan@amazom.com, gtzalik@amazon.com, igorch@amazon.com, mw@semihalf.com, Stanislaw Kardach , Michal Krawczyk , Shay Agroskin Date: Fri, 30 Apr 2021 14:57:23 +0200 Message-Id: <20210430125725.28796-21-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210430125725.28796-1-mk@semihalf.com> References: <20210430125725.28796-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 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