DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] net/ice: add nic blinking support
@ 2022-09-01 21:13 Markus Theil
  2022-09-01 21:13 ` [PATCH 2/2] net/ice: add basic flow ctrl support for enable/disable/get Markus Theil
  2022-09-04  2:10 ` [PATCH 1/2] net/ice: add nic blinking support Zhang, Qi Z
  0 siblings, 2 replies; 6+ messages in thread
From: Markus Theil @ 2022-09-01 21:13 UTC (permalink / raw)
  To: dev; +Cc: Qiming Yang, Qi Zhang, Markus Theil

From: Markus Theil <markus.theil@secunet.com>

Signed-off-by: Markus Theil <markus.theil@secunet.com>
---
 drivers/net/ice/ice_ethdev.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index fc889420c7..f5820d6ccb 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -90,6 +90,8 @@ static int ice_link_update(struct rte_eth_dev *dev,
 			   int wait_to_complete);
 static int ice_dev_set_link_up(struct rte_eth_dev *dev);
 static int ice_dev_set_link_down(struct rte_eth_dev *dev);
+static int ice_dev_led_on(struct rte_eth_dev *dev);
+static int ice_dev_led_off(struct rte_eth_dev *dev);
 
 static int ice_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
 static int ice_vlan_offload_set(struct rte_eth_dev *dev, int mask);
@@ -215,6 +217,8 @@ static const struct eth_dev_ops ice_eth_dev_ops = {
 	.dev_reset                    = ice_dev_reset,
 	.dev_set_link_up              = ice_dev_set_link_up,
 	.dev_set_link_down            = ice_dev_set_link_down,
+	.dev_led_on                   = ice_dev_led_on,
+	.dev_led_off                  = ice_dev_led_off,
 	.rx_queue_start               = ice_rx_queue_start,
 	.rx_queue_stop                = ice_rx_queue_stop,
 	.tx_queue_start               = ice_tx_queue_start,
@@ -4074,6 +4078,24 @@ ice_dev_set_link_down(struct rte_eth_dev *dev)
 	return ice_force_phys_link_state(hw, false);
 }
 
+static int
+ice_dev_led_on(struct rte_eth_dev *dev)
+{
+	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	int status = ice_aq_set_port_id_led(hw->port_info, false, NULL);
+
+	return status == ICE_SUCCESS ? 0 : -ENOTSUP;
+}
+
+static int
+ice_dev_led_off(struct rte_eth_dev *dev)
+{
+	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	int status = ice_aq_set_port_id_led(hw->port_info, true, NULL);
+
+	return status == ICE_SUCCESS ? 0 : -ENOTSUP;
+}
+
 static int
 ice_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused)
 {
-- 
2.37.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] net/ice: add basic flow ctrl support for enable/disable/get
  2022-09-01 21:13 [PATCH 1/2] net/ice: add nic blinking support Markus Theil
