[dpdk-dev,5/8] nfp: don't refer to eth_dev->pci_dev

Message ID 20170107181756.1944-6-sthemmin@microsoft.com (mailing list archive)
State Changes Requested, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

Stephen Hemminger Jan. 7, 2017, 6:17 p.m. UTC
  Later patches remove pci_dev from the ethernet device structure.
Fix the nfp code to just use it's own name when forming zone name.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 drivers/net/nfp/nfp_net.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Comments

Jan Blunck Jan. 10, 2017, 12:13 p.m. UTC | #1
On Sat, Jan 7, 2017 at 7:17 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> Later patches remove pci_dev from the ethernet device structure.
> Fix the nfp code to just use it's own name when forming zone name.
>
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> ---
>  drivers/net/nfp/nfp_net.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
> index e85315f1..970b5c84 100644
> --- a/drivers/net/nfp/nfp_net.c
> +++ b/drivers/net/nfp/nfp_net.c
> @@ -213,8 +213,7 @@ ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name,
>         char z_name[RTE_MEMZONE_NAMESIZE];
>         const struct rte_memzone *mz;
>
> -       snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
> -                dev->driver->pci_drv.driver.name,
> +       snprintf(z_name, sizeof(z_name), "nfp_%s_%u_%u",
>                  ring_name, dev->data->port_id, queue_id);
>

The driver is called 'net_nfp'.

>         mz = rte_memzone_lookup(z_name);
> @@ -1009,7 +1008,6 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
>         hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>
>         dev_info->pci_dev = RTE_DEV_TO_PCI(dev->device);
> -       dev_info->driver_name = dev->driver->pci_drv.driver.name;
>         dev_info->max_rx_queues = (uint16_t)hw->max_rx_queues;
>         dev_info->max_tx_queues = (uint16_t)hw->max_tx_queues;
>         dev_info->min_rx_bufsize = ETHER_MIN_MTU;
> --
> 2.11.0
>
  

Patch

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index e85315f1..970b5c84 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -213,8 +213,7 @@  ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name,
 	char z_name[RTE_MEMZONE_NAMESIZE];
 	const struct rte_memzone *mz;
 
-	snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
-		 dev->driver->pci_drv.driver.name,
+	snprintf(z_name, sizeof(z_name), "nfp_%s_%u_%u",
 		 ring_name, dev->data->port_id, queue_id);
 
 	mz = rte_memzone_lookup(z_name);
@@ -1009,7 +1008,6 @@  nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
 	dev_info->pci_dev = RTE_DEV_TO_PCI(dev->device);
-	dev_info->driver_name = dev->driver->pci_drv.driver.name;
 	dev_info->max_rx_queues = (uint16_t)hw->max_rx_queues;
 	dev_info->max_tx_queues = (uint16_t)hw->max_tx_queues;
 	dev_info->min_rx_bufsize = ETHER_MIN_MTU;