liquidio: fix hang when re-binding VF host drv after running DPDK VF driver
authorRick Farrington <ricardo.farrington@cavium.com>
Fri, 13 Jul 2018 19:50:21 +0000 (12:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Jul 2018 21:02:00 +0000 (14:02 -0700)
When configuring SLI_PKTn_OUTPUT_CONTROL, VF driver was assuming that IPTR
mode was disabled by reset, which was not true.  Since DPDK driver had
set IPTR mode previously, the VF driver (which uses buf-ptr-only mode) was
not properly handling DROQ packets (i.e. it saw zero-length packets).

This represented an invalid hardware configuration which the driver could
not handle.

Signed-off-by: Rick Farrington <ricardo.farrington@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c

index 929d485a3a2fea6b7f13f389c9e90cda183da737..e088dedc17478353f229ca084151bedb01465c40 100644 (file)
@@ -493,6 +493,9 @@ static void cn23xx_pf_setup_global_output_regs(struct octeon_device *oct)
        for (q_no = srn; q_no < ern; q_no++) {
                reg_val = octeon_read_csr(oct, CN23XX_SLI_OQ_PKT_CONTROL(q_no));
 
+               /* clear IPTR */
+               reg_val &= ~CN23XX_PKT_OUTPUT_CTL_IPTR;
+
                /* set DPTR */
                reg_val |= CN23XX_PKT_OUTPUT_CTL_DPTR;
 
index 9338a00083788059736edefd472710c00b30f9af..1f8b7f65125401ef250f9cf57c266fbb55da3f38 100644 (file)
@@ -165,6 +165,9 @@ static void cn23xx_vf_setup_global_output_regs(struct octeon_device *oct)
                reg_val =
                    octeon_read_csr(oct, CN23XX_VF_SLI_OQ_PKT_CONTROL(q_no));
 
+               /* clear IPTR */
+               reg_val &= ~CN23XX_PKT_OUTPUT_CTL_IPTR;
+
                /* set DPTR */
                reg_val |= CN23XX_PKT_OUTPUT_CTL_DPTR;