@ 2022-09-01 21:13 ` Markus Theil
  2022-09-04  2:06   ` Zhang, Qi Z
  2022-09-04  2:10 ` [PATCH 1/2] net/ice: add nic blinking support Zhang, Qi Z
  1 sibling, 1 reply; 6+ messages in thread
From: Markus Theil @ 2022-09-01 21:13 UTC (permalink / raw)
  To: dev; +Cc: Qiming Yang, Qi Zhang, Markus Theil

From: Markus Theil <markus.theil@secunet.com>

Signed-off-by: Markus Theil <markus.theil@secunet.com>
---
 drivers/net/ice/ice_ethdev.c | 108 +++++++++++++++++++++++++++++++++++
 1 file changed, 108 insertions(+)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index f5820d6ccb..ad93ec8155 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -92,6 +92,10 @@ static int ice_dev_set_link_up(struct rte_eth_dev *dev);
 static int ice_dev_set_link_down(struct rte_eth_dev *dev);
 static int ice_dev_led_on(struct rte_eth_dev *dev);
 static int ice_dev_led_off(struct rte_eth_dev *dev);
+static int ice_dev_flow_ctrl_get(struct rte_eth_dev *dev,
+				 struct rte_eth_fc_conf *fc_conf);
+static int ice_dev_flow_ctrl_set(struct rte_eth_dev *dev,
+				 struct rte_eth_fc_conf *fc_conf);
 
 static int ice_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
 static int ice_vlan_offload_set(struct rte_eth_dev *dev, int mask);
@@ -219,6 +223,8 @@ static const struct eth_dev_ops ice_eth_dev_ops = {
 	.dev_set_link_down            = ice_dev_set_link_down,
 	.dev_led_on                   = ice_dev_led_on,
 	.dev_led_off                  = ice_dev_led_off,
+	.flow_ctrl_get                = ice_dev_flow_ctrl_get,
+	.flow_ctrl_set                = ice_dev_flow_ctrl_set,
 	.rx_queue_start               = ice_rx_queue_start,
 	.rx_queue_stop                = ice_rx_queue_stop,
 	.tx_queue_start               = ice_tx_queue_start,
@@ -4096,6 +4102,108 @@ ice_dev_led_off(struct rte_eth_dev *dev)
 	return status == ICE_SUCCESS ? 0 : -ENOTSUP;
 }
 
+static int
+ice_dev_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
+{
+	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct ice_aqc_get_phy_caps_data *pcaps;
+	int tx_pause, rx_pause;
+	int status;
+
+	pcaps = (struct ice_aqc_get_phy_caps_data *)
+		ice_malloc(hw, sizeof(*pcaps));
+	if (!pcaps)
+		return -ENOMEM;
+
+	status = ice_aq_get_phy_caps(hw->port_info, false,
+			ICE_AQC_REPORT_ACTIVE_CFG, pcaps, NULL);
+	if(status)
+		goto out;
+
+	fc_conf->autoneg = ice_is_phy_caps_an_enabled(pcaps);
+	tx_pause = !!(pcaps->caps & ICE_AQC_PHY_EN_TX_LINK_PAUSE);
+	rx_pause = !!(pcaps->caps & ICE_AQC_PHY_EN_RX_LINK_PAUSE);
+
+	if (rx_pause && tx_pause)
+		fc_conf->mode = RTE_ETH_FC_FULL;
+	else if (rx_pause)
+		fc_conf->mode = RTE_ETH_FC_RX_PAUSE;
+	else if (tx_pause)
+		fc_conf->mode = RTE_ETH_FC_TX_PAUSE;
+	else
+		fc_conf->mode = RTE_ETH_FC_NONE;
+
+out:
+	ice_free(hw, pcaps);
+	return status;
+}
+
+static int
+ice_dev_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
+{
+	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct ice_port_info *pi = hw->port_info;
+	struct ice_link_status *ls = &pi->phy.link_info;
+	bool link_up = !!(ls->link_info & ICE_AQ_LINK_UP);
+	struct ice_aqc_get_phy_caps_data *pcaps;
+	u8 aq_failures;
+	int status;
+
+	pcaps = (struct ice_aqc_get_phy_caps_data *)
+		ice_malloc(hw, sizeof(*pcaps));
+	if (!pcaps)
+		return -ENOMEM;
+
+	status = ice_aq_get_phy_caps(hw->port_info, false,
+			ICE_AQC_REPORT_ACTIVE_CFG, pcaps, NULL);
+	if(status) {
+		status = -EIO;
+		goto out;
+	}
+	if(fc_conf->autoneg != ice_is_phy_caps_an_enabled(pcaps)) {
+		status = -ENOTSUP;
+		goto out;
+	}
+
+	switch(fc_conf->mode) {
+		case RTE_ETH_FC_FULL:
+			pi->fc.req_mode = ICE_FC_FULL;
+			break;
+		case RTE_ETH_FC_RX_PAUSE:
+			pi->fc.req_mode = ICE_FC_RX_PAUSE;
+			break;
+		case RTE_ETH_FC_TX_PAUSE:
+			pi->fc.req_mode = ICE_FC_TX_PAUSE;
+			break;
+		case RTE_ETH_FC_NONE:
+			pi->fc.req_mode = ICE_FC_NONE;
+			break;
+	}
+
+	status = ice_set_fc(pi, &aq_failures, link_up);
+
+	if (aq_failures & ICE_SET_FC_AQ_FAIL_GET) {
+		PMD_DRV_LOG(ERR,
+			    "port %d fc set failed on get, err %d aq status %i\n",
+			    dev->data->port_id, status, hw->adminq.sq_last_status);
+		status = -EIO;
+	} else if (aq_failures & ICE_SET_FC_AQ_FAIL_SET) {
+		PMD_DRV_LOG(ERR,
+			    "port %d fc set failed on set, err %d aq status %i\n",
+			    dev->data->port_id, status, hw->adminq.sq_last_status);
+		status = -EIO;
+	} else if (aq_failures & ICE_SET_FC_AQ_FAIL_UPDATE) {
+		PMD_DRV_LOG(ERR,
+			    "port %d fc set failed on update, err %d aq status %i\n",
+			    dev->data->port_id, status, hw->adminq.sq_last_status);
+		status = -EIO;
+	}
+
+out:
+	ice_free(hw, pcaps);
+	return status;
+}
+
 static int
 ice_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused)
 {
-- 
2.37.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 2/2] net/ice: add basic flow ctrl support for enable/disable/get
  2022-09-01 21:13 ` [PATCH 2/2] net/ice: add basic flow ctrl support for enable/disable/get Markus Theil
