From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 2C73D237 for ; Tue, 21 Nov 2017 14:29:01 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D4A15207FE; Tue, 21 Nov 2017 08:29:00 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:29:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=IsgK00oDmHONRFkFm zXZRlEROWCnyAusOaBTyuKmO7I=; b=H6lFU5ogLgcVVI8rr9j4iIKPwMwqImP/T syrmDUCf2dq1CyPHfq++m4ZvO9YCWkCUMaoMV8ashhFEgQvm6Thgl+uPappCOUzD ww8j/6MzB+PpMfNf52BfHEr+vOOAl6woffrs0l4lSKYKGi3/gu5jxv0wZXvx/vCF JBeUV30gd8uLGqHOfoExvZxCi7YNdHBlEmg6CmE5bkAsGaO3GDdRjKWFVfG+kXeo jFE9dhJq6FBD/K3CovgER+RL+YtRisz+EuBzp40LIcAQ5A9qx0Wa0IApzXz011dU sxVrpjAidt6eXAuOWcjaw+QuQIFftIRacyQyaq97IckErXHR+9JFw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=IsgK00oDmHONRFkFmzXZRlEROWCnyAusOaBTyuKmO7I=; b=M9JoZm6e D1Cuw7fYNLovHF+dBGyNehxeth4jJsNNsDGY5Le9ycNeNVm8MdXpF6Fl99i3xkdy 9nNbKiyFKgCL1lRj3wHQufZyay6TLyB+XBF88NFXfmY70DdVJBQzheiEhNpADh/F Fk6g8EwcfDREyfWJPqf0q6OhwEQuN/XbjF1XJAhPkOLrpgMGt5hGlZEr2HZ23D2M hEHPRz1IQ7KO4QSdWPHOVvnZ4dp/5bU7rBj/9Pu84GQSGMN2n2OAThctODwFRUWd CqrVsV86cFWQ+eUYylKS14FI2ZGfUKJj2Zdyvq0uHOY5xyyfbArUotuAXvIXwqqc g7h0N6WrNTZZKw== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id 6D982248B4; Tue, 21 Nov 2017 08:28:58 -0500 (EST) From: Yuanhan Liu To: Raslan Darawsheh Cc: Gaetan Rivet , dpdk stable Date: Tue, 21 Nov 2017 21:18:10 +0800 Message-Id: <1511270333-31002-148-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/failsafe: fix PCI devices init' has been queued to stable release 17.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 13:29:01 -0000 Hi, FYI, your patch has been queued to stable release 17.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From f3c4dadfb0dd02a54d4734d89bd842094942b07c Mon Sep 17 00:00:00 2001 From: Raslan Darawsheh Date: Fri, 20 Oct 2017 00:15:00 +0300 Subject: [PATCH] net/failsafe: fix PCI devices init [ upstream commit b8f4fa4103eaaf082d42ad85f01b1a08e74b89d6 ] When trying to attach a port as a sub-device, the ethdev port was compared with devargs. In the case of a PCI device, the name in devargs is the PCI address. And since DPDK 17.08, the devargs name of the underlying device was used to match an ethdev port: a1e7c17555e8 ("ethdev: use device name from device structure") But the recent commit 72e3efb149cc has reverted this wrong matching to use the ethdev port name as identifier of the port. It impacts functions like rte_eth_dev_allocated() used in failsafe for matching ports with given devargs. The fix is to search for matching devargs in underlying device of all ethdev ports. If many ports match the same PCI device, only the first one is matched. This limitation was already present in previous implementation of rte_eth_dev_allocated(), and must be adressed later with a better devargs syntax. Fixes: 72e3efb149cc ("ethdev: revert use port name from device structure") Signed-off-by: Raslan Darawsheh Acked-by: Gaetan Rivet --- drivers/net/failsafe/failsafe_eal.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c index aeb87a0..19d26f5 100644 --- a/drivers/net/failsafe/failsafe_eal.c +++ b/drivers/net/failsafe/failsafe_eal.c @@ -41,6 +41,7 @@ fs_bus_init(struct rte_eth_dev *dev) struct sub_device *sdev; struct rte_devargs *da; uint8_t i; + uint16_t j; int ret; FOREACH_SUBDEV(sdev, i, dev) { @@ -57,7 +58,13 @@ fs_bus_init(struct rte_eth_dev *dev) rte_errno ? ")" : ""); continue; } - ETH(sdev) = rte_eth_dev_allocated(da->name); + RTE_ETH_FOREACH_DEV(j) { + if (strcmp(rte_eth_devices[j].device->name, + da->name) == 0) { + ETH(sdev) = &rte_eth_devices[j]; + break; + } + } if (ETH(sdev) == NULL) { ERROR("sub_device %d init went wrong", i); return -ENODEV; -- 2.7.4