DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] pci device access from dpdk secondary process with igb_uio
@ 2019-12-27  0:58 vijay mohan
  2020-01-02 18:58 ` vijay mohan
  0 siblings, 1 reply; 6+ messages in thread
From: vijay mohan @ 2019-12-27  0:58 UTC (permalink / raw)
  To: dev

Hi All,
I am trying to use pci vf device with secondary process in a multiple
process mode and finding pci_dev->mem_resource[0].addr to be NULL. This
happens when the pci device is attached to igb_uio.ko but with vfio_pci it
works fine.

Looking at the pci device initialization part for secondary process, when
device is presented through igb_uio, (in pci_uio_map_secondary), it doesn't
seems to update pci_dev->mem_resource[X].addr. For vfio-pci, it updates the
addresses in pci_vfio_map_resource_secondary. With the following patch, i
am able to use the device from secondary process but would like to know if
I am missing something.

diff --git a/drivers/bus/pci/pci_common_uio.c
b/drivers/bus/pci/pci_common_uio.c
index 7ea73db..f4dca9d 100644
--- a/drivers/bus/pci/pci_common_uio.c
+++ b/drivers/bus/pci/pci_common_uio.c
@@ -70,6 +70,7 @@
                                }
                                return -1;
                        }
+                       dev->mem_resource[i].addr = mapaddr;
                }
                return 0;
        }

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

* Re: [dpdk-dev] pci device access from dpdk secondary process with igb_uio
  2019-12-27  0:58 [dpdk-dev] pci device access from dpdk secondary process with igb_uio vijay mohan
@ 2020-01-02 18:58 ` vijay mohan
  2020-01-22 17:19   ` Trahe, Fiona
  2020-03-04 12:32   ` Ferruh Yigit
  0 siblings, 2 replies; 6+ messages in thread
From: vijay mohan @ 2020-01-02 18:58 UTC (permalink / raw)
  To: dev, ferruh.yigit, john.griffin

On Thu, 26 Dec 2019 at 16:58, vijay mohan <vijay1054@gmail.com> wrote:
>
> Hi All,
> I am trying to use pci vf device with secondary process in a multiple process mode and finding pci_dev->mem_resource[0].addr to be NULL. This happens when the pci device is attached to igb_uio.ko but with vfio_pci it works fine.
>
> Looking at the pci device initialization part for secondary process, when device is presented through igb_uio, (in pci_uio_map_secondary), it doesn't seems to update pci_dev->mem_resource[X].addr. For vfio-pci, it updates the addresses in pci_vfio_map_resource_secondary. With the following patch, i am able to use the device from secondary process but would like to know if I am missing something.
>
> diff --git a/drivers/bus/pci/pci_common_uio.c b/drivers/bus/pci/pci_common_uio.c
> index 7ea73db..f4dca9d 100644
> --- a/drivers/bus/pci/pci_common_uio.c
> +++ b/drivers/bus/pci/pci_common_uio.c
> @@ -70,6 +70,7 @@
>                                 }
>                                 return -1;
>                         }
> +                       dev->mem_resource[i].addr = mapaddr;
>                 }
>                 return 0;
>         }

Hi Ferruh Yigit/John Griffin,
I am trying to use QAT crypto VF device attached to igb_uio.ko with
secondary process and has observed following errors while setting up
the queues due to pci_dev->mem_resource[0].addr check from
qat_qp_setup. mem_resource[0].addr happens to be NULL when the device
is presented to dpdk through igb_uio but works fine with vfio_pci.ko.
Could you please let me know if the fix mentioned above is sufficient
for the device to work with secondary process.

CRYPTODEV: Initialisation parameters - name: BDF_qat_sym,socket id: 0,
max queue pairs: 0
qat_sym_dev_create(): Created QAT SYM device BDF_qat_sym as cryptodev instance 0
qat_comp_dev_create(): Creating QAT COMP device BDF_qat_comp
qat_comp_dev_create(): Created QAT COMP device BDF_qat_comp as
compressdev instance 0
Dev config
Setting up queues
qat_qp_setup(): Setup qp 0 on qat pci device 0 gen 2
qat_qp_setup(): Could not find VF config space (UIO driver attached?).
Crypto device queue pair init failed

