From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Mq/GAOflRftxZ6TKGzo84eB8vY47VUxUTPkdxfV5130=; b=Sd5XmDMoRjK/aKqj7pugcvRbEuYEfH5o4kSv6yKERLM6p6EhYLxzxyrOWNluT96lrv bw5e5zj9S+/577nygjFydPeSmu4qQjrdkkHFiOgB1G2l2kCbs3oY6Iv5IT8nLH0WcJsa FXSc8d+ypwgj4bVIcg4rZZFpppwYsok4jpF8Vnv9dzuCEyymn3BlcsBeNc6G2r8/TPA1 7MB10Igds8VFv1Oo/P2QEmeSovgomxwsX+D2My6Y5MEcJwd2DNyUoovqxoxpUT4iA3bE CCh8hBXbziV7344MR8a8zpg/QUERpQT1EWP1/jNNIhI1ZfscVaWqjvAfBRofpriVgc/m 1S4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Mq/GAOflRftxZ6TKGzo84eB8vY47VUxUTPkdxfV5130=; b=PZc2nmIMqYRGAYAwDYtA48Lh6Ip68ChwXjX7pi76DvTv1AUjbizjhQRIt+2tTuxnoT ncK9KtLALg8l3HjXz1AiBx4vvAx3AxVi6DBGoy8m+9zncj4kYhLav1Im/2MDEV3B6JD9 sTaqkv30mA7mfmt0PIyHAvjMLCJ43nCsYjeXI5XWt/3wJVn+ar8Rprj527oGqs1DzLZE B93Cz8b2x/BPpBXSoVeN3pip2wlc3KaNY1irRhvXD1Xssv4jQcp8SAq4LhgvbFd8OnI1 mEjht0FXMGifEA7yw/nxFT9fVpDCRh+ezt0gjFVoLff0TSFO3zsNC3o7zvIyy65NkUaT zV7A== X-Gm-Message-State: AN3rC/7M94jNpYK9yqnodNgxAyoaE2sk94JXI+fbr6GWgwlHQeayA+r6 deJSktRoIu6IvQ== X-Received: by 10.84.193.129 with SMTP id f1mr9627425pld.97.1492685279155; Thu, 20 Apr 2017 03:47:59 -0700 (PDT) Received: from localhost.arubanetworks.com ([220.227.73.66]) by smtp.gmail.com with ESMTPSA id n67sm9792445pfk.44.2017.04.20.03.47.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Apr 2017 03:47:58 -0700 (PDT) From: Srini J To: Wenzhuo Lu , Konstantin Ananyev Cc: dev@dpdk.org, Srinivasan Jayarajan Date: Thu, 20 Apr 2017 16:17:51 +0530 Message-Id: <1492685271-7583-1-git-send-email-srinidpdk@gmail.com> X-Mailer: git-send-email 1.8.1.4 Subject: [dpdk-dev] [PATCH] net/ixgbe: support detection of hot swapped SFP/SFP+ X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Apr 2017 10:48:00 -0000 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