diff mbox series

[V1,1/2] framework/project_dpdk:replace i40evf with iavf for NIC X722

Message ID 20210108053754.13590-2-weix.xie@intel.com (mailing list archive)
State Accepted
Headers show
Series replace i40evf with iavf | expand

Commit Message

Xie, WeiX Jan. 8, 2021, 5:37 a.m. UTC
Replace i40evf with iavf in both host and vm dut for fortpark_BASE-T and fortpark_TLV.

Signed-off-by: Xie wei <weix.xie@intel.com>
---
 framework/project_dpdk.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Lijuan Tu Jan. 13, 2021, 6:43 a.m. UTC | #1
> 
> Replace i40evf with iavf in both host and vm dut for fortpark_BASE-T and
> fortpark_TLV.
> 
> Signed-off-by: Xie wei <weix.xie@intel.com>
> ---
>  framework/project_dpdk.py | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py index
> a8c4e379..36e21c42 100644
> --- a/framework/project_dpdk.py
> +++ b/framework/project_dpdk.py
> @@ -279,13 +279,19 @@ class DPDKdut(Dut):
>          if use_shared_lib == 'true' and 'Virt' not in str(self):
>              self.set_build_options({'RTE_BUILD_SHARED_LIB': 'y'})
>          kernel_driver = ''
> +        nic_name = ''
>          if 'Virt' in str(self):
>              if self.host_dut.nic:
>                  kernel_driver = self.host_dut.nic.default_driver
> +                nic_name = self.host_dut.nic.name
>          elif self.nic:
>              kernel_driver = self.nic.default_driver
> +            nic_name = self.nic.name
> 
> -        if kernel_driver == 'i40e':
> +        if nic_name in ['fortpark_TLV', 'fortpark_BASE-T']:

I don't think it's necessary to add a new variable, self.nic can handle it.

> +            self.send_expect("sed -i '/{ RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID,
> IAVF_DEV_ID_ADAPTIVE_VF) },/i { RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID,
> IAVF_DEV_ID_X722_VF) },' drivers/net/iavf/iavf_ethdev.c", "# ")
> +            self.send_expect("sed -i '/I40E_DEV_ID_X722_VF/d'
> drivers/net/i40e/i40e_ethdev_vf.c", "# ")
> +        elif kernel_driver == 'i40e':
>              self.send_expect("sed -i '/{ RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID,
> IAVF_DEV_ID_ADAPTIVE_VF) },/a { RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID,
> IAVF_DEV_ID_VF) },' drivers/net/iavf/iavf_ethdev.c", "# ")
>              self.send_expect("sed -i -e '/I40E_DEV_ID_VF/s/0x154C/0x164C/g'
> drivers/net/i40e/base/i40e_devids.h", "# ")
> 
> --
> 2.17.1
Lijuan Tu Jan. 13, 2021, 8:14 a.m. UTC | #2
> >
> > Replace i40evf with iavf in both host and vm dut for fortpark_BASE-T
> > and fortpark_TLV.
> >
> > Signed-off-by: Xie wei <weix.xie@intel.com>
> > ---
> >  framework/project_dpdk.py | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
> > index
> > a8c4e379..36e21c42 100644
> > --- a/framework/project_dpdk.py
> > +++ b/framework/project_dpdk.py
> > @@ -279,13 +279,19 @@ class DPDKdut(Dut):
> >          if use_shared_lib == 'true' and 'Virt' not in str(self):
> >              self.set_build_options({'RTE_BUILD_SHARED_LIB': 'y'})
> >          kernel_driver = ''
> > +        nic_name = ''
> >          if 'Virt' in str(self):
> >              if self.host_dut.nic:
> >                  kernel_driver = self.host_dut.nic.default_driver
> > +                nic_name = self.host_dut.nic.name
> >          elif self.nic:
> >              kernel_driver = self.nic.default_driver
> > +            nic_name = self.nic.name
> >
> > -        if kernel_driver == 'i40e':
> > +        if nic_name in ['fortpark_TLV', 'fortpark_BASE-T']:
> 
> I don't think it's necessary to add a new variable, self.nic can handle it.

Both class "DPDKdut" and "TestCase" have attribute "nic", but it's an object in DPDKdut, and nic name in TestCase, so here self.nic is not nic name.

Applied the series.

> 
> > +            self.send_expect("sed -i '/{
> > + RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID,
> > IAVF_DEV_ID_ADAPTIVE_VF) },/i { RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID,
> > IAVF_DEV_ID_X722_VF) },' drivers/net/iavf/iavf_ethdev.c", "# ")
> > +            self.send_expect("sed -i '/I40E_DEV_ID_X722_VF/d'
> > drivers/net/i40e/i40e_ethdev_vf.c", "# ")
> > +        elif kernel_driver == 'i40e':
> >              self.send_expect("sed -i '/{
> > RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID,
> > IAVF_DEV_ID_ADAPTIVE_VF) },/a { RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID,
> > IAVF_DEV_ID_VF) },' drivers/net/iavf/iavf_ethdev.c", "# ")
> >              self.send_expect("sed -i -e '/I40E_DEV_ID_VF/s/0x154C/0x164C/g'
> > drivers/net/i40e/base/i40e_devids.h", "# ")
> >
> > --
> > 2.17.1
diff mbox series

Patch

diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index a8c4e379..36e21c42 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -279,13 +279,19 @@  class DPDKdut(Dut):
         if use_shared_lib == 'true' and 'Virt' not in str(self):
             self.set_build_options({'RTE_BUILD_SHARED_LIB': 'y'})
         kernel_driver = ''
+        nic_name = ''
         if 'Virt' in str(self):
             if self.host_dut.nic:
                 kernel_driver = self.host_dut.nic.default_driver
+                nic_name = self.host_dut.nic.name
         elif self.nic:
             kernel_driver = self.nic.default_driver
+            nic_name = self.nic.name
 
-        if kernel_driver == 'i40e':
+        if nic_name in ['fortpark_TLV', 'fortpark_BASE-T']:
+            self.send_expect("sed -i '/{ RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_ADAPTIVE_VF) },/i { RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_X722_VF) },' drivers/net/iavf/iavf_ethdev.c", "# ")
+            self.send_expect("sed -i '/I40E_DEV_ID_X722_VF/d' drivers/net/i40e/i40e_ethdev_vf.c", "# ")
+        elif kernel_driver == 'i40e':
             self.send_expect("sed -i '/{ RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_ADAPTIVE_VF) },/a { RTE_PCI_DEVICE(IAVF_INTEL_VENDOR_ID, IAVF_DEV_ID_VF) },' drivers/net/iavf/iavf_ethdev.c", "# ")
             self.send_expect("sed -i -e '/I40E_DEV_ID_VF/s/0x154C/0x164C/g'  drivers/net/i40e/base/i40e_devids.h", "# ")