DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] access to different ports on the same NIC by 2 DPDK applications
@ 2021-05-20 20:34 Sudharshan Krishnakumar
  2021-05-20 20:54 ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Sudharshan Krishnakumar @ 2021-05-20 20:34 UTC (permalink / raw)
  To: users

Hi All,

Have a Qs related to-> access to different ports on the same NIC by 2 DPDK
applications.



Setup: 4-Port 10 Gig NIC card with ports bound for DPDK usage.



With intel’s igb_uio kernel driver (used for binding NIC’s ports) using
dpdk-setup.sh, at the /dev level, I see 4 device paths created,

/dev/uio0, /dev/uio1, /dev/ui02, /dev/uio3



And I was able to run 2 DPDK applications concurrently(by blacklisting the
ports in EAL parameters), and they were able to take ownership of different
ports on the same NIC.

For example DPDK_APP1 can take access of ports->0,1 and DPDK_APP2 can take
access of ports->2,3.



Currently, I am using another DPDK app that relies on binding to VFIO
driver.



So I am trying to switch to binding NIC’s 4 ports to VFIO driver.



Enabled VTIO in BIOS and added intel_iommu=on in kernel boot-param in GRUB.



After binding all 4 ports to VFIO driver, using dpdk-setup,sh, at the /dev
level, I only see these 2 device paths created-> /dev/vfio/vfio(control
channel)

and /dev/vfio/1(essentially just 1 path).



I am able to run one DPDK application, for example-> PacketGen tool.

But not able to run 2 DPDK applications concurrently accessing different
ports on the same NIC, due to DPDK application not being able to get access
to the ports.

For example, if I launch DPDK_APP1 first, it can get access to the ports,
but DPDK_APP2 is NOT able to get access, and vice-versa.

Note that both apps are trying to access different ports on the same NIC,
and also ports have been black-listed as part of EAL params to the DPDK
apps.

I know this is possible with igb_uio driver.



Please let me know, if it is possible to do this when ports are bound to
VFIO driver.

Thanks,

Sudha

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-users] access to different ports on the same NIC by 2 DPDK applications
  2021-05-20 20:34 [dpdk-users] access to different ports on the same NIC by 2 DPDK applications Sudharshan Krishnakumar
@ 2021-05-20 20:54 ` Stephen Hemminger
  2021-05-20 21:19   ` Sudharshan Krishnakumar
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2021-05-20 20:54 UTC (permalink / raw)
  To: Sudharshan Krishnakumar; +Cc: users

On Thu, 20 May 2021 13:34:35 -0700
Sudharshan Krishnakumar <sudhar.ckrishna@gmail.com> wrote:

> Hi All,
> 
> Have a Qs related to-> access to different ports on the same NIC by 2 DPDK
> applications.
> 
> 
> 
> Setup: 4-Port 10 Gig NIC card with ports bound for DPDK usage.
> 
> 
> 
> With intel’s igb_uio kernel driver (used for binding NIC’s ports) using
> dpdk-setup.sh, at the /dev level, I see 4 device paths created,
> 
> /dev/uio0, /dev/uio1, /dev/ui02, /dev/uio3
> 
> 
> 
> And I was able to run 2 DPDK applications concurrently(by blacklisting the
> ports in EAL parameters), and they were able to take ownership of different
> ports on the same NIC.
> 
> For example DPDK_APP1 can take access of ports->0,1 and DPDK_APP2 can take
> access of ports->2,3.
> 
> 
> 
> Currently, I am using another DPDK app that relies on binding to VFIO
> driver.
> 
> 
> 
> So I am trying to switch to binding NIC’s 4 ports to VFIO driver.
> 
> 
> 
> Enabled VTIO in BIOS and added intel_iommu=on in kernel boot-param in GRUB.
> 
> 
> 
> After binding all 4 ports to VFIO driver, using dpdk-setup,sh, at the /dev
> level, I only see these 2 device paths created-> /dev/vfio/vfio(control
> channel)
> 
> and /dev/vfio/1(essentially just 1 path).
> 
> 
> 
> I am able to run one DPDK application, for example-> PacketGen tool.
> 
> But not able to run 2 DPDK applications concurrently accessing different
> ports on the same NIC, due to DPDK application not being able to get access
> to the ports.
> 
> For example, if I launch DPDK_APP1 first, it can get access to the ports,
> but DPDK_APP2 is NOT able to get access, and vice-versa.
> 
> Note that both apps are trying to access different ports on the same NIC,
> and also ports have been black-listed as part of EAL params to the DPDK
> apps.
> 
> I know this is possible with igb_uio driver.
> 
> 
> 
> Please let me know, if it is possible to do this when ports are bound to
> VFIO driver.
> 
> Thanks,
> 
> Sudha

