DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
* [dpdk-dev] [DPDK] net/e1000: fix buffer overrun while i219 processing DMA transactions
@ 2019-07-08 13:36 Xiao Zhang
  2019-07-19  5:44 ` Zhang, Qi Z
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Xiao Zhang @ 2019-07-08 13:36 UTC (permalink / raw)
  To: dev; +Cc: wenzhuo.lu, wei.zhao1, Xiao Zhang

Intel® 100/200 Series Chipset platforms reduced the round-trip
latency for the LAN Controller DMA accesses, causing in some high
performance cases a buffer overrun while the I219 LAN Connected
Device is processing the DMA transactions. I219LM and I219V devices
can fall into unrecovered Tx hang under very stressfully UDP traffic
and multiple reconnection of Ethernet cable. This Tx hang of the LAN
Controller is only recovered if the system is rebooted. Slightly slow
down DMA access by reducing the number of outstanding requests.
This workaround could have an impact on TCP traffic performance
on the platform. Disabling TSO eliminates performance loss for TCP
traffic without a noticeable impact on CPU performance.

Please, refer to I218/I219 specification update:
https://www.intel.com/content/www/us/en/embedded/products/networking/
ethernet-connection-i218-family-documentation.html

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
---
 drivers/net/e1000/base/e1000_ich8lan.h |  1 +
 drivers/net/e1000/igb_rxtx.c           | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/drivers/net/e1000/base/e1000_ich8lan.h b/drivers/net/e1000/base/e1000_ich8lan.h
index 1f2a3f8..084eb9c 100644
--- a/drivers/net/e1000/base/e1000_ich8lan.h
+++ b/drivers/net/e1000/base/e1000_ich8lan.h
@@ -134,6 +134,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #define E1000_FLASH_BASE_ADDR 0xE000 /*offset of NVM access regs*/
 #define E1000_CTRL_EXT_NVMVS 0x3 /*NVM valid sector */
 #define E1000_TARC0_CB_MULTIQ_3_REQ	(1 << 28 | 1 << 29)
+#define E1000_TARC0_CB_MULTIQ_2_REQ	(1 << 29)
 #define PCIE_ICH8_SNOOP_ALL	PCIE_NO_SNOOP_ALL
 
 #define E1000_ICH_RAR_ENTRIES	7
diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
index 33eeb4e..5d45e62 100644
--- a/drivers/net/e1000/igb_rxtx.c
+++ b/drivers/net/e1000/igb_rxtx.c
@@ -2627,6 +2627,22 @@ eth_igb_tx_init(struct rte_eth_dev *dev)
 
 	e1000_config_collision_dist(hw);
 
+	/* SPT and CNP Si errata workaround to avoid data corruption */
+	if (hw->mac.type == e1000_pch_spt) {
+		uint32_t reg_val;
+		reg_val = E1000_READ_REG(hw, E1000_IOSFPC);
+		reg_val |= E1000_RCTL_RDMTS_HEX;
+		E1000_WRITE_REG(hw, E1000_IOSFPC, reg_val);
+
+		/* Dropping the number of outstanding requests from
+		 * 3 to 2 in order to avoid a buffer overrun.
+		 */
+		reg_val = E1000_READ_REG(hw, E1000_TARC(0));
+		reg_val &= ~E1000_TARC0_CB_MULTIQ_3_REQ;
+		reg_val |= E1000_TARC0_CB_MULTIQ_2_REQ;
+		E1000_WRITE_REG(hw, E1000_TARC(0), reg_val);
+	}
+
 	/* This write will effectively turn on the transmit unit. */
 	E1000_WRITE_REG(hw, E1000_TCTL, tctl);
 }
-- 
2.7.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [DPDK] net/e1000: fix buffer overrun while i219 processing DMA transactions
  2019-07-08 13:36 [dpdk-dev] [DPDK] net/e1000: fix buffer overrun while i219 processing DMA transactions Xiao Zhang
@ 2019-07-19  5:44 ` Zhang, Qi Z
  2019-07-20  2:56 ` Anand H. Krishnan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Zhang, Qi Z @ 2019-07-19  5:44 UTC (permalink / raw)
  To: Zhang, Xiao, dev; +Cc: Lu, Wenzhuo, Zhao1, Wei, Zhang, Xiao



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xiao Zhang
> Sent: Monday, July 8, 2019 9:37 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>; Zhang, Xiao <xiao.zhang@intel.com>
> Subject: [dpdk-dev] [DPDK] net/e1000: fix buffer overrun while i219
> processing DMA transactions
> 
> Intel® 100/200 Series Chipset platforms reduced the round-trip latency for the
> LAN Controller DMA accesses, causing in some high performance cases a buffer
> overrun while the I219 LAN Connected Device is processing the DMA
> transactions. I219LM and I219V devices can fall into unrecovered Tx hang
> under very stressfully UDP traffic and multiple reconnection of Ethernet cable.
> This Tx hang of the LAN Controller is only recovered if the system is rebooted.
> Slightly slow down DMA access by reducing the number of outstanding
> requests.
> This workaround could have an impact on TCP traffic performance on the
> platform. Disabling TSO eliminates performance loss for TCP traffic without a
> noticeable impact on CPU performance.
> 
> Please, refer to I218/I219 specification update:
> https://www.intel.com/content/www/us/en/embedded/products/networking
> /
> ethernet-connection-i218-family-documentation.html
> 
> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [DPDK] net/e1000: fix buffer overrun while i219 processing DMA transactions
  2019-07-08 13:36 [dpdk-dev] [DPDK] net/e1000: fix buffer overrun while i219 processing DMA transactions Xiao Zhang
  2019-07-19  5:44 ` Zhang, Qi Z
