* [dpdk-dev] [PATCH] i40e: workaround for XL710 performance @ 2014-12-24 7:14 Helin Zhang 2014-12-24 14:55 ` Neil Horman 2014-12-29 1:41 ` [dpdk-dev] [PATCH v2] " Helin Zhang 0 siblings, 2 replies; 10+ messages in thread From: Helin Zhang @ 2014-12-24 7:14 UTC (permalink / raw) To: dev on XL710, performance number is far from the expectation on recent firmware versions, if promiscuous mode is disabled, or promiscuous mode is enabled and port MAC address is equal to the packet destination MAC address. The fix for this issue may not be integrated in the following firmware version. So the workaround in software driver is needed. It needs to modify the initial values of 2 internal only registers which is the same 2 of 3 registers of it did for X710. Note that the workaround can be removed when it is fixed in firmware in the future. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- lib/librte_pmd_i40e/i40e_ethdev.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index b47a3d2..3bb75d8 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -5327,21 +5327,30 @@ i40e_debug_read_register(struct i40e_hw *hw, uint32_t addr, uint64_t *val) /* * On X710, performance number is far from the expectation on recent firmware - * versions. The fix for this issue may not be integrated in the following + * versions; on XL710, performance number is also far from the expectation on + * recent firmware versions, if promiscuous mode is disabled, or promiscuous + * mode is enabled and port MAC address is equal to the packet destination MAC + * address. The fix for this issue may not be integrated in the following * firmware version. So the workaround in software driver is needed. It needs - * to modify the initial values of 3 internal only registers. Note that the - * workaround can be removed when it is fixed in firmware in the future. + * to modify the initial values of 3 internal only registers for X710, and the + * same 2 internal registers for XL710. Note that the workaround can be removed + * when it is fixed in firmware in the future. */ -static void -i40e_configure_registers(struct i40e_hw *hw) -{ -#define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 -#define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 -#define I40E_GL_SWR_PM_UP_THR 0x269FBC + +/* For both X710 and XL710 */ #define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 +#define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 + #define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 +#define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 + +/* For X710 only */ #define I40E_GL_SWR_PM_UP_THR_VALUE 0x03030303 +#define I40E_GL_SWR_PM_UP_THR 0x269FBC +static void +i40e_configure_registers(struct i40e_hw *hw) +{ static const struct { uint32_t addr; uint64_t val; @@ -5354,11 +5363,11 @@ i40e_configure_registers(struct i40e_hw *hw) uint32_t i; int ret; - /* Below fix is for X710 only */ - if (i40e_is_40G_device(hw->device_id)) - return; - for (i = 0; i < RTE_DIM(reg_table); i++) { + if ((i40e_is_40G_device(hw->device_id)) && + (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR)) + continue; + ret = i40e_debug_read_register(hw, reg_table[i].addr, ®); if (ret < 0) { PMD_DRV_LOG(ERR, "Failed to read from 0x%"PRIx32, -- 1.9.3 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] i40e: workaround for XL710 performance 2014-12-24 7:14 [dpdk-dev] [PATCH] i40e: workaround for XL710 performance Helin Zhang @ 2014-12-24 14:55 ` Neil Horman 2014-12-25 0:20 ` Zhang, Helin 2014-12-29 1:41 ` [dpdk-dev] [PATCH v2] " Helin Zhang 1 sibling, 1 reply; 10+ messages in thread From: Neil Horman @ 2014-12-24 14:55 UTC (permalink / raw) To: Helin Zhang; +Cc: dev On Wed, Dec 24, 2014 at 03:14:08PM +0800, Helin Zhang wrote: > on XL710, performance number is far from the expectation on recent > firmware versions, if promiscuous mode is disabled, or promiscuous > mode is enabled and port MAC address is equal to the packet > destination MAC address. The fix for this issue may not be integrated > in the following firmware version. So the workaround in software > driver is needed. It needs to modify the initial values of 2 internal > only registers which is the same 2 of 3 registers of it did for X710. > Note that the workaround can be removed when it is fixed in firmware > in the future. > > Signed-off-by: Helin Zhang <helin.zhang@intel.com> > --- > lib/librte_pmd_i40e/i40e_ethdev.c | 35 ++++++++++++++++++++++------------- > 1 file changed, 22 insertions(+), 13 deletions(-) > > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c > index b47a3d2..3bb75d8 100644 > --- a/lib/librte_pmd_i40e/i40e_ethdev.c > +++ b/lib/librte_pmd_i40e/i40e_ethdev.c > @@ -5327,21 +5327,30 @@ i40e_debug_read_register(struct i40e_hw *hw, uint32_t addr, uint64_t *val) > > /* > * On X710, performance number is far from the expectation on recent firmware > - * versions. The fix for this issue may not be integrated in the following > + * versions; on XL710, performance number is also far from the expectation on > + * recent firmware versions, if promiscuous mode is disabled, or promiscuous > + * mode is enabled and port MAC address is equal to the packet destination MAC > + * address. The fix for this issue may not be integrated in the following > * firmware version. So the workaround in software driver is needed. It needs > - * to modify the initial values of 3 internal only registers. Note that the > - * workaround can be removed when it is fixed in firmware in the future. > + * to modify the initial values of 3 internal only registers for X710, and the > + * same 2 internal registers for XL710. Note that the workaround can be removed > + * when it is fixed in firmware in the future. Wouldn't it be preferable to add a firmware version check to this code so that a single driver can handle both cards with old and 'fixed' firmware? That way nothing needs to be removed and all i40e cards will have a consistent behavior Neil > */ > -static void > -i40e_configure_registers(struct i40e_hw *hw) > -{ > -#define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 > -#define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 > -#define I40E_GL_SWR_PM_UP_THR 0x269FBC > + > +/* For both X710 and XL710 */ > #define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 > +#define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 > + > #define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 > +#define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 > + > +/* For X710 only */ > #define I40E_GL_SWR_PM_UP_THR_VALUE 0x03030303 > +#define I40E_GL_SWR_PM_UP_THR 0x269FBC > > +static void > +i40e_configure_registers(struct i40e_hw *hw) > +{ > static const struct { > uint32_t addr; > uint64_t val; > @@ -5354,11 +5363,11 @@ i40e_configure_registers(struct i40e_hw *hw) > uint32_t i; > int ret; > > - /* Below fix is for X710 only */ > - if (i40e_is_40G_device(hw->device_id)) > - return; > - > for (i = 0; i < RTE_DIM(reg_table); i++) { > + if ((i40e_is_40G_device(hw->device_id)) && > + (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR)) > + continue; > + > ret = i40e_debug_read_register(hw, reg_table[i].addr, ®); > if (ret < 0) { > PMD_DRV_LOG(ERR, "Failed to read from 0x%"PRIx32, > -- > 1.9.3 > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] i40e: workaround for XL710 performance 2014-12-24 14:55 ` Neil Horman @ 2014-12-25 0:20 ` Zhang, Helin 2014-12-26 14:28 ` Neil Horman 0 siblings, 1 reply; 10+ messages in thread From: Zhang, Helin @ 2014-12-25 0:20 UTC (permalink / raw) To: Neil Horman; +Cc: dev Hi Neil > -----Original Message----- > From: Neil Horman [mailto:nhorman@tuxdriver.com] > Sent: Wednesday, December 24, 2014 10:55 PM > To: Zhang, Helin > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] i40e: workaround for XL710 performance > > On Wed, Dec 24, 2014 at 03:14:08PM +0800, Helin Zhang wrote: > > on XL710, performance number is far from the expectation on recent > > firmware versions, if promiscuous mode is disabled, or promiscuous > > mode is enabled and port MAC address is equal to the packet > > destination MAC address. The fix for this issue may not be integrated > > in the following firmware version. So the workaround in software > > driver is needed. It needs to modify the initial values of 2 internal > > only registers which is the same 2 of 3 registers of it did for X710. > > Note that the workaround can be removed when it is fixed in firmware > > in the future. > > > > Signed-off-by: Helin Zhang <helin.zhang@intel.com> > > --- > > lib/librte_pmd_i40e/i40e_ethdev.c | 35 > > ++++++++++++++++++++++------------- > > 1 file changed, 22 insertions(+), 13 deletions(-) > > > > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c > > b/lib/librte_pmd_i40e/i40e_ethdev.c > > index b47a3d2..3bb75d8 100644 > > --- a/lib/librte_pmd_i40e/i40e_ethdev.c > > +++ b/lib/librte_pmd_i40e/i40e_ethdev.c > > @@ -5327,21 +5327,30 @@ i40e_debug_read_register(struct i40e_hw *hw, > > uint32_t addr, uint64_t *val) > > > > /* > > * On X710, performance number is far from the expectation on recent > > firmware > > - * versions. The fix for this issue may not be integrated in the > > following > > + * versions; on XL710, performance number is also far from the > > + expectation on > > + * recent firmware versions, if promiscuous mode is disabled, or > > + promiscuous > > + * mode is enabled and port MAC address is equal to the packet > > + destination MAC > > + * address. The fix for this issue may not be integrated in the > > + following > > * firmware version. So the workaround in software driver is needed. > > It needs > > - * to modify the initial values of 3 internal only registers. Note > > that the > > - * workaround can be removed when it is fixed in firmware in the future. > > + * to modify the initial values of 3 internal only registers for > > + X710, and the > > + * same 2 internal registers for XL710. Note that the workaround can > > + be removed > > + * when it is fixed in firmware in the future. > > Wouldn't it be preferable to add a firmware version check to this code so that a > single driver can handle both cards with old and 'fixed' firmware? That way > nothing needs to be removed and all i40e cards will have a consistent behavior > Neil Yes, good idea! The problem is that no firmware contains this fix till now, firmware guys even cannot tell me which version will have this fix at this moment. As it reads the registers first, and compares if it is what we wanted, and then decides if a write is needed or not. With this, removing this piece of code is not actually needed even a fix occur in the future, though the code will be redundant. Thank you for the comments! Regards, Helin > > > */ > > -static void > > -i40e_configure_registers(struct i40e_hw *hw) -{ > > -#define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 > > -#define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 > > -#define I40E_GL_SWR_PM_UP_THR 0x269FBC > > + > > +/* For both X710 and XL710 */ > > #define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 > > +#define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 > > + > > #define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 > > +#define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 > > + > > +/* For X710 only */ > > #define I40E_GL_SWR_PM_UP_THR_VALUE 0x03030303 > > +#define I40E_GL_SWR_PM_UP_THR 0x269FBC > > > > +static void > > +i40e_configure_registers(struct i40e_hw *hw) { > > static const struct { > > uint32_t addr; > > uint64_t val; > > @@ -5354,11 +5363,11 @@ i40e_configure_registers(struct i40e_hw *hw) > > uint32_t i; > > int ret; > > > > - /* Below fix is for X710 only */ > > - if (i40e_is_40G_device(hw->device_id)) > > - return; > > - > > for (i = 0; i < RTE_DIM(reg_table); i++) { > > + if ((i40e_is_40G_device(hw->device_id)) && > > + (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR)) > > + continue; > > + > > ret = i40e_debug_read_register(hw, reg_table[i].addr, ®); > > if (ret < 0) { > > PMD_DRV_LOG(ERR, "Failed to read from 0x%"PRIx32, > > -- > > 1.9.3 > > > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] i40e: workaround for XL710 performance 2014-12-25 0:20 ` Zhang, Helin @ 2014-12-26 14:28 ` Neil Horman 2014-12-28 13:22 ` Zhang, Helin 0 siblings, 1 reply; 10+ messages in thread From: Neil Horman @ 2014-12-26 14:28 UTC (permalink / raw) To: Zhang, Helin; +Cc: dev On Thu, Dec 25, 2014 at 12:20:11AM +0000, Zhang, Helin wrote: > Hi Neil > > > -----Original Message----- > > From: Neil Horman [mailto:nhorman@tuxdriver.com] > > Sent: Wednesday, December 24, 2014 10:55 PM > > To: Zhang, Helin > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] i40e: workaround for XL710 performance > > > > On Wed, Dec 24, 2014 at 03:14:08PM +0800, Helin Zhang wrote: > > > on XL710, performance number is far from the expectation on recent > > > firmware versions, if promiscuous mode is disabled, or promiscuous > > > mode is enabled and port MAC address is equal to the packet > > > destination MAC address. The fix for this issue may not be integrated > > > in the following firmware version. So the workaround in software > > > driver is needed. It needs to modify the initial values of 2 internal > > > only registers which is the same 2 of 3 registers of it did for X710. > > > Note that the workaround can be removed when it is fixed in firmware > > > in the future. > > > > > > Signed-off-by: Helin Zhang <helin.zhang@intel.com> > > > --- > > > lib/librte_pmd_i40e/i40e_ethdev.c | 35 > > > ++++++++++++++++++++++------------- > > > 1 file changed, 22 insertions(+), 13 deletions(-) > > > > > > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c > > > b/lib/librte_pmd_i40e/i40e_ethdev.c > > > index b47a3d2..3bb75d8 100644 > > > --- a/lib/librte_pmd_i40e/i40e_ethdev.c > > > +++ b/lib/librte_pmd_i40e/i40e_ethdev.c > > > @@ -5327,21 +5327,30 @@ i40e_debug_read_register(struct i40e_hw *hw, > > > uint32_t addr, uint64_t *val) > > > > > > /* > > > * On X710, performance number is far from the expectation on recent > > > firmware > > > - * versions. The fix for this issue may not be integrated in the > > > following > > > + * versions; on XL710, performance number is also far from the > > > + expectation on > > > + * recent firmware versions, if promiscuous mode is disabled, or > > > + promiscuous > > > + * mode is enabled and port MAC address is equal to the packet > > > + destination MAC > > > + * address. The fix for this issue may not be integrated in the > > > + following > > > * firmware version. So the workaround in software driver is needed. > > > It needs > > > - * to modify the initial values of 3 internal only registers. Note > > > that the > > > - * workaround can be removed when it is fixed in firmware in the future. > > > + * to modify the initial values of 3 internal only registers for > > > + X710, and the > > > + * same 2 internal registers for XL710. Note that the workaround can > > > + be removed > > > + * when it is fixed in firmware in the future. > > > > Wouldn't it be preferable to add a firmware version check to this code so that a > > single driver can handle both cards with old and 'fixed' firmware? That way > > nothing needs to be removed and all i40e cards will have a consistent behavior > > Neil > Yes, good idea! > The problem is that no firmware contains this fix till now, firmware guys even > cannot tell me which version will have this fix at this moment. > As it reads the registers first, and compares if it is what we wanted, and then > decides if a write is needed or not. With this, removing this piece of code is not > actually needed even a fix occur in the future, though the code will be redundant. > Very well, lets just make sure when it is fixed, the driver works with both patched and unpatched firmware Acked-by: Neil Horman <nhorman@tuxdriver.com> > Thank you for the comments! > > Regards, > Helin > > > > > > */ > > > -static void > > > -i40e_configure_registers(struct i40e_hw *hw) -{ > > > -#define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 > > > -#define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 > > > -#define I40E_GL_SWR_PM_UP_THR 0x269FBC > > > + > > > +/* For both X710 and XL710 */ > > > #define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 > > > +#define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 > > > + > > > #define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 > > > +#define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 > > > + > > > +/* For X710 only */ > > > #define I40E_GL_SWR_PM_UP_THR_VALUE 0x03030303 > > > +#define I40E_GL_SWR_PM_UP_THR 0x269FBC > > > > > > +static void > > > +i40e_configure_registers(struct i40e_hw *hw) { > > > static const struct { > > > uint32_t addr; > > > uint64_t val; > > > @@ -5354,11 +5363,11 @@ i40e_configure_registers(struct i40e_hw *hw) > > > uint32_t i; > > > int ret; > > > > > > - /* Below fix is for X710 only */ > > > - if (i40e_is_40G_device(hw->device_id)) > > > - return; > > > - > > > for (i = 0; i < RTE_DIM(reg_table); i++) { > > > + if ((i40e_is_40G_device(hw->device_id)) && > > > + (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR)) > > > + continue; > > > + > > > ret = i40e_debug_read_register(hw, reg_table[i].addr, ®); > > > if (ret < 0) { > > > PMD_DRV_LOG(ERR, "Failed to read from 0x%"PRIx32, > > > -- > > > 1.9.3 > > > > > > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] i40e: workaround for XL710 performance 2014-12-26 14:28 ` Neil Horman @ 2014-12-28 13:22 ` Zhang, Helin 0 siblings, 0 replies; 10+ messages in thread From: Zhang, Helin @ 2014-12-28 13:22 UTC (permalink / raw) To: Neil Horman; +Cc: dev Hi Neil Great to have your Ack! Thank you very much! Regards, Helin > -----Original Message----- > From: Neil Horman [mailto:nhorman@tuxdriver.com] > Sent: Friday, December 26, 2014 10:29 PM > To: Zhang, Helin > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] i40e: workaround for XL710 performance > > On Thu, Dec 25, 2014 at 12:20:11AM +0000, Zhang, Helin wrote: > > Hi Neil > > > > > -----Original Message----- > > > From: Neil Horman [mailto:nhorman@tuxdriver.com] > > > Sent: Wednesday, December 24, 2014 10:55 PM > > > To: Zhang, Helin > > > Cc: dev@dpdk.org > > > Subject: Re: [dpdk-dev] [PATCH] i40e: workaround for XL710 > > > performance > > > > > > On Wed, Dec 24, 2014 at 03:14:08PM +0800, Helin Zhang wrote: > > > > on XL710, performance number is far from the expectation on recent > > > > firmware versions, if promiscuous mode is disabled, or promiscuous > > > > mode is enabled and port MAC address is equal to the packet > > > > destination MAC address. The fix for this issue may not be > > > > integrated in the following firmware version. So the workaround in > > > > software driver is needed. It needs to modify the initial values > > > > of 2 internal only registers which is the same 2 of 3 registers of it did for > X710. > > > > Note that the workaround can be removed when it is fixed in > > > > firmware in the future. > > > > > > > > Signed-off-by: Helin Zhang <helin.zhang@intel.com> > > > > --- > > > > lib/librte_pmd_i40e/i40e_ethdev.c | 35 > > > > ++++++++++++++++++++++------------- > > > > 1 file changed, 22 insertions(+), 13 deletions(-) > > > > > > > > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c > > > > b/lib/librte_pmd_i40e/i40e_ethdev.c > > > > index b47a3d2..3bb75d8 100644 > > > > --- a/lib/librte_pmd_i40e/i40e_ethdev.c > > > > +++ b/lib/librte_pmd_i40e/i40e_ethdev.c > > > > @@ -5327,21 +5327,30 @@ i40e_debug_read_register(struct i40e_hw > > > > *hw, uint32_t addr, uint64_t *val) > > > > > > > > /* > > > > * On X710, performance number is far from the expectation on > > > > recent firmware > > > > - * versions. The fix for this issue may not be integrated in the > > > > following > > > > + * versions; on XL710, performance number is also far from the > > > > + expectation on > > > > + * recent firmware versions, if promiscuous mode is disabled, or > > > > + promiscuous > > > > + * mode is enabled and port MAC address is equal to the packet > > > > + destination MAC > > > > + * address. The fix for this issue may not be integrated in the > > > > + following > > > > * firmware version. So the workaround in software driver is needed. > > > > It needs > > > > - * to modify the initial values of 3 internal only registers. > > > > Note that the > > > > - * workaround can be removed when it is fixed in firmware in the future. > > > > + * to modify the initial values of 3 internal only registers for > > > > + X710, and the > > > > + * same 2 internal registers for XL710. Note that the workaround > > > > + can be removed > > > > + * when it is fixed in firmware in the future. > > > > > > Wouldn't it be preferable to add a firmware version check to this > > > code so that a single driver can handle both cards with old and > > > 'fixed' firmware? That way nothing needs to be removed and all i40e > > > cards will have a consistent behavior Neil > > Yes, good idea! > > The problem is that no firmware contains this fix till now, firmware > > guys even cannot tell me which version will have this fix at this moment. > > As it reads the registers first, and compares if it is what we wanted, > > and then decides if a write is needed or not. With this, removing this > > piece of code is not actually needed even a fix occur in the future, though the > code will be redundant. > > > Very well, lets just make sure when it is fixed, the driver works with both > patched and unpatched firmware > Acked-by: Neil Horman <nhorman@tuxdriver.com> > > > Thank you for the comments! > > > > Regards, > > Helin > > > > > > > > > */ > > > > -static void > > > > -i40e_configure_registers(struct i40e_hw *hw) -{ > > > > -#define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 > > > > -#define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 > > > > -#define I40E_GL_SWR_PM_UP_THR 0x269FBC > > > > + > > > > +/* For both X710 and XL710 */ > > > > #define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 > > > > +#define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 > > > > + > > > > #define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 > > > > +#define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 > > > > + > > > > +/* For X710 only */ > > > > #define I40E_GL_SWR_PM_UP_THR_VALUE 0x03030303 > > > > +#define I40E_GL_SWR_PM_UP_THR 0x269FBC > > > > > > > > +static void > > > > +i40e_configure_registers(struct i40e_hw *hw) { > > > > static const struct { > > > > uint32_t addr; > > > > uint64_t val; > > > > @@ -5354,11 +5363,11 @@ i40e_configure_registers(struct i40e_hw > *hw) > > > > uint32_t i; > > > > int ret; > > > > > > > > - /* Below fix is for X710 only */ > > > > - if (i40e_is_40G_device(hw->device_id)) > > > > - return; > > > > - > > > > for (i = 0; i < RTE_DIM(reg_table); i++) { > > > > + if ((i40e_is_40G_device(hw->device_id)) && > > > > + (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR)) > > > > + continue; > > > > + > > > > ret = i40e_debug_read_register(hw, reg_table[i].addr, ®); > > > > if (ret < 0) { > > > > PMD_DRV_LOG(ERR, "Failed to read from 0x%"PRIx32, > > > > -- > > > > 1.9.3 > > > > > > > > > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-dev] [PATCH v2] i40e: workaround for XL710 performance 2014-12-24 7:14 [dpdk-dev] [PATCH] i40e: workaround for XL710 performance Helin Zhang 2014-12-24 14:55 ` Neil Horman @ 2014-12-29 1:41 ` Helin Zhang 2015-01-12 7:33 ` Wu, Jingjing ` (2 more replies) 1 sibling, 3 replies; 10+ messages in thread From: Helin Zhang @ 2014-12-29 1:41 UTC (permalink / raw) To: dev On XL710, performance number is far from the expectation on recent firmware versions, if promiscuous mode is disabled, or promiscuous mode is enabled and port MAC address is equal to the packet destination MAC address. The fix for this issue may not be integrated in the following firmware version. So the workaround in software driver is needed. For XL710, it needs to modify the initial values of 3 internal only registers, which are the same as X710. Note that the values for X710 and XL710 registers could be different, and the workaround can be removed when it is fixed in firmware in the future. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- lib/librte_pmd_i40e/i40e_ethdev.c | 44 ++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 14 deletions(-) v2 changes: * Supported modifying the address of 0x269FBC of XL710 during initialization, to fix the minor performance gap to expectation. That means XL710 can meet the performance expectation with this workaround. diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index b47a3d2..8982920 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -5327,38 +5327,54 @@ i40e_debug_read_register(struct i40e_hw *hw, uint32_t addr, uint64_t *val) /* * On X710, performance number is far from the expectation on recent firmware - * versions. The fix for this issue may not be integrated in the following + * versions; on XL710, performance number is also far from the expectation on + * recent firmware versions, if promiscuous mode is disabled, or promiscuous + * mode is enabled and port MAC address is equal to the packet destination MAC + * address. The fix for this issue may not be integrated in the following * firmware version. So the workaround in software driver is needed. It needs - * to modify the initial values of 3 internal only registers. Note that the + * to modify the initial values of 3 internal only registers for both X710 and + * XL710. Note that the values for X710 or XL710 could be different, and the * workaround can be removed when it is fixed in firmware in the future. */ -static void -i40e_configure_registers(struct i40e_hw *hw) -{ + +/* For both X710 and XL710 */ +#define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 #define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 + +#define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 #define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 + +/* For X710 */ +#define I40E_GL_SWR_PM_UP_THR_EF_VALUE 0x03030303 +/* For XL710 */ +#define I40E_GL_SWR_PM_UP_THR_SF_VALUE 0x06060606 #define I40E_GL_SWR_PM_UP_THR 0x269FBC -#define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 -#define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 -#define I40E_GL_SWR_PM_UP_THR_VALUE 0x03030303 - static const struct { +static void +i40e_configure_registers(struct i40e_hw *hw) +{ + static struct { uint32_t addr; uint64_t val; } reg_table[] = { {I40E_GL_SWR_PRI_JOIN_MAP_0, I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE}, {I40E_GL_SWR_PRI_JOIN_MAP_2, I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE}, - {I40E_GL_SWR_PM_UP_THR, I40E_GL_SWR_PM_UP_THR_VALUE}, + {I40E_GL_SWR_PM_UP_THR, 0}, /* Compute value dynamically */ }; uint64_t reg; uint32_t i; int ret; - /* Below fix is for X710 only */ - if (i40e_is_40G_device(hw->device_id)) - return; - for (i = 0; i < RTE_DIM(reg_table); i++) { + if (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR) { + if (i40e_is_40G_device(hw->device_id)) /* For XL710 */ + reg_table[i].val = + I40E_GL_SWR_PM_UP_THR_SF_VALUE; + else /* For X710 */ + reg_table[i].val = + I40E_GL_SWR_PM_UP_THR_EF_VALUE; + } + ret = i40e_debug_read_register(hw, reg_table[i].addr, ®); if (ret < 0) { PMD_DRV_LOG(ERR, "Failed to read from 0x%"PRIx32, -- 1.9.3 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v2] i40e: workaround for XL710 performance 2014-12-29 1:41 ` [dpdk-dev] [PATCH v2] " Helin Zhang @ 2015-01-12 7:33 ` Wu, Jingjing 2015-01-12 7:57 ` Zhang, Helin 2015-01-16 5:54 ` Zhang, Helin 2015-02-10 9:06 ` Xu, Qian Q 2 siblings, 1 reply; 10+ messages in thread From: Wu, Jingjing @ 2015-01-12 7:33 UTC (permalink / raw) To: Zhang, Helin, dev > -----Original Message----- > From: Zhang, Helin > Sent: Monday, December 29, 2014 9:41 AM > To: dev@dpdk.org > Cc: nhorman@tuxdriver.com; Xu, Qian Q; Cao, Waterman; Lu, Patrick; Liu, > Jijiang; Wu, Jingjing; Zhang, Helin > Subject: [PATCH v2] i40e: workaround for XL710 performance > > On XL710, performance number is far from the expectation on recent > firmware versions, if promiscuous mode is disabled, or promiscuous mode is > enabled and port MAC address is equal to the packet destination MAC > address. The fix for this issue may not be integrated in the following > firmware version. So the workaround in software driver is needed. For XL710, > it needs to modify the initial values of 3 internal only registers, which are the > same as X710. > Note that the values for X710 and XL710 registers could be different, and the > workaround can be removed when it is fixed in firmware in the future. > > Signed-off-by: Helin Zhang <helin.zhang@intel.com> > --- > lib/librte_pmd_i40e/i40e_ethdev.c | 44 ++++++++++++++++++++++++++--- > ---------- > 1 file changed, 30 insertions(+), 14 deletions(-) > > v2 changes: > * Supported modifying the address of 0x269FBC of XL710 during > initialization, to fix the minor performance gap to expectation. > That means XL710 can meet the performance expectation with this > workaround. > > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c > b/lib/librte_pmd_i40e/i40e_ethdev.c > index b47a3d2..8982920 100644 > --- a/lib/librte_pmd_i40e/i40e_ethdev.c > +++ b/lib/librte_pmd_i40e/i40e_ethdev.c > @@ -5327,38 +5327,54 @@ i40e_debug_read_register(struct i40e_hw *hw, > uint32_t addr, uint64_t *val) > > /* > * On X710, performance number is far from the expectation on recent > firmware > - * versions. The fix for this issue may not be integrated in the following > + * versions; on XL710, performance number is also far from the > + expectation on > + * recent firmware versions, if promiscuous mode is disabled, or > + promiscuous > + * mode is enabled and port MAC address is equal to the packet > + destination MAC > + * address. The fix for this issue may not be integrated in the > + following > * firmware version. So the workaround in software driver is needed. It > needs > - * to modify the initial values of 3 internal only registers. Note that the > + * to modify the initial values of 3 internal only registers for both > + X710 and > + * XL710. Note that the values for X710 or XL710 could be different, > + and the > * workaround can be removed when it is fixed in firmware in the future. > */ > -static void > -i40e_configure_registers(struct i40e_hw *hw) -{ > + > +/* For both X710 and XL710 */ > +#define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 > #define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 > + > +#define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 > #define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 > + > +/* For X710 */ > +#define I40E_GL_SWR_PM_UP_THR_EF_VALUE 0x03030303 > +/* For XL710 */ > +#define I40E_GL_SWR_PM_UP_THR_SF_VALUE 0x06060606 > #define I40E_GL_SWR_PM_UP_THR 0x269FBC > -#define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 -#define > I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 > -#define I40E_GL_SWR_PM_UP_THR_VALUE 0x03030303 > > - static const struct { > +static void > +i40e_configure_registers(struct i40e_hw *hw) { > + static struct { > uint32_t addr; > uint64_t val; > } reg_table[] = { > {I40E_GL_SWR_PRI_JOIN_MAP_0, > I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE}, > {I40E_GL_SWR_PRI_JOIN_MAP_2, > I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE}, > - {I40E_GL_SWR_PM_UP_THR, > I40E_GL_SWR_PM_UP_THR_VALUE}, > + {I40E_GL_SWR_PM_UP_THR, 0}, /* Compute value > dynamically */ > }; > uint64_t reg; > uint32_t i; > int ret; > > - /* Below fix is for X710 only */ > - if (i40e_is_40G_device(hw->device_id)) > - return; > - > for (i = 0; i < RTE_DIM(reg_table); i++) { > + if (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR) { > + if (i40e_is_40G_device(hw->device_id)) /* For XL710 > */ > + reg_table[i].val = > + > I40E_GL_SWR_PM_UP_THR_SF_VALUE; > + else /* For X710 */ > + reg_table[i].val = > + > I40E_GL_SWR_PM_UP_THR_EF_VALUE; > + } > + > ret = i40e_debug_read_register(hw, reg_table[i].addr, ®); > if (ret < 0) { > PMD_DRV_LOG(ERR, "Failed to read from > 0x%"PRIx32, > -- > 1.9.3 Acked-by: Jingjing Wu <jingjing.wu@intel.com> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v2] i40e: workaround for XL710 performance 2015-01-12 7:33 ` Wu, Jingjing @ 2015-01-12 7:57 ` Zhang, Helin 0 siblings, 0 replies; 10+ messages in thread From: Zhang, Helin @ 2015-01-12 7:57 UTC (permalink / raw) To: Wu, Jingjing, dev Thank you, Jingjing! Regards, Helin > -----Original Message----- > From: Wu, Jingjing > Sent: Monday, January 12, 2015 3:34 PM > To: Zhang, Helin; dev@dpdk.org > Cc: nhorman@tuxdriver.com; Xu, Qian Q; Cao, Waterman; Lu, Patrick; Liu, > Jijiang > Subject: RE: [PATCH v2] i40e: workaround for XL710 performance > > > > > -----Original Message----- > > From: Zhang, Helin > > Sent: Monday, December 29, 2014 9:41 AM > > To: dev@dpdk.org > > Cc: nhorman@tuxdriver.com; Xu, Qian Q; Cao, Waterman; Lu, Patrick; > > Liu, Jijiang; Wu, Jingjing; Zhang, Helin > > Subject: [PATCH v2] i40e: workaround for XL710 performance > > > > On XL710, performance number is far from the expectation on recent > > firmware versions, if promiscuous mode is disabled, or promiscuous > > mode is enabled and port MAC address is equal to the packet > > destination MAC address. The fix for this issue may not be integrated > > in the following firmware version. So the workaround in software > > driver is needed. For XL710, it needs to modify the initial values of > > 3 internal only registers, which are the same as X710. > > Note that the values for X710 and XL710 registers could be different, > > and the workaround can be removed when it is fixed in firmware in the future. > > > > Signed-off-by: Helin Zhang <helin.zhang@intel.com> > > --- > > lib/librte_pmd_i40e/i40e_ethdev.c | 44 ++++++++++++++++++++++++++--- > > ---------- > > 1 file changed, 30 insertions(+), 14 deletions(-) > > > > v2 changes: > > * Supported modifying the address of 0x269FBC of XL710 during > > initialization, to fix the minor performance gap to expectation. > > That means XL710 can meet the performance expectation with this > > workaround. > > > > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c > > b/lib/librte_pmd_i40e/i40e_ethdev.c > > index b47a3d2..8982920 100644 > > --- a/lib/librte_pmd_i40e/i40e_ethdev.c > > +++ b/lib/librte_pmd_i40e/i40e_ethdev.c > > @@ -5327,38 +5327,54 @@ i40e_debug_read_register(struct i40e_hw *hw, > > uint32_t addr, uint64_t *val) > > > > /* > > * On X710, performance number is far from the expectation on recent > > firmware > > - * versions. The fix for this issue may not be integrated in the > > following > > + * versions; on XL710, performance number is also far from the > > + expectation on > > + * recent firmware versions, if promiscuous mode is disabled, or > > + promiscuous > > + * mode is enabled and port MAC address is equal to the packet > > + destination MAC > > + * address. The fix for this issue may not be integrated in the > > + following > > * firmware version. So the workaround in software driver is needed. > > It needs > > - * to modify the initial values of 3 internal only registers. Note > > that the > > + * to modify the initial values of 3 internal only registers for both > > + X710 and > > + * XL710. Note that the values for X710 or XL710 could be different, > > + and the > > * workaround can be removed when it is fixed in firmware in the future. > > */ > > -static void > > -i40e_configure_registers(struct i40e_hw *hw) -{ > > + > > +/* For both X710 and XL710 */ > > +#define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 > > #define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 > > + > > +#define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 > > #define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 > > + > > +/* For X710 */ > > +#define I40E_GL_SWR_PM_UP_THR_EF_VALUE 0x03030303 > > +/* For XL710 */ > > +#define I40E_GL_SWR_PM_UP_THR_SF_VALUE 0x06060606 > > #define I40E_GL_SWR_PM_UP_THR 0x269FBC > > -#define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 -#define > > I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 > > -#define I40E_GL_SWR_PM_UP_THR_VALUE 0x03030303 > > > > - static const struct { > > +static void > > +i40e_configure_registers(struct i40e_hw *hw) { > > + static struct { > > uint32_t addr; > > uint64_t val; > > } reg_table[] = { > > {I40E_GL_SWR_PRI_JOIN_MAP_0, > > I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE}, > > {I40E_GL_SWR_PRI_JOIN_MAP_2, > > I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE}, > > - {I40E_GL_SWR_PM_UP_THR, > > I40E_GL_SWR_PM_UP_THR_VALUE}, > > + {I40E_GL_SWR_PM_UP_THR, 0}, /* Compute value > > dynamically */ > > }; > > uint64_t reg; > > uint32_t i; > > int ret; > > > > - /* Below fix is for X710 only */ > > - if (i40e_is_40G_device(hw->device_id)) > > - return; > > - > > for (i = 0; i < RTE_DIM(reg_table); i++) { > > + if (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR) { > > + if (i40e_is_40G_device(hw->device_id)) /* For XL710 > > */ > > + reg_table[i].val = > > + > > I40E_GL_SWR_PM_UP_THR_SF_VALUE; > > + else /* For X710 */ > > + reg_table[i].val = > > + > > I40E_GL_SWR_PM_UP_THR_EF_VALUE; > > + } > > + > > ret = i40e_debug_read_register(hw, reg_table[i].addr, ®); > > if (ret < 0) { > > PMD_DRV_LOG(ERR, "Failed to read from 0x%"PRIx32, > > -- > > 1.9.3 > > Acked-by: Jingjing Wu <jingjing.wu@intel.com> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v2] i40e: workaround for XL710 performance 2014-12-29 1:41 ` [dpdk-dev] [PATCH v2] " Helin Zhang 2015-01-12 7:33 ` Wu, Jingjing @ 2015-01-16 5:54 ` Zhang, Helin 2015-02-10 9:06 ` Xu, Qian Q 2 siblings, 0 replies; 10+ messages in thread From: Zhang, Helin @ 2015-01-16 5:54 UTC (permalink / raw) To: Zhang, Helin; +Cc: dev > Subject: [PATCH v2] i40e: workaround for XL710 performance > > On XL710, performance number is far from the expectation on recent firmware > versions, if promiscuous mode is disabled, or promiscuous mode is enabled and > port MAC address is equal to the packet destination MAC address. The fix for > this issue may not be integrated in the following firmware version. So the > workaround in software driver is needed. For XL710, it needs to modify the > initial values of 3 internal only registers, which are the same as X710. > Note that the values for X710 and XL710 registers could be different, and the > workaround can be removed when it is fixed in firmware in the future. > > Signed-off-by: Helin Zhang <helin.zhang@intel.com> Acked-by: Jingjing Wu <jingjing.wu@intel.com> > --- > lib/librte_pmd_i40e/i40e_ethdev.c | 44 > ++++++++++++++++++++++++++------------- > 1 file changed, 30 insertions(+), 14 deletions(-) > > v2 changes: > * Supported modifying the address of 0x269FBC of XL710 during > initialization, to fix the minor performance gap to expectation. > That means XL710 can meet the performance expectation with this > workaround. Applied. Thanks to Neil's for his reviewing efforts on v1 version! Thanks, Helin ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v2] i40e: workaround for XL710 performance 2014-12-29 1:41 ` [dpdk-dev] [PATCH v2] " Helin Zhang 2015-01-12 7:33 ` Wu, Jingjing 2015-01-16 5:54 ` Zhang, Helin @ 2015-02-10 9:06 ` Xu, Qian Q 2 siblings, 0 replies; 10+ messages in thread From: Xu, Qian Q @ 2015-02-10 9:06 UTC (permalink / raw) To: Zhang, Helin, dev Tested-by: Qian Xu <qian.q.xu@intel.com> - Tested Commit: 2250cc5a191906c914221ff4f0da7b5d699b4175 - OS: Fedora20 3.18.0 - GCC: gcc version 4.8.3 20140911 - CPU: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz - NIC: Intel Ethernet Controller XL710 for 40GbE QSFP+ [8086:1583] - Default x86_64-native-linuxapp-gcc configuration - Total 1 case, 1 passed, 0 failed - Case: l3fwd_2port_perf Description: Check l3fwd of 2port on different card can achieve hardware limitation rate. Command / instruction: Bind 40G port to igb_uio ./<dpdk>/tools/dpdk_nic_bind.py --bind=igb_uio 82:00.1 85:00.1 Run l3fwd ./l3fwd -c 0x3fc0000 -n 4 -w 82:00.1 -w 85:00.1 -- -p 0x3 --config '(0,0,18),(0,1,19),(1,0,20),(1,1,21)' Ixia send packets with IP Expected test result: Ixia can receive the packet with maximum hardware limitation rate. -----Original Message----- From: Zhang, Helin Sent: Monday, December 29, 2014 9:41 AM To: dev@dpdk.org Cc: nhorman@tuxdriver.com; Xu, Qian Q; Cao, Waterman; Lu, Patrick; Liu, Jijiang; Wu, Jingjing; Zhang, Helin Subject: [PATCH v2] i40e: workaround for XL710 performance On XL710, performance number is far from the expectation on recent firmware versions, if promiscuous mode is disabled, or promiscuous mode is enabled and port MAC address is equal to the packet destination MAC address. The fix for this issue may not be integrated in the following firmware version. So the workaround in software driver is needed. For XL710, it needs to modify the initial values of 3 internal only registers, which are the same as X710. Note that the values for X710 and XL710 registers could be different, and the workaround can be removed when it is fixed in firmware in the future. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- lib/librte_pmd_i40e/i40e_ethdev.c | 44 ++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 14 deletions(-) v2 changes: * Supported modifying the address of 0x269FBC of XL710 during initialization, to fix the minor performance gap to expectation. That means XL710 can meet the performance expectation with this workaround. diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index b47a3d2..8982920 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -5327,38 +5327,54 @@ i40e_debug_read_register(struct i40e_hw *hw, uint32_t addr, uint64_t *val) /* * On X710, performance number is far from the expectation on recent firmware - * versions. The fix for this issue may not be integrated in the following + * versions; on XL710, performance number is also far from the + expectation on + * recent firmware versions, if promiscuous mode is disabled, or + promiscuous + * mode is enabled and port MAC address is equal to the packet + destination MAC + * address. The fix for this issue may not be integrated in the + following * firmware version. So the workaround in software driver is needed. It needs - * to modify the initial values of 3 internal only registers. Note that the + * to modify the initial values of 3 internal only registers for both + X710 and + * XL710. Note that the values for X710 or XL710 could be different, + and the * workaround can be removed when it is fixed in firmware in the future. */ -static void -i40e_configure_registers(struct i40e_hw *hw) -{ + +/* For both X710 and XL710 */ +#define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 #define I40E_GL_SWR_PRI_JOIN_MAP_0 0x26CE00 + +#define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 #define I40E_GL_SWR_PRI_JOIN_MAP_2 0x26CE08 + +/* For X710 */ +#define I40E_GL_SWR_PM_UP_THR_EF_VALUE 0x03030303 +/* For XL710 */ +#define I40E_GL_SWR_PM_UP_THR_SF_VALUE 0x06060606 #define I40E_GL_SWR_PM_UP_THR 0x269FBC -#define I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE 0x10000200 -#define I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE 0x011f0200 -#define I40E_GL_SWR_PM_UP_THR_VALUE 0x03030303 - static const struct { +static void +i40e_configure_registers(struct i40e_hw *hw) { + static struct { uint32_t addr; uint64_t val; } reg_table[] = { {I40E_GL_SWR_PRI_JOIN_MAP_0, I40E_GL_SWR_PRI_JOIN_MAP_0_VALUE}, {I40E_GL_SWR_PRI_JOIN_MAP_2, I40E_GL_SWR_PRI_JOIN_MAP_2_VALUE}, - {I40E_GL_SWR_PM_UP_THR, I40E_GL_SWR_PM_UP_THR_VALUE}, + {I40E_GL_SWR_PM_UP_THR, 0}, /* Compute value dynamically */ }; uint64_t reg; uint32_t i; int ret; - /* Below fix is for X710 only */ - if (i40e_is_40G_device(hw->device_id)) - return; - for (i = 0; i < RTE_DIM(reg_table); i++) { + if (reg_table[i].addr == I40E_GL_SWR_PM_UP_THR) { + if (i40e_is_40G_device(hw->device_id)) /* For XL710 */ + reg_table[i].val = + I40E_GL_SWR_PM_UP_THR_SF_VALUE; + else /* For X710 */ + reg_table[i].val = + I40E_GL_SWR_PM_UP_THR_EF_VALUE; + } + ret = i40e_debug_read_register(hw, reg_table[i].addr, ®); if (ret < 0) { PMD_DRV_LOG(ERR, "Failed to read from 0x%"PRIx32, -- 1.9.3 ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-02-10 9:10 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-12-24 7:14 [dpdk-dev] [PATCH] i40e: workaround for XL710 performance Helin Zhang 2014-12-24 14:55 ` Neil Horman 2014-12-25 0:20 ` Zhang, Helin 2014-12-26 14:28 ` Neil Horman 2014-12-28 13:22 ` Zhang, Helin 2014-12-29 1:41 ` [dpdk-dev] [PATCH v2] " Helin Zhang 2015-01-12 7:33 ` Wu, Jingjing 2015-01-12 7:57 ` Zhang, Helin 2015-01-16 5:54 ` Zhang, Helin 2015-02-10 9:06 ` Xu, Qian Q
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).