@ 2022-09-04  2:06   ` Zhang, Qi Z
  2022-09-14 15:49     ` Markus Theil
  0 siblings, 1 reply; 6+ messages in thread
From: Zhang, Qi Z @ 2022-09-04  2:06 UTC (permalink / raw)
  To: Markus Theil, dev; +Cc: Yang, Qiming, Theil, Markus



> -----Original Message-----
> From: Markus Theil <markus.theil@tu-ilmenau.de>
> Sent: Friday, September 2, 2022 5:14 AM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Theil, Markus <markus.theil@secunet.com>
> Subject: [PATCH 2/2] net/ice: add basic flow ctrl support for enable/disable/get
> 
> From: Markus Theil <markus.theil@secunet.com>

Thanks for contribute this.

As this expose new features of Intel E810 NIC and this is not in Intel's plan on DPDK 22.11. 

To help maintainer to decide if we should accept the patches in 22.11. Could you help to share more background? especially the test cases you performed as well as the test result.

Thanks
Qi

> 
> Signed-off-by: Markus Theil <markus.theil@secunet.com>
> ---
>  drivers/net/ice/ice_ethdev.c | 108 +++++++++++++++++++++++++++++++++++
>  1 file changed, 108 insertions(+)
> 
> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index
> f5820d6ccb..ad93ec8155 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -92,6 +92,10 @@ static int ice_dev_set_link_up(struct rte_eth_dev *dev);
> static int ice_dev_set_link_down(struct rte_eth_dev *dev);  static int
> ice_dev_led_on(struct rte_eth_dev *dev);  static int ice_dev_led_off(struct
> rte_eth_dev *dev);
> +static int ice_dev_flow_ctrl_get(struct rte_eth_dev *dev,
> +				 struct rte_eth_fc_conf *fc_conf);
> +static int ice_dev_flow_ctrl_set(struct rte_eth_dev *dev,
> +				 struct rte_eth_fc_conf *fc_conf);
> 
>  static int ice_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);  static int
> ice_vlan_offload_set(struct rte_eth_dev *dev, int mask); @@ -219,6 +223,8
> @@ static const struct eth_dev_ops ice_eth_dev_ops = {
>  	.dev_set_link_down            = ice_dev_set_link_down,
>  	.dev_led_on                   = ice_dev_led_on,
>  	.dev_led_off                  = ice_dev_led_off,
> +	.flow_ctrl_get                = ice_dev_flow_ctrl_get,
> +	.flow_ctrl_set                = ice_dev_flow_ctrl_set,
>  	.rx_queue_start               = ice_rx_queue_start,
>  	.rx_queue_stop                = ice_rx_queue_stop,
>  	.tx_queue_start               = ice_tx_queue_start,
> @@ -4096,6 +4102,108 @@ ice_dev_led_off(struct rte_eth_dev *dev)
>  	return status == ICE_SUCCESS ? 0 : -ENOTSUP;  }
> 
> +static int
> +ice_dev_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf
> +*fc_conf) {
> +	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> +	struct ice_aqc_get_phy_caps_data *pcaps;
> +	int tx_pause, rx_pause;
> +	int status;
> +
> +	pcaps = (struct ice_aqc_get_phy_caps_data *)
> +		ice_malloc(hw, sizeof(*pcaps));
> +	if (!pcaps)
> +		return -ENOMEM;
> +
> +	status = ice_aq_get_phy_caps(hw->port_info, false,
> +			ICE_AQC_REPORT_ACTIVE_CFG, pcaps, NULL);
> +	if(status)
> +		goto out;
> +
> +	fc_conf->autoneg = ice_is_phy_caps_an_enabled(pcaps);
> +	tx_pause = !!(pcaps->caps & ICE_AQC_PHY_EN_TX_LINK_PAUSE);
> +	rx_pause = !!(pcaps->caps & ICE_AQC_PHY_EN_RX_LINK_PAUSE);
> +
> +	if (rx_pause && tx_pause)
> +		fc_conf->mode = RTE_ETH_FC_FULL;
> +	else if (rx_pause)
> +		fc_conf->mode = RTE_ETH_FC_RX_PAUSE;
> +	else if (tx_pause)
> +		fc_conf->mode = RTE_ETH_FC_TX_PAUSE;
> +	else
> +		fc_conf->mode = RTE_ETH_FC_NONE;
> +
> +out:
> +	ice_free(hw, pcaps);
> +	return status;
> +}
> +
> +static int
> +ice_dev_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf
> +*fc_conf) {
> +	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> +	struct ice_port_info *pi = hw->port_info;
> +	struct ice_link_status *ls = &pi->phy.link_info;
> +	bool link_up = !!(ls->link_info & ICE_AQ_LINK_UP);
> +	struct ice_aqc_get_phy_caps_data *pcaps;
> +	u8 aq_failures;
> +	int status;
> +
> +	pcaps = (struct ice_aqc_get_phy_caps_data *)
> +		ice_malloc(hw, sizeof(*pcaps));
> +	if (!pcaps)
> +		return -ENOMEM;
> +
> +	status = ice_aq_get_phy_caps(hw->port_info, false,
> +			ICE_AQC_REPORT_ACTIVE_CFG, pcaps, NULL);
> +	if(status) {
> +		status = -EIO;
> +		goto out;
> +	}
> +	if(fc_conf->autoneg != ice_is_phy_caps_an_enabled(pcaps)) {
> +		status = -ENOTSUP;
> +		goto out;
> +	}
> +
> +	switch(fc_conf->mode) {
> +		case RTE_ETH_FC_FULL:
> +			pi->fc.req_mode = ICE_FC_FULL;
> +			break;
> +		case RTE_ETH_FC_RX_PAUSE:
> +			pi->fc.req_mode = ICE_FC_RX_PAUSE;
> +			break;
> +		case RTE_ETH_FC_TX_PAUSE:
> +			pi->fc.req_mode = ICE_FC_TX_PAUSE;
> +			break;
> +		case RTE_ETH_FC_NONE:
> +			pi->fc.req_mode = ICE_FC_NONE;
> +			break;
> +	}
> +
> +	status = ice_set_fc(pi, &aq_failures, link_up);
> +
> +	if (aq_failures & ICE_SET_FC_AQ_FAIL_GET) {
> +		PMD_DRV_LOG(ERR,
> +			    "port %d fc set failed on get, err %d aq status %i\n",
> +			    dev->data->port_id, status, hw-
> >adminq.sq_last_status);
> +		status = -EIO;
> +	} else if (aq_failures & ICE_SET_FC_AQ_FAIL_SET) {
> +		PMD_DRV_LOG(ERR,
> +			    "port %d fc set failed on set, err %d aq status %i\n",
> +			    dev->data->port_id, status, hw-
> >adminq.sq_last_status);
> +		status = -EIO;
> +	} else if (aq_failures & ICE_SET_FC_AQ_FAIL_UPDATE) {
> +		PMD_DRV_LOG(ERR,
> +			    "port %d fc set failed on update, err %d aq
> status %i\n",
> +			    dev->data->port_id, status, hw-
> >adminq.sq_last_status);
> +		status = -EIO;
> +	}
> +
> +out:
> +	ice_free(hw, pcaps);
> +	return status;
> +}
> +
>  static int
>  ice_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused)  {
> --
> 2.37.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH 1/2] net/ice: add nic blinking support
  2022-09-01 21:13 [PATCH 1/2] net/ice: add nic blinking support Markus Theil
  2022-09-01 21:13 ` [PATCH 2/2] net/ice: add basic flow ctrl support for enable/disable/get Markus Theil
@ 2022-09-04  2:10 ` Zhang, Qi Z
  2022-09-14 15:50   ` Markus Theil
  1 sibling, 1 reply; 6+ messages in thread
From: Zhang, Qi Z @ 2022-09-04  2:10 UTC (permalink / raw)
  To: Markus Theil, dev; +Cc: Yang, Qiming, Theil, Markus



> -----Original Message-----
> From: Markus Theil <markus.theil@tu-ilmenau.de>
> Sent: Friday, September 2, 2022 5:14 AM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Theil, Markus <markus.theil@secunet.com>
> Subject: [PATCH 1/2] net/ice: add nic blinking support
> 
> From: Markus Theil <markus.theil@secunet.com>


Please also updated the doc/guides/nics/features/ice.ini

To add "LED = Y" 

Same for PATCH 2/2 with "Flow Control = Y"


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] net/ice: add basic flow ctrl support for enable/disable/get
  2022-09-04  2:06   ` Zhang, Qi Z