@ 2019-07-20  2:56 ` Anand H. Krishnan
  2019-07-20  8:17   ` Zhang, Xiao
  2019-07-20 17:01 ` [dpdk-dev] [v2] " Xiao Zhang
  2019-07-26  2:52 ` [dpdk-dev] [DPDK] " Zhao1, Wei
  3 siblings, 1 reply; 7+ messages in thread
From: Anand H. Krishnan @ 2019-07-20  2:56 UTC (permalink / raw)
  To: Xiao Zhang; +Cc: dev, Lu, Wenzhuo, Zhao1, Wei

This seems to be changing the IGB driver. Shouldn't you be changing
the em driver
rather than the igb driver?

Thanks,
Anand

On Mon, Jul 8, 2019 at 10:10 AM Xiao Zhang <xiao.zhang@intel.com> wrote:
>
> Intel® 100/200 Series Chipset platforms reduced the round-trip
> latency for the LAN Controller DMA accesses, causing in some high
> performance cases a buffer overrun while the I219 LAN Connected
> Device is processing the DMA transactions. I219LM and I219V devices
> can fall into unrecovered Tx hang under very stressfully UDP traffic
> and multiple reconnection of Ethernet cable. This Tx hang of the LAN
> Controller is only recovered if the system is rebooted. Slightly slow
> down DMA access by reducing the number of outstanding requests.
> This workaround could have an impact on TCP traffic performance
> on the platform. Disabling TSO eliminates performance loss for TCP
> traffic without a noticeable impact on CPU performance.
>
> Please, refer to I218/I219 specification update:
> https://www.intel.com/content/www/us/en/embedded/products/networking/
> ethernet-connection-i218-family-documentation.html
>
> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> ---
>  drivers/net/e1000/base/e1000_ich8lan.h |  1 +
>  drivers/net/e1000/igb_rxtx.c           | 16 ++++++++++++++++
>  2 files changed, 17 insertions(+)
>
> diff --git a/drivers/net/e1000/base/e1000_ich8lan.h b/drivers/net/e1000/base/e1000_ich8lan.h
> index 1f2a3f8..084eb9c 100644
> --- a/drivers/net/e1000/base/e1000_ich8lan.h
> +++ b/drivers/net/e1000/base/e1000_ich8lan.h
> @@ -134,6 +134,7 @@ POSSIBILITY OF SUCH DAMAGE.
>  #define E1000_FLASH_BASE_ADDR 0xE000 /*offset of NVM access regs*/
>  #define E1000_CTRL_EXT_NVMVS 0x3 /*NVM valid sector */
>  #define E1000_TARC0_CB_MULTIQ_3_REQ    (1 << 28 | 1 << 29)
> +#define E1000_TARC0_CB_MULTIQ_2_REQ    (1 << 29)
>  #define PCIE_ICH8_SNOOP_ALL    PCIE_NO_SNOOP_ALL
>
>  #define E1000_ICH_RAR_ENTRIES  7
> diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c
> index 33eeb4e..5d45e62 100644
> --- a/drivers/net/e1000/igb_rxtx.c
> +++ b/drivers/net/e1000/igb_rxtx.c
> @@ -2627,6 +2627,22 @@ eth_igb_tx_init(struct rte_eth_dev *dev)
>
>         e1000_config_collision_dist(hw);
>
> +       /* SPT and CNP Si errata workaround to avoid data corruption */
> +       if (hw->mac.type == e1000_pch_spt) {
> +               uint32_t reg_val;
> +               reg_val = E1000_READ_REG(hw, E1000_IOSFPC);
> +               reg_val |= E1000_RCTL_RDMTS_HEX;
> +               E1000_WRITE_REG(hw, E1000_IOSFPC, reg_val);
> +
> +               /* Dropping the number of outstanding requests from
> +                * 3 to 2 in order to avoid a buffer overrun.
> +                */
> +               reg_val = E1000_READ_REG(hw, E1000_TARC(0));
> +               reg_val &= ~E1000_TARC0_CB_MULTIQ_3_REQ;
> +               reg_val |= E1000_TARC0_CB_MULTIQ_2_REQ;
> +               E1000_WRITE_REG(hw, E1000_TARC(0), reg_val);
> +       }
> +
>         /* This write will effectively turn on the transmit unit. */
>         E1000_WRITE_REG(hw, E1000_TCTL, tctl);
>  }
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [DPDK] net/e1000: fix buffer overrun while i219 processing DMA transactions
  2019-07-20  2:56 ` Anand H. Krishnan
@ 2019-07-20  8:17   ` Zhang, Xiao
  0 siblings, 0 replies; 7+ messages in thread
