[dpdk-dev] [PATCH 15/19] net/mlx5: making flow control DPDK callback invalid

Srikanth Kaka srikanth.k at oneconvergence.com
Mon Sep 27 15:34:46 CEST 2021


At present, flow control CBs are not being supported on FreeBSD

Signed-off-by: Srikanth Kaka <srikanth.k at oneconvergence.com>
Signed-off-by: Vag Singh <vag.singh at oneconvergence.com>
Signed-off-by: Anand Thulasiram <avelu at juniper.net>
---
 drivers/net/mlx5/freebsd/mlx5_ethdev_os.c | 61 ++++-------------------
 1 file changed, 10 insertions(+), 51 deletions(-)

diff --git a/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c b/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c
index f1946fa9f6..a04bac8ed9 100644
--- a/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/freebsd/mlx5_ethdev_os.c
@@ -414,31 +414,12 @@ mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 int
 mlx5_dev_get_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 {
-	struct ifreq ifr;
-	struct ethtool_pauseparam ethpause = {
-		.cmd = ETHTOOL_GPAUSEPARAM
-	};
-	int ret;
+	RTE_SET_USED(fc_conf);
+	DRV_LOG(WARNING,
+		"port %u can not get flow control status. Operation not supported in FreeBSD",
+		dev->data->port_id);
 
-	ifr.ifr_data = (void *)ðpause;
-	ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
-	if (ret) {
-		DRV_LOG(WARNING,
-			"port %u ioctl(SIOCETHTOOL, ETHTOOL_GPAUSEPARAM) failed:"
-			" %s",
-			dev->data->port_id, strerror(rte_errno));
-		return ret;
-	}
-	fc_conf->autoneg = ethpause.autoneg;
-	if (ethpause.rx_pause && ethpause.tx_pause)
-		fc_conf->mode = RTE_FC_FULL;
-	else if (ethpause.rx_pause)
-		fc_conf->mode = RTE_FC_RX_PAUSE;
-	else if (ethpause.tx_pause)
-		fc_conf->mode = RTE_FC_TX_PAUSE;
-	else
-		fc_conf->mode = RTE_FC_NONE;
-	return 0;
+	return -EOPNOTSUPP;
 }
 
 /**
@@ -455,34 +436,12 @@ 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)
 {
-	struct ifreq ifr;
-	struct ethtool_pauseparam ethpause = {
-		.cmd = ETHTOOL_SPAUSEPARAM
-	};
-	int ret;
-
-	ifr.ifr_data = (void *)ðpause;
-	ethpause.autoneg = fc_conf->autoneg;
-	if (((fc_conf->mode & RTE_FC_FULL) == RTE_FC_FULL) ||
-	    (fc_conf->mode & RTE_FC_RX_PAUSE))
-		ethpause.rx_pause = 1;
-	else
-		ethpause.rx_pause = 0;
+	RTE_SET_USED(fc_conf);
+	DRV_LOG(WARNING,
+		"port %u can not modify flow control. Operation not supported in FreeBSD",
+		dev->data->port_id);
 
-	if (((fc_conf->mode & RTE_FC_FULL) == RTE_FC_FULL) ||
-	    (fc_conf->mode & RTE_FC_TX_PAUSE))
-		ethpause.tx_pause = 1;
-	else
-		ethpause.tx_pause = 0;
-	ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
-	if (ret) {
-		DRV_LOG(WARNING,
-			"port %u ioctl(SIOCETHTOOL, ETHTOOL_SPAUSEPARAM)"
-			" failed: %s",
-			dev->data->port_id, strerror(rte_errno));
-		return ret;
-	}
-	return 0;
+	return -EOPNOTSUPP;
 }
 
 /**
-- 
2.30.2



More information about the dev mailing list