Thanks,
Vijay

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

* Re: [dpdk-dev] pci device access from dpdk secondary process with igb_uio
  2020-01-02 18:58 ` vijay mohan
@ 2020-01-22 17:19   ` Trahe, Fiona
  2020-02-25 15:09     ` Trahe, Fiona
  2020-03-04 12:32   ` Ferruh Yigit
  1 sibling, 1 reply; 6+ messages in thread
From: Trahe, Fiona @ 2020-01-22 17:19 UTC (permalink / raw)
  To: vijay mohan, dev, Yigit, Ferruh; +Cc: Trahe, Fiona

Hi Vijay,

Sorry for the delay, we missed this as It arrived while on Christmas holidays.
We'll investigate, though it may take some time as this looks like a pci lib issue
and up to recently we have only been using QAT in primary processes so don't have
expertise yet in this area.

If you could provide some background to your use-case for qat in primary/secondary, that may help.

Fiona

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of vijay mohan
> Sent: Thursday, January 2, 2020 6:58 PM
> To: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Griffin, John <john.griffin@intel.com>
> Subject: Re: [dpdk-dev] pci device access from dpdk secondary process with igb_uio
> 
> On Thu, 26 Dec 2019 at 16:58, vijay mohan <vijay1054@gmail.com> wrote:
> >
> > Hi All,
> > I am trying to use pci vf device with secondary process in a multiple process mode and finding
> pci_dev->mem_resource[0].addr to be NULL. This happens when the pci device is attached to
> igb_uio.ko but with vfio_pci it works fine.
> >
> > Looking at the pci device initialization part for secondary process, when device is presented through
> igb_uio, (in pci_uio_map_secondary), it doesn't seems to update pci_dev->mem_resource[X].addr.
> For vfio-pci, it updates the addresses in pci_vfio_map_resource_secondary. With the following patch, i
> am able to use the device from secondary process but would like to know if I am missing something.
> >
> > diff --git a/drivers/bus/pci/pci_common_uio.c b/drivers/bus/pci/pci_common_uio.c
> > index 7ea73db..f4dca9d 100644
> > --- a/drivers/bus/pci/pci_common_uio.c
> > +++ b/drivers/bus/pci/pci_common_uio.c
> > @@ -70,6 +70,7 @@
> >                                 }
> >                                 return -1;
> >                         }
> > +                       dev->mem_resource[i].addr = mapaddr;
> >                 }
> >                 return 0;
> >         }
> 
> Hi Ferruh Yigit/John Griffin,
> I am trying to use QAT crypto VF device attached to igb_uio.ko with
> secondary process and has observed following errors while setting up
> the queues due to pci_dev->mem_resource[0].addr check from
> qat_qp_setup. mem_resource[0].addr happens to be NULL when the device
> is presented to dpdk through igb_uio but works fine with vfio_pci.ko.
> Could you please let me know if the fix mentioned above is sufficient
> for the device to work with secondary process.
> 
> CRYPTODEV: Initialisation parameters - name: BDF_qat_sym,socket id: 0,
> max queue pairs: 0
> qat_sym_dev_create(): Created QAT SYM device BDF_qat_sym as cryptodev instance 0
> qat_comp_dev_create(): Creating QAT COMP device BDF_qat_comp
> qat_comp_dev_create(): Created QAT COMP device BDF_qat_comp as
> compressdev instance 0
> Dev config
> Setting up queues
> qat_qp_setup(): Setup qp 0 on qat pci device 0 gen 2
> qat_qp_setup(): Could not find VF config space (UIO driver attached?).
> Crypto device queue pair init failed
> 
> Thanks,
> Vijay

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

