DPDK patches and discussions
 help / color / mirror / Atom feed
From: <wanry@3snic.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@amd.com>, Renyong Wan <wanry@3snic.com>,
	Steven Song <steven.song@3snic.com>
Subject: [PATCH v2 20/32] net/sssnic: support dev close and reset
Date: Thu, 31 Aug 2023 17:56:38 +0800	[thread overview]
Message-ID: <20230831095650.219964-21-wanry@3snic.com> (raw)
In-Reply-To: <20230831095650.219964-1-wanry@3snic.com>

From: Renyong Wan <wanry@3snic.com>

Signed-off-by: Steven Song <steven.song@3snic.com>
Signed-off-by: Renyong Wan <wanry@3snic.com>
---
 drivers/net/sssnic/sssnic_ethdev.c | 32 ++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/drivers/net/sssnic/sssnic_ethdev.c b/drivers/net/sssnic/sssnic_ethdev.c
index 8201a1e3c4..b59c4fd3ad 100644
--- a/drivers/net/sssnic/sssnic_ethdev.c
+++ b/drivers/net/sssnic/sssnic_ethdev.c
@@ -13,6 +13,8 @@
 #include "sssnic_ethdev_rx.h"
 #include "sssnic_ethdev_tx.h"
 
+static int sssnic_ethdev_init(struct rte_eth_dev *ethdev);
+
 static int
 sssnic_ethdev_infos_get(struct rte_eth_dev *ethdev,
 	struct rte_eth_dev_info *devinfo)
@@ -622,9 +624,39 @@ sssnic_ethdev_stop(struct rte_eth_dev *ethdev)
 	return 0;
 }
 
+static int
+sssnic_ethdev_close(struct rte_eth_dev *ethdev)
+{
+	sssnic_ethdev_release(ethdev);
+
+	PMD_DRV_LOG(INFO, "Port %u is closed", ethdev->data->port_id);
+
+	return 0;
+}
+
+static int
+sssnic_ethdev_reset(struct rte_eth_dev *ethdev)
+{
+	int ret;
+
+	sssnic_ethdev_release(ethdev);
+
+	ret = sssnic_ethdev_init(ethdev);
+	if (ret != 0) {
+		PMD_DRV_LOG(ERR, "Failed to initialize sssnic ethdev");
+		return ret;
+	}
+
+	PMD_DRV_LOG(INFO, "Port %u is reset", ethdev->data->port_id);
+
+	return 0;
+}
+
 static const struct eth_dev_ops sssnic_ethdev_ops = {
 	.dev_start = sssnic_ethdev_start,
 	.dev_stop = sssnic_ethdev_stop,
+	.dev_close = sssnic_ethdev_close,
+	.dev_reset = sssnic_ethdev_reset,
 	.dev_set_link_up = sssnic_ethdev_set_link_up,
 	.dev_set_link_down = sssnic_ethdev_set_link_down,
 	.link_update = sssnic_ethdev_link_update,
-- 
2.27.0


  parent reply	other threads:[~2023-08-31 10:00 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31  9:56 [PATCH v2 00/32] Introduce sssnic PMD for 3SNIC's 9x0 serials Ethernet adapters wanry
2023-08-31  9:56 ` [PATCH v2 01/32] net/sssnic: add build and doc infrastructure wanry
2023-08-31  9:56 ` [PATCH v2 02/32] net/sssnic: add log type and log macros wanry
2023-08-31  9:56 ` [PATCH v2 03/32] net/sssnic: support probe and remove wanry
2023-08-31  9:56 ` [PATCH v2 04/32] net/sssnic: initialize hardware base wanry
2023-08-31  9:56 ` [PATCH v2 05/32] net/sssnic: add event queue wanry
2023-08-31  9:56 ` [PATCH v2 06/32] net/sssnic/base: add message definition and utility wanry
2023-08-31  9:56 ` [PATCH v2 07/32] net/sssnic/base: add mailbox support wanry
2023-08-31  9:56 ` [PATCH v2 08/32] net/sssnic/base: add work queue wanry
2023-08-31  9:56 ` [PATCH v2 09/32] net/sssnic/base: add control queue wanry
2023-08-31  9:56 ` [PATCH v2 10/32] net/sssnic: add dev configure and infos get wanry
2023-08-31  9:56 ` [PATCH v2 11/32] net/sssnic: add dev MAC ops wanry
2023-08-31  9:56 ` [PATCH v2 12/32] net/sssnic: support dev link status wanry
2023-08-31  9:56 ` [PATCH v2 13/32] net/sssnic: support link status event wanry
2023-08-31  9:56 ` [PATCH v2 14/32] net/sssnic: support Rx queue setup and release wanry
2023-08-31  9:56 ` [PATCH v2 15/32] net/sssnic: support Tx " wanry
2023-08-31  9:56 ` [PATCH v2 16/32] net/sssnic: support Rx queue start and stop wanry
2023-08-31  9:56 ` [PATCH v2 17/32] net/sssnic: support Tx " wanry
2023-08-31  9:56 ` [PATCH v2 18/32] net/sssnic: add Rx interrupt support wanry
2023-08-31  9:56 ` [PATCH v2 19/32] net/sssnic: support dev start and stop wanry
2023-08-31  9:56 ` wanry [this message]
2023-08-31  9:56 ` [PATCH v2 21/32] net/sssnic: add allmulticast and promiscuous ops wanry
2023-08-31  9:56 ` [PATCH v2 22/32] net/sssnic: add basic and extended stats ops wanry
2023-08-31  9:56 ` [PATCH v2 23/32] net/sssnic: support Rx packet burst wanry
2023-08-31  9:56 ` [PATCH v2 24/32] net/sssnic: support Tx " wanry
2023-08-31  9:56 ` [PATCH v2 25/32] net/sssnic: add RSS support wanry
2023-08-31  9:56 ` [PATCH v2 26/32] net/sssnic: support dev MTU set wanry
2023-08-31  9:56 ` [PATCH v2 27/32] net/sssnic: support dev queue info get wanry
2023-08-31  9:56 ` [PATCH v2 28/32] net/sssnic: support dev firmware version get wanry
2023-08-31  9:56 ` [PATCH v2 29/32] net/sssnic: add dev flow control ops wanry
2023-08-31  9:56 ` [PATCH v2 30/32] net/sssnic: support VLAN offload and filter wanry
2023-08-31  9:56 ` [PATCH v2 31/32] net/sssnic: add generic flow ops wanry
2023-08-31  9:56 ` [PATCH v2 32/32] net/sssnic: add VF dev support wanry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230831095650.219964-21-wanry@3snic.com \
    --to=wanry@3snic.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=steven.song@3snic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).