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 A566EA04B5; Wed, 30 Sep 2020 13:02:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 72B711D673; Wed, 30 Sep 2020 13:02:50 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 96D7A1D66E for ; Wed, 30 Sep 2020 13:02:48 +0200 (CEST) IronPort-SDR: IgtvoNGPs215KEqSaKp9ggxs3r5fp9W9qYYfPSTF3CGHnkCu7ZkbWNiKyZfwZmGuYtIDyUCMfW db73fpTmuVTA== X-IronPort-AV: E=McAfee;i="6000,8403,9759"; a="163278922" X-IronPort-AV: E=Sophos;i="5.77,322,1596524400"; d="scan'208";a="163278922" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2020 04:02:44 -0700 IronPort-SDR: iQt7V2++gb1aIRRd9El6V93sk+s2bn6fnPzCMiR8I5l0oZth/jc+p6kOpvi0l2NEvzcGLfKNLP 2SRRXDYop1FQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,322,1596524400"; d="scan'208";a="341156510" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by orsmga008.jf.intel.com with ESMTP; 30 Sep 2020 04:02:43 -0700 From: Ferruh Yigit To: Bruce Richardson , Anatoly Burakov Cc: dev@dpdk.org, Ferruh Yigit , Kevin Laatz Date: Wed, 30 Sep 2020 12:02:40 +0100 Message-Id: <20200930110241.1882308-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/ring: support secondary 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" Also add missing .ini feature list documentation and document some existing features including new "Multiprocess aware" feature. Signed-off-by: Ferruh Yigit --- Cc: Kevin Laatz --- doc/guides/nics/features/ring.ini | 10 ++++++++++ drivers/net/ring/rte_eth_ring.c | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 doc/guides/nics/features/ring.ini diff --git a/doc/guides/nics/features/ring.ini b/doc/guides/nics/features/ring.ini new file mode 100644 index 0000000000..fbfa6555d7 --- /dev/null +++ b/doc/guides/nics/features/ring.ini @@ -0,0 +1,10 @@ +; +; Supported features of the 'ring' network poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Basic stats = Y +Multiprocess aware = Y +ARMv8 = Y +x86-64 = Y diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 12046f5a00..f33951ee2e 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -595,6 +595,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.26.2