* Re: [dpdk-dev] pci device access from dpdk secondary process with igb_uio
  2020-01-22 17:19   ` Trahe, Fiona
@ 2020-02-25 15:09     ` Trahe, Fiona
  2020-02-25 19:45       ` vijay mohan
  0 siblings, 1 reply; 6+ messages in thread
From: Trahe, Fiona @ 2020-02-25 15:09 UTC (permalink / raw)
  To: vijay mohan, dev, Yigit, Ferruh; +Cc: Trahe, Fiona

Hi Vijay,

Thanks for debugging. We've recreated your issue and validated that this fixes it.
Do you want to go ahead and send up a patch or will I do that?

Fiona


> -----Original Message-----
> From: Trahe, Fiona
> Sent: Wednesday, January 22, 2020 5:19 PM
> To: vijay mohan <vijay1054@gmail.com>; dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: Trahe, Fiona <fiona.trahe@intel.com>
> Subject: RE: [dpdk-dev] pci device access from dpdk secondary process with igb_uio
> 
> Hi Vijay,
> 
> Sorry for the delay, we missed this as It arrived while on Christmas holidays.
> We'll investigate, though it may take some time as this looks like a pci lib issue
> and up to recently we have only been using QAT in primary processes so don't have
> expertise yet in this area.
> 
> If you could provide some background to your use-case for qat in primary/secondary, that may help.
> 
> Fiona
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of vijay mohan
> > Sent: Thursday, January 2, 2020 6:58 PM
> > To: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Griffin, John <john.griffin@intel.com>
> > Subject: Re: [dpdk-dev] pci device access from dpdk secondary process with igb_uio
> >
> > On Thu, 26 Dec 2019 at 16:58, vijay mohan <vijay1054@gmail.com> wrote:
> > >
> > > Hi All,
> > > I am trying to use pci vf device with secondary process in a multiple process mode and finding
> > pci_dev->mem_resource[0].addr to be NULL. This happens when the pci device is attached to
> > igb_uio.ko but with vfio_pci it works fine.
> > >
> > > Looking at the pci device initialization part for secondary process, when device is presented
> through
> > igb_uio, (in pci_uio_map_secondary), it doesn't seems to update pci_dev->mem_resource[X].addr.
> > For vfio-pci, it updates the addresses in pci_vfio_map_resource_secondary. With the following
> patch, i
> > am able to use the device from secondary process but would like to know if I am missing something.
> > >
> > > diff --git a/drivers/bus/pci/pci_common_uio.c b/drivers/bus/pci/pci_common_uio.c
> > > index 7ea73db..f4dca9d 100644
> > > --- a/drivers/bus/pci/pci_common_uio.c
> > > +++ b/drivers/bus/pci/pci_common_uio.c
> > > @@ -70,6 +70,7 @@
> > >                                 }
> > >                                 return -1;
> > >                         }
> > > +                       dev->mem_resource[i].addr = mapaddr;
> > >                 }
> > >                 return 0;
> > >         }
> >
> > Hi Ferruh Yigit/John Griffin,
> > I am trying to use QAT crypto VF device attached to igb_uio.ko with
> > secondary process and has observed following errors while setting up
> > the queues due to pci_dev->mem_resource[0].addr check from
> > qat_qp_setup. mem_resource[0].addr happens to be NULL when the device
> > is presented to dpdk through igb_uio but works fine with vfio_pci.ko.
> > Could you please let me know if the fix mentioned above is sufficient
> > for the device to work with secondary process.
> >
> > CRYPTODEV: Initialisation parameters - name: BDF_qat_sym,socket id: 0,
> > max queue pairs: 0
> > qat_sym_dev_create(): Created QAT SYM device BDF_qat_sym as cryptodev instance 0
> > qat_comp_dev_create(): Creating QAT COMP device BDF_qat_comp
> > qat_comp_dev_create(): Created QAT COMP device BDF_qat_comp as
> > compressdev instance 0
> > Dev config
> > Setting up queues
> > qat_qp_setup(): Setup qp 0 on qat pci device 0 gen 2
> > qat_qp_setup(): Could not find VF config space (UIO driver attached?).
> > Crypto device queue pair init failed
> >
> > Thanks,
> > Vijay

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

* Re: [dpdk-dev] pci device access from dpdk secondary process with igb_uio
  2020-02-25 15:09     ` Trahe, Fiona