@ 2022-09-14 15:49     ` Markus Theil
  0 siblings, 0 replies; 6+ messages in thread
From: Markus Theil @ 2022-09-14 15:49 UTC (permalink / raw)
  To: Zhang, Qi Z, dev; +Cc: Yang, Qiming, Theil, Markus

On 9/4/22 04:06, Zhang, Qi Z wrote:
>
>> -----Original Message-----
>> From: Markus Theil <markus.theil@tu-ilmenau.de>
>> Sent: Friday, September 2, 2022 5:14 AM
>> To: dev@dpdk.org
>> Cc: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
>> <qi.z.zhang@intel.com>; Theil, Markus <markus.theil@secunet.com>
>> Subject: [PATCH 2/2] net/ice: add basic flow ctrl support for enable/disable/get
>>
>> From: Markus Theil <markus.theil@secunet.com>
> Thanks for contribute this.
>
> As this expose new features of Intel E810 NIC and this is not in Intel's plan on DPDK 22.11.
>
> To help maintainer to decide if we should accept the patches in 22.11. Could you help to share more background? especially the test cases you performed as well as the test result.

I only tested, if disabling fc works. After testing this against the 
kernel driver on a multi-port E810 card, I drop the flow control patch 
for now. On my machine with firmware 4.00 I was not able to re-bind the 
port to the kernel ice driver after enabling flow control in DPDK. Even 
the kernel-driven port was not usable after a simple reboot, when I 
enabled flow control. Therefore it seems, like some firmware/NVM work 
has to be also done for enabling this feature.

BR
Markus

> Thanks
> Qi
>
>> Signed-off-by: Markus Theil <markus.theil@secunet.com>
>> ---
>>   drivers/net/ice/ice_ethdev.c | 108 +++++++++++++++++++++++++++++++++++
>>   1 file changed, 108 insertions(+)
>>
>> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index
>> f5820d6ccb..ad93ec8155 100644
>> --- a/drivers/net/ice/ice_ethdev.c
>> +++ b/drivers/net/ice/ice_ethdev.c
>> @@ -92,6 +92,10 @@ static int ice_dev_set_link_up(struct rte_eth_dev *dev);
>> static int ice_dev_set_link_down(struct rte_eth_dev *dev);  static int
>> ice_dev_led_on(struct rte_eth_dev *dev);  static int ice_dev_led_off(struct
>> rte_eth_dev *dev);
>> +static int ice_dev_flow_ctrl_get(struct rte_eth_dev *dev,
>> +				 struct rte_eth_fc_conf *fc_conf);
>> +static int ice_dev_flow_ctrl_set(struct rte_eth_dev *dev,
>> +				 struct rte_eth_fc_conf *fc_conf);
>>
>>   static int ice_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);  static int
>> ice_vlan_offload_set(struct rte_eth_dev *dev, int mask); @@ -219,6 +223,8
>> @@ static const struct eth_dev_ops ice_eth_dev_ops = {
>>   	.dev_set_link_down            = ice_dev_set_link_down,
>>   	.dev_led_on                   = ice_dev_led_on,
>>   	.dev_led_off                  = ice_dev_led_off,
>> +	.flow_ctrl_get                = ice_dev_flow_ctrl_get,
>> +	.flow_ctrl_set                = ice_dev_flow_ctrl_set,
>>   	.rx_queue_start               = ice_rx_queue_start,
>>   	.rx_queue_stop                = ice_rx_queue_stop,
>>   	.tx_queue_start               = ice_tx_queue_start,
>> @@ -4096,6 +4102,108 @@ ice_dev_led_off(struct rte_eth_dev *dev)
>>   	return status == ICE_SUCCESS ? 0 : -ENOTSUP;  }
>>
>> +static int
>> +ice_dev_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf
>> +*fc_conf) {
>> +	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data-
>>> dev_private);
>> +	struct ice_aqc_get_phy_caps_data *pcaps;
>> +	int tx_pause, rx_pause;
>> +	int status;
>> +
>> +	pcaps = (struct ice_aqc_get_phy_caps_data *)
>> +		ice_malloc(hw, sizeof(*pcaps));
>> +	if (!pcaps)
>> +		return -ENOMEM;
>> +
>> +	status = ice_aq_get_phy_caps(hw->port_info, false,
>> +			ICE_AQC_REPORT_ACTIVE_CFG, pcaps, NULL);
>> +	if(status)
>> +		goto out;
>> +
>> +	fc_conf->autoneg = ice_is_phy_caps_an_enabled(pcaps);
>> +	tx_pause = !!(pcaps->caps & ICE_AQC_PHY_EN_TX_LINK_PAUSE);
>> +	rx_pause = !!(pcaps->caps & ICE_AQC_PHY_EN_RX_LINK_PAUSE);
>> +
>> +	if (rx_pause && tx_pause)
>> +		fc_conf->mode = RTE_ETH_FC_FULL;
>> +	else if (rx_pause)
>> +		fc_conf->mode = RTE_ETH_FC_RX_PAUSE;
>> +	else if (tx_pause)
>> +		fc_conf->mode = RTE_ETH_FC_TX_PAUSE;
>> +	else
>> +		fc_conf->mode = RTE_ETH_FC_NONE;
>> +
>> +out:
>> +	ice_free(hw, pcaps);
>> +	return status;
>> +}
>> +
>> +static int
>> +ice_dev_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf
>> +*fc_conf) {
>> +	struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data-
>>> dev_private);
>> +	struct ice_port_info *pi = hw->port_info;
>> +	struct ice_link_status *ls = &pi->phy.link_info;
>> +	bool link_up = !!(ls->link_info & ICE_AQ_LINK_UP);
>> +	struct ice_aqc_get_phy_caps_data *pcaps;
>> +	u8 aq_failures;
>> +	int status;
>> +
>> +	pcaps = (struct ice_aqc_get_phy_caps_data *)
>> +		ice_malloc(hw, sizeof(*pcaps));
>> +	if (!pcaps)
>> +		return -ENOMEM;
>> +
>> +	status = ice_aq_get_phy_caps(hw->port_info, false,
>> +			ICE_AQC_REPORT_ACTIVE_CFG, pcaps, NULL);
>> +	if(status) {
>> +		status = -EIO;
>> +		goto out;
>> +	}
>> +	if(fc_conf->autoneg != ice_is_phy_caps_an_enabled(pcaps)) {
>> +		status = -ENOTSUP;
>> +		goto out;
>> +	}
>> +
>> +	switch(fc_conf->mode) {
>> +		case RTE_ETH_FC_FULL:
>> +			pi->fc.req_mode = ICE_FC_FULL;
>> +			break;
>> +		case RTE_ETH_FC_RX_PAUSE:
>> +			pi->fc.req_mode = ICE_FC_RX_PAUSE;
>> +			break;
>> +		case RTE_ETH_FC_TX_PAUSE:
>> +			pi->fc.req_mode = ICE_FC_TX_PAUSE;
>> +			break;
>> +		case RTE_ETH_FC_NONE:
>> +			pi->fc.req_mode = ICE_FC_NONE;
>> +			break;
>> +	}
>> +
>> +	status = ice_set_fc(pi, &aq_failures, link_up);
>> +
>> +	if (aq_failures & ICE_SET_FC_AQ_FAIL_GET) {
>> +		PMD_DRV_LOG(ERR,
>> +			    "port %d fc set failed on get, err %d aq status %i\n",
>> +			    dev->data->port_id, status, hw-
>>> adminq.sq_last_status);
>> +		status = -EIO;
>> +	} else if (aq_failures & ICE_SET_FC_AQ_FAIL_SET) {
>> +		PMD_DRV_LOG(ERR,
>> +			    "port %d fc set failed on set, err %d aq status %i\n",
>> +			    dev->data->port_id, status, hw-
>>> adminq.sq_last_status);
>> +		status = -EIO;
>> +	} else if (aq_failures & ICE_SET_FC_AQ_FAIL_UPDATE) {
>> +		PMD_DRV_LOG(ERR,
>> +			    "port %d fc set failed on update, err %d aq
>> status %i\n",
>> +			    dev->data->port_id, status, hw-
>>> adminq.sq_last_status);
>> +		status = -EIO;
>> +	}
>> +
>> +out:
>> +	ice_free(hw, pcaps);
>> +	return status;
>> +}
>> +
>>   static int
>>   ice_mtu_set(struct rte_eth_dev *dev, uint16_t mtu __rte_unused)  {
>> --
>> 2.37.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] net/ice: add nic blinking support
  2022-09-04  2:10 ` [PATCH 1/2] net/ice: add nic blinking support Zhang, Qi Z
