From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id 0ED2A2E8F for ; Tue, 18 Sep 2018 10:57:02 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id n11-v6so1729357wmc.2 for ; Tue, 18 Sep 2018 01:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=xutWMMK9NpnaIz0xceofLTRHkCqVm6yuPvYkHo2Yjzg=; b=RkMta7anIfZyQGrhuJ2CS22bUEXokUqH47nl7odpBoM+FyVVErLyslUKR6ljJ4ULTv 7TQnMm9e0nCDZU0MaCrGKV5iEaoW9aYX8LxNeQF5sjzOfXRocyHASo63n9RwMz3P/Avh TZg22CioazP/tdp4yrXiYnfPGh8ZSQViU2gqIF+ZwMCQ0t55Ad+Km+1wLnvY3UKlVd9Y Qvh11kwG3J5PyqfpLydYEdBm6QsNvEMNgzAyxz7hiLLJBFCeMp1RmHLQ+u9rgRI/+/kI R7PCOY5mQwNoGeIj0jE0yEYjSS/7VzBvm7A49vVNUaapLugdIedflWFt5S8tTxZtp5QM qYJA== 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=xutWMMK9NpnaIz0xceofLTRHkCqVm6yuPvYkHo2Yjzg=; b=E4yVhQSCXIav2igxrPu8Z1nvhMA8Ljol4v2KtfKtYHpWsRMKDAQlXPuxomkfZyw+d0 5mvZpowWJVJZEJlEJ/3LnUHPCiNqdaSZC/AC/desAjwTfYiOts1wK3hZnVWWqLnwr0mm CfeEtyblN21Wmd0Dxzcs+HbdbuU8lyalAYWhVbTbiF64fnP4W8BuJGmRfqIL+Yy90mL5 D4Kk2eweXelnFqC+j3gwJJSQsH6Y4m7xWzymWaYC6cgx120jekUDLYb/on3SwMe25s5a WhcgiQkvOA3QuE1CdmhLJNTwCzPatMSCUA8gkO3ioWq1Muz70zFyRIVf8xaOjHjrVVac melA== X-Gm-Message-State: APzg51DRnD2xWf4fIBmOtrD4R5AhdjYjBG0BKiyffrJr7c7dGKw5UxjS nx5Pc5jReLlJ1coDBZdzBoGagLk4psk= X-Google-Smtp-Source: ANB0VdavICXnu0ubE7ym1W+o8S+Mz1wIej7l2nnQCI/DP2A1T0a55oJfhs1H6jyP4DFA7SaVGiEZgQ== X-Received: by 2002:a1c:398b:: with SMTP id g133-v6mr15864026wma.5.1537261021141; Tue, 18 Sep 2018 01:57:01 -0700 (PDT) Received: from bidouze.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id s13-v6sm15426260wrq.39.2018.09.18.01.56.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Sep 2018 01:57:00 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Tue, 18 Sep 2018 10:56:38 +0200 Message-Id: <19c88f5ae59f600c05dc09f8cec66cf2315c702c.1537260844.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.18.0 Subject: [dpdk-dev] [PATCH v1] e1000: support dev reset 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: Tue, 18 Sep 2018 08:57:02 -0000 Add support for passive device reset on IGB ports. Signed-off-by: Gaetan Rivet --- drivers/net/e1000/igb_ethdev.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 64dfe6836..4dbf46b28 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -74,6 +74,7 @@ static void eth_igb_stop(struct rte_eth_dev *dev); static int eth_igb_dev_set_link_up(struct rte_eth_dev *dev); static int eth_igb_dev_set_link_down(struct rte_eth_dev *dev); static void eth_igb_close(struct rte_eth_dev *dev); +static int eth_igb_reset(struct rte_eth_dev *dev); static void eth_igb_promiscuous_enable(struct rte_eth_dev *dev); static void eth_igb_promiscuous_disable(struct rte_eth_dev *dev); static void eth_igb_allmulticast_enable(struct rte_eth_dev *dev); @@ -351,6 +352,7 @@ static const struct eth_dev_ops eth_igb_ops = { .dev_set_link_up = eth_igb_dev_set_link_up, .dev_set_link_down = eth_igb_dev_set_link_down, .dev_close = eth_igb_close, + .dev_reset = eth_igb_reset, .promiscuous_enable = eth_igb_promiscuous_enable, .promiscuous_disable = eth_igb_promiscuous_disable, .allmulticast_enable = eth_igb_allmulticast_enable, @@ -1593,6 +1595,33 @@ eth_igb_close(struct rte_eth_dev *dev) rte_eth_linkstatus_set(dev, &link); } +/* + * Reset PF device. + */ +static int +eth_igb_reset(struct rte_eth_dev *dev) +{ + int ret; + + /* When a DPDK PMD PF begin to reset PF port, it should notify all + * its VF to make them align with it. The detailed notification + * mechanism is PMD specific and is currently not implemented. + * To avoid unexpected behavior in VF, currently reset of PF with + * SR-IOV activation is not supported. It might be supported later. + */ + if (dev->data->sriov.active) + return -ENOTSUP; + + ret = eth_igb_dev_uninit(dev); + if (ret) + return ret; + + ret = eth_igb_dev_init(dev); + + return ret; +} + + static int igb_get_rx_buffer_size(struct e1000_hw *hw) { -- 2.18.0