From patchwork Thu Sep 1 21:13:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Theil X-Patchwork-Id: 115757 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1353BA034C; Thu, 1 Sep 2022 23:14:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B065440693; Thu, 1 Sep 2022 23:14:18 +0200 (CEST) Received: from smail.rz.tu-ilmenau.de (smail.rz.tu-ilmenau.de [141.24.186.67]) by mails.dpdk.org (Postfix) with ESMTP id 150BB40684 for ; Thu, 1 Sep 2022 23:14:17 +0200 (CEST) Received: from localhost.localdomain (pd9559a85.dip0.t-ipconnect.de [217.85.154.133]) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPA id 7524858008C; Thu, 1 Sep 2022 23:14:16 +0200 (CEST) From: Markus Theil To: dev@dpdk.org Cc: Qiming Yang , Qi Zhang , Markus Theil Subject: [PATCH 1/2] net/ice: add nic blinking support Date: Thu, 1 Sep 2022 23:13:49 +0200 Message-Id: <20220901211350.87631-1-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Markus Theil Signed-off-by: Markus Theil --- 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) {