The issue is that the IOMMU can't map two different areas at once
to same device. You might be able to use DPDK primary/secondary process
model to do this.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-users] access to different ports on the same NIC by 2 DPDK applications
  2021-05-20 20:54 ` Stephen Hemminger
@ 2021-05-20 21:19   ` Sudharshan Krishnakumar
  2021-05-20 22:34     ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Sudharshan Krishnakumar @ 2021-05-20 21:19 UTC (permalink / raw)
  To: stephen; +Cc: users

Thanks for your inputs. So, does this mean, when ports are bound to VFIO
driver(which uses IOMMU), we can
run 2 DPDK apps concurrently, only if the 2 apps are accessing ports on 2
different Network cards.
In other words, when ports are bound to VFIO driver, if 2 DPDK apps are
running concurrently on the same system,
then we need 2 Network cards installed on that system.
So, I am guessing with 2 Network cards, under /dev, they would enumerate as
2 distinct paths, for example-> /dev/vfio/1 and /dev/vfio/2.
Is this a correct understanding, please let me know.

On Thu, May 20, 2021 at 1:54 PM Stephen Hemminger <
stephen@networkplumber.org> wrote:

> On Thu, 20 May 2021 13:34:35 -0700
> Sudharshan Krishnakumar <sudhar.ckrishna@gmail.com> wrote:
>
> > Hi All,
> >
> > Have a Qs related to-> access to different ports on the same NIC by 2
> DPDK
> > applications.
> >
> >
> >
> > Setup: 4-Port 10 Gig NIC card with ports bound for DPDK usage.
> >
> >
> >
> > With intel’s igb_uio kernel driver (used for binding NIC’s ports) using
> > dpdk-setup.sh, at the /dev level, I see 4 device paths created,
> >
> > /dev/uio0, /dev/uio1, /dev/ui02, /dev/uio3
> >
> >
> >
> > And I was able to run 2 DPDK applications concurrently(by blacklisting
> the
> > ports in EAL parameters), and they were able to take ownership of
> different
> > ports on the same NIC.
> >
> > For example DPDK_APP1 can take access of ports->0,1 and DPDK_APP2 can
> take
> > access of ports->2,3.
> >
> >
> >
> > Currently, I am using another DPDK app that relies on binding to VFIO
> > driver.
> >
> >
> >
> > So I am trying to switch to binding NIC’s 4 ports to VFIO driver.
> >
> >
> >
> > Enabled VTIO in BIOS and added intel_iommu=on in kernel boot-param in
> GRUB.
> >
> >
> >
> > After binding all 4 ports to VFIO driver, using dpdk-setup,sh, at the
> /dev
> > level, I only see these 2 device paths created-> /dev/vfio/vfio(control
> > channel)
> >
> > and /dev/vfio/1(essentially just 1 path).
> >
> >
> >
> > I am able to run one DPDK application, for example-> PacketGen tool.
> >
> > But not able to run 2 DPDK applications concurrently accessing different
> > ports on the same NIC, due to DPDK application not being able to get
> access
> > to the ports.
> >
> > For example, if I launch DPDK_APP1 first, it can get access to the ports,
> > but DPDK_APP2 is NOT able to get access, and vice-versa.
> >
> > Note that both apps are trying to access different ports on the same NIC,
> > and also ports have been black-listed as part of EAL params to the DPDK
> > apps.
> >
> > I know this is possible with igb_uio driver.
> >
> >
> >
> > Please let me know, if it is possible to do this when ports are bound to
> > VFIO driver.
> >
> > Thanks,
> >
> > Sudha
>
> The issue is that the IOMMU can't map two different areas at once
> to same device. You might be able to use DPDK primary/secondary process
> model to do this.
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-users] access to different ports on the same NIC by 2 DPDK applications
  2021-05-20 21:19   ` Sudharshan Krishnakumar
@ 2021-05-20 22:34     ` Stephen Hemminger
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2021-05-20 22:34 UTC (permalink / raw)
  To: Sudharshan Krishnakumar; +Cc: users

On Thu, 20 May 2021 14:19:13 -0700
Sudharshan Krishnakumar <sudhar.ckrishna@gmail.com> wrote:

> Thanks for your inputs. So, does this mean, when ports are bound to VFIO
> driver(which uses IOMMU), we can
> run 2 DPDK apps concurrently, only if the 2 apps are accessing ports on 2
> different Network cards.
> In other words, when ports are bound to VFIO driver, if 2 DPDK apps are
> running concurrently on the same system,
> then we need 2 Network cards installed on that system.
> So, I am guessing with 2 Network cards, under /dev, they would enumerate as
> 2 distinct paths, for example-> /dev/vfio/1 and /dev/vfio/2.
> Is this a correct understanding, please let me know.

Groups are explained here.

https://www.kernel.org/doc/Documentation/vfio.txt

The VFIO is about isolation and if two processes are trying to
use the same group they are not isolated.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-20 22:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 20:34 [dpdk-users] access to different ports on the same NIC by 2 DPDK applications Sudharshan Krishnakumar
2021-05-20 20:54 ` Stephen Hemminger
2021-05-20 21:19   ` Sudharshan Krishnakumar
2021-05-20 22:34     ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).