From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-co1nam03on0116.outbound.protection.outlook.com ([104.47.40.116]:27616 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729220AbeIOGtv (ORCPT ); Sat, 15 Sep 2018 02:49:51 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Rick Farrington , Felix Manlunas , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.14 22/57] liquidio: fix hang when re-binding VF host drv after running DPDK VF driver Date: Sat, 15 Sep 2018 01:32:43 +0000 Message-ID: <20180915013223.179909-22-alexander.levin@microsoft.com> References: <20180915013223.179909-1-alexander.levin@microsoft.com> In-Reply-To: <20180915013223.179909-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Rick Farrington [ Upstream commit ac13d6d8eaded15c67265eafc32f439ea3a0ac4a ] 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 Signed-off-by: Felix Manlunas Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c | 3 +++ drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c b/driv= ers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c index e8b290473ee2..2e089b5ff8f3 100644 --- a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c +++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c @@ -493,6 +493,9 @@ static void cn23xx_pf_setup_global_output_regs(struct o= cteon_device *oct) for (q_no =3D srn; q_no < ern; q_no++) { reg_val =3D octeon_read_csr(oct, CN23XX_SLI_OQ_PKT_CONTROL(q_no)); =20 + /* clear IPTR */ + reg_val &=3D ~CN23XX_PKT_OUTPUT_CTL_IPTR; + /* set DPTR */ reg_val |=3D CN23XX_PKT_OUTPUT_CTL_DPTR; =20 diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c b/driv= ers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c index 9338a0008378..1f8b7f651254 100644 --- a/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c +++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_vf_device.c @@ -165,6 +165,9 @@ static void cn23xx_vf_setup_global_output_regs(struct o= cteon_device *oct) reg_val =3D octeon_read_csr(oct, CN23XX_VF_SLI_OQ_PKT_CONTROL(q_no)); =20 + /* clear IPTR */ + reg_val &=3D ~CN23XX_PKT_OUTPUT_CTL_IPTR; + /* set DPTR */ reg_val |=3D CN23XX_PKT_OUTPUT_CTL_DPTR; =20 --=20 2.17.1