@ 2020-02-25 19:45       ` vijay mohan
  0 siblings, 0 replies; 6+ messages in thread
From: vijay mohan @ 2020-02-25 19:45 UTC (permalink / raw)
  To: Trahe, Fiona; +Cc: dev, Yigit, Ferruh

Hi Fiona,
Thanks for verifying the fix. I will send this patch out for review.

Thanks,
Vijay

On Tue, 25 Feb 2020 at 07:09, Trahe, Fiona <fiona.trahe@intel.com> wrote:
>
> Hi Vijay,
>
> Thanks for debugging. We've recreated your issue and validated that this fixes it.
> Do you want to go ahead and send up a patch or will I do that?
>
> Fiona
>
>
> > -----Original Message-----
> > From: Trahe, Fiona
> > Sent: Wednesday, January 22, 2020 5:19 PM
> > To: vijay mohan <vijay1054@gmail.com>; dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>
> > Cc: Trahe, Fiona <fiona.trahe@intel.com>
> > Subject: RE: [dpdk-dev] pci device access from dpdk secondary process with igb_uio
> >
> > Hi Vijay,
> >
> > Sorry for the delay, we missed this as It arrived while on Christmas holidays.
> > We'll investigate, though it may take some time as this looks like a pci lib issue
> > and up to recently we have only been using QAT in primary processes so don't have
> > expertise yet in this area.
> >
> > If you could provide some background to your use-case for qat in primary/secondary, that may help.
> >
> > Fiona
> >
> > > -----Original Message-----
> > > From: dev <dev-bounces@dpdk.org> On Behalf Of vijay mohan
> > > Sent: Thursday, January 2, 2020 6:58 PM
> > > To: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Griffin, John <john.griffin@intel.com>
> > > Subject: Re: [dpdk-dev] pci device access from dpdk secondary process with igb_uio
> > >
> > > On Thu, 26 Dec 2019 at 16:58, vijay mohan <vijay1054@gmail.com> wrote:
> > > >
> > > > Hi All,
> > > > I am trying to use pci vf device with secondary process in a multiple process mode and finding
> > > pci_dev->mem_resource[0].addr to be NULL. This happens when the pci device is attached to
> > > igb_uio.ko but with vfio_pci it works fine.
> > > >
> > > > Looking at the pci device initialization part for secondary process, when device is presented
> > through
> > > igb_uio, (in pci_uio_map_secondary), it doesn't seems to update pci_dev->mem_resource[X].addr.
> > > For vfio-pci, it updates the addresses in pci_vfio_map_resource_secondary. With the following
> > patch, i
> > > am able to use the device from secondary process but would like to know if I am missing something.
> > > >
> > > > diff --git a/drivers/bus/pci/pci_common_uio.c b/drivers/bus/pci/pci_common_uio.c
> > > > index 7ea73db..f4dca9d 100644
> > > > --- a/drivers/bus/pci/pci_common_uio.c
> > > > +++ b/drivers/bus/pci/pci_common_uio.c
> > > > @@ -70,6 +70,7 @@
> > > >                                 }
> > > >                                 return -1;
> > > >                         }
> > > > +                       dev->mem_resource[i].addr = mapaddr;
> > > >                 }
> > > >                 return 0;
> > > >         }
> > >
> > > Hi Ferruh Yigit/John Griffin,
> > > I am trying to use QAT crypto VF device attached to igb_uio.ko with
> > > secondary process and has observed following errors while setting up
> > > the queues due to pci_dev->mem_resource[0].addr check from
> > > qat_qp_setup. mem_resource[0].addr happens to be NULL when the device
> > > is presented to dpdk through igb_uio but works fine with vfio_pci.ko.
> > > Could you please let me know if the fix mentioned above is sufficient
> > > for the device to work with secondary process.
> > >
> > > CRYPTODEV: Initialisation parameters - name: BDF_qat_sym,socket id: 0,
> > > max queue pairs: 0
> > > qat_sym_dev_create(): Created QAT SYM device BDF_qat_sym as cryptodev instance 0
> > > qat_comp_dev_create(): Creating QAT COMP device BDF_qat_comp
> > > qat_comp_dev_create(): Created QAT COMP device BDF_qat_comp as
> > > compressdev instance 0
> > > Dev config
> > > Setting up queues
> > > qat_qp_setup(): Setup qp 0 on qat pci device 0 gen 2
> > > qat_qp_setup(): Could not find VF config space (UIO driver attached?).
> > > Crypto device queue pair init failed
> > >
> > > Thanks,
> > > Vijay

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

* Re: [dpdk-dev] pci device access from dpdk secondary process with igb_uio
  2020-01-02 18:58 ` vijay mohan
  2020-01-22 17:19   ` Trahe, Fiona
@ 2020-03-04 12:32   ` Ferruh Yigit
  1 sibling, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2020-03-04 12:32 UTC (permalink / raw)
  To: vijay mohan, dev, john.griffin; +Cc: Fiona Trahe, Anatoly Burakov