From: Zhang, Xiao @ 2019-07-20  8:17 UTC (permalink / raw)
  To: Anand H. Krishnan; +Cc: dev, Lu, Wenzhuo, Zhao1, Wei



> -----Original Message-----
> From: Anand H. Krishnan [mailto:anandhkrishnan@gmail.com]
> Sent: Saturday, July 20, 2019 10:57 AM
> To: Zhang, Xiao <xiao.zhang@intel.com>
> Cc: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>
> Subject: Re: [dpdk-dev] [DPDK] net/e1000: fix buffer overrun while i219
> processing DMA transactions
> 
> This seems to be changing the IGB driver. Shouldn't you be changing the em
> driver rather than the igb driver?

Yes, the fix changed to em driver in v2 patch. Thanks.

> Thanks,
> Anand
> 
> On Mon, Jul 8, 2019 at 10:10 AM Xiao Zhang <xiao.zhang@intel.com> wrote:
> >
> > Intel® 100/200 Series Chipset platforms reduced the round-trip latency
> > for the LAN Controller DMA accesses, causing in some high performance
> > cases a buffer overrun while the I219 LAN Connected Device is
> > processing the DMA transactions. I219LM and I219V devices can fall
> > into unrecovered Tx hang under very stressfully UDP traffic and
> > multiple reconnection of Ethernet cable. This Tx hang of the LAN
> > Controller is only recovered if the system is rebooted. Slightly slow
> > down DMA access by reducing the number of outstanding requests.
> > This workaround could have an impact on TCP traffic performance on the
> > platform. Disabling TSO eliminates performance loss for TCP traffic
> > without a noticeable impact on CPU performance.
> >
> > Please, refer to I218/I219 specification update:
> >
> https://www.intel.com/content/www/us/en/embedded/products/network
> ing/
> > ethernet-connection-i218-family-documentation.html
> >
> > Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> > ---
> >  drivers/net/e1000/base/e1000_ich8lan.h |  1 +
> >  drivers/net/e1000/igb_rxtx.c           | 16 ++++++++++++++++
> >  2 files changed, 17 insertions(+)
> >
> > diff --git a/drivers/net/e1000/base/e1000_ich8lan.h
> > b/drivers/net/e1000/base/e1000_ich8lan.h
> > index 1f2a3f8..084eb9c 100644
> > --- a/drivers/net/e1000/base/e1000_ich8lan.h
> > +++ b/drivers/net/e1000/base/e1000_ich8lan.h
> > @@ -134,6 +134,7 @@ POSSIBILITY OF SUCH DAMAGE.
> >  #define E1000_FLASH_BASE_ADDR 0xE000 /*offset of NVM access regs*/
> > #define E1000_CTRL_EXT_NVMVS 0x3 /*NVM valid sector */
> >  #define E1000_TARC0_CB_MULTIQ_3_REQ    (1 << 28 | 1 << 29)
> > +#define E1000_TARC0_CB_MULTIQ_2_REQ    (1 << 29)
> >  #define PCIE_ICH8_SNOOP_ALL    PCIE_NO_SNOOP_ALL
> >
> >  #define E1000_ICH_RAR_ENTRIES  7
> > diff --git a/drivers/net/e1000/igb_rxtx.c
> > b/drivers/net/e1000/igb_rxtx.c index 33eeb4e..5d45e62 100644
> > --- a/drivers/net/e1000/igb_rxtx.c
> > +++ b/drivers/net/e1000/igb_rxtx.c
> > @@ -2627,6 +2627,22 @@ eth_igb_tx_init(struct rte_eth_dev *dev)
> >
> >         e1000_config_collision_dist(hw);
> >
> > +       /* SPT and CNP Si errata workaround to avoid data corruption */
> > +       if (hw->mac.type == e1000_pch_spt) {
> > +               uint32_t reg_val;
> > +               reg_val = E1000_READ_REG(hw, E1000_IOSFPC);
> > +               reg_val |= E1000_RCTL_RDMTS_HEX;
> > +               E1000_WRITE_REG(hw, E1000_IOSFPC, reg_val);
> > +
> > +               /* Dropping the number of outstanding requests from
> > +                * 3 to 2 in order to avoid a buffer overrun.
> > +                */
> > +               reg_val = E1000_READ_REG(hw, E1000_TARC(0));
> > +               reg_val &= ~E1000_TARC0_CB_MULTIQ_3_REQ;
> > +               reg_val |= E1000_TARC0_CB_MULTIQ_2_REQ;
> > +               E1000_WRITE_REG(hw, E1000_TARC(0), reg_val);
> > +       }
> > +
> >         /* This write will effectively turn on the transmit unit. */
> >         E1000_WRITE_REG(hw, E1000_TCTL, tctl);  }
> > --
> > 2.7.4
> >

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [v2] net/e1000: fix buffer overrun while i219 processing DMA transactions
  2019-07-08 13:36 [dpdk-dev] [DPDK] net/e1000: fix buffer overrun while i219 processing DMA transactions Xiao Zhang
  2019-07-19  5:44 ` Zhang, Qi Z
  2019-07-20  2:56 ` Anand H. Krishnan
