net/qede: support IOVA VA mode

Message ID 20190307183903.10779-1-ktraynor@redhat.com
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • net/qede: support IOVA VA mode
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch warning coding style issues
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

Kevin Traynor March 7, 2019, 6:39 p.m.
Set RTE_PCI_DRV_IOVA_AS_VA in drv_flags. This allows initializing qede
PMD as non-root also on Linux v4.x, where /proc/self/pagemap can't be
acccessed without CAP_SYS_ADMIN privileges.

The flag was introduced generically but not in pmds in commit:
815c7deaed2d ("pci: get IOMMU class on Linux") 

Cc: stable@dpdk.org

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---

 drivers/net/qede/qede_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Rasesh Mody March 7, 2019, 9:09 p.m. | #1
>From: Kevin Traynor <ktraynor@redhat.com>
>Sent: Thursday, March 07, 2019 10:39 AM
>
>----------------------------------------------------------------------
>Set RTE_PCI_DRV_IOVA_AS_VA in drv_flags. This allows initializing qede PMD
>as non-root also on Linux v4.x, where /proc/self/pagemap can't be acccessed
>without CAP_SYS_ADMIN privileges.
>
>The flag was introduced generically but not in pmds in commit:
>815c7deaed2d ("pci: get IOMMU class on Linux")
>
>Cc: stable@dpdk.org
>
>Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
>---

Acked-by: Rasesh Mody <rmody@marvell.com>
>
> drivers/net/qede/qede_ethdev.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/qede/qede_ethdev.c
>b/drivers/net/qede/qede_ethdev.c index 518673dce..6b330c2b2 100644
>--- a/drivers/net/qede/qede_ethdev.c
>+++ b/drivers/net/qede/qede_ethdev.c
>@@ -2736,5 +2736,6 @@ static int qedevf_eth_dev_pci_remove(struct
>rte_pci_device *pci_dev)  static struct rte_pci_driver rte_qedevf_pmd = {
> 	.id_table = pci_id_qedevf_map,
>-	.drv_flags = RTE_PCI_DRV_NEED_MAPPING |
>RTE_PCI_DRV_INTR_LSC,
>+	.drv_flags = RTE_PCI_DRV_NEED_MAPPING
>|RTE_PCI_DRV_INTR_LSC |
>+		     RTE_PCI_DRV_IOVA_AS_VA,
> 	.probe = qedevf_eth_dev_pci_probe,
> 	.remove = qedevf_eth_dev_pci_remove,
>@@ -2755,5 +2756,6 @@ static int qede_eth_dev_pci_remove(struct
>rte_pci_device *pci_dev)  static struct rte_pci_driver rte_qede_pmd = {
> 	.id_table = pci_id_qede_map,
>-	.drv_flags = RTE_PCI_DRV_NEED_MAPPING |
>RTE_PCI_DRV_INTR_LSC,
>+	.drv_flags = RTE_PCI_DRV_NEED_MAPPING |
>RTE_PCI_DRV_INTR_LSC |
>+		     RTE_PCI_DRV_IOVA_AS_VA,
> 	.probe = qede_eth_dev_pci_probe,
> 	.remove = qede_eth_dev_pci_remove,
>--
>2.20.1
Shahed Shaikh March 8, 2019, 5:15 a.m. | #2
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Kevin Traynor
> Sent: Friday, March 8, 2019 12:09 AM
> To: Rasesh Mody <rmody@marvell.com>; dev@dpdk.org
> Cc: Kevin Traynor <ktraynor@redhat.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/qede: support IOVA VA mode
> 
> Set RTE_PCI_DRV_IOVA_AS_VA in drv_flags. This allows initializing qede PMD as
> non-root also on Linux v4.x, where /proc/self/pagemap can't be acccessed
> without CAP_SYS_ADMIN privileges.
> 
> The flag was introduced generically but not in pmds in commit:
> 815c7deaed2d ("pci: get IOMMU class on Linux")
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>

Acked-by: Shahed Shaikh <shshaikh@marvell.com>

Thanks,
Shahed
> ---
> 
>  drivers/net/qede/qede_ethdev.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
> index 518673dce..6b330c2b2 100644
> --- a/drivers/net/qede/qede_ethdev.c
> +++ b/drivers/net/qede/qede_ethdev.c
> @@ -2736,5 +2736,6 @@ static int qedevf_eth_dev_pci_remove(struct
> rte_pci_device *pci_dev)  static struct rte_pci_driver rte_qedevf_pmd = {
>  	.id_table = pci_id_qedevf_map,
> -	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
> +	.drv_flags = RTE_PCI_DRV_NEED_MAPPING |RTE_PCI_DRV_INTR_LSC |
> +		     RTE_PCI_DRV_IOVA_AS_VA,
>  	.probe = qedevf_eth_dev_pci_probe,
>  	.remove = qedevf_eth_dev_pci_remove,
> @@ -2755,5 +2756,6 @@ static int qede_eth_dev_pci_remove(struct
> rte_pci_device *pci_dev)  static struct rte_pci_driver rte_qede_pmd = {
>  	.id_table = pci_id_qede_map,
> -	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
> +	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC
> |
> +		     RTE_PCI_DRV_IOVA_AS_VA,
>  	.probe = qede_eth_dev_pci_probe,
>  	.remove = qede_eth_dev_pci_remove,
> --
> 2.20.1

Patch

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 518673dce..6b330c2b2 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -2736,5 +2736,6 @@  static int qedevf_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
 static struct rte_pci_driver rte_qedevf_pmd = {
 	.id_table = pci_id_qedevf_map,
-	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+	.drv_flags = RTE_PCI_DRV_NEED_MAPPING |RTE_PCI_DRV_INTR_LSC |
+		     RTE_PCI_DRV_IOVA_AS_VA,
 	.probe = qedevf_eth_dev_pci_probe,
 	.remove = qedevf_eth_dev_pci_remove,
@@ -2755,5 +2756,6 @@  static int qede_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
 static struct rte_pci_driver rte_qede_pmd = {
 	.id_table = pci_id_qede_map,
-	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC |
+		     RTE_PCI_DRV_IOVA_AS_VA,
 	.probe = qede_eth_dev_pci_probe,
 	.remove = qede_eth_dev_pci_remove,