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 058F1A0548; Mon, 8 Mar 2021 12:39:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8783F22A353; Mon, 8 Mar 2021 12:39:10 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 92AC34068A for ; Mon, 8 Mar 2021 12:39:08 +0100 (CET) IronPort-SDR: IHoMiGzHAltDIT+xoavzvAwNxBQ0YVF8oc3GVCGBKYtC3FQ1qXnK6iFFIMhN8AYh2DUnqge6r8 mDAu/lWTALoQ== X-IronPort-AV: E=McAfee;i="6000,8403,9916"; a="175121927" X-IronPort-AV: E=Sophos;i="5.81,232,1610438400"; d="scan'208";a="175121927" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2021 03:39:07 -0800 IronPort-SDR: R0X8/1wMBvVzr4D/VComPgkvkNLd+twu5YF2IFYxL6ZbDilgAt7m673h3E73FAYsNWwT87OFK9 8mK/vf6gEg/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,232,1610438400"; d="scan'208";a="598825704" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.27]) by fmsmga006.fm.intel.com with ESMTP; 08 Mar 2021 03:39:05 -0800 From: Ferruh Yigit To: Bruce Richardson , Anatoly Burakov Cc: Ferruh Yigit , dev@dpdk.org Date: Mon, 8 Mar 2021 11:39:03 +0000 Message-Id: <20210308113903.2475582-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20200930110241.1882308-1-ferruh.yigit@intel.com> References: <20200930110241.1882308-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] net/ring: support secondary process 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" Signed-off-by: Ferruh Yigit Acked-by: Bruce Richardson --- v2: * Drop .ini file --- drivers/net/ring/rte_eth_ring.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 472d838582ee..02f6da2817ba 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -615,6 +615,23 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) PMD_LOG(INFO, "Initializing pmd_ring for %s", name); + if (rte_eal_process_type() == RTE_PROC_SECONDARY) { + eth_dev = rte_eth_dev_attach_secondary(name); + if (!eth_dev) { + PMD_LOG(ERR, "Failed to probe %s", name); + return -1; + } + eth_dev->dev_ops = &ops; + eth_dev->device = &dev->device; + + eth_dev->rx_pkt_burst = eth_ring_rx; + eth_dev->tx_pkt_burst = eth_ring_tx; + + rte_eth_dev_probing_finish(eth_dev); + + return 0; + } + if (params == NULL || params[0] == '\0') { ret = eth_dev_ring_create(name, dev, rte_socket_id(), DEV_CREATE, ð_dev); -- 2.29.2