Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp26995imu; Thu, 8 Nov 2018 14:08:25 -0800 (PST) X-Google-Smtp-Source: AJdET5eoP6MFiYUuj/hK7XZjtO9uCFD20OLuarOiU4ZazWXpkVSmQ83CwPvSMS03jGTJH2m0ZyAO X-Received: by 2002:a63:4926:: with SMTP id w38mr5068449pga.353.1541714905116; Thu, 08 Nov 2018 14:08:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541714905; cv=none; d=google.com; s=arc-20160816; b=SavNWK4wjVa0imyxH2kaMR+nwpD+pGW3sJmO3YfavCd/Ki9Z5JV+QZy2Nt6A+k9Iby L0p8drvd8K16eut8TZHbb+lMcPiaTDJdEj0+qCksuYjJNko/x6sMzb7feRurifj8CgUu rSyfYAh8R4IeBm6HmUN6ueW5cbiCiGEF/oJHCqTssO/R3qjDLCOfplpQ+hG8o3HzeUC1 AUxJ6hOfSdSacqQxlBy8II7tIu0rEUtJM8Yyuasj/T6j7ah4EqIsjLYhFuIjo+TvPH1s QfjoJLT8no2pyOqpXwt0VfyVqitls37+0Y5AABiVEjNFwCSRmsLyZHL3wotgTWcgKZv0 0YgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=M37WF9u/lWuOLbVI+hTYWSdVYvkKFedqd4A0M0xY+94=; b=MJF/UxKGarW1kgVj4k8tBrPgkAoqksL/zxf6e7eYsAxKKkYM9Xgp5UAXh6BWqN97lr 2E6Jp4xtKUcL2ueI6LsyPn4gyv1eT8FbplE9UZoaRkVOEXq9ofQUesxNodp+e7TaxKHL Ytww4kT3ZZNyahLgKRLilnmQJiX9x2oev+2VIeFNTz1SC4BDLOol/xrckkpguXuL/67U JbThVeKpK+jQciaKCr9lIEOESc5iaGSLPNjudOGfioPVHJRncujRiJ3PFzg1TUJXlfzH dn891ivFYyh8d7YlIkpB+G4fE7t9fbnraZjT8lcI7mAp5iJPtAst3L4KxsTvT5mSwWFy jMkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qaCRFxZU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l26-v6si5985824pfe.21.2018.11.08.14.08.08; Thu, 08 Nov 2018 14:08:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qaCRFxZU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731486AbeKIHmT (ORCPT + 99 others); Fri, 9 Nov 2018 02:42:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:34070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727288AbeKIHmS (ORCPT ); Fri, 9 Nov 2018 02:42:18 -0500 Received: from localhost (unknown [208.72.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1842A20844; Thu, 8 Nov 2018 22:04:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714688; bh=98JvYzUzuD6neUgXffg0PE5QMT2/wBrDRrdCs27Y8eY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qaCRFxZUs1f7/hvGXdP7BrhDmCozourksvMjjnF8LbXYS7BF2NL6bM99phZv570Uj dJ85DgMhbvr9dULJYadbUUPnkWF728V1z0B5bo6219qqfHCcJMrdzUaj0RIFSiBQpB CmAk4+HSMPudZgftEU4UdCpqkMBFSIiwKPRr+c4Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manish Chopra , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 065/171] qlcnic: Fix tunnel offload for 82xx adapters Date: Thu, 8 Nov 2018 13:50:35 -0800 Message-Id: <20181108215132.283850917@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215127.257643509@linuxfoundation.org> References: <20181108215127.257643509@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 4bd7ef0b033721b659b9357057e76d1ced95c1da ] Qlogic's 82xx series adapter doesn't support tunnel offloads, driver incorrectly assumes that it is supported and causes firmware hang while running tunnel IO. This patch fixes this by not advertising tunnel offloads for 82xx adapters. Signed-off-by: Manish Chopra Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 26 +++++++++++++++++-- .../ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 2 ++ .../net/ethernet/qlogic/qlcnic/qlcnic_main.c | 2 ++ .../qlogic/qlcnic/qlcnic_sriov_common.c | 2 ++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h index 5ddadcd0c8db..f1242ab32ca6 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h @@ -1825,22 +1825,44 @@ struct qlcnic_hardware_ops { u32 (*get_cap_size)(void *, int); void (*set_sys_info)(void *, int, u32); void (*store_cap_mask)(void *, u32); + bool (*encap_rx_offload) (struct qlcnic_adapter *adapter); + bool (*encap_tx_offload) (struct qlcnic_adapter *adapter); }; extern struct qlcnic_nic_template qlcnic_vf_ops; -static inline bool qlcnic_encap_tx_offload(struct qlcnic_adapter *adapter) +static inline bool qlcnic_83xx_encap_tx_offload(struct qlcnic_adapter *adapter) { return adapter->ahw->extra_capability[0] & QLCNIC_83XX_FW_CAPAB_ENCAP_TX_OFFLOAD; } -static inline bool qlcnic_encap_rx_offload(struct qlcnic_adapter *adapter) +static inline bool qlcnic_83xx_encap_rx_offload(struct qlcnic_adapter *adapter) { return adapter->ahw->extra_capability[0] & QLCNIC_83XX_FW_CAPAB_ENCAP_RX_OFFLOAD; } +static inline bool qlcnic_82xx_encap_tx_offload(struct qlcnic_adapter *adapter) +{ + return false; +} + +static inline bool qlcnic_82xx_encap_rx_offload(struct qlcnic_adapter *adapter) +{ + return false; +} + +static inline bool qlcnic_encap_rx_offload(struct qlcnic_adapter *adapter) +{ + return adapter->ahw->hw_ops->encap_rx_offload(adapter); +} + +static inline bool qlcnic_encap_tx_offload(struct qlcnic_adapter *adapter) +{ + return adapter->ahw->hw_ops->encap_tx_offload(adapter); +} + static inline int qlcnic_start_firmware(struct qlcnic_adapter *adapter) { return adapter->nic_ops->start_firmware(adapter); diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c index 05d32e86bcf7..35c5ac41c0a1 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c @@ -242,6 +242,8 @@ static struct qlcnic_hardware_ops qlcnic_83xx_hw_ops = { .get_cap_size = qlcnic_83xx_get_cap_size, .set_sys_info = qlcnic_83xx_set_sys_info, .store_cap_mask = qlcnic_83xx_store_cap_mask, + .encap_rx_offload = qlcnic_83xx_encap_rx_offload, + .encap_tx_offload = qlcnic_83xx_encap_tx_offload, }; static struct qlcnic_nic_template qlcnic_83xx_ops = { diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 3ae3968b0edf..ebf5ead16939 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c @@ -632,6 +632,8 @@ static struct qlcnic_hardware_ops qlcnic_hw_ops = { .get_cap_size = qlcnic_82xx_get_cap_size, .set_sys_info = qlcnic_82xx_set_sys_info, .store_cap_mask = qlcnic_82xx_store_cap_mask, + .encap_rx_offload = qlcnic_82xx_encap_rx_offload, + .encap_tx_offload = qlcnic_82xx_encap_tx_offload, }; static int qlcnic_check_multi_tx_capability(struct qlcnic_adapter *adapter) diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c index 2f656f395f39..c58180f40844 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c @@ -77,6 +77,8 @@ static struct qlcnic_hardware_ops qlcnic_sriov_vf_hw_ops = { .free_mac_list = qlcnic_sriov_vf_free_mac_list, .enable_sds_intr = qlcnic_83xx_enable_sds_intr, .disable_sds_intr = qlcnic_83xx_disable_sds_intr, + .encap_rx_offload = qlcnic_83xx_encap_rx_offload, + .encap_tx_offload = qlcnic_83xx_encap_tx_offload, }; static struct qlcnic_nic_template qlcnic_sriov_vf_ops = { -- 2.17.1