From patchwork Sun Sep 24 09:09:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kalderon, Michal" X-Patchwork-Id: 9967855 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E0AA2602CB for ; Sun, 24 Sep 2017 09:11:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D25BF28966 for ; Sun, 24 Sep 2017 09:11:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C706228C5D; Sun, 24 Sep 2017 09:11:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 403F228DF0 for ; Sun, 24 Sep 2017 09:11:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752000AbdIXJKk (ORCPT ); Sun, 24 Sep 2017 05:10:40 -0400 Received: from mail-by2nam03on0064.outbound.protection.outlook.com ([104.47.42.64]:11794 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751630AbdIXJKg (ORCPT ); Sun, 24 Sep 2017 05:10:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KDWYj8khDIUkOO4tVSQRh3ZSSdfURIsgvPS2SxG1MS4=; b=nJuUdT5qDjkWKv4ya/JiN4chlz6O13deOPzweW8x2dKAY6SMBxD1hwWlu+SmQVWuiEuWIrbMJpoX4Ze1ED0oqY56n4qd5gq6Zuhk0gyuS1dygW/eGKXqtZPUddmkQHHcTfleMqOqYJjxjuIoEtm5r6rR28HQXYH4EcgkwIeWvos= Received: from DM5PR07CA0035.namprd07.prod.outlook.com (10.168.109.21) by BLUPR0701MB2081.namprd07.prod.outlook.com (10.163.122.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sun, 24 Sep 2017 09:10:34 +0000 Received: from BN1AFFO11FD039.protection.gbl (2a01:111:f400:7c10::147) by DM5PR07CA0035.outlook.office365.com (2603:10b6:3:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.56.11 via Frontend Transport; Sun, 24 Sep 2017 09:10:34 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1AFFO11FD039.mail.protection.outlook.com (10.58.52.243) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.35.14 via Frontend Transport; Sun, 24 Sep 2017 09:10:33 +0000 Received: from lb-tlvb-michal.il.qlogic.com.com (10.185.6.89) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Sun, 24 Sep 2017 02:10:30 -0700 From: Michal Kalderon To: , , CC: , , Michal Kalderon , Ariel Elior Subject: [PATCH v2 net-next 4/4] qed: iWARP - Add check for errors on a SYN packet Date: Sun, 24 Sep 2017 12:09:45 +0300 Message-ID: <1506244185-2129-5-git-send-email-Michal.Kalderon@cavium.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1506244185-2129-1-git-send-email-Michal.Kalderon@cavium.com> References: <1506244185-2129-1-git-send-email-Michal.Kalderon@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(2980300002)(428002)(199003)(189002)(86362001)(356003)(50226002)(107886003)(2906002)(72206003)(69596002)(54906003)(105586002)(478600001)(81166006)(106466001)(2201001)(77096006)(104016004)(575784001)(50466002)(2950100002)(6666003)(5660300001)(47776003)(48376002)(81156014)(76176999)(110136005)(8676002)(16586007)(50986999)(5003940100001)(305945005)(8936002)(189998001)(101416001)(316002)(36756003)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB2081; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD039; 1:hxvGR50zpqOpV8YJh7g6BbDKbO2IfUcTdTEOYPzQgLizTRFNP+7nx3NUGMnxSli79exhRIgFMeRj82TjXy+cto3Rk+c+esIivu6P5fP1Uav9EXmyE3wJUpJlYSPKdjRN X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4bdbb60d-879b-4745-a51b-08d5032c1cbf X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BLUPR0701MB2081; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2081; 3:0MWcYZeiwWPy7+j35Lw0xgVlhkOi+YjTUrpkowqeM2fukivteE6l0ipiuvxV6q27vjtBMhnHdPZlhAbuNIotxohrDIwb7vN551PY6YC3bgmPdS5o0weq85YMl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ui+zzIBrLGIaCYTm76OV6+PTok7wVBHyB4v49bJ/JWxKu2M4r0ef1AnAl/omJhxwVLexV/8w7fUBuR/iuHA6J5w40BuE46ocUtS9uhd8j9vG/k+Fd67DAGEg0nUPAzicuhERz+prjZVHekGZDPEEgVYayG5VAtroHa7ZTMuwy2Fy0Zrzsfc1HT48IfGCXDHn43Jb7rsKzBolyZuYLuCzdKv+0WdPAjIcQm3lmqOotu7ZkvT1qBS9MuA88Q5+DvxScvcIjAnqd+ejgmB5KBU4ZX7UrEHLUruAsGWa1unVt0oY+tg09; 4:GpEKBaQhZPoLLgeSimgjIlT4RW24kA7CUeh+tJbFGWu/HMwWRqrh756j+IHP61KI/VhVWZcQOqIOJNUdZAuWigJnKzcDz2Bqfsnx7KHRTfmW5i9mmp9jM8F+vC71j4l+8J4WsfcO6klJFXNVv5uvfynn+TU+EWTo4y8BuCLon4K345LUeEOz28RAo1p5Jsx4y63pLvr1gPYMi196FcBLEaWZkJazEcYlPnGwE4R6hnC/+5mlcjLfSfatjLLgl2Nw X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123558100)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0701MB2081; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0701MB2081; X-Forefront-PRVS: 0440AC9990 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB2081; 23:gMflrH2huAxkRFIVjqxVgDx9d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SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2017 09:10:33.5127 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB2081 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A SYN packet which arrives with errors from FW should be dropped. This required adding an additional field to the ll2 rx completion data. Signed-off-by: Michal Kalderon Signed-off-by: Ariel Elior --- drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 8 ++++++++ drivers/net/ethernet/qlogic/qed/qed_ll2.c | 1 + include/linux/qed/qed_ll2_if.h | 1 + 3 files changed, 10 insertions(+) diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c index 568e985..8fc9c811 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c @@ -1733,6 +1733,14 @@ int qed_iwarp_reject(void *rdma_cxt, struct qed_iwarp_reject_in *iparams) memset(&cm_info, 0, sizeof(cm_info)); ll2_syn_handle = p_hwfn->p_rdma_info->iwarp.ll2_syn_handle; + + /* Check if packet was received with errors... */ + if (data->err_flags) { + DP_NOTICE(p_hwfn, "Error received on SYN packet: 0x%x\n", + data->err_flags); + goto err; + } + if (GET_FIELD(data->parse_flags, PARSING_AND_ERR_FLAGS_L4CHKSMWASCALCULATED) && GET_FIELD(data->parse_flags, PARSING_AND_ERR_FLAGS_L4CHKSMERROR)) { diff --git a/drivers/net/ethernet/qlogic/qed/qed_ll2.c b/drivers/net/ethernet/qlogic/qed/qed_ll2.c index c06ad4f..250afa5 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_ll2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_ll2.c @@ -413,6 +413,7 @@ static void qed_ll2_rxq_parse_reg(struct qed_hwfn *p_hwfn, struct qed_ll2_comp_rx_data *data) { data->parse_flags = le16_to_cpu(p_cqe->rx_cqe_fp.parse_flags.flags); + data->err_flags = le16_to_cpu(p_cqe->rx_cqe_fp.err_flags.flags); data->length.packet_length = le16_to_cpu(p_cqe->rx_cqe_fp.packet_length); data->vlan = le16_to_cpu(p_cqe->rx_cqe_fp.vlan); diff --git a/include/linux/qed/qed_ll2_if.h b/include/linux/qed/qed_ll2_if.h index dd7a3b8..89fa0bb 100644 --- a/include/linux/qed/qed_ll2_if.h +++ b/include/linux/qed/qed_ll2_if.h @@ -101,6 +101,7 @@ struct qed_ll2_comp_rx_data { void *cookie; dma_addr_t rx_buf_addr; u16 parse_flags; + u16 err_flags; u16 vlan; bool b_last_packet; u8 connection_handle;