From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id A0BDA28FD for ; Thu, 8 Nov 2018 19:01:49 +0100 (CET) Received: by mail-wr1-f65.google.com with SMTP id 74-v6so22210431wrb.13 for ; Thu, 08 Nov 2018 10:01:49 -0800 (PST) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=U+iFePXwEGibTE+8mYe/0aHEU9P3BGPoii51QETNark=; b=MC7EFgDPCRRGhlVdWEvL82QX9IjGeRBq4XGDum9tzGQkg0lUmWmy7j5TtCvicaXsVY kR6D6R6LlsXWL8lXKLvhZOP8//E9ZCXC19AcpUKXjbVKHsiBxgKis8h50f1OBoC0VB6u vsZyckHwLY68iWebmHWAw7OFPX8VzK3baNgsNhB9VwcjMJa2aDVZvb0THhWF8d0FYrVP 4HqnqCJqn9dkWtV+e1jzO7N3jMrWaF2sfFCiXtJWzTIdnDz+6LhvcHui+HBPQ8ULSAJR NsT5iuS6G41PkTGEdba21jNqL9f+H3iKJdS44wW4jkbebVUB5VnknCDwSAAy/LC8Zg4a 1qvw== X-Gm-Message-State: AGRZ1gJuWTOMobRDqnR7w237fjw2O0BKTFclxoi2r99ytfwcB5Z5HC6d CjoHQpdueSUjQlIi9IZkcsU= X-Google-Smtp-Source: AJdET5d9gPK8kVLdSbq0MDAM0NKmVMjaq+RAD64VDPNw2JnyLziTrD9x4ZHCatjgnzgYTmi0pL3Qmw== X-Received: by 2002:adf:e0ce:: with SMTP id e14-v6mr5233982wri.199.1541700109319; Thu, 08 Nov 2018 10:01:49 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id x142-v6sm8884194wmd.20.2018.11.08.10.01.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Nov 2018 10:01:48 -0800 (PST) From: Luca Boccassi To: Shijith Thotton Cc: Jianfeng Tan , Ferruh Yigit , Gregory Etelson , dpdk stable Date: Thu, 8 Nov 2018 18:01:10 +0000 Message-Id: <20181108180111.25873-14-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108180111.25873-1-bluca@debian.org> References: <20181029125329.17729-20-bluca@debian.org> <20181108180111.25873-1-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'igb_uio: issue FLR during open and release of device file' has been queued to LTS release 16.11.9 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: Thu, 08 Nov 2018 18:01:49 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.9 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/10/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Luca Boccassi --- >>From 11bb826270d6feb3e810aec77a9252cf65b559a9 Mon Sep 17 00:00:00 2001 From: Shijith Thotton Date: Fri, 7 Jul 2017 16:43:51 +0530 Subject: [PATCH] igb_uio: issue FLR during open and release of device file [ upstream commit b58eedfc7dd57eef6d12e2c654a52c834f36084a ] Set UIO info device file operations open and release. Call pci reset function inside open and release to clear device state at start and end. Copied this behaviour from vfio_pci kernel module code. With this patch, it is not mandatory to issue FLR by PMD's during init and close. Bus master enable and disable are added in open and release respectively to take care of device DMA. Signed-off-by: Shijith Thotton Reviewed-by: Jianfeng Tan Acked-by: Ferruh Yigit Acked-by: Gregory Etelson --- lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c index 9f00f07ab..4be89ef86 100644 --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c @@ -170,6 +170,37 @@ igbuio_pci_irqhandler(int irq, struct uio_info *info) return IRQ_HANDLED; } +/** + * This gets called while opening uio device file. + */ +static int +igbuio_pci_open(struct uio_info *info, struct inode *inode) +{ + struct rte_uio_pci_dev *udev = info->priv; + struct pci_dev *dev = udev->pdev; + + pci_reset_function(dev); + + /* set bus master, which was cleared by the reset function */ + pci_set_master(dev); + + return 0; +} + +static int +igbuio_pci_release(struct uio_info *info, struct inode *inode) +{ + struct rte_uio_pci_dev *udev = info->priv; + struct pci_dev *dev = udev->pdev; + + /* stop the device from further DMA */ + pci_clear_master(dev); + + pci_reset_function(dev); + + return 0; +} + #ifdef CONFIG_XEN_DOM0 static int igbuio_dom0_mmap_phys(struct uio_info *info, struct vm_area_struct *vma) @@ -370,6 +401,8 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) udev->info.version = "0.1"; udev->info.handler = igbuio_pci_irqhandler; udev->info.irqcontrol = igbuio_pci_irqcontrol; + udev->info.open = igbuio_pci_open; + udev->info.release = igbuio_pci_release; #ifdef CONFIG_XEN_DOM0 /* check if the driver run on Xen Dom0 */ if (xen_initial_domain()) -- 2.19.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-08 17:59:30.319286385 +0000 +++ 0014-igb_uio-issue-FLR-during-open-and-release-of-device-.patch 2018-11-08 17:59:30.064751011 +0000 @@ -1,8 +1,10 @@ -From b58eedfc7dd57eef6d12e2c654a52c834f36084a Mon Sep 17 00:00:00 2001 +From 11bb826270d6feb3e810aec77a9252cf65b559a9 Mon Sep 17 00:00:00 2001 From: Shijith Thotton Date: Fri, 7 Jul 2017 16:43:51 +0530 Subject: [PATCH] igb_uio: issue FLR during open and release of device file +[ upstream commit b58eedfc7dd57eef6d12e2c654a52c834f36084a ] + Set UIO info device file operations open and release. Call pci reset function inside open and release to clear device state at start and end. Copied this behaviour from vfio_pci kernel module code. With this patch, @@ -20,7 +22,7 @@ 1 file changed, 33 insertions(+) diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c -index b9d427c51..07a19a315 100644 +index 9f00f07ab..4be89ef86 100644 --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c @@ -170,6 +170,37 @@ igbuio_pci_irqhandler(int irq, struct uio_info *info) @@ -61,7 +63,7 @@ #ifdef CONFIG_XEN_DOM0 static int igbuio_dom0_mmap_phys(struct uio_info *info, struct vm_area_struct *vma) -@@ -372,6 +403,8 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) +@@ -370,6 +401,8 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) udev->info.version = "0.1"; udev->info.handler = igbuio_pci_irqhandler; udev->info.irqcontrol = igbuio_pci_irqcontrol;