DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ophir Munk <ophirmu@mellanox.com>
To: dev@dpdk.org
Cc: Raslan Darawsheh <rasland@mellanox.com>,
	Ophir Munk <ophirmu@mellanox.com>,
	Matan Azrad <matan@mellanox.com>
Subject: [dpdk-dev] [PATCH v2 6/8] net/mlx5: header file cleanup
Date: Sun, 19 Jul 2020 07:11:10 +0000	[thread overview]
Message-ID: <20200719071112.8540-7-ophirmu@mellanox.com> (raw)
In-Reply-To: <20200719071112.8540-1-ophirmu@mellanox.com>

The cleanup refers to header file mlx5.h.
1. Remove unused prototypes.
2. Move prototypes under their correct title.
3. Change functions to static and remove their prototye from the header
file.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/linux/mlx5_ethdev_os.c | 102 ++++++++++++++++----------------
 drivers/net/mlx5/mlx5.h                 |  18 +++---
 2 files changed, 58 insertions(+), 62 deletions(-)

diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
index e79d576..1735157 100644
--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
@@ -973,6 +973,57 @@ mlx5_is_removed(struct rte_eth_dev *dev)
 }
 
 /**
+ * Analyze gathered port parameters via sysfs to recognize master
+ * and representor devices for E-Switch configuration.
+ *
+ * @param[in] device_dir
+ *   flag of presence of "device" directory under port device key.
+ * @param[inout] switch_info
+ *   Port information, including port name as a number and port name
+ *   type if recognized
+ *
+ * @return
+ *   master and representor flags are set in switch_info according to
+ *   recognized parameters (if any).
+ */
+static void
+mlx5_sysfs_check_switch_info(bool device_dir,
+			     struct mlx5_switch_info *switch_info)
+{
+	switch (switch_info->name_type) {
+	case MLX5_PHYS_PORT_NAME_TYPE_UNKNOWN:
+		/*
+		 * Name is not recognized, assume the master,
+		 * check the device directory presence.
+		 */
+		switch_info->master = device_dir;
+		break;
+	case MLX5_PHYS_PORT_NAME_TYPE_NOTSET:
+		/*
+		 * Name is not set, this assumes the legacy naming
+		 * schema for master, just check if there is
+		 * a device directory.
+		 */
+		switch_info->master = device_dir;
+		break;
+	case MLX5_PHYS_PORT_NAME_TYPE_UPLINK:
+		/* New uplink naming schema recognized. */
+		switch_info->master = 1;
+		break;
+	case MLX5_PHYS_PORT_NAME_TYPE_LEGACY:
+		/* Legacy representors naming schema. */
+		switch_info->representor = !device_dir;
+		break;
+	case MLX5_PHYS_PORT_NAME_TYPE_PFHPF:
+		/* Fallthrough */
+	case MLX5_PHYS_PORT_NAME_TYPE_PFVF:
+		/* New representors naming schema. */
+		switch_info->representor = 1;
+		break;
+	}
+}
+
+/**
  * Get switch information associated with network interface.
  *
  * @param ifindex
@@ -1051,57 +1102,6 @@ mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info)
 }
 
 /**
- * Analyze gathered port parameters via sysfs to recognize master
- * and representor devices for E-Switch configuration.
- *
- * @param[in] device_dir
- *   flag of presence of "device" directory under port device key.
- * @param[inout] switch_info
- *   Port information, including port name as a number and port name
- *   type if recognized
- *
- * @return
- *   master and representor flags are set in switch_info according to
- *   recognized parameters (if any).
- */
-void
-mlx5_sysfs_check_switch_info(bool device_dir,
-			     struct mlx5_switch_info *switch_info)
-{
-	switch (switch_info->name_type) {
-	case MLX5_PHYS_PORT_NAME_TYPE_UNKNOWN:
-		/*
-		 * Name is not recognized, assume the master,
-		 * check the device directory presence.
-		 */
-		switch_info->master = device_dir;
-		break;
-	case MLX5_PHYS_PORT_NAME_TYPE_NOTSET:
-		/*
-		 * Name is not set, this assumes the legacy naming
-		 * schema for master, just check if there is
-		 * a device directory.
-		 */
-		switch_info->master = device_dir;
-		break;
-	case MLX5_PHYS_PORT_NAME_TYPE_UPLINK:
-		/* New uplink naming schema recognized. */
-		switch_info->master = 1;
-		break;
-	case MLX5_PHYS_PORT_NAME_TYPE_LEGACY:
-		/* Legacy representors naming schema. */
-		switch_info->representor = !device_dir;
-		break;
-	case MLX5_PHYS_PORT_NAME_TYPE_PFHPF:
-		/* Fallthrough */
-	case MLX5_PHYS_PORT_NAME_TYPE_PFVF:
-		/* New representors naming schema. */
-		switch_info->representor = 1;
-		break;
-	}
-}
-
-/**
  * DPDK callback to retrieve plug-in module EEPROM information (type and size).
  *
  * @param dev
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 00ee2e3..147ff62 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -813,6 +813,10 @@ const uint32_t *mlx5_dev_supported_ptypes_get(struct rte_eth_dev *dev);
 int mlx5_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu);
 int mlx5_hairpin_cap_get(struct rte_eth_dev *dev,
 			 struct rte_eth_hairpin_cap *cap);
+eth_rx_burst_t mlx5_select_rx_function(struct rte_eth_dev *dev);
+struct mlx5_priv *mlx5_port_to_eswitch_info(uint16_t port, bool valid);
+struct mlx5_priv *mlx5_dev_to_eswitch_info(struct rte_eth_dev *dev);
+int mlx5_dev_configure_rss_reta(struct rte_eth_dev *dev);
 
 /* mlx5_ethdev_os.c */
 
