From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by dpdk.org (Postfix) with ESMTP id 007CBB375 for ; Fri, 18 Jul 2014 18:14:27 +0200 (CEST) Received: by mail-pd0-f175.google.com with SMTP id r10so3820382pdi.34 for ; Fri, 18 Jul 2014 09:15:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:user-agent:date:from:to:cc:subject :references:mime-version:content-type:content-disposition; bh=KvP+jZNWNqPME56aBuJ5g7L9q57oGhPXmX+QW/xQaWE=; b=j4NdH6xgU5ao4n2ykAA3uptpSfxdGe9gUhupGZRGs5IPIRNBRsEz51NYzZPK5pZNcE g81g4n+8kgpeIJPVgh1ccJISYpF4W3BcZVA+i+YYsFWiyj8TUqFVLqdUHGZRqDpgF/5g HTRvS/3vICyPAtd4FBF7tYLMU1XPsNu7sGunAk3AcflajW0Iy+47vCVcTBhdvsO7bUN2 KLP+vhA1s5S/NyXOLzbOzMNi20LKrD6bAC0Rvg6MVvfOil2QLUVFk6DHyLnpHwiGcP4m wlnztxqtKVOe9skVp4j8ziQSCDDBRQH9sF11TidEUltY9u8CcN/gaksUkXE6Gi8kCaQn 8myQ== X-Gm-Message-State: ALoCoQlYtop1HUAInmTXtpE3DYxogkL8lXnFCXN//9wo2zHmGCZqN8j8OgfBruD3qRGapHlNwQA4 X-Received: by 10.68.171.1 with SMTP id aq1mr6451346pbc.115.1405700128535; Fri, 18 Jul 2014 09:15:28 -0700 (PDT) Received: from localhost (static-50-53-66-61.bvtn.or.frontiernet.net. [50.53.66.61]) by mx.google.com with ESMTPSA id z2sm7980004pdp.91.2014.07.18.09.15.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jul 2014 09:15:27 -0700 (PDT) Message-Id: <20140718161526.944177421@networkplumber.org> User-Agent: quilt/0.63-1 Date: Fri, 18 Jul 2014 09:14:56 -0700 From: Stephen Hemminger To: Thomas Monjalon References: <20140718161447.020882834@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=igb_uio_msi_mode.patch Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH 09/10] igb_uio: allow msi mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 16:14:28 -0000 Allows msi to be selected as a preferred mode. Signed-off-by: Stephen Hemminger --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c 2014-07-18 08:47:24.713604900 -0700 +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c 2014-07-18 08:47:24.709604886 -0700 @@ -646,7 +646,7 @@ fail_release_iomem: igbuio_pci_release_iomem(&udev->info); if (udev->mode == RTE_INTR_MODE_MSIX) pci_disable_msix(udev->pdev); - if (udev->mode == RTE_INTR_MODE_MSI) + else if (udev->mode == RTE_INTR_MODE_MSI) pci_disable_msi(udev->pdev); pci_release_regions(dev); fail_disable: @@ -661,6 +661,7 @@ static void igbuio_pci_remove(struct pci_dev *dev) { struct uio_info *info = pci_get_drvdata(dev); + struct rte_uio_pci_dev *udev = igbuio_get_uio_pci_dev(info); if (info->priv == NULL) { pr_notice("Not igbuio device\n"); @@ -670,9 +671,10 @@ igbuio_pci_remove(struct pci_dev *dev) sysfs_remove_group(&dev->dev.kobj, &dev_attr_grp); uio_unregister_device(info); igbuio_pci_release_iomem(info); - if (((struct rte_uio_pci_dev *)info->priv)->mode == - RTE_INTR_MODE_MSIX) + if (udev->mode == RTE_INTR_MODE_MSIX) pci_disable_msix(dev); + else if (udev->mode == RTE_INTR_MODE_MSI) + pci_disable_msi(dev); pci_release_regions(dev); pci_disable_device(dev); pci_set_drvdata(dev, NULL); @@ -690,6 +692,9 @@ igbuio_config_intr_mode(char *intr_str) if (!strcmp(intr_str, RTE_INTR_MODE_MSIX_NAME)) { igbuio_intr_mode_preferred = RTE_INTR_MODE_MSIX; pr_info("Use MSIX interrupt\n"); + } else if (!strcmp(intr_str, RTE_INTR_MODE_MSI_NAME)) { + igbuio_intr_mode_preferred = RTE_INTR_MODE_MSI; + pr_info("Use MSI interrupt\n"); } else if (!strcmp(intr_str, RTE_INTR_MODE_LEGACY_NAME)) { igbuio_intr_mode_preferred = RTE_INTR_MODE_LEGACY; pr_info("Use legacy interrupt\n"); @@ -733,6 +738,7 @@ module_param(intr_mode, charp, S_IRUGO); MODULE_PARM_DESC(intr_mode, "igb_uio interrupt mode (default=msix):\n" " " RTE_INTR_MODE_MSIX_NAME " Use MSIX interrupt\n" +" " RTE_INTR_MODE_MSI_NAME " Use MSI interrupt\n" " " RTE_INTR_MODE_LEGACY_NAME " Use Legacy interrupt\n" "\n");