@ 2022-09-14 15:50   ` Markus Theil
  0 siblings, 0 replies; 6+ messages in thread
From: Markus Theil @ 2022-09-14 15:50 UTC (permalink / raw)
  To: Zhang, Qi Z, dev; +Cc: Yang, Qiming, Theil, Markus

Thanks for the hint/advice. I will resend the led patch and drop the fc 
patch for now (see another reply).

On 9/4/22 04:10, Zhang, Qi Z wrote:
>
>> -----Original Message-----
>> From: Markus Theil <markus.theil@tu-ilmenau.de>
>> Sent: Friday, September 2, 2022 5:14 AM
>> To: dev@dpdk.org
>> Cc: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
>> <qi.z.zhang@intel.com>; Theil, Markus <markus.theil@secunet.com>
>> Subject: [PATCH 1/2] net/ice: add nic blinking support
>>
>> From: Markus Theil <markus.theil@secunet.com>
>
> Please also updated the doc/guides/nics/features/ice.ini
>
> To add "LED = Y"
>
> Same for PATCH 2/2 with "Flow Control = Y"
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-14 15:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01 21:13 [PATCH 1/2] net/ice: add nic blinking support Markus Theil
2022-09-01 21:13 ` [PATCH 2/2] net/ice: add basic flow ctrl support for enable/disable/get Markus Theil
2022-09-04  2:06   ` Zhang, Qi Z
2022-09-14 15:49     ` Markus Theil
2022-09-04  2:10 ` [PATCH 1/2] net/ice: add nic blinking support Zhang, Qi Z
2022-09-14 15:50   ` Markus Theil

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).