@@ -823,27 +827,17 @@ int mlx5_get_mtu(struct rte_eth_dev *dev, uint16_t *mtu);
 int mlx5_set_mtu(struct rte_eth_dev *dev, uint16_t mtu);
 int mlx5_read_clock(struct rte_eth_dev *dev, uint64_t *clock);
 int mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete);
-int mlx5_force_link_status_change(struct rte_eth_dev *dev, int status);
 int mlx5_dev_get_flow_ctrl(struct rte_eth_dev *dev,
 			   struct rte_eth_fc_conf *fc_conf);
 int mlx5_dev_set_flow_ctrl(struct rte_eth_dev *dev,
 			   struct rte_eth_fc_conf *fc_conf);
-void mlx5_dev_link_status_handler(void *arg);
 void mlx5_dev_interrupt_handler(void *arg);
 void mlx5_dev_interrupt_handler_devx(void *arg);
-void mlx5_dev_interrupt_handler_uninstall(struct rte_eth_dev *dev);
-void mlx5_dev_interrupt_handler_install(struct rte_eth_dev *dev);
 int mlx5_set_link_down(struct rte_eth_dev *dev);
 int mlx5_set_link_up(struct rte_eth_dev *dev);
 int mlx5_is_removed(struct rte_eth_dev *dev);
-eth_tx_burst_t mlx5_select_tx_function(struct rte_eth_dev *dev);
-eth_rx_burst_t mlx5_select_rx_function(struct rte_eth_dev *dev);
-struct mlx5_priv *mlx5_port_to_eswitch_info(uint16_t port, bool valid);
-struct mlx5_priv *mlx5_dev_to_eswitch_info(struct rte_eth_dev *dev);
 int mlx5_sysfs_switch_info(unsigned int ifindex,
 			   struct mlx5_switch_info *info);
