DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] driver: i40evf device initialization
@ 2021-08-25 19:45 Ben Magistro
  2021-08-26 10:25 ` Ferruh Yigit
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Ben Magistro @ 2021-08-25 19:45 UTC (permalink / raw)
  To: dev; +Cc: ben.magistro, stefan.baranoff, Ben Magistro

The i40evf driver is not initializing the eth_dev attribute which
can result in a nullptr dereference. Changes were modeled after the
iavf_dev_init() per suggestion from the mailing list[1].

[1] https://mails.dpdk.org/archives/dev/2021-August/217251.html

Signed-off-by: Ben Magistro <koncept1@gmail.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 0cfe13b7b2..ccdce9a16a 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1564,8 +1564,9 @@ i40evf_dev_alarm_handler(void *param)
 static int
 i40evf_dev_init(struct rte_eth_dev *eth_dev)
 {
-	struct i40e_hw *hw
-		= I40E_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
+	struct i40e_adapter *adapter =
+		I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
+	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(adapter);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 
 	PMD_INIT_FUNC_TRACE();
@@ -1596,11 +1597,14 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
 	hw->device_id = pci_dev->id.device_id;
 	hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
 	hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
+	hw->bus.bus_id = pci_dev->addr.bus;
 	hw->bus.device = pci_dev->addr.devid;
 	hw->bus.func = pci_dev->addr.function;
 	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
 	hw->adapter_stopped = 1;
 	hw->adapter_closed = 0;
+	hw->back = I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
+	adapter->eth_dev = eth_dev;
 
 	if(i40evf_init_vf(eth_dev) != 0) {
 		PMD_INIT_LOG(ERR, "Init vf failed");
-- 
2.27.0


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

* Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
  2021-08-25 19:45 [dpdk-dev] [PATCH] driver: i40evf device initialization Ben Magistro
@ 2021-08-26 10:25 ` Ferruh Yigit
  2021-08-26 10:46   ` Kevin Traynor
  2021-09-28 21:23 ` [dpdk-dev] [PATCH v2, 20.11] net/i40e: fix " Ben Magistro
  2021-10-12 14:17 ` [dpdk-dev] [PATCH v3] " Ben Magistro
  2 siblings, 1 reply; 14+ messages in thread
From: Ferruh Yigit @ 2021-08-26 10:25 UTC (permalink / raw)
  To: Ben Magistro, dev, Beilei Xing, Luca Boccassi
  Cc: ben.magistro, stefan.baranoff, Qi Zhang, Kevin Traynor

On 8/25/2021 8:45 PM, Ben Magistro wrote:
> The i40evf driver is not initializing the eth_dev attribute which
> can result in a nullptr dereference. Changes were modeled after the
> iavf_dev_init() per suggestion from the mailing list[1].
> 
> [1] https://mails.dpdk.org/archives/dev/2021-August/217251.html
> 
> Signed-off-by: Ben Magistro <koncept1@gmail.com>

i40evf will be removed in this release. But I guess it helps for stable releases
to first merge the fixes and later removed it, not sure.

@Luca, @Kevin, do you prefer this patch directly to stable repos, or through the
main repo?
i40evf won't be tested in the main anyway, since it would be removed before -rc1
testing, so it looks like there won't be any difference from testing point of view.


> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
> index 0cfe13b7b2..ccdce9a16a 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -1564,8 +1564,9 @@ i40evf_dev_alarm_handler(void *param)
>  static int
>  i40evf_dev_init(struct rte_eth_dev *eth_dev)
>  {
> -	struct i40e_hw *hw
> -		= I40E_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
> +	struct i40e_adapter *adapter =
> +		I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
> +	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(adapter);
>  	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
>  
>  	PMD_INIT_FUNC_TRACE();
> @@ -1596,11 +1597,14 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
>  	hw->device_id = pci_dev->id.device_id;
>  	hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
>  	hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
> +	hw->bus.bus_id = pci_dev->addr.bus;
>  	hw->bus.device = pci_dev->addr.devid;
>  	hw->bus.func = pci_dev->addr.function;
>  	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
>  	hw->adapter_stopped = 1;
>  	hw->adapter_closed = 0;
> +	hw->back = I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
> +	adapter->eth_dev = eth_dev;
>  
>  	if(i40evf_init_vf(eth_dev) != 0) {
>  		PMD_INIT_LOG(ERR, "Init vf failed");
> 


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

* Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
  2021-08-26 10:25 ` Ferruh Yigit
@ 2021-08-26 10:46   ` Kevin Traynor
  2021-08-27  6:28     ` Xueming(Steven) Li
  0 siblings, 1 reply; 14+ messages in thread
From: Kevin Traynor @ 2021-08-26 10:46 UTC (permalink / raw)
  To: Ferruh Yigit, Ben Magistro, dev, Beilei Xing, Luca Boccassi,
	Christian Ehrhardt, Xueming(Steven) Li
  Cc: ben.magistro, stefan.baranoff, Qi Zhang

+ Christian and Xueming

On 26/08/2021 11:25, Ferruh Yigit wrote:
> On 8/25/2021 8:45 PM, Ben Magistro wrote:
>> The i40evf driver is not initializing the eth_dev attribute which
>> can result in a nullptr dereference. Changes were modeled after the
>> iavf_dev_init() per suggestion from the mailing list[1].
>>
>> [1] https://mails.dpdk.org/archives/dev/2021-August/217251.html
>>
>> Signed-off-by: Ben Magistro <koncept1@gmail.com>
> 
> i40evf will be removed in this release. But I guess it helps for stable releases
> to first merge the fixes and later removed it, not sure.
> 
> @Luca, @Kevin, do you prefer this patch directly to stable repos, or through the
> main repo?

I'll leave to Luca/Xueming and Christian to say if they have a
preference, but I'd guess either way is fine from stable view once it
has fixes/stable tags or LTS patch prefix (it doesn't have any of these
at present).

