From patchwork Tue Oct 22 13:16:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chautru, Nicolas" X-Patchwork-Id: 61679 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7B38A1BEF1; Tue, 22 Oct 2019 22:22:16 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 3CFF01BEC9; Tue, 22 Oct 2019 22:22:12 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Oct 2019 13:22:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,217,1569308400"; d="scan'208";a="397812314" Received: from skx-5gnr-sc12-4.sc.intel.com ([172.25.69.210]) by fmsmga005.fm.intel.com with ESMTP; 22 Oct 2019 13:22:10 -0700 From: Nicolas Chautru To: akhil.goyal@nxp.com, dev@dpdk.org Cc: ferruh.yigit@intel.com, thomas@monjalon.net, Nic Chautru , stable@dpdk.org Date: Tue, 22 Oct 2019 06:16:16 -0700 Message-Id: <1571750177-387063-2-git-send-email-nicolas.chautru@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1571750177-387063-1-git-send-email-nicolas.chautru@intel.com> References: <1571750177-387063-1-git-send-email-nicolas.chautru@intel.com> Subject: [dpdk-dev] [PATCH v2 1/2] baseband/fpga_lte_fec: fix probing fatal failure 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Nic Chautru A change to PCI mapping assumption was missed earlier, this causes probing to fail with the fpga_lte_fec PMD when checking for name of the rte_driver (not set yet) instead of the rte_pci_driver. Fixes: 391797f04208 ("drivers/bus: move driver assignment to end of probing") Cc: thomas@monjalon.net Cc: stable@dpdk.org Signed-off-by: Nic Chautru --- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c index 7e05b94..2fc7f11 100644 --- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c @@ -2307,7 +2307,7 @@ struct __rte_cache_aligned fpga_queue { /* Initialization Function */ static void -fpga_lte_fec_init(struct rte_bbdev *dev) +fpga_lte_fec_init(struct rte_bbdev *dev, struct rte_pci_driver *drv) { struct rte_pci_device *pci_dev = RTE_DEV_TO_PCI(dev->device); @@ -2318,7 +2318,7 @@ struct __rte_cache_aligned fpga_queue { dev->dequeue_dec_ops = fpga_dequeue_dec; ((struct fpga_lte_fec_device *) dev->data->dev_private)->pf_device = - !strcmp(dev->device->driver->name, + !strcmp(drv->driver.name, RTE_STR(FPGA_LTE_FEC_PF_DRIVER_NAME)); ((struct fpga_lte_fec_device *) dev->data->dev_private)->mmio_base = pci_dev->mem_resource[0].addr; @@ -2331,7 +2331,7 @@ struct __rte_cache_aligned fpga_queue { } static int -fpga_lte_fec_probe(struct rte_pci_driver *pci_drv __rte_unused, +fpga_lte_fec_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) { struct rte_bbdev *bbdev = NULL; @@ -2368,7 +2368,7 @@ struct __rte_cache_aligned fpga_queue { bbdev->data->socket_id = pci_dev->device.numa_node; /* Invoke FEC FPGA device initialization function */ - fpga_lte_fec_init(bbdev); + fpga_lte_fec_init(bbdev, pci_drv); rte_bbdev_log_debug("bbdev id = %u [%s]", bbdev->data->dev_id, dev_name); From patchwork Tue Oct 22 13:16:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chautru, Nicolas" X-Patchwork-Id: 61680 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1943A1BF02; Tue, 22 Oct 2019 22:22:19 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id BE5731BEE1; Tue, 22 Oct 2019 22:22:12 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Oct 2019 13:22:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,217,1569308400"; d="scan'208";a="397812317" Received: from skx-5gnr-sc12-4.sc.intel.com ([172.25.69.210]) by fmsmga005.fm.intel.com with ESMTP; 22 Oct 2019 13:22:10 -0700 From: Nicolas Chautru To: akhil.goyal@nxp.com, dev@dpdk.org Cc: ferruh.yigit@intel.com, thomas@monjalon.net, Nic Chautru , stable@dpdk.org Date: Tue, 22 Oct 2019 06:16:17 -0700 Message-Id: <1571750177-387063-3-git-send-email-nicolas.chautru@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1571750177-387063-1-git-send-email-nicolas.chautru@intel.com> References: <1571750177-387063-1-git-send-email-nicolas.chautru@intel.com> Subject: [dpdk-dev] [PATCH v2 2/2] baseband/fpga_lte_fec: fix to polling of MMIO register 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Nic Chautru Polling of a MMIO register could misreport the actual value set dynamically in hardware as the variable was not set explicitly to volatile integer. Fixes: efd453698c49 ("baseband/fpga_lte_fec: add driver for FEC on FPGA") Cc: nicolas.chautru@intel.com Cc: stable@dpdk.org Signed-off-by: Nic Chautru --- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c index 2fc7f11..8bd10b4 100644 --- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c @@ -889,7 +889,7 @@ struct __rte_cache_aligned fpga_queue { * completed. If completion flag is not updated within 1ms it is * considered as a failure. */ - while (!(*((uint8_t *)d->flush_queue_status + q->q_idx) & payload)) { + while (!(*((volatile uint8_t *)d->flush_queue_status + q->q_idx) & payload)) { if (counter > timeout) { rte_bbdev_log(ERR, "FPGA Queue Flush failed for queue %d", queue_id);