From mboxrd@z Thu Jan 1 00:00:00 1970 From: Srini J Subject: [PATCH] net/ixgbe: support detection of hot swapped SFP/SFP+ Date: Thu, 20 Apr 2017 16:17:51 +0530 Message-ID: <1492685271-7583-1-git-send-email-srinidpdk@gmail.com> Cc: dev@dpdk.org, Srinivasan Jayarajan To: Wenzhuo Lu , Konstantin Ananyev Return-path: Received: from mail-oi0-f66.google.com (mail-oi0-f66.google.com [209.85.218.66]) by dpdk.org (Postfix) with ESMTP id 003302904 for ; Thu, 20 Apr 2017 12:47:59 +0200 (CEST) Received: by mail-oi0-f66.google.com with SMTP id y11so5981146oie.1 for ; Thu, 20 Apr 2017 03:47:59 -0700 (PDT) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Srinivasan Jayarajan Adds support to use a different SFP/SFP+ without restarting the DPDK app. rte_eth_dev_stop()/rte_eth_dev_start() will need to be called on the port to detect the SFP/SFP+ change. Signed-off-by: Srinivasan Jayarajan --- drivers/net/ixgbe/ixgbe_ethdev.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index c226e0a..85407a9 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2520,6 +2520,19 @@ static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev) status = ixgbe_pf_reset_hw(hw); if (status != 0) return -1; + + /* Set phy type as unknown so that PHY scan is always done */ + hw->phy.type = ixgbe_phy_unknown; + + /* Identify PHY and related function pointers */ + status = hw->phy.ops.init(hw); + + if (status == IXGBE_ERR_SFP_NOT_SUPPORTED) { + PMD_INIT_LOG(ERR, "Found unsupported SFP in " + "ixgbe_dev_start(): %d", status); + return -1; + } + hw->mac.ops.start_hw(hw); hw->mac.get_link_status = true; -- 1.8.1.4