From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0CD8AA2EDB for ; Fri, 6 Sep 2019 08:53:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C0DEF1F13D; Fri, 6 Sep 2019 08:53:40 +0200 (CEST) Received: from alln-iport-7.cisco.com (alln-iport-7.cisco.com [173.37.142.94]) by dpdk.org (Postfix) with ESMTP id 7EDCB1F13C; Fri, 6 Sep 2019 08:53:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2669; q=dns/txt; s=iport; t=1567752819; x=1568962419; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bPvVVCrAYkqPYWPnHj6muNc3mxhTvLh4SUS1F5f8bhw=; b=EkvoWuclK9h7r5jicAHaTsqpEwTK8cMtUCpHTnjXqwSPswmNFkBRnVCI u8eEhXSvZeY/Btn2JsVKeGE7EZxlHffzBqFC8pahVmFNrtfseBrHRFauD 3gnHW8Fun8/mLO3ITcFnA+X4N4RvLyQEor0LNbfDVL3xejoDrqmAZctpk o=; X-IronPort-AV: E=Sophos;i="5.64,472,1559520000"; d="scan'208";a="320821705" Received: from alln-core-6.cisco.com ([173.36.13.139]) by alln-iport-7.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 06 Sep 2019 06:53:38 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-6.cisco.com (8.15.2/8.15.2) with ESMTP id x866rcQ3006808; Fri, 6 Sep 2019 06:53:38 GMT Received: by cisco.com (Postfix, from userid 508933) id 18ADB20F2003; Thu, 5 Sep 2019 23:53:38 -0700 (PDT) From: Hyong Youb Kim To: Ferruh Yigit Cc: dev@dpdk.org, John Daley , Dirk-Holger Lenz , Hyong Youb Kim , stable@dpdk.org Date: Thu, 5 Sep 2019 23:50:18 -0700 Message-Id: <20190906065020.21206-2-hyonkim@cisco.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190906065020.21206-1-hyonkim@cisco.com> References: <20190906065020.21206-1-hyonkim@cisco.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: alln-core-6.cisco.com Subject: [dpdk-dev] [PATCH 1/3] net/enic: restrict several handlers to primary process X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" These eth_dev_ops handlers should run only in the primary process. - filter_ctrl - reta_update - rss_hash_update - set_mc_addr_list - udp_tunnel_port_add - udp_tunnel_port_del Fixes: c2fec27b5cb0 ("net/enic: allow to change RSS settings") Fixes: 8d496995346c ("net/enic: support multicast filtering") Fixes: 8a4efd17410c ("net/enic: add handlers to add/delete vxlan port number") Cc: stable@dpdk.org Reported-by: Dirk-Holger Lenz Signed-off-by: Hyong Youb Kim Tested-by: Dirk-Holger Lenz Reviewed-by: John Daley --- drivers/net/enic/enic_ethdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 06dc67122..85d785e62 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -129,6 +129,8 @@ enicpmd_dev_filter_ctrl(struct rte_eth_dev *dev, { int ret = 0; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; ENICPMD_FUNC_TRACE(); switch (filter_type) { @@ -710,6 +712,8 @@ static int enicpmd_set_mc_addr_list(struct rte_eth_dev *eth_dev, uint32_t i, j; int ret; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; ENICPMD_FUNC_TRACE(); /* Validate the given addresses first */ @@ -826,6 +830,8 @@ static int enicpmd_dev_rss_reta_update(struct rte_eth_dev *dev, union vnic_rss_cpu rss_cpu; uint16_t i, idx, shift; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; ENICPMD_FUNC_TRACE(); if (reta_size != ENIC_RSS_RETA_SIZE) { dev_err(enic, "reta_update: wrong reta_size. given=%u" @@ -854,6 +860,8 @@ static int enicpmd_dev_rss_hash_update(struct rte_eth_dev *dev, { struct enic *enic = pmd_priv(dev); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; ENICPMD_FUNC_TRACE(); return enic_set_rss_conf(enic, rss_conf); } @@ -986,6 +994,8 @@ static int enicpmd_dev_udp_tunnel_port_add(struct rte_eth_dev *eth_dev, struct enic *enic = pmd_priv(eth_dev); int ret; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; ENICPMD_FUNC_TRACE(); ret = udp_tunnel_common_check(enic, tnl); if (ret) @@ -1008,6 +1018,8 @@ static int enicpmd_dev_udp_tunnel_port_del(struct rte_eth_dev *eth_dev, struct enic *enic = pmd_priv(eth_dev); int ret; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; ENICPMD_FUNC_TRACE(); ret = udp_tunnel_common_check(enic, tnl); if (ret) -- 2.22.0