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 30BA6A0524; Wed, 5 May 2021 09:36:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED36A4118E; Wed, 5 May 2021 09:34:29 +0200 (CEST) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mails.dpdk.org (Postfix) with ESMTP id 7B4224117C for ; Wed, 5 May 2021 09:34:25 +0200 (CEST) Received: by mail-wr1-f42.google.com with SMTP id h4so649900wrt.12 for ; Wed, 05 May 2021 00:34:25 -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=ZQlHF8k5GaH08Vd1Cn7gY3H4r0b01avhW4Hcxzn9vzPl82OHG15eS1aRzgS3Hv+ZIO 1vdudA1fQZV0B8Ee9xHTy187cov668Jo0fgAGAKFaxU19Nkj2QmRKh5GT28o9HKJPXJz 0K5IJuNlehG2EPIDMG/dqcTK5GnV29RFbZT0zVO90+EuDYmH3x6OsBf6LANcma7kudRA IvGiOMHa7l5k1qFhWDIdl6mA5xW+QHwhGjaCHubcRaDBn144mMY9b6HqMMZdqcofU68z y16bVAZp10jZdoJJnRa0n3AE4/vJVskFc08pP7j+fE98qp+QUpaN4T46QAlhTQPQT5v7 /7qw== 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=gH/56yaHAwPkdFsU/pS/64dzXoAmUoLvdd6nXBWH6R+XNGxleEBMNo4j5uQ11jdUzP 1dTBvC4q192gpNweIAX9/48IN/sseRLOE3he1MgPcDO4/6XkixZe54lm5Q/luZvGApsk B4+/4EeVxPLBUrBxbk8QctJnLcVfgX7mJa6THdP3LNP16iXEwZ+vvbgGGbJwYjHypVM3 RolpQJYBNJ3ibPKBcIitQxx5H0nG9oSVABYI3jELs+c4AFepXFEC1Go/6i/J4lY33NLS 4OfgaQGYfE5h9XD2BuVNeCV6pSJ4qpbQCq2nR6gKqlytVcP0xTeiGYOa2KbZ0dcjEX5/ oBHA== X-Gm-Message-State: AOAM5300ojxiFBg0bw9EBqFQoxhJie32MZfSWxwm7YnbOIEfqrpz1/75 Iy5LR0ybQIeEZ0uu7oCGIbo6GIUygk99B5KU X-Google-Smtp-Source: ABdhPJxHmvX92yMC/ESzxdFGY+LOMnD1Ul//iaFH3rfrIVmzmbyLbf9B8IhsffpPhYPdEgvHmL8utg== X-Received: by 2002:a5d:6e04:: with SMTP id h4mr29989001wrz.256.1620200064952; Wed, 05 May 2021 00:34:24 -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 t17sm4679856wmq.12.2021.05.05.00.34.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 00:34:24 -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: Wed, 5 May 2021 09:33:46 +0200 Message-Id: <20210505073348.6394-21-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505073348.6394-1-mk@semihalf.com> References: <20210430125725.28796-1-mk@semihalf.com> <20210505073348.6394-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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