From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C97CC43331 for ; Fri, 6 Sep 2019 06:53:42 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id AA1FD206BB for ; Fri, 6 Sep 2019 06:53:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=cisco.com header.i=@cisco.com header.b="EkvoWucl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA1FD206BB Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=cisco.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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