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

Message ID 20170107181756.1944-3-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 i40e code to just use it's own name when forming zone name.

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

Comments

Jan Blunck Jan. 10, 2017, 12:08 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 i40e code to just use it's own name when forming zone name.
>
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> ---
>  drivers/net/i40e/i40e_fdir.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
> index 335bf15c..68a2523c 100644
> --- a/drivers/net/i40e/i40e_fdir.c
> +++ b/drivers/net/i40e/i40e_fdir.c
> @@ -250,8 +250,7 @@ i40e_fdir_setup(struct i40e_pf *pf)
>         }
>
>         /* reserve memory for the fdir programming packet */
> -       snprintf(z_name, sizeof(z_name), "%s_%s_%d",
> -                       eth_dev->driver->pci_drv.driver.name,
> +       snprintf(z_name, sizeof(z_name), "i40e_%s_%d",

The driver is called 'net_i40e'.

>                         I40E_FDIR_MZ_NAME,
>                         eth_dev->data->port_id);
>         mz = i40e_memzone_reserve(z_name, I40E_FDIR_PKT_LEN, SOCKET_ID_ANY);
> --
> 2.11.0
>
  
Stephen Hemminger Jan. 10, 2017, 5:57 p.m. UTC | #2
On Tue, 10 Jan 2017 13:08:30 +0100
Jan Blunck <jblunck@infradead.org> wrote:

> 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 i40e code to just use it's own name when forming zone name.
> >
> > Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
> > ---
> >  drivers/net/i40e/i40e_fdir.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
> > index 335bf15c..68a2523c 100644
> > --- a/drivers/net/i40e/i40e_fdir.c
> > +++ b/drivers/net/i40e/i40e_fdir.c
> > @@ -250,8 +250,7 @@ i40e_fdir_setup(struct i40e_pf *pf)
> >         }
> >
> >         /* reserve memory for the fdir programming packet */
> > -       snprintf(z_name, sizeof(z_name), "%s_%s_%d",
> > -                       eth_dev->driver->pci_drv.driver.name,
> > +       snprintf(z_name, sizeof(z_name), "i40e_%s_%d",  
> 
> The driver is called 'net_i40e'.

It really doesn't matter. The memory name is just so that primary and secondary
find the same resources.  Having net_ on the front doesn't change or help.
  
Jan Blunck Jan. 11, 2017, 7:55 a.m. UTC | #3
On Tue, Jan 10, 2017 at 6:57 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> On Tue, 10 Jan 2017 13:08:30 +0100
> Jan Blunck <jblunck@infradead.org> wrote:
>
>> 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 i40e code to just use it's own name when forming zone name.
>> >
>> > Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
>> > ---
>> >  drivers/net/i40e/i40e_fdir.c | 3 +--
>> >  1 file changed, 1 insertion(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
>> > index 335bf15c..68a2523c 100644
>> > --- a/drivers/net/i40e/i40e_fdir.c
>> > +++ b/drivers/net/i40e/i40e_fdir.c
>> > @@ -250,8 +250,7 @@ i40e_fdir_setup(struct i40e_pf *pf)
>> >         }
>> >
>> >         /* reserve memory for the fdir programming packet */
>> > -       snprintf(z_name, sizeof(z_name), "%s_%s_%d",
>> > -                       eth_dev->driver->pci_drv.driver.name,
>> > +       snprintf(z_name, sizeof(z_name), "i40e_%s_%d",
>>
>> The driver is called 'net_i40e'.
>
> It really doesn't matter. The memory name is just so that primary and secondary
> find the same resources.  Having net_ on the front doesn't change or help.

I understand. Still David Marchand just recently went through the
exercise to align all driver names and their usage.

Is there a reason why you didn't choose to use eth_dev->data->drv_name?
  

Patch

diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index 335bf15c..68a2523c 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -250,8 +250,7 @@  i40e_fdir_setup(struct i40e_pf *pf)
 	}
 
 	/* reserve memory for the fdir programming packet */
-	snprintf(z_name, sizeof(z_name), "%s_%s_%d",
-			eth_dev->driver->pci_drv.driver.name,
+	snprintf(z_name, sizeof(z_name), "i40e_%s_%d",
 			I40E_FDIR_MZ_NAME,
 			eth_dev->data->port_id);
 	mz = i40e_memzone_reserve(z_name, I40E_FDIR_PKT_LEN, SOCKET_ID_ANY);