-void mlx5_sysfs_check_switch_info(bool device_dir,
-				  struct mlx5_switch_info *switch_info);
 void mlx5_translate_port_name(const char *port_name_in,
 			      struct mlx5_switch_info *port_info_out);
 void mlx5_intr_callback_unregister(const struct rte_intr_handle *handle,
@@ -852,7 +846,6 @@ int mlx5_get_module_info(struct rte_eth_dev *dev,
 			 struct rte_eth_dev_module_info *modinfo);
 int mlx5_get_module_eeprom(struct rte_eth_dev *dev,
 			   struct rte_dev_eeprom_info *info);
-int mlx5_dev_configure_rss_reta(struct rte_eth_dev *dev);
 int mlx5_os_read_dev_stat(struct mlx5_priv *priv,
 			  const char *ctr_name, uint64_t *stat);
 int mlx5_os_read_dev_counters(struct rte_eth_dev *dev, uint64_t *stats);
@@ -1043,4 +1036,7 @@ int mlx5_txpp_xstats_get_names(struct rte_eth_dev *dev,
 			       unsigned int n, unsigned int n_used);
 void mlx5_txpp_interrupt_handler(void *cb_arg);
 
+/* mlx5_rxtx.c */
+
+eth_tx_burst_t mlx5_select_tx_function(struct rte_eth_dev *dev);
 #endif /* RTE_PMD_MLX5_H_ */
-- 
2.8.4


  parent reply	other threads:[~2020-07-19  7:12 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14 14:20 [dpdk-dev] [PATCH v1 0/8] mlx5 PMD multi OS support - part #3 Ophir Munk
2020-07-14 14:20 ` [dpdk-dev] [PATCH v1 1/8] net/mlx5: move flow prio discovery and adjust under verbs Ophir Munk
2020-07-14 14:20 ` [dpdk-dev] [PATCH v1 2/8] net/mlx5: replace Linux specific calls with rte API Ophir Munk
2020-07-14 14:20 ` [dpdk-dev] [PATCH v1 3/8] net/mlx5: refactor Linux MAC operations Ophir Munk
2020-07-14 14:20 ` [dpdk-dev] [PATCH v1 4/8] linux/mlx5: add setters for promiscuous and all-multi Ophir Munk
2020-07-14 14:20 ` [dpdk-dev] [PATCH v1 5/8] net/mlx5: eliminate dependency on Linux in shared header Ophir Munk
2020-07-14 14:21 ` [dpdk-dev] [PATCH v1 6/8] net/mlx5: header file cleanup Ophir Munk
2020-07-14 14:21 ` [dpdk-dev] [PATCH v1 7/8] net/mlx5: refactor multi process communication Ophir Munk
2020-07-14 14:21 ` [dpdk-dev] [PATCH v1 8/8] mlx5: remove inclusion of verbs header files Ophir Munk
2020-07-19  7:11   ` [dpdk-dev] [PATCH v2 0/8] mlx5 PMD multi OS support - part #3 Ophir Munk
2020-07-19  7:11     ` [dpdk-dev] [PATCH v2 1/8] net/mlx5: move flow prio discovery and adjust under Verbs Ophir Munk
2020-07-19  7:11     ` [dpdk-dev] [PATCH v2 2/8] net/mlx5: replace Linux specific calls with rte API Ophir Munk
2020-07-19  7:11     ` [dpdk-dev] [PATCH v2 3/8] net/mlx5: refactor Linux MAC operations Ophir Munk
2020-07-19  7:11     ` [dpdk-dev] [PATCH v2 4/8] linux/mlx5: add setters for promiscuous and all-multi Ophir Munk
2020-07-19  7:11     ` [dpdk-dev] [PATCH v2 5/8] net/mlx5: eliminate dependency on Linux in shared header Ophir Munk
2020-07-19  7:11     ` Ophir Munk [this message]
2020-07-19  7:11     ` [dpdk-dev] [PATCH v2 7/8] net/mlx5: refactor multi process communication Ophir Munk
2020-07-19  7:11     ` [dpdk-dev] [PATCH v2 8/8] mlx5: remove inclusion of Verbs header files Ophir Munk
2020-07-19 10:18       ` [dpdk-dev] [PATCH v3 0/8] mlx5 PMD multi OS support - part #3 Ophir Munk
2020-07-19 10:18         ` [dpdk-dev] [PATCH v3 1/8] net/mlx5: move flow prio discovery and adjust under Verbs Ophir Munk
2020-07-19 10:18         ` [dpdk-dev] [PATCH v3 2/8] net/mlx5: replace Linux specific calls with rte API Ophir Munk
2020-07-19 10:18         ` [dpdk-dev] [PATCH v3 3/8] net/mlx5: refactor Linux MAC operations Ophir Munk
2020-07-19 10:18         ` [dpdk-dev] [PATCH v3 4/8] linux/mlx5: add setters for promiscuous and all-multi Ophir Munk
2020-07-19 10:18         ` [dpdk-dev] [PATCH v3 5/8] net/mlx5: eliminate dependency on Linux in shared header Ophir Munk
2020-07-19 10:18         ` [dpdk-dev] [PATCH v3 6/8] net/mlx5: header file cleanup Ophir Munk
2020-07-19 10:18         ` [dpdk-dev] [PATCH v3 7/8] net/mlx5: refactor multi process communication Ophir Munk
2020-07-19 10:18         ` [dpdk-dev] [PATCH v3 8/8] mlx5: remove inclusion of Verbs header files Ophir Munk
2020-07-19 14:56         ` [dpdk-dev] [PATCH v3 0/8] mlx5 PMD multi OS support - part #3 Raslan Darawsheh

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=20200719071112.8540-7-ophirmu@mellanox.com \
    --to=ophirmu@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=rasland@mellanox.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).