From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f194.google.com (mail-qt0-f194.google.com [209.85.216.194]) by dpdk.org (Postfix) with ESMTP id 9DAD12BAE for ; Mon, 24 Apr 2017 12:51:14 +0200 (CEST) Received: by mail-qt0-f194.google.com with SMTP id y33so19709360qta.1 for ; Mon, 24 Apr 2017 03:51:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9YTJw6EyRK+oIA5+LoHv7TkJ1O0RRLvEsEwfCZuKK24=; b=H+nItj8WryYRjph3vXHYwWrOcdmUmGDngcqaIVeqLPB9JC960iF9GarJ7Wb7UygjcT +9M/nCM8VFN2uiwFljQuFU26HPliLQadywz82Ayj2nI4iWnIu6VPoheQCW7TUsAxjqLc Xc0Hgnp96IY6xD8IWKgz8+md7UkSiqXleLR8lfKH4j760YXJKVh1+Iqn6H/bScH3aMwn Hch/MblTqoLMQ/rNyQg2BYoUkv92newY0+Ekt39Y0NqhuGi9wsgkC5TqfMeQiw5REQB5 tHOKNJuZMol+fMs3QRqwf2mjs7IsHqLNmna75mDKHYBjS19YYzghvUL6c1G/gs2h4wnZ 6haw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9YTJw6EyRK+oIA5+LoHv7TkJ1O0RRLvEsEwfCZuKK24=; b=RojF0BdVayvwDxyw/D/ysRP9gDO6M1r4HhM4kUDP82XtRfFwjdjL1Rkbp26jaz2WTw RlikXdgjfK9VAsbCP6V7dpKI8EJ+oCUSfJFEGBlHzUxQPas9vt3iLyVzUooVZ/9y+8Ku jtTzOIFW/U/xA2/h9FuSbCDaRleWEFWBmUhqwa5ooIZWD97QUMOoxXcQuSEm7nffXoHG MkCxM1Ehvj1R78nviCu7tircFM+yxARzaaaZ3eSmapz1wCjZTTn+nJx1r0HeUM/fw/Lu KmyGnN6+2cb3x6iSK4pOfMuku4rsUeyHvdKBuWkHTO1MFWTQs9M7UqHSramj+m5KZg49 5tzA== X-Gm-Message-State: AN3rC/7RC+v53T+9Wc6sOzQXq5xdgZDRUiypRxDLJFvTiGWpJbxzBHVW S4LiG3TVPjPk6kCnhu2Oc/Qtf0YDKg== X-Received: by 10.200.0.215 with SMTP id d23mr8478685qtg.198.1493031073872; Mon, 24 Apr 2017 03:51:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.177.84 with HTTP; Mon, 24 Apr 2017 03:51:13 -0700 (PDT) In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC09093B59C18B@shsmsx102.ccr.corp.intel.com> References: <1492685271-7583-1-git-send-email-srinidpdk@gmail.com> <6A0DE07E22DDAD4C9103DF62FEBC09093B59B57F@shsmsx102.ccr.corp.intel.com> <6A0DE07E22DDAD4C9103DF62FEBC09093B59C18B@shsmsx102.ccr.corp.intel.com> From: Srinivasan J Date: Mon, 24 Apr 2017 16:21:13 +0530 Message-ID: To: "Lu, Wenzhuo" Cc: "Ananyev, Konstantin" , "dev@dpdk.org" Content-Type: text/plain; charset=UTF-8 Subject: Re: [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: Mon, 24 Apr 2017 10:51:14 -0000 Hi Wenzhuo, Port hot-plug would require the DPDK app to dynamically mange ports and the kernel to support PCI hot-plugging. When multiple ports are detached/attached (SFP's plugged in/out), would the DPDK port id's remain same? If not, app needs to handle port id change for a give NIC. While port hot-plug can be used to dynamically handle SFP hot-plugging, I feel it's not the optimal solution. Regards, Srini On Mon, Apr 24, 2017 at 12:45 PM, Lu, Wenzhuo wrote: > Hi Srini, > > >> -----Original Message----- >> From: Srinivasan J [mailto:srinidpdk@gmail.com] >> Sent: Monday, April 24, 2017 2:24 PM >> To: Lu, Wenzhuo >> Cc: Ananyev, Konstantin; dev@dpdk.org >> Subject: Re: [PATCH] net/ixgbe: support detection of hot swapped SFP/SFP+ >> >> Hi Wenzhuo, >> I understand your concern. I had to do this change to support hot >> swap of SFP/SFP+ modules without restarting the DPDK app. If we have some >> other mechanism in pipeline to support hot swap of SFP/SFP+ modules, then >> my changes can be ignored. I just wanted to share the changes which worked >> for me back to the community. > I think restarting the APP is not necessary. You can uninit the port, then re-init the port. > Please reference http://dpdk.org/doc/guides/prog_guide/port_hotplug_framework.html to see if it can help. > >> >> Regards, >> Srini >> >> On Fri, Apr 21, 2017 at 10:22 AM, Lu, Wenzhuo >> wrote: >> > Hi Srini, >> > >> >> -----Original Message----- >> >> From: Srini J [mailto:srinidpdk@gmail.com] >> >> Sent: Thursday, April 20, 2017 6:48 PM >> >> To: Lu, Wenzhuo; Ananyev, Konstantin >> >> Cc: dev@dpdk.org; Srinivasan Jayarajan >> >> Subject: [PATCH] net/ixgbe: support detection of hot swapped SFP/SFP+ >> >> >> >> 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; >> >> + } >> >> + >> > I have the concern if it's a good idea to move the functions from dev_init >> to dev_start. Especially this function named init. >> > Anyway, let's listen to others opinion. >> > >> > >> >> hw->mac.ops.start_hw(hw); >> >> hw->mac.get_link_status = true; >> >> >> >> -- >> >> 1.8.1.4 >> >