DPDK patches and discussions
 help / color / mirror / Atom feed
From: Mingxia Liu <mingxia.liu@intel.com>
To: dev@dpdk.org
Cc: jingjing.wu@intel.com, beilei.xing@intel.com,
	Mingxia Liu <mingxia.liu@intel.com>
Subject: [PATCH] net/idpf: optimize the code of IDPF PMD
Date: Mon, 26 Jun 2023 14:05:31 +0000	[thread overview]
Message-ID: <20230626140531.490850-1-mingxia.liu@intel.com> (raw)

This patch moves 'struct eth_dev_ops idpf_eth_dev_ops = {...}'
block just after idpf_dev_close(), to group dev_ops related
code together.

Signed-off-by: Mingxia Liu <mingxia.liu@intel.com>
---
 drivers/net/idpf/idpf_ethdev.c | 56 +++++++++++++++++-----------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index bfdac92b95..801da57472 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -839,6 +839,34 @@ idpf_dev_close(struct rte_eth_dev *dev)
 	return 0;
 }
 
+static const struct eth_dev_ops idpf_eth_dev_ops = {
+	.dev_configure			= idpf_dev_configure,
+	.dev_close			= idpf_dev_close,
+	.rx_queue_setup			= idpf_rx_queue_setup,
+	.tx_queue_setup			= idpf_tx_queue_setup,
+	.dev_infos_get			= idpf_dev_info_get,
+	.dev_start			= idpf_dev_start,
+	.dev_stop			= idpf_dev_stop,
+	.link_update			= idpf_dev_link_update,
+	.rx_queue_start			= idpf_rx_queue_start,
+	.tx_queue_start			= idpf_tx_queue_start,
+	.rx_queue_stop			= idpf_rx_queue_stop,
+	.tx_queue_stop			= idpf_tx_queue_stop,
+	.rx_queue_release		= idpf_dev_rx_queue_release,
+	.tx_queue_release		= idpf_dev_tx_queue_release,
+	.mtu_set			= idpf_dev_mtu_set,
+	.dev_supported_ptypes_get	= idpf_dev_supported_ptypes_get,
+	.stats_get			= idpf_dev_stats_get,
+	.stats_reset			= idpf_dev_stats_reset,
+	.reta_update			= idpf_rss_reta_update,
+	.reta_query			= idpf_rss_reta_query,
+	.rss_hash_update		= idpf_rss_hash_update,
+	.rss_hash_conf_get		= idpf_rss_hash_conf_get,
+	.xstats_get			= idpf_dev_xstats_get,
+	.xstats_get_names		= idpf_dev_xstats_get_names,
+	.xstats_reset			= idpf_dev_xstats_reset,
+};
+
 static int
 insert_value(struct idpf_devargs *devargs, uint16_t id)
 {
@@ -1206,34 +1234,6 @@ idpf_adapter_ext_init(struct rte_pci_device *pci_dev, struct idpf_adapter_ext *a
 	return ret;
 }
 
-static const struct eth_dev_ops idpf_eth_dev_ops = {
-	.dev_configure			= idpf_dev_configure,
-	.dev_close			= idpf_dev_close,
-	.rx_queue_setup			= idpf_rx_queue_setup,
-	.tx_queue_setup			= idpf_tx_queue_setup,
-	.dev_infos_get			= idpf_dev_info_get,
-	.dev_start			= idpf_dev_start,
-	.dev_stop			= idpf_dev_stop,
-	.link_update			= idpf_dev_link_update,
-	.rx_queue_start			= idpf_rx_queue_start,
-	.tx_queue_start			= idpf_tx_queue_start,
-	.rx_queue_stop			= idpf_rx_queue_stop,
-	.tx_queue_stop			= idpf_tx_queue_stop,
-	.rx_queue_release		= idpf_dev_rx_queue_release,
-	.tx_queue_release		= idpf_dev_tx_queue_release,
-	.mtu_set			= idpf_dev_mtu_set,
-	.dev_supported_ptypes_get	= idpf_dev_supported_ptypes_get,
-	.stats_get			= idpf_dev_stats_get,
-	.stats_reset			= idpf_dev_stats_reset,
-	.reta_update			= idpf_rss_reta_update,
-	.reta_query			= idpf_rss_reta_query,
-	.rss_hash_update		= idpf_rss_hash_update,
-	.rss_hash_conf_get		= idpf_rss_hash_conf_get,
-	.xstats_get			= idpf_dev_xstats_get,
-	.xstats_get_names		= idpf_dev_xstats_get_names,
-	.xstats_reset			= idpf_dev_xstats_reset,
-};
-
 static uint16_t
 idpf_vport_idx_alloc(struct idpf_adapter_ext *ad)
 {
-- 
2.34.1


             reply	other threads:[~2023-06-26  5:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 14:05 Mingxia Liu [this message]
2023-06-30  8:32 ` Zhang, Qi Z

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=20230626140531.490850-1-mingxia.liu@intel.com \
    --to=mingxia.liu@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.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).