patches for DPDK stable branches
 help / color / mirror / Atom feed
  • * [dpdk-stable] [PATCH v2, 20.11] net/i40e: fix i40evf device initialization
           [not found] <20210825194526.14987-1-koncept1@gmail.com>
           [not found] ` <94f93212-6432-710b-1135-638e359741da@intel.com>
    @ 2021-09-17 14:44 ` Ben Magistro
      2021-09-28 21:23 ` Ben Magistro
      2021-10-12 14:17 ` [dpdk-stable] [PATCH v3] " Ben Magistro
      3 siblings, 0 replies; 7+ messages in thread
    From: Ben Magistro @ 2021-09-17 14:44 UTC (permalink / raw)
      To: stable; +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
    
    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] 7+ messages in thread
  • * [dpdk-stable] [PATCH v2, 20.11] net/i40e: fix i40evf device initialization
           [not found] <20210825194526.14987-1-koncept1@gmail.com>
           [not found] ` <94f93212-6432-710b-1135-638e359741da@intel.com>
      2021-09-17 14:44 ` [dpdk-stable] [PATCH v2, 20.11] net/i40e: fix " Ben Magistro
    @ 2021-09-28 21:23 ` Ben Magistro
      2021-10-12 14:17 ` [dpdk-stable] [PATCH v3] " Ben Magistro
      3 siblings, 0 replies; 7+ 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] 7+ messages in thread
  • * [dpdk-stable] [PATCH v3] net/i40e: fix i40evf device initialization
           [not found] <20210825194526.14987-1-koncept1@gmail.com>
                       ` (2 preceding siblings ...)
      2021-09-28 21:23 ` Ben Magistro
    @ 2021-10-12 14:17 ` Ben Magistro
      2021-11-08 11:21   ` [dpdk-stable] [dpdk-dev] " Xueming(Steven) Li
      2021-11-08 15:54   ` [dpdk-stable] [PATCH v4] " Ben Magistro
      3 siblings, 2 replies; 7+ 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] 7+ messages in thread

  • end of thread, other threads:[~2021-11-27 13:34 UTC | newest]
    
    Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
    -- links below jump to the message on this page --
         [not found] <20210825194526.14987-1-koncept1@gmail.com>
         [not found] ` <94f93212-6432-710b-1135-638e359741da@intel.com>
         [not found]   ` <11dd4ae3-0396-b237-7f2b-1484f07bb637@redhat.com>
         [not found]     ` <DM4PR12MB5373F257EB40412DB8614815A1C89@DM4PR12MB5373.namprd12.prod.outlook.com>
         [not found]       ` <9527de1a-30ac-9bc9-ad11-14fbcd5207a1@intel.com>
         [not found]         ` <DM4PR12MB537374EE140EFF70B2ADD3DCA1CE9@DM4PR12MB5373.namprd12.prod.outlook.com>
    2021-09-14  2:52           ` [dpdk-stable] [dpdk-dev] [PATCH] driver: i40evf device initialization Ben Magistro
    2021-09-17 14:44 ` [dpdk-stable] [PATCH v2, 20.11] net/i40e: fix " Ben Magistro
    2021-09-28 21:23 ` Ben Magistro
    2021-10-12 14:17 ` [dpdk-stable] [PATCH v3] " Ben Magistro
    2021-11-08 11:21   ` [dpdk-stable] [dpdk-dev] " Xueming(Steven) Li
    2021-11-08 15:54   ` [dpdk-stable] [PATCH v4] " Ben Magistro
    2021-11-27 13:34     ` [dpdk-stable][20.11] " Xueming(Steven) Li
    

    patches for DPDK stable branches
    
    This inbox may be cloned and mirrored by anyone:
    
    	git clone --mirror http://inbox.dpdk.org/stable/0 stable/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 stable stable/ http://inbox.dpdk.org/stable \
    		stable@dpdk.org
    	public-inbox-index stable
    
    Example config snippet for mirrors.
    Newsgroup available over NNTP:
    	nntp://inbox.dpdk.org/inbox.dpdk.stable
    
    
    AGPL code for this site: git clone https://public-inbox.org/public-inbox.git