@ 2019-07-20 17:01 ` " Xiao Zhang
  2019-07-22  0:43   ` Zhang, Qi Z
  2019-07-26  2:52 ` [dpdk-dev] [DPDK] " Zhao1, Wei
  3 siblings, 1 reply; 7+ messages in thread
From: Xiao Zhang @ 2019-07-20 17:01 UTC (permalink / raw)
  To: dev; +Cc: wenzhuo.lu, wei.zhao1, qi.z.zhang, Xiao Zhang, stable

Intel® 100/200 Series Chipset platforms reduced the round-trip
latency for the LAN Controller DMA accesses, causing in some high
performance cases a buffer overrun while the I219 LAN Connected
Device is processing the DMA transactions. I219LM and I219V devices
can fall into unrecovered Tx hang under very stressfully UDP traffic
and multiple reconnection of Ethernet cable. This Tx hang of the LAN
Controller is only recovered if the system is rebooted. Slightly slow
down DMA access by reducing the number of outstanding requests.
This workaround could have an impact on TCP traffic performance
on the platform. Disabling TSO eliminates performance loss for TCP
traffic without a noticeable impact on CPU performance.

Please, refer to I218/I219 specification update:
https://www.intel.com/content/www/us/en/embedded/products/networking/
ethernet-connection-i218-family-documentation.html

Cc: stable@dpdk.org

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
---
v2
Change the fix from igb_rxtx to em_rxtx, since i219 use em PMD.
v1
Apply kernel fix to igb PMD driver.
---
 drivers/net/e1000/base/e1000_ich8lan.h |  1 +
 drivers/net/e1000/em_rxtx.c            | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/drivers/net/e1000/base/e1000_ich8lan.h b/drivers/net/e1000/base/e1000_ich8lan.h
index bc4ed1d..9ee94f6 100644
--- a/drivers/net/e1000/base/e1000_ich8lan.h
+++ b/drivers/net/e1000/base/e1000_ich8lan.h
@@ -133,6 +133,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #define E1000_FLASH_BASE_ADDR 0xE000 /*offset of NVM access regs*/
 #define E1000_CTRL_EXT_NVMVS 0x3 /*NVM valid sector */
 #define E1000_TARC0_CB_MULTIQ_3_REQ	(1 << 28 | 1 << 29)
+#define E1000_TARC0_CB_MULTIQ_2_REQ	(1 << 29)
 #define PCIE_ICH8_SNOOP_ALL	PCIE_NO_SNOOP_ALL
 
 #define E1000_ICH_RAR_ENTRIES	7
diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c
index 0d0d38e..d53ee80 100644
--- a/drivers/net/e1000/em_rxtx.c
+++ b/drivers/net/e1000/em_rxtx.c
@@ -1970,6 +1970,22 @@ eth_em_tx_init(struct rte_eth_dev *dev)
 	tctl |= (E1000_TCTL_PSP | E1000_TCTL_RTLC | E1000_TCTL_EN |
 		 (E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT));
 
+	/* SPT and CNP Si errata workaround to avoid data corruption */
+	if (hw->mac.type == e1000_pch_spt) {
+		uint32_t reg_val;
+		reg_val = E1000_READ_REG(hw, E1000_IOSFPC);
+		reg_val |= E1000_RCTL_RDMTS_HEX;
+		E1000_WRITE_REG(hw, E1000_IOSFPC, reg_val);
+
+		/* Dropping the number of outstanding requests from
+		 * 3 to 2 in order to avoid a buffer overrun.
+		 */
+		reg_val = E1000_READ_REG(hw, E1000_TARC(0));
+		reg_val &= ~E1000_TARC0_CB_MULTIQ_3_REQ;
+		reg_val |= E1000_TARC0_CB_MULTIQ_2_REQ;
+		E1000_WRITE_REG(hw, E1000_TARC(0), reg_val);
+	}
+
 	/* This write will effectively turn on the transmit unit. */
 	E1000_WRITE_REG(hw, E1000_TCTL, tctl);
 }
-- 
2.7.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [v2] net/e1000: fix buffer overrun while i219 processing DMA transactions
  2019-07-20 17:01 ` [dpdk-dev] [v2] " Xiao Zhang