> i40evf won't be tested in the main anyway, since it would be removed before -rc1
> testing, so it looks like there won't be any difference from testing point of view.
> 
> 
>> ---
>>  drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
>> index 0cfe13b7b2..ccdce9a16a 100644
>> --- a/drivers/net/i40e/i40e_ethdev_vf.c
>> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
>> @@ -1564,8 +1564,9 @@ i40evf_dev_alarm_handler(void *param)
>>  static int
>>  i40evf_dev_init(struct rte_eth_dev *eth_dev)
>>  {
>> -	struct i40e_hw *hw
>> -		= I40E_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
>> +	struct i40e_adapter *adapter =
>> +		I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
>> +	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(adapter);
>>  	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
>>  
>>  	PMD_INIT_FUNC_TRACE();
>> @@ -1596,11 +1597,14 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
>>  	hw->device_id = pci_dev->id.device_id;
>>  	hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
>>  	hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
>> +	hw->bus.bus_id = pci_dev->addr.bus;
>>  	hw->bus.device = pci_dev->addr.devid;
>>  	hw->bus.func = pci_dev->addr.function;
>>  	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
>>  	hw->adapter_stopped = 1;
>>  	hw->adapter_closed = 0;
>> +	hw->back = I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
>> +	adapter->eth_dev = eth_dev;
>>  
>>  	if(i40evf_init_vf(eth_dev) != 0) {
>>  		PMD_INIT_LOG(ERR, "Init vf failed");
>>
> 


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

* Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
  2021-08-26 10:46   ` Kevin Traynor
@ 2021-08-27  6:28     ` Xueming(Steven) Li
  2021-08-30  9:43       ` Ferruh Yigit
  0 siblings, 1 reply; 14+ messages in thread
From: Xueming(Steven) Li @ 2021-08-27  6:28 UTC (permalink / raw)
  To: Kevin Traynor, Ferruh Yigit, Ben Magistro, dev, Beilei Xing,
	Luca Boccassi, Christian Ehrhardt
  Cc: ben.magistro, stefan.baranoff, Qi Zhang



> -----Original Message-----
> From: Kevin Traynor <ktraynor@redhat.com>
> Sent: Thursday, August 26, 2021 6:46 PM
> To: Ferruh Yigit <ferruh.yigit@intel.com>; Ben Magistro <koncept1@gmail.com>; dev@dpdk.org; Beilei Xing <beilei.xing@intel.com>;
> Luca Boccassi <bluca@debian.org>; Christian Ehrhardt <christian.ehrhardt@canonical.com>; Xueming(Steven) Li
> <xuemingl@nvidia.com>
> Cc: ben.magistro@trinitycyber.com; stefan.baranoff@trinitycyber.com; Qi Zhang <qi.z.zhang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
> 
> + Christian and Xueming
> 
> On 26/08/2021 11:25, Ferruh Yigit wrote:
> > On 8/25/2021 8:45 PM, Ben Magistro wrote:
> >> The i40evf driver is not initializing the eth_dev attribute which can
> >> result in a nullptr dereference. Changes were modeled after the
> >> iavf_dev_init() per suggestion from the mailing list[1].
> >>
> >> [1] https://mails.dpdk.org/archives/dev/2021-August/217251.html
> >>
> >> Signed-off-by: Ben Magistro <koncept1@gmail.com>
> >
> > i40evf will be removed in this release. But I guess it helps for
> > stable releases to first merge the fixes and later removed it, not sure.
> >
> > @Luca, @Kevin, do you prefer this patch directly to stable repos, or
> > through the main repo?
> 
> I'll leave to Luca/Xueming and Christian to say if they have a preference, but I'd guess either way is fine from stable view once it has
> fixes/stable tags or LTS patch prefix (it doesn't have any of these at present).

Yes, any option will make it being noticed by LTS maintainer:
1. patches accepted by main with "fix" in subject
2. patches accepted by main with "cc: stable@dpdk.org" in commit message
3. patches backported to LTS, sent to stable maillist with LTS prefix, for example "[20.11]"

> 
> > i40evf won't be tested in the main anyway, since it would be removed
> > before -rc1 testing, so it looks like there won't be any difference from testing point of view.
> >
> >
> >> ---
> >>  drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++--
> >>  1 file changed, 6 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> >> b/drivers/net/i40e/i40e_ethdev_vf.c
> >> index 0cfe13b7b2..ccdce9a16a 100644
> >> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> >> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> >> @@ -1564,8 +1564,9 @@ i40evf_dev_alarm_handler(void *param)  static
> >> int  i40evf_dev_init(struct rte_eth_dev *eth_dev)  {
> >> -	struct i40e_hw *hw
> >> -		= I40E_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
> >> +	struct i40e_adapter *adapter =
> >> +		I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
> >> +	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(adapter);
> >>  	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
> >>
> >>  	PMD_INIT_FUNC_TRACE();
> >> @@ -1596,11 +1597,14 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
> >>  	hw->device_id = pci_dev->id.device_id;
> >>  	hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
> >>  	hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
> >> +	hw->bus.bus_id = pci_dev->addr.bus;
> >>  	hw->bus.device = pci_dev->addr.devid;
> >>  	hw->bus.func = pci_dev->addr.function;
> >>  	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
> >>  	hw->adapter_stopped = 1;
> >>  	hw->adapter_closed = 0;
> >> +	hw->back = I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
> >> +	adapter->eth_dev = eth_dev;
> >>
> >>  	if(i40evf_init_vf(eth_dev) != 0) {
> >>  		PMD_INIT_LOG(ERR, "Init vf failed");
> >>
> >


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

* Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
  2021-08-27  6:28     ` Xueming(Steven) Li
@ 2021-08-30  9:43       ` Ferruh Yigit
  2021-09-02 12:37         ` Xueming(Steven) Li
  0 siblings, 1 reply; 14+ messages in thread
From: Ferruh Yigit @ 2021-08-30  9:43 UTC (permalink / raw)
  To: Xueming(Steven) Li, Kevin Traynor, Ben Magistro, dev,
	Beilei Xing, Luca Boccassi, Christian Ehrhardt
  Cc: ben.magistro, stefan.baranoff, Qi Zhang

On 8/27/2021 7:28 AM, Xueming(Steven) Li wrote:
> 
> 
>> -----Original Message-----
>> From: Kevin Traynor <ktraynor@redhat.com>
>> Sent: Thursday, August 26, 2021 6:46 PM
>> To: Ferruh Yigit <ferruh.yigit@intel.com>; Ben Magistro <koncept1@gmail.com>; dev@dpdk.org; Beilei Xing <beilei.xing@intel.com>;
>> Luca Boccassi <bluca@debian.org>; Christian Ehrhardt <christian.ehrhardt@canonical.com>; Xueming(Steven) Li
>> <xuemingl@nvidia.com>
>> Cc: ben.magistro@trinitycyber.com; stefan.baranoff@trinitycyber.com; Qi Zhang <qi.z.zhang@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
>>
>> + Christian and Xueming
>>
>> On 26/08/2021 11:25, Ferruh Yigit wrote:
>>> On 8/25/2021 8:45 PM, Ben Magistro wrote:
>>>> The i40evf driver is not initializing the eth_dev attribute which can
>>>> result in a nullptr dereference. Changes were modeled after the
>>>> iavf_dev_init() per suggestion from the mailing list[1].
>>>>
>>>> [1] https://mails.dpdk.org/archives/dev/2021-August/217251.html
>>>>
>>>> Signed-off-by: Ben Magistro <koncept1@gmail.com>
>>>
>>> i40evf will be removed in this release. But I guess it helps for
>>> stable releases to first merge the fixes and later removed it, not sure.
>>>
>>> @Luca, @Kevin, do you prefer this patch directly to stable repos, or
>>> through the main repo?
>>
>> I'll leave to Luca/Xueming and Christian to say if they have a preference, but I'd guess either way is fine from stable view once it has
>> fixes/stable tags or LTS patch prefix (it doesn't have any of these at present).
> 
> Yes, any option will make it being noticed by LTS maintainer:
> 1. patches accepted by main with "fix" in subject
> 2. patches accepted by main with "cc: stable@dpdk.org" in commit message
> 3. patches backported to LTS, sent to stable maillist with LTS prefix, for example "[20.11]"
> 

Thanks Xueming,

But is there a preferences for this case?

The i40evf will be removed from main repo, is it better
1- first apply the fix and remove the component from main (I assume fix still
will be bacported to LTS in this case)
or
2- remove the i40evf from main (without fix), apply the fix directly to the LTS.

Thanks,
ferruh

>>
>>> i40evf won't be tested in the main anyway, since it would be removed
>>> before -rc1 testing, so it looks like there won't be any difference from testing point of view.
>>>
>>>
>>>> ---
>>>>  drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++--
>>>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
>>>> b/drivers/net/i40e/i40e_ethdev_vf.c
>>>> index 0cfe13b7b2..ccdce9a16a 100644
>>>> --- a/drivers/net/i40e/i40e_ethdev_vf.c
>>>> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
>>>> @@ -1564,8 +1564,9 @@ i40evf_dev_alarm_handler(void *param)  static
>>>> int  i40evf_dev_init(struct rte_eth_dev *eth_dev)  {
>>>> -	struct i40e_hw *hw
>>>> -		= I40E_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
>>>> +	struct i40e_adapter *adapter =
>>>> +		I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
>>>> +	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(adapter);
>>>>  	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
>>>>
>>>>  	PMD_INIT_FUNC_TRACE();
>>>> @@ -1596,11 +1597,14 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
>>>>  	hw->device_id = pci_dev->id.device_id;
>>>>  	hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
>>>>  	hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
>>>> +	hw->bus.bus_id = pci_dev->addr.bus;
>>>>  	hw->bus.device = pci_dev->addr.devid;
>>>>  	hw->bus.func = pci_dev->addr.function;
>>>>  	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
>>>>  	hw->adapter_stopped = 1;
>>>>  	hw->adapter_closed = 0;
>>>> +	hw->back = I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
>>>> +	adapter->eth_dev = eth_dev;
>>>>
>>>>  	if(i40evf_init_vf(eth_dev) != 0) {
>>>>  		PMD_INIT_LOG(ERR, "Init vf failed");
>>>>
>>>
> 


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

* Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
  2021-08-30  9:43       ` Ferruh Yigit
@ 2021-09-02 12:37         ` Xueming(Steven) Li
  2021-09-14  2:52           ` Ben Magistro
  0 siblings, 1 reply; 14+ messages in thread
From: Xueming(Steven) Li @ 2021-09-02 12:37 UTC (permalink / raw)
  To: Ferruh Yigit, Kevin Traynor, Ben Magistro, dev, Beilei Xing,
	Luca Boccassi, Christian Ehrhardt
  Cc: ben.magistro, stefan.baranoff, Qi Zhang



> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Monday, August 30, 2021 5:43 PM
> To: Xueming(Steven) Li <xuemingl@nvidia.com>; Kevin Traynor <ktraynor@redhat.com>; Ben Magistro <koncept1@gmail.com>;
> dev@dpdk.org; Beilei Xing <beilei.xing@intel.com>; Luca Boccassi <bluca@debian.org>; Christian Ehrhardt
> <christian.ehrhardt@canonical.com>
> Cc: ben.magistro@trinitycyber.com; stefan.baranoff@trinitycyber.com; Qi Zhang <qi.z.zhang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
> 
> On 8/27/2021 7:28 AM, Xueming(Steven) Li wrote:
> >
> >
> >> -----Original Message-----
> >> From: Kevin Traynor <ktraynor@redhat.com>
> >> Sent: Thursday, August 26, 2021 6:46 PM
> >> To: Ferruh Yigit <ferruh.yigit@intel.com>; Ben Magistro
> >> <koncept1@gmail.com>; dev@dpdk.org; Beilei Xing
> >> <beilei.xing@intel.com>; Luca Boccassi <bluca@debian.org>; Christian
> >> Ehrhardt <christian.ehrhardt@canonical.com>; Xueming(Steven) Li
> >> <xuemingl@nvidia.com>
> >> Cc: ben.magistro@trinitycyber.com; stefan.baranoff@trinitycyber.com;
> >> Qi Zhang <qi.z.zhang@intel.com>
> >> Subject: Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
> >>
> >> + Christian and Xueming
> >>
> >> On 26/08/2021 11:25, Ferruh Yigit wrote:
> >>> On 8/25/2021 8:45 PM, Ben Magistro wrote:
> >>>> The i40evf driver is not initializing the eth_dev attribute which
> >>>> can result in a nullptr dereference. Changes were modeled after the
> >>>> iavf_dev_init() per suggestion from the mailing list[1].
> >>>>
> >>>> [1] https://mails.dpdk.org/archives/dev/2021-August/217251.html
> >>>>
> >>>> Signed-off-by: Ben Magistro <koncept1@gmail.com>
> >>>
> >>> i40evf will be removed in this release. But I guess it helps for
> >>> stable releases to first merge the fixes and later removed it, not sure.
> >>>
> >>> @Luca, @Kevin, do you prefer this patch directly to stable repos, or
> >>> through the main repo?
> >>
> >> I'll leave to Luca/Xueming and Christian to say if they have a
> >> preference, but I'd guess either way is fine from stable view once it has fixes/stable tags or LTS patch prefix (it doesn't have any of
> these at present).
> >
> > Yes, any option will make it being noticed by LTS maintainer:
> > 1. patches accepted by main with "fix" in subject 2. patches accepted
> > by main with "cc: stable@dpdk.org" in commit message 3. patches
> > backported to LTS, sent to stable maillist with LTS prefix, for example "[20.11]"
> >
> 
> Thanks Xueming,
> 
> But is there a preferences for this case?
> 
> The i40evf will be removed from main repo, is it better
> 1- first apply the fix and remove the component from main (I assume fix still will be bacported to LTS in this case) or
> 2- remove the i40evf from main (without fix), apply the fix directly to the LTS.

Both options will work, the first is more easy and common I guess, both 19.11 LTS and 20.11 LTS maintainer can find it.

> 
> Thanks,
> ferruh
> 
> >>
> >>> i40evf won't be tested in the main anyway, since it would be removed
> >>> before -rc1 testing, so it looks like there won't be any difference from testing point of view.
> >>>
> >>>
> >>>> ---
> >>>>  drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++--
> >>>>  1 file changed, 6 insertions(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> >>>> b/drivers/net/i40e/i40e_ethdev_vf.c
> >>>> index 0cfe13b7b2..ccdce9a16a 100644
> >>>> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> >>>> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> >>>> @@ -1564,8 +1564,9 @@ i40evf_dev_alarm_handler(void *param)  static
> >>>> int  i40evf_dev_init(struct rte_eth_dev *eth_dev)  {
> >>>> -	struct i40e_hw *hw
> >>>> -		= I40E_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
> >>>> +	struct i40e_adapter *adapter =
> >>>> +		I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
> >>>> +	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(adapter);
> >>>>  	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
> >>>>
> >>>>  	PMD_INIT_FUNC_TRACE();
> >>>> @@ -1596,11 +1597,14 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
> >>>>  	hw->device_id = pci_dev->id.device_id;
> >>>>  	hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
> >>>>  	hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
> >>>> +	hw->bus.bus_id = pci_dev->addr.bus;
> >>>>  	hw->bus.device = pci_dev->addr.devid;
> >>>>  	hw->bus.func = pci_dev->addr.function;
> >>>>  	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
> >>>>  	hw->adapter_stopped = 1;
> >>>>  	hw->adapter_closed = 0;
> >>>> +	hw->back = I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
> >>>> +	adapter->eth_dev = eth_dev;
> >>>>
> >>>>  	if(i40evf_init_vf(eth_dev) != 0) {
> >>>>  		PMD_INIT_LOG(ERR, "Init vf failed");
> >>>>
> >>>
> >


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

* Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
  2021-09-02 12:37         ` Xueming(Steven) Li
@ 2021-09-14  2:52           ` Ben Magistro
  2021-10-13 13:21             ` Ben Magistro
  0 siblings, 1 reply; 14+ messages in thread
From: Ben Magistro @ 2021-09-14  2:52 UTC (permalink / raw)
  To: Xueming(Steven) Li
  Cc: Ferruh Yigit, Kevin Traynor, dev, Beilei Xing, Luca Boccassi,
	Christian Ehrhardt, ben.magistro, stefan.baranoff, Qi Zhang,
	stable

+cc: stable@dpdk.org

Per discussions here, cc'ing stable for fix to be applied to LTS as
i40evf is being removed from next.

On Thu, Sep 2, 2021 at 8:37 AM Xueming(Steven) Li <xuemingl@nvidia.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Ferruh Yigit <ferruh.yigit@intel.com>
> > Sent: Monday, August 30, 2021 5:43 PM
> > To: Xueming(Steven) Li <xuemingl@nvidia.com>; Kevin Traynor <ktraynor@redhat.com>; Ben Magistro <koncept1@gmail.com>;
> > dev@dpdk.org; Beilei Xing <beilei.xing@intel.com>; Luca Boccassi <bluca@debian.org>; Christian Ehrhardt
> > <christian.ehrhardt@canonical.com>
> > Cc: ben.magistro@trinitycyber.com; stefan.baranoff@trinitycyber.com; Qi Zhang <qi.z.zhang@intel.com>
> > Subject: Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
> >
> > On 8/27/2021 7:28 AM, Xueming(Steven) Li wrote:
> > >
> > >
> > >> -----Original Message-----
> > >> From: Kevin Traynor <ktraynor@redhat.com>
> > >> Sent: Thursday, August 26, 2021 6:46 PM
> > >> To: Ferruh Yigit <ferruh.yigit@intel.com>; Ben Magistro
> > >> <koncept1@gmail.com>; dev@dpdk.org; Beilei Xing
> > >> <beilei.xing@intel.com>; Luca Boccassi <bluca@debian.org>; Christian
> > >> Ehrhardt <christian.ehrhardt@canonical.com>; Xueming(Steven) Li
> > >> <xuemingl@nvidia.com>
> > >> Cc: ben.magistro@trinitycyber.com; stefan.baranoff@trinitycyber.com;
> > >> Qi Zhang <qi.z.zhang@intel.com>
> > >> Subject: Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
> > >>
> > >> + Christian and Xueming
> > >>
> > >> On 26/08/2021 11:25, Ferruh Yigit wrote:
> > >>> On 8/25/2021 8:45 PM, Ben Magistro wrote:
> > >>>> The i40evf driver is not initializing the eth_dev attribute which
> > >>>> can result in a nullptr dereference. Changes were modeled after the
> > >>>> iavf_dev_init() per suggestion from the mailing list[1].
> > >>>>
> > >>>> [1] https://mails.dpdk.org/archives/dev/2021-August/217251.html
> > >>>>
> > >>>> Signed-off-by: Ben Magistro <koncept1@gmail.com>
> > >>>
> > >>> i40evf will be removed in this release. But I guess it helps for
> > >>> stable releases to first merge the fixes and later removed it, not sure.
> > >>>
> > >>> @Luca, @Kevin, do you prefer this patch directly to stable repos, or
> > >>> through the main repo?
> > >>
> > >> I'll leave to Luca/Xueming and Christian to say if they have a
> > >> preference, but I'd guess either way is fine from stable view once it has fixes/stable tags or LTS patch prefix (it doesn't have any of
> > these at present).
> > >
> > > Yes, any option will make it being noticed by LTS maintainer:
> > > 1. patches accepted by main with "fix" in subject 2. patches accepted
> > > by main with "cc: stable@dpdk.org" in commit message 3. patches
> > > backported to LTS, sent to stable maillist with LTS prefix, for example "[20.11]"
> > >
> >
> > Thanks Xueming,
> >
> > But is there a preferences for this case?
> >
> > The i40evf will be removed from main repo, is it better
> > 1- first apply the fix and remove the component from main (I assume fix still will be bacported to LTS in this case) or
> > 2- remove the i40evf from main (without fix), apply the fix directly to the LTS.
>
> Both options will work, the first is more easy and common I guess, both 19.11 LTS and 20.11 LTS maintainer can find it.
>
> >
> > Thanks,
> > ferruh
> >
> > >>
> > >>> i40evf won't be tested in the main anyway, since it would be removed
> > >>> before -rc1 testing, so it looks like there won't be any difference from testing point of view.
> > >>>
> > >>>
> > >>>> ---
> > >>>>  drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++--
> > >>>>  1 file changed, 6 insertions(+), 2 deletions(-)
> > >>>>
> > >>>> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> > >>>> b/drivers/net/i40e/i40e_ethdev_vf.c
> > >>>> index 0cfe13b7b2..ccdce9a16a 100644
> > >>>> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> > >>>> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> > >>>> @@ -1564,8 +1564,9 @@ i40evf_dev_alarm_handler(void *param)  static
> > >>>> int  i40evf_dev_init(struct rte_eth_dev *eth_dev)  {
> > >>>> -        struct i40e_hw *hw
> > >>>> -                = I40E_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
> > >>>> +        struct i40e_adapter *adapter =
> > >>>> +                I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
> > >>>> +        struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(adapter);
> > >>>>          struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
> > >>>>
> > >>>>          PMD_INIT_FUNC_TRACE();
> > >>>> @@ -1596,11 +1597,14 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
> > >>>>          hw->device_id = pci_dev->id.device_id;
> > >>>>          hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
> > >>>>          hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
> > >>>> +        hw->bus.bus_id = pci_dev->addr.bus;
> > >>>>          hw->bus.device = pci_dev->addr.devid;
> > >>>>          hw->bus.func = pci_dev->addr.function;
> > >>>>          hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
> > >>>>          hw->adapter_stopped = 1;
> > >>>>          hw->adapter_closed = 0;
> > >>>> +        hw->back = I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
> > >>>> +        adapter->eth_dev = eth_dev;
> > >>>>
> > >>>>          if(i40evf_init_vf(eth_dev) != 0) {
> > >>>>                  PMD_INIT_LOG(ERR, "Init vf failed");
> > >>>>
> > >>>
> > >
>

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

* [dpdk-dev] [PATCH v2, 20.11] net/i40e: fix i40evf device initialization
  2021-08-25 19:45 [dpdk-dev] [PATCH] driver: i40evf device initialization Ben Magistro
  2021-08-26 10:25 ` Ferruh Yigit
@ 2021-09-28 21:23 ` Ben Magistro
  2021-10-12 14:17 ` [dpdk-dev] [PATCH v3] " Ben Magistro
  2 siblings, 0 replies; 14+ messages in thread
From: Ben Magistro @ 2021-09-28 21:23 UTC (permalink / raw)
  To: dev; +Cc: stable, ben.magistro, Ben Magistro

The i40evf driver is not initializing the eth_dev attribute which
can result in a nullptr dereference. Changes were modeled after the
iavf_dev_init() per suggestion from the mailing list[1].

[1] https://mails.dpdk.org/archives/dev/2021-August/217251.html

Cc: stable@dpdk.org

Signed-off-by: Ben Magistro <koncept1@gmail.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 625981048a..1d08064b58 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1562,8 +1562,9 @@ i40evf_dev_alarm_handler(void *param)
 static int
 i40evf_dev_init(struct rte_eth_dev *eth_dev)
 {
-	struct i40e_hw *hw
-		= I40E_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
+	struct i40e_adapter *adapter =
+		I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
+	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(adapter);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 
 	PMD_INIT_FUNC_TRACE();
@@ -1594,11 +1595,14 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
 	hw->device_id = pci_dev->id.device_id;
 	hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
 	hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
+	hw->bus.bus_id = pci_dev->addr.bus;
 	hw->bus.device = pci_dev->addr.devid;
 	hw->bus.func = pci_dev->addr.function;
 	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
 	hw->adapter_stopped = 1;
 	hw->adapter_closed = 0;
+	hw->back = I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
+	adapter->eth_dev = eth_dev;
 
 	if(i40evf_init_vf(eth_dev) != 0) {
 		PMD_INIT_LOG(ERR, "Init vf failed");
-- 
2.27.0


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

* [dpdk-dev] [PATCH v3] net/i40e: fix i40evf device initialization
  2021-08-25 19:45 [dpdk-dev] [PATCH] driver: i40evf device initialization Ben Magistro
  2021-08-26 10:25 ` Ferruh Yigit
  2021-09-28 21:23 ` [dpdk-dev] [PATCH v2, 20.11] net/i40e: fix " Ben Magistro
@ 2021-10-12 14:17 ` Ben Magistro
  2021-11-08 11:21   ` Xueming(Steven) Li
  2021-11-08 15:54   ` [dpdk-dev] [PATCH v4] " Ben Magistro
  2 siblings, 2 replies; 14+ messages in thread
From: Ben Magistro @ 2021-10-12 14:17 UTC (permalink / raw)
  To: dev; +Cc: stable, ben.magistro, Ben Magistro

The i40evf driver is not initializing the eth_dev attribute which
can result in a nullptr dereference. Changes were modeled after the
iavf_dev_init() per suggestion from the mailing list[1].

[1] https://mails.dpdk.org/archives/dev/2021-August/217251.html

Fixes: 4861cde46116 ("i40e: new poll mode driver") 
Cc: stable@dpdk.org

Signed-off-by: Ben Magistro <koncept1@gmail.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 0cfe13b7b2..ccdce9a16a 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1564,8 +1564,9 @@ i40evf_dev_alarm_handler(void *param)
 static int
 i40evf_dev_init(struct rte_eth_dev *eth_dev)
 {
-	struct i40e_hw *hw
-		= I40E_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
+	struct i40e_adapter *adapter =
+		I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
+	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(adapter);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 
 	PMD_INIT_FUNC_TRACE();
@@ -1596,11 +1597,14 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
 	hw->device_id = pci_dev->id.device_id;
 	hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
 	hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
+	hw->bus.bus_id = pci_dev->addr.bus;
 	hw->bus.device = pci_dev->addr.devid;
 	hw->bus.func = pci_dev->addr.function;
 	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
 	hw->adapter_stopped = 1;
 	hw->adapter_closed = 0;
+	hw->back = I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
+	adapter->eth_dev = eth_dev;
 
 	if(i40evf_init_vf(eth_dev) != 0) {
 		PMD_INIT_LOG(ERR, "Init vf failed");
-- 
2.27.0


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

* Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
  2021-09-14  2:52           ` Ben Magistro
@ 2021-10-13 13:21             ` Ben Magistro
  2021-10-15 11:10               ` Xueming(Steven) Li
  0 siblings, 1 reply; 14+ messages in thread
From: Ben Magistro @ 2021-10-13 13:21 UTC (permalink / raw)
  To: Xueming(Steven) Li, Qi Zhang
  Cc: Ferruh Yigit, Kevin Traynor, dev, Beilei Xing, Luca Boccassi,
	Christian Ehrhardt, ben.magistro, stefan.baranoff

Hello,

Replying here as I'm a little stuck and hoping someone has some advice for
what the next steps should be.

Going from the list above of how to get this noticed by the LTS
maintainer(s), the patch, well commit message + subject were revised and
resent to the list (
https://patches.dpdk.org/project/dpdk/patch/20211012141752.6376-1-koncept1@gmail.com/)
but the i40evf has since been removed from main already so options 1 & 2
seem to no longer apply.  This seems to put us into option 3 of a
backported patch?  Is it just a subject line change then or can this be
pulled out of the "not applicable" pile still?

Thanks and appreciate the advice,

Ben Magistro

On Mon, Sep 13, 2021 at 10:52 PM Ben Magistro <koncept1@gmail.com> wrote:

> +cc: stable@dpdk.org
>
> Per discussions here, cc'ing stable for fix to be applied to LTS as
> i40evf is being removed from next.
>
> On Thu, Sep 2, 2021 at 8:37 AM Xueming(Steven) Li <xuemingl@nvidia.com>
> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Ferruh Yigit <ferruh.yigit@intel.com>
> > > Sent: Monday, August 30, 2021 5:43 PM
> > > To: Xueming(Steven) Li <xuemingl@nvidia.com>; Kevin Traynor <
> ktraynor@redhat.com>; Ben Magistro <koncept1@gmail.com>;
> > > dev@dpdk.org; Beilei Xing <beilei.xing@intel.com>; Luca Boccassi <
> bluca@debian.org>; Christian Ehrhardt
> > > <christian.ehrhardt@canonical.com>
> > > Cc: ben.magistro@trinitycyber.com; stefan.baranoff@trinitycyber.com;
> Qi Zhang <qi.z.zhang@intel.com>
> > > Subject: Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
> > >
> > > On 8/27/2021 7:28 AM, Xueming(Steven) Li wrote:
> > > >
> > > >
> > > >> -----Original Message-----
> > > >> From: Kevin Traynor <ktraynor@redhat.com>
> > > >> Sent: Thursday, August 26, 2021 6:46 PM
> > > >> To: Ferruh Yigit <ferruh.yigit@intel.com>; Ben Magistro
> > > >> <koncept1@gmail.com>; dev@dpdk.org; Beilei Xing
> > > >> <beilei.xing@intel.com>; Luca Boccassi <bluca@debian.org>;
> Christian
> > > >> Ehrhardt <christian.ehrhardt@canonical.com>; Xueming(Steven) Li
> > > >> <xuemingl@nvidia.com>
> > > >> Cc: ben.magistro@trinitycyber.com; stefan.baranoff@trinitycyber.com
> ;
> > > >> Qi Zhang <qi.z.zhang@intel.com>
> > > >> Subject: Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
> > > >>
> > > >> + Christian and Xueming
> > > >>
> > > >> On 26/08/2021 11:25, Ferruh Yigit wrote:
> > > >>> On 8/25/2021 8:45 PM, Ben Magistro wrote:
> > > >>>> The i40evf driver is not initializing the eth_dev attribute which
> > > >>>> can result in a nullptr dereference. Changes were modeled after
> the
> > > >>>> iavf_dev_init() per suggestion from the mailing list[1].
> > > >>>>
> > > >>>> [1] https://mails.dpdk.org/archives/dev/2021-August/217251.html
> > > >>>>
> > > >>>> Signed-off-by: Ben Magistro <koncept1@gmail.com>
> > > >>>
> > > >>> i40evf will be removed in this release. But I guess it helps for
> > > >>> stable releases to first merge the fixes and later removed it, not
> sure.
> > > >>>
> > > >>> @Luca, @Kevin, do you prefer this patch directly to stable repos,
> or
> > > >>> through the main repo?
> > > >>
> > > >> I'll leave to Luca/Xueming and Christian to say if they have a
> > > >> preference, but I'd guess either way is fine from stable view once
> it has fixes/stable tags or LTS patch prefix (it doesn't have any of
> > > these at present).
> > > >
> > > > Yes, any option will make it being noticed by LTS maintainer:
> > > > 1. patches accepted by main with "fix" in subject 2. patches accepted
> > > > by main with "cc: stable@dpdk.org" in commit message 3. patches
> > > > backported to LTS, sent to stable maillist with LTS prefix, for
> example "[20.11]"
> > > >
> > >
> > > Thanks Xueming,
> > >
> > > But is there a preferences for this case?
> > >
> > > The i40evf will be removed from main repo, is it better
> > > 1- first apply the fix and remove the component from main (I assume
> fix still will be bacported to LTS in this case) or
> > > 2- remove the i40evf from main (without fix), apply the fix directly
> to the LTS.
> >
> > Both options will work, the first is more easy and common I guess, both
> 19.11 LTS and 20.11 LTS maintainer can find it.
> >
> > >
> > > Thanks,
> > > ferruh
> > >
> > > >>
> > > >>> i40evf won't be tested in the main anyway, since it would be
> removed
> > > >>> before -rc1 testing, so it looks like there won't be any
> difference from testing point of view.
> > > >>>
> > > >>>
> > > >>>> ---
> > > >>>>  drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++--
> > > >>>>  1 file changed, 6 insertions(+), 2 deletions(-)
> > > >>>>
> > > >>>> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> > > >>>> b/drivers/net/i40e/i40e_ethdev_vf.c
> > > >>>> index 0cfe13b7b2..ccdce9a16a 100644
> > > >>>> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> > > >>>> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> > > >>>> @@ -1564,8 +1564,9 @@ i40evf_dev_alarm_handler(void *param)
> static
> > > >>>> int  i40evf_dev_init(struct rte_eth_dev *eth_dev)  {
> > > >>>> -        struct i40e_hw *hw
> > > >>>> -                =
> I40E_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
> > > >>>> +        struct i40e_adapter *adapter =
> > > >>>> +
> I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
> > > >>>> +        struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(adapter);
> > > >>>>          struct rte_pci_device *pci_dev =
> RTE_ETH_DEV_TO_PCI(eth_dev);
> > > >>>>
> > > >>>>          PMD_INIT_FUNC_TRACE();
> > > >>>> @@ -1596,11 +1597,14 @@ i40evf_dev_init(struct rte_eth_dev
> *eth_dev)
> > > >>>>          hw->device_id = pci_dev->id.device_id;
> > > >>>>          hw->subsystem_vendor_id =
> pci_dev->id.subsystem_vendor_id;
> > > >>>>          hw->subsystem_device_id =
> pci_dev->id.subsystem_device_id;
> > > >>>> +        hw->bus.bus_id = pci_dev->addr.bus;
> > > >>>>          hw->bus.device = pci_dev->addr.devid;
> > > >>>>          hw->bus.func = pci_dev->addr.function;
> > > >>>>          hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
> > > >>>>          hw->adapter_stopped = 1;
> > > >>>>          hw->adapter_closed = 0;
> > > >>>> +        hw->back =
> I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
> > > >>>> +        adapter->eth_dev = eth_dev;
> > > >>>>
> > > >>>>          if(i40evf_init_vf(eth_dev) != 0) {
> > > >>>>                  PMD_INIT_LOG(ERR, "Init vf failed");
> > > >>>>
> > > >>>
> > > >
> >
>

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

* Re: [dpdk-dev] [PATCH] driver: i40evf device initialization
  2021-10-13 13:21             ` Ben Magistro
@ 2021-10-15 11:10               ` Xueming(Steven) Li
  0 siblings, 0 replies; 14+ messages in thread
From: Xueming(Steven) Li @ 2021-10-15 11:10 UTC (permalink / raw)
  To: koncept1, qi.z.zhang
  Cc: ktraynor, beilei.xing, christian.ehrhardt, bluca, ben.magistro,
	ferruh.yigit, dev, stefan.baranoff

On Wed, 2021-10-13 at 09:21 -0400, Ben Magistro wrote:
> Hello,
> 
> Replying here as I'm a little stuck and hoping someone has some
> advice for what the next steps should be.
> 
> Going from the list above of how to get this noticed by the LTS
> maintainer(s), the patch, well commit message + subject were revised
> and resent to the list
> (https://patches.dpdk.org/project/dpdk/patch/20211012141752.6376-1-
> koncept1@gmail.com/) but the i40evf has since been removed from main
> already so options 1 & 2 seem to no longer apply.  This seems to put
> us into option 3 of a backported patch?  Is it just a subject line
> change then or can this be pulled out of the "not applicable" pile
> still?

Hi Ben,

Since it doesn't apply to upstream, option 3 should be good enough,
just add [20.11] or [19.11] as prefix and send to stable@dpdk.org.

Regards,
Xueming Li


> 
> Thanks and appreciate the advice,
> 
> Ben Magistro
> 
> On Mon, Sep 13, 2021 at 10:52 PM Ben Magistro <koncept1@gmail.com>
> wrote:
> > +cc: stable@dpdk.org
> > 
> > Per discussions here, cc'ing stable for fix to be applied to LTS as
> > i40evf is being removed from next.
> > 
> > On Thu, Sep 2, 2021 at 8:37 AM Xueming(Steven) Li
> > <xuemingl@nvidia.com> wrote:
> > > 
> > > 
> > > 
> > > > -----Original Message-----
> > > > From: Ferruh Yigit <ferruh.yigit@intel.com>
> > > > Sent: Monday, August 30, 2021 5:43 PM
> > > > To: Xueming(Steven) Li <xuemingl@nvidia.com>; Kevin Traynor
> > > > <ktraynor@redhat.com>; Ben Magistro <koncept1@gmail.com>;
> > > > dev@dpdk.org; Beilei Xing <beilei.xing@intel.com>; Luca
> > > > Boccassi <bluca@debian.org>; Christian Ehrhardt
> > > > <christian.ehrhardt@canonical.com>
> > > > Cc: ben.magistro@trinitycyber.com;
> > > > stefan.baranoff@trinitycyber.com; Qi Zhang
> > > > <qi.z.zhang@intel.com>
> > > > Subject: Re: [dpdk-dev] [PATCH] driver: i40evf device
> > > > initialization
> > > > 
> > > > On 8/27/2021 7:28 AM, Xueming(Steven) Li wrote:
> > > > > 
> > > > > 
> > > > > > -----Original Message-----
> > > > > > From: Kevin Traynor <ktraynor@redhat.com>
> > > > > > Sent: Thursday, August 26, 2021 6:46 PM
> > > > > > To: Ferruh Yigit <ferruh.yigit@intel.com>; Ben Magistro
> > > > > > <koncept1@gmail.com>; dev@dpdk.org; Beilei Xing
> > > > > > <beilei.xing@intel.com>; Luca Boccassi <bluca@debian.org>;
> > > > > > Christian
> > > > > > Ehrhardt <christian.ehrhardt@canonical.com>;
> > > > > > Xueming(Steven) Li
> > > > > > <xuemingl@nvidia.com>
> > > > > > Cc: ben.magistro@trinitycyber.com;
> > > > > > stefan.baranoff@trinitycyber.com;
> > > > > > Qi Zhang <qi.z.zhang@intel.com>
> > > > > > Subject: Re: [dpdk-dev] [PATCH] driver: i40evf device
> > > > > > initialization
> > > > > > 
> > > > > > + Christian and Xueming
> > > > > > 
> > > > > > On 26/08/2021 11:25, Ferruh Yigit wrote:
> > > > > > > On 8/25/2021 8:45 PM, Ben Magistro wrote:
> > > > > > > > The i40evf driver is not initializing the eth_dev
> > > > > > > > attribute which
> > > > > > > > can result in a nullptr dereference. Changes were
> > > > > > > > modeled after the
> > > > > > > > iavf_dev_init() per suggestion from the mailing
> > > > > > > > list[1].
> > > > > > > > 
> > > > > > > > [1] https://mails.dpdk.org/archives/dev/2021-
> > > > > > > > August/217251.html
> > > > > > > > 
> > > > > > > > Signed-off-by: Ben Magistro <koncept1@gmail.com>
> > > > > > > 
> > > > > > > i40evf will be removed in this release. But I guess it
> > > > > > > helps for
> > > > > > > stable releases to first merge the fixes and later
> > > > > > > removed it, not sure.
> > > > > > > 
> > > > > > > @Luca, @Kevin, do you prefer this patch directly to
> > > > > > > stable repos, or
> > > > > > > through the main repo?
> > > > > > 
> > > > > > I'll leave to Luca/Xueming and Christian to say if they
> > > > > > have a
> > > > > > preference, but I'd guess either way is fine from stable
> > > > > > view once it has fixes/stable tags or LTS patch prefix (it
> > > > > > doesn't have any of
> > > > these at present).
> > > > > 
> > > > > Yes, any option will make it being noticed by LTS maintainer:
> > > > > 1. patches accepted by main with "fix" in subject 2. patches
> > > > > accepted
> > > > > by main with "cc: stable@dpdk.org" in commit message 3.
> > > > > patches
> > > > > backported to LTS, sent to stable maillist with LTS prefix,
> > > > > for example "[20.11]"
> > > > > 
> > > > 
> > > > Thanks Xueming,
> > > > 
> > > > But is there a preferences for this case?
> > > > 
> > > > The i40evf will be removed from main repo, is it better
> > > > 1- first apply the fix and remove the component from main (I
> > > > assume fix still will be bacported to LTS in this case) or
> > > > 2- remove the i40evf from main (without fix), apply the fix
> > > > directly to the LTS.
> > > 
> > > Both options will work, the first is more easy and common I
> > > guess, both 19.11 LTS and 20.11 LTS maintainer can find it.
> > > 
> > > > 
> > > > Thanks,
> > > > ferruh
> > > > 
> > > > > > 
> > > > > > > i40evf won't be tested in the main anyway, since it would
> > > > > > > be removed
> > > > > > > before -rc1 testing, so it looks like there won't be any
> > > > > > > difference from testing point of view.
> > > > > > > 
> > > > > > > 
> > > > > > > > ---
> > > > > > > >   drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++--
> > > > > > > >   1 file changed, 6 insertions(+), 2 deletions(-)
> > > > > > > > 
> > > > > > > > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> > > > > > > > b/drivers/net/i40e/i40e_ethdev_vf.c
> > > > > > > > index 0cfe13b7b2..ccdce9a16a 100644
> > > > > > > > --- a/drivers/net/i40e/i40e_ethdev_vf.c
> > > > > > > > +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> > > > > > > > @@ -1564,8 +1564,9 @@ i40evf_dev_alarm_handler(void
> > > > > > > > *param)  static
> > > > > > > > int  i40evf_dev_init(struct rte_eth_dev *eth_dev)  {
> > > > > > > > -        struct i40e_hw *hw
> > > > > > > > -                = I40E_DEV_PRIVATE_TO_HW(eth_dev-
> > > > > > > > >data->dev_private);
> > > > > > > > +        struct i40e_adapter *adapter =
> > > > > > > > +                I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev-
> > > > > > > > >data->dev_private);
> > > > > > > > +        struct i40e_hw *hw =
> > > > > > > > I40E_DEV_PRIVATE_TO_HW(adapter);
> > > > > > > >           struct rte_pci_device *pci_dev =
> > > > > > > > RTE_ETH_DEV_TO_PCI(eth_dev);
> > > > > > > > 
> > > > > > > >           PMD_INIT_FUNC_TRACE();
> > > > > > > > @@ -1596,11 +1597,14 @@ i40evf_dev_init(struct
> > > > > > > > rte_eth_dev *eth_dev)
> > > > > > > >           hw->device_id = pci_dev->id.device_id;
> > > > > > > >           hw->subsystem_vendor_id = pci_dev-
> > > > > > > > >id.subsystem_vendor_id;
> > > > > > > >           hw->subsystem_device_id = pci_dev-
> > > > > > > > >id.subsystem_device_id;
> > > > > > > > +        hw->bus.bus_id = pci_dev->addr.bus;
> > > > > > > >           hw->bus.device = pci_dev->addr.devid;
> > > > > > > >           hw->bus.func = pci_dev->addr.function;
> > > > > > > >           hw->hw_addr = (void *)pci_dev-
> > > > > > > > >mem_resource[0].addr;
> > > > > > > >           hw->adapter_stopped = 1;
> > > > > > > >           hw->adapter_closed = 0;
> > > > > > > > +        hw->back =
> > > > > > > > I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data-
> > > > > > > > >dev_private);
> > > > > > > > +        adapter->eth_dev = eth_dev;
> > > > > > > > 
> > > > > > > >           if(i40evf_init_vf(eth_dev) != 0) {
> > > > > > > >                   PMD_INIT_LOG(ERR, "Init vf failed");
> > > > > > > > 
> > > > > > > 
> > > > > 
> > > 


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

* Re: [dpdk-dev] [PATCH v3] net/i40e: fix i40evf device initialization
  2021-10-12 14:17 ` [dpdk-dev] [PATCH v3] " Ben Magistro
@ 2021-11-08 11:21   ` Xueming(Steven) Li
  2021-11-08 15:54   ` [dpdk-dev] [PATCH v4] " Ben Magistro
  1 sibling, 0 replies; 14+ messages in thread
From: Xueming(Steven) Li @ 2021-11-08 11:21 UTC (permalink / raw)
  To: koncept1, dev; +Cc: ben.magistro, stable

On Tue, 2021-10-12 at 14:17 +0000, Ben Magistro wrote:
> The i40evf driver is not initializing the eth_dev attribute which
> can result in a nullptr dereference. Changes were modeled after the
> iavf_dev_init() per suggestion from the mailing list[1].
> 
> [1] https://mails.dpdk.org/archives/dev/2021-August/217251.html
> 
> Fixes: 4861cde46116 ("i40e: new poll mode driver") 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ben Magistro <koncept1@gmail.com>
> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
> index 0cfe13b7b2..ccdce9a16a 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -1564,8 +1564,9 @@ i40evf_dev_alarm_handler(void *param)
>  static int
>  i40evf_dev_init(struct rte_eth_dev *eth_dev)
>  {
> -	struct i40e_hw *hw
> -		= I40E_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
> +	struct i40e_adapter *adapter =
> +		I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
> +	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(adapter);
>  	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
>  
>  	PMD_INIT_FUNC_TRACE();
> @@ -1596,11 +1597,14 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
>  	hw->device_id = pci_dev->id.device_id;
>  	hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
>  	hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
> +	hw->bus.bus_id = pci_dev->addr.bus;
>  	hw->bus.device = pci_dev->addr.devid;
>  	hw->bus.func = pci_dev->addr.function;
>  	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
>  	hw->adapter_stopped = 1;
>  	hw->adapter_closed = 0;
> +	hw->back = I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
> +	adapter->eth_dev = eth_dev;
>  
>  	if(i40evf_init_vf(eth_dev) != 0) {
>  		PMD_INIT_LOG(ERR, "Init vf failed");

Hi Ben,

There is compilation error, could you rebase with tag v20.11.3?


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

* [dpdk-dev] [PATCH v4] net/i40e: fix i40evf device initialization
  2021-10-12 14:17 ` [dpdk-dev] [PATCH v3] " Ben Magistro
  2021-11-08 11:21   ` Xueming(Steven) Li
@ 2021-11-08 15:54   ` Ben Magistro
  2021-11-27 13:34     ` [dpdk-stable][20.11] " Xueming(Steven) Li
  1 sibling, 1 reply; 14+ messages in thread
From: Ben Magistro @ 2021-11-08 15:54 UTC (permalink / raw)
  To: dev; +Cc: stable, ben.magistro, Ben Magistro

The i40evf driver is not initializing the eth_dev attribute which
can result in a nullptr dereference. Changes were modeled after the
iavf_dev_init() per suggestion from the mailing list[1] and
i40evf_init_vf().

[1] https://mails.dpdk.org/archives/dev/2021-August/217251.html

Rebased on v20.11.3.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org

Signed-off-by: Ben Magistro <koncept1@gmail.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 625981048a..adfe4f12f7 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1564,6 +1564,7 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
 {
 	struct i40e_hw *hw
 		= I40E_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
+	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(eth_dev->data->dev_private);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 
 	PMD_INIT_FUNC_TRACE();
@@ -1594,12 +1595,17 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
 	hw->device_id = pci_dev->id.device_id;
 	hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id;
 	hw->subsystem_device_id = pci_dev->id.subsystem_device_id;
+	hw->bus.bus_id = pci_dev->addr.bus;
 	hw->bus.device = pci_dev->addr.devid;
 	hw->bus.func = pci_dev->addr.function;
 	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
 	hw->adapter_stopped = 1;
 	hw->adapter_closed = 0;
 
+	vf->adapter = I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private);
+	vf->dev_data = eth_dev->data;
+	hw->back = I40E_DEV_PRIVATE_TO_ADAPTER(vf);
+
 	if(i40evf_init_vf(eth_dev) != 0) {
 		PMD_INIT_LOG(ERR, "Init vf failed");
 		return -1;
-- 
2.27.0


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

* Re: [dpdk-stable][20.11] [PATCH v4] net/i40e: fix i40evf device initialization
  2021-11-08 15:54   ` [dpdk-dev] [PATCH v4] " Ben Magistro
@ 2021-11-27 13:34     ` Xueming(Steven) Li
  0 siblings, 0 replies; 14+ messages in thread
From: Xueming(Steven) Li @ 2021-11-27 13:34 UTC (permalink / raw)
  To: koncept1, dev; +Cc: ben.magistro, stable

On Mon, 2021-11-08 at 15:54 +0000, Ben Magistro wrote:
> The i40evf driver is not initializing the eth_dev attribute which
> can result in a nullptr dereference. Changes were modeled after the
> iavf_dev_init() per suggestion from the mailing list[1] and
> i40evf_init_vf().
> 
> [1] https://mails.dpdk.org/archives/dev/2021-August/217251.html
> 
> Rebased on v20.11.3.
> 
> Fixes: 4861cde46116 ("i40e: new poll mode driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ben Magistro <koncept1@gmail.com>
> ---


Hi Ben,

Applied to 20.11.4 list, thanks!

Best Regards,
Xueming Li

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

end of thread, other threads:[~2021-11-27 13:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 19:45 [dpdk-dev] [PATCH] driver: i40evf device initialization Ben Magistro
2021-08-26 10:25 ` Ferruh Yigit
2021-08-26 10:46   ` Kevin Traynor
2021-08-27  6:28     ` Xueming(Steven) Li
2021-08-30  9:43       ` Ferruh Yigit
2021-09-02 12:37         ` Xueming(Steven) Li
2021-09-14  2:52           ` Ben Magistro
2021-10-13 13:21             ` Ben Magistro
2021-10-15 11:10               ` Xueming(Steven) Li
2021-09-28 21:23 ` [dpdk-dev] [PATCH v2, 20.11] net/i40e: fix " Ben Magistro
2021-10-12 14:17 ` [dpdk-dev] [PATCH v3] " Ben Magistro
2021-11-08 11:21   ` Xueming(Steven) Li
2021-11-08 15:54   ` [dpdk-dev] [PATCH v4] " Ben Magistro
2021-11-27 13:34     ` [dpdk-stable][20.11] " Xueming(Steven) Li

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