On 1/2/2020 6:58 PM, vijay mohan wrote:
> On Thu, 26 Dec 2019 at 16:58, vijay mohan <vijay1054@gmail.com> wrote:
>>
>> Hi All,
>> I am trying to use pci vf device with secondary process in a multiple process mode and finding pci_dev->mem_resource[0].addr to be NULL. This happens when the pci device is attached to igb_uio.ko but with vfio_pci it works fine.
>>
>> Looking at the pci device initialization part for secondary process, when device is presented through igb_uio, (in pci_uio_map_secondary), it doesn't seems to update pci_dev->mem_resource[X].addr. For vfio-pci, it updates the addresses in pci_vfio_map_resource_secondary. With the following patch, i am able to use the device from secondary process but would like to know if I am missing something.
>>
>> diff --git a/drivers/bus/pci/pci_common_uio.c b/drivers/bus/pci/pci_common_uio.c
>> index 7ea73db..f4dca9d 100644
>> --- a/drivers/bus/pci/pci_common_uio.c
>> +++ b/drivers/bus/pci/pci_common_uio.c
>> @@ -70,6 +70,7 @@
>>                                 }
>>                                 return -1;
>>                         }
>> +                       dev->mem_resource[i].addr = mapaddr;
>>                 }
>>                 return 0;
>>         }
> 
> Hi Ferruh Yigit/John Griffin,
> I am trying to use QAT crypto VF device attached to igb_uio.ko with
> secondary process and has observed following errors while setting up
> the queues due to pci_dev->mem_resource[0].addr check from
> qat_qp_setup. mem_resource[0].addr happens to be NULL when the device
> is presented to dpdk through igb_uio but works fine with vfio_pci.ko.
> Could you please let me know if the fix mentioned above is sufficient
> for the device to work with secondary process.

Hi Vijay,

Sorry for late response.

Yes, 'dev->mem_resource[i].addr' seems not updated in the secondary process for
igb_uio, independent from being VF or PF.

And yes vfio path already updates it and your above suggested code looks good to me.

Feel free to attach following tag when the patch sent:
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>


> 
> CRYPTODEV: Initialisation parameters - name: BDF_qat_sym,socket id: 0,
> max queue pairs: 0
> qat_sym_dev_create(): Created QAT SYM device BDF_qat_sym as cryptodev instance 0
> qat_comp_dev_create(): Creating QAT COMP device BDF_qat_comp
> qat_comp_dev_create(): Created QAT COMP device BDF_qat_comp as
> compressdev instance 0
> Dev config
> Setting up queues
> qat_qp_setup(): Setup qp 0 on qat pci device 0 gen 2
> qat_qp_setup(): Could not find VF config space (UIO driver attached?).
> Crypto device queue pair init failed
> 
> Thanks,
> Vijay
> 


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

end of thread, other threads:[~2020-03-04 12:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-27  0:58 [dpdk-dev] pci device access from dpdk secondary process with igb_uio vijay mohan
2020-01-02 18:58 ` vijay mohan
2020-01-22 17:19   ` Trahe, Fiona
2020-02-25 15:09     ` Trahe, Fiona
2020-02-25 19:45       ` vijay mohan
2020-03-04 12:32   ` Ferruh Yigit

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git