@ 2019-07-22  0:43   ` Zhang, Qi Z
  0 siblings, 0 replies; 7+ messages in thread
From: Zhang, Qi Z @ 2019-07-22  0:43 UTC (permalink / raw)
  To: Zhang, Xiao, dev; +Cc: Lu, Wenzhuo, Zhao1, Wei, stable



> -----Original Message-----
> From: Zhang, Xiao
> Sent: Sunday, July 21, 2019 1:02 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhang, Xiao
> <xiao.zhang@intel.com>; stable@dpdk.org
> Subject: [v2] net/e1000: fix buffer overrun while i219 processing DMA
> transactions
> 
> Intel® 100/200 Series Chipset platforms reduced the round-trip latency for the
> LAN Controller DMA accesses, causing in some high performance cases a buffer
> overrun while the I219 LAN Connected Device is processing the DMA
> transactions. I219LM and I219V devices can fall into unrecovered Tx hang
> under very stressfully UDP traffic and multiple reconnection of Ethernet cable.
> This Tx hang of the LAN Controller is only recovered if the system is rebooted.
> Slightly slow down DMA access by reducing the number of outstanding
> requests.
> This workaround could have an impact on TCP traffic performance on the
> platform. Disabling TSO eliminates performance loss for TCP traffic without a
> noticeable impact on CPU performance.
> 
> Please, refer to I218/I219 specification update:
> https://www.intel.com/content/www/us/en/embedded/products/networking
> /
> ethernet-connection-i218-family-documentation.html
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel and v1 is reverted.

Thanks
Qi


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [DPDK] net/e1000: fix buffer overrun while i219 processing DMA transactions
  2019-07-08 13:36 [dpdk-dev] [DPDK] net/e1000: fix buffer overrun while i219 processing DMA transactions Xiao Zhang
                   ` (2 preceding siblings ...)
  2019-07-20 17:01 ` [dpdk-dev] [v2] " Xiao Zhang
@ 2019-07-26  2:52 ` " Zhao1, Wei
  3 siblings, 0 replies; 7+ messages in thread
From: Zhao1, Wei @ 2019-07-26  2:52 UTC (permalink / raw)
  To: Zhang, Xiao, dev; +Cc: Lu, Wenzhuo

Acked-by: Wei Zhao <wei.zhao1@intel.com>


> -----Original Message-----
> From: Zhang, Xiao
> Sent: Monday, July 8, 2019 9:37 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>;
> Zhang, Xiao <xiao.zhang@intel.com>
> Subject: [DPDK] net/e1000: fix buffer overrun while i219 processing DMA
> transactions
> 
> Intel® 100/200 Series Chipset platforms reduced the round-trip latency for the
> LAN Controller DMA accesses, causing in some high performance cases a
> buffer overrun while the I219 LAN Connected Device is processing the DMA
> transactions. I219LM and I219V devices can fall into unrecovered Tx hang
> under very stressfully UDP traffic and multiple reconnection of Ethernet cable.
> This Tx hang of the LAN Controller is only recovered if the system is rebooted.
> Slightly slow down DMA access by reducing the number of outstanding requests.
> This workaround could have an impact on TCP traffic performance on the
> platform. Disabling TSO eliminates performance loss for TCP traffic without a
> noticeable impact on CPU performance.
> 
> Please, refer to I218/I219 specification update:
> https://www.intel.com/content/www/us/en/embedded/products/networking/
> ethernet-connection-i218-family-documentation.html
> 
> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> ---
>  drivers/net/e1000/base/e1000_ich8lan.h |  1 +
>  drivers/net/e1000/igb_rxtx.c           | 16 ++++++++++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/drivers/net/e1000/base/e1000_ich8lan.h
> b/drivers/net/e1000/base/e1000_ich8lan.h
> index 1f2a3f8..084eb9c 100644
> --- a/drivers/net/e1000/base/e1000_ich8lan.h
> +++ b/drivers/net/e1000/base/e1000_ich8lan.h
> @@ -134,6 +134,7 @@ POSSIBILITY OF SUCH DAMAGE.
>  #define E1000_FLASH_BASE_ADDR 0xE000 /*offset of NVM access regs*/
> #define E1000_CTRL_EXT_NVMVS 0x3 /*NVM valid sector */
>  #define E1000_TARC0_CB_MULTIQ_3_REQ	(1 << 28 | 1 << 29)
> +#define E1000_TARC0_CB_MULTIQ_2_REQ	(1 << 29)
>  #define PCIE_ICH8_SNOOP_ALL	PCIE_NO_SNOOP_ALL
> 
>  #define E1000_ICH_RAR_ENTRIES	7
> diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index
> 33eeb4e..5d45e62 100644
> --- a/drivers/net/e1000/igb_rxtx.c
> +++ b/drivers/net/e1000/igb_rxtx.c
> @@ -2627,6 +2627,22 @@ eth_igb_tx_init(struct rte_eth_dev *dev)
> 
>  	e1000_config_collision_dist(hw);
> 
> +	/* SPT and CNP Si errata workaround to avoid data corruption */
> +	if (hw->mac.type == e1000_pch_spt) {
> +		uint32_t reg_val;
> +		reg_val = E1000_READ_REG(hw, E1000_IOSFPC);
> +		reg_val |= E1000_RCTL_RDMTS_HEX;
> +		E1000_WRITE_REG(hw, E1000_IOSFPC, reg_val);
> +
> +		/* Dropping the number of outstanding requests from
> +		 * 3 to 2 in order to avoid a buffer overrun.
> +		 */
> +		reg_val = E1000_READ_REG(hw, E1000_TARC(0));
> +		reg_val &= ~E1000_TARC0_CB_MULTIQ_3_REQ;
> +		reg_val |= E1000_TARC0_CB_MULTIQ_2_REQ;
> +		E1000_WRITE_REG(hw, E1000_TARC(0), reg_val);
> +	}
> +
>  	/* This write will effectively turn on the transmit unit. */
>  	E1000_WRITE_REG(hw, E1000_TCTL, tctl);  }
> --
> 2.7.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-08 13:36 [dpdk-dev] [DPDK] net/e1000: fix buffer overrun while i219 processing DMA transactions Xiao Zhang
2019-07-19  5:44 ` Zhang, Qi Z
2019-07-20  2:56 ` Anand H. Krishnan
2019-07-20  8:17   ` Zhang, Xiao
2019-07-20 17:01 ` [dpdk-dev] [v2] " Xiao Zhang
2019-07-22  0:43   ` Zhang, Qi Z
2019-07-26  2:52 ` [dpdk-dev] [DPDK] " Zhao1, Wei

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/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 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org dpdk-dev@archiver.kernel.org
	public-inbox-index dpdk-dev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox