[1/2] net/ice: add nic blinking support

Message ID 20220901211350.87631-1-markus.theil@tu-ilmenau.de (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series [1/2] net/ice: add nic blinking support |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Markus Theil Sept. 1, 2022, 9:13 p.m. UTC
  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(+)
  

Comments

Qi Zhang Sept. 4, 2022, 2:10 a.m. UTC | #1
> -----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"
  
Markus Theil Sept. 14, 2022, 3:50 p.m. UTC | #2
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"
>
  

Patch

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