From patchwork Tue Sep 19 17:26:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kalderon, Michal" X-Patchwork-Id: 9959777 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 9547060568 for ; Tue, 19 Sep 2017 17:27:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E1A128ED5 for ; Tue, 19 Sep 2017 17:27:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72F3E28ED9; Tue, 19 Sep 2017 17:27:50 +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 F2B8E28ED5 for ; Tue, 19 Sep 2017 17:27:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751499AbdISR1n (ORCPT ); Tue, 19 Sep 2017 13:27:43 -0400 Received: from mail-by2nam01on0051.outbound.protection.outlook.com ([104.47.34.51]:32800 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751471AbdISR1j (ORCPT ); Tue, 19 Sep 2017 13:27:39 -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=IevIuC5GWnX9D2s3wXQL4CkLc/69tPqoH3SGwLTFw0WQV3cnPbBH4ExiRU9HCgX0aQhTU45OUV04iJJoYIcmdUDDBq6WQxBhmV5Os+R2k7ze9erwFGcifyeFrfID50pNX4NC6jtj2DCkPCGdbZTk7mA8dJvJL+vggiHzPzfZs8Q= Received: from SN1PR0701CA0018.namprd07.prod.outlook.com (10.162.96.28) by BLUPR0701MB2084.namprd07.prod.outlook.com (10.163.122.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Tue, 19 Sep 2017 17:27:37 +0000 Received: from BL2FFO11FD050.protection.gbl (2a01:111:f400:7c09::109) by SN1PR0701CA0018.outlook.office365.com (2a01:111:e400:5173::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.56.9 via Frontend Transport; Tue, 19 Sep 2017 17:27:37 +0000 Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BL2FFO11FD050.mail.protection.outlook.com (10.173.161.212) 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; Tue, 19 Sep 2017 17:27:36 +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; Tue, 19 Sep 2017 10:27:34 -0700 From: Michal Kalderon To: , CC: , , Michal Kalderon , Ariel Elior Subject: [PATCH net-next 4/4] qed: iWARP - Add check for errors on a SYN packet Date: Tue, 19 Sep 2017 20:26:19 +0300 Message-ID: <1505841979-26365-5-git-send-email-Michal.Kalderon@cavium.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1505841979-26365-1-git-send-email-Michal.Kalderon@cavium.com> References: <1505841979-26365-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)(2906002)(48376002)(107886003)(16586007)(76176999)(5660300001)(356003)(105586002)(2950100002)(47776003)(50466002)(69596002)(104016004)(110136005)(72206003)(77096006)(4326008)(478600001)(305945005)(50986999)(36756003)(316002)(575784001)(81156014)(5003940100001)(86362001)(81166006)(8676002)(8936002)(50226002)(189998001)(6666003)(54906002)(101416001)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB2084; 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; BL2FFO11FD050; 1:qjtN513MdeEUnBcCK4vv5iGO6iJ35ruvX+x04MNBaWbsyBnIcbCukCMdktMLkVls59LI4t2iE274/wYpehqltqMYGUV5Zidzje/XjSiodu6cDvetph9Op5pt4gbA5cEa X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3e364908-e382-41d4-85f6-08d4ff83b8d9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BLUPR0701MB2084; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2084; 3:9goVWi7Kqp5xTFxM8c78IaibgYpdX/5l2w5PtF0K2YgdZ0d1qYKdxkcfWSPrxuc+fBiCBa5CGfM9NiaIbwWL9ZyH9KShJ5uAGEQzR15LYAR08di7w03A7fHy72DwqVcPwGDm5h1hC3VQ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IvUhHMIdMDgzq63HOykvKWeD5vyzMqVNKwqlmNHC8cteH5iqBJ7le1/CsCbRp+sOd7aJMyW+yTsAMkCtcZEHnAX18Aoi6D/FIZDWw9wVJNYW4SHKjpqiePTGu2exq1IT1hYBzZfccC+naoDQQOEL4K7OzzPsI0AtSGqOuEe/R02WQxp2RsMlfKvqY2FmrNQNotfn44gSxLy0GWLMlIB5Kvuu2NLcsGk4Hz5gZUKEjqIrFpulmjOmzvwZSbfK2eXeJEly5NC55xXsSqctZac/W9QqP2oeE1M7qkE6X4CgrjHN5v8Yo8TeMk+3KmAxshFeqnvEm2HTRanu 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)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123564025)(20161123560025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0701MB2084; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0701MB2084; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB2084; 4:/8jFFRVMPy8bGiJhHR3FL+DEzs9yzNxMnceHGwgr6WEEUjyd3UWr/zBWqhgxdbwm/xJnLbImbjPvbw41fB/iyRTxBI6VCIPg4jw9msR1rAtk8Ft5Hu7Q42wihoE98QBMJQ5bJ5+Mi4ssmc7lJODXGOuA2vAFjA5wHTSkLvQJkZqCvlwbXMoPvyIRhEg3auu1MlX43tjovvw/ljDUQis+ZKPPgXPWOBD5ZrU4XYahy+YdWv2aSUl/k7IUFAc5oeMD X-Forefront-PRVS: 04359FAD81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ATKvMkBlkZg9Gn/IWIQes/6voOr1GZi9sbGJXqlt8AiwCQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2017 17:27:36.9557 (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: BLUPR0701MB2084 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;