From patchwork Tue Oct 3 08:54:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kalderon, Michal" X-Patchwork-Id: 9981963 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 245216029B for ; Tue, 3 Oct 2017 08:56:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 174471FFCA for ; Tue, 3 Oct 2017 08:56:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C26C2862A; Tue, 3 Oct 2017 08:56:53 +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 187AA1FFCA for ; Tue, 3 Oct 2017 08:56:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751377AbdJCI4E (ORCPT ); Tue, 3 Oct 2017 04:56:04 -0400 Received: from mail-by2nam01on0071.outbound.protection.outlook.com ([104.47.34.71]:27217 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751277AbdJCI4C (ORCPT ); Tue, 3 Oct 2017 04:56:02 -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=I1Q01pdmzkp5LpuGSLJ18TzjUglRIIxzJOEkyIE9IC8=; b=BDWYYZ70JYtsnmlnTkp01x79yB2T1quO90px7Xrk+4+rQK3OdP+9C/j9hO1qNUG6LY2T8OLcwTurTVozeiEGTbgBnqsa+YHD+vEo4sWvrpuNlpETdcuga7CG4Lehtxe3jYIRomPTkHzNBW7ruYo1HOSu8vKZP/sw88nZFe2rvho= Received: from BY2PR07CA0031.namprd07.prod.outlook.com (10.166.107.26) by BY2PR0701MB2040.namprd07.prod.outlook.com (10.163.156.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 3 Oct 2017 08:55:59 +0000 Received: from BY2FFO11FD010.protection.gbl (2a01:111:f400:7c0c::193) by BY2PR07CA0031.outlook.office365.com (2a01:111:e400:7bff::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.56.11 via Frontend Transport; Tue, 3 Oct 2017 08:55:59 +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 BY2FFO11FD010.mail.protection.outlook.com (10.1.14.74) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.56.11 via Frontend Transport; Tue, 3 Oct 2017 08:55:59 +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, 3 Oct 2017 01:55:57 -0700 From: Michal Kalderon To: CC: , , , Michal Kalderon , "Ariel Elior" Subject: [PATCH v2 net-next 06/12] qed: Add LL2 slowpath handling Date: Tue, 3 Oct 2017 11:54:56 +0300 Message-ID: <1507020902-4952-7-git-send-email-Michal.Kalderon@cavium.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1507020902-4952-1-git-send-email-Michal.Kalderon@cavium.com> References: <1507020902-4952-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)(346002)(376002)(2980300002)(428002)(189002)(199003)(81156014)(50226002)(5003940100001)(72206003)(81166006)(8936002)(189998001)(104016004)(305945005)(2906002)(356003)(16586007)(86362001)(54906003)(77096006)(47776003)(8676002)(316002)(4326008)(48376002)(2950100002)(107886003)(50466002)(101416001)(50986999)(76176999)(478600001)(36756003)(106466001)(2351001)(69596002)(105586002)(5660300001)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0701MB2040; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD010; 1:cMVJmJzb57kEQW1vW8EIYzRCDZLz8Nd3tIVTzdxEdJdKmgBRaC+N2FbdF0kryXANY0Qpm32h2vzpO0NJlZ9Eh385rPCXTzGKV/HJn869vQQ2iHQ99Z1FKa689qfpjkfM X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4aa15adf-2712-4d46-eadb-08d50a3c9160 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BY2PR0701MB2040; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB2040; 3:Rm6QZZpV6f8WsZX0+d3/9LTM2Ac/uKwXWdtRt4flfGzJp5TdjroI/46/EP5W8GA3vDIQn1u4X3snIYaK8o4mIyqyQyWoqCsy1cko2hcvJceO9vT9rEssNfj3XEq/BLdmc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Wzt6rdpXSEdBtT5+S7+djX63T5DGRUQs2Ki5Tr2OEUTjWHelH+p47RuisT0AFbQa0zKhzMjqybZXnfrmGg2x8eyVXJDPu1vBvvX29Oi2GgJv/U3ItEXxnO+eizDynhP5KSs3iPOzGYpsWdk1yS0QHMqfLsjx7zU8TVogWaovzfrbpSW80bT0cWtKUGbNVC41Lfb9z2G6J6eYbPmn2BueKuFGq02wqci6dxQVmLagWSgiWsvFc+F7PmIEApzS+dl6LBuYxSYlVn03T9wUCsH/y55sB6RLXTSUaO8oMSNNplpj7iVL8afaS7; 4:8GyJc5+tweK2F+gS+TTwvMQke4UyS5Mf5G8XOvV7U1gX17LknLCf3h3fNLX8kpVMF4vzvlf8Df7E+WDPSUcPS2jNYslw66FIH0ucUc/6cNF6h9uBoTLUadKw1zLdqKm2HxfAaeBgeQ5nO2kG5CZUrpIpvx/xP3OCx7uHyz445VJ0hyUzK/RooUAaXOKbFUTt2DFhr/pYYfEcy0zud+Qb5h6GH2Pa0AgaJm5oMlACMPG17N5gKkgEoRtEps/evzr6 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)(10201501046)(3002001)(93006095)(93001095)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR0701MB2040; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR0701MB2040; X-Forefront-PRVS: 044968D9E1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0701MB2040; 23:pz/y2lonYgm7UeZQ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QBVKvQ3A1EzfnYzKYkD8OMt5yZeyN3IzG7LYw4eiWIpeRw7VPEsJex5+?= =?us-ascii?Q?U/PU600AHQyGd6wNJKI357P75rMaWxmja/QF9aiLGaPry1tHOt6HDgQkIAzd?= =?us-ascii?Q?S1d8=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB2040; 6:s0kROtV0wlBCNkriopbY1esP1k6/HRYiDrx0S+eX9YXBXKNG+TO6K41G+pHhN5LhRAFgXmQncwemAu28aFwkqda1+53zGzwCOUtbmpQfMh53t3qulu32aZOcMNfwmsrRy5HiqfLTZE4VM9oqvut88KIcTjj1g3L7TdU1DHbK3h8dOE8BLiCnRVv45+zH4myMaCfu/WUD+ntonNyH8pd40vP6hKzBev8WO/WSGEkH6+NFFNI5XWg4pfDQAS4Sv71N3NAyHZ/arvD9PLq65aFuCW410NBbiHSvxZeaaPTAfaTBOpxrzlRIdPFiltjtlPYMqPFPcIbPsYMzi8BZSKcUfQ==; 5:yK1GXxnfDyEkP977G58yu07HmLStPqEV3CWc+GWRHoJCFLS7TIBKCErIGh+nOOzv3eSOl4A8wh4yrsyGrwiEFATP7qOdTsd7KON06c8WavBx2qqfavQ9Tx8n0OXZbhfYMlpW21p2yN/AC15DaxVmIQ==; 24:lq5csqRtJoCKtJK8lMeVM/oHy223Yd1RVGWbymrbsg5rYsrRlhiqucdEC8YCD2Y3QwGYtYzXEdP8LR4a7xKvFksrKNVrYCOjsguIGfDsNlc=; 7:/sOhWPDlNw581hvOuYeNHfNgBbOdXBzxGgTI4jMPli8yO1wmY3xxfezzSyhX6hzM5Quu0iV1rtL4KB6eSTbjcrnXASUYveYii3egLzOc7sil4MH8O6L67Pn1rTBucSjyw5oi1FY8liIXHgmY3cYuckDJiiIsTOuZxr7U5hoJINrlDmS5Ek33RxMTPY+h95AUfMWfgf/n3nC3bbgwe6EOk/LbODhoB2ekwBlZRthjM0U= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2017 08:55:59.4128 (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: BY2PR0701MB2040 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 For iWARP unaligned MPA flow, a slowpath event of flushing an MPA connection that entered an unaligned state is required. The flush ramrod is received on the ll2 queue, and a pre-registered callback function is called to handle the flush event. Signed-off-by: Michal Kalderon Signed-off-by: Ariel Elior --- drivers/net/ethernet/qlogic/qed/qed_ll2.c | 40 +++++++++++++++++++++++++++++-- include/linux/qed/qed_ll2_if.h | 5 ++++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_ll2.c b/drivers/net/ethernet/qlogic/qed/qed_ll2.c index 8eb9645..047f556 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_ll2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_ll2.c @@ -423,6 +423,41 @@ static void qed_ll2_rxq_parse_reg(struct qed_hwfn *p_hwfn, } static int +qed_ll2_handle_slowpath(struct qed_hwfn *p_hwfn, + struct qed_ll2_info *p_ll2_conn, + union core_rx_cqe_union *p_cqe, + unsigned long *p_lock_flags) +{ + struct qed_ll2_rx_queue *p_rx = &p_ll2_conn->rx_queue; + struct core_rx_slow_path_cqe *sp_cqe; + + sp_cqe = &p_cqe->rx_cqe_sp; + if (sp_cqe->ramrod_cmd_id != CORE_RAMROD_RX_QUEUE_FLUSH) { + DP_NOTICE(p_hwfn, + "LL2 - unexpected Rx CQE slowpath ramrod_cmd_id:%d\n", + sp_cqe->ramrod_cmd_id); + return -EINVAL; + } + + if (!p_ll2_conn->cbs.slowpath_cb) { + DP_NOTICE(p_hwfn, + "LL2 - received RX_QUEUE_FLUSH but no callback was provided\n"); + return -EINVAL; + } + + spin_unlock_irqrestore(&p_rx->lock, *p_lock_flags); + + p_ll2_conn->cbs.slowpath_cb(p_ll2_conn->cbs.cookie, + p_ll2_conn->my_id, + le32_to_cpu(sp_cqe->opaque_data.data[0]), + le32_to_cpu(sp_cqe->opaque_data.data[1])); + + spin_lock_irqsave(&p_rx->lock, *p_lock_flags); + + return 0; +} + +static int qed_ll2_rxq_handle_completion(struct qed_hwfn *p_hwfn, struct qed_ll2_info *p_ll2_conn, union core_rx_cqe_union *p_cqe, @@ -495,8 +530,8 @@ static int qed_ll2_rxq_completion(struct qed_hwfn *p_hwfn, void *cookie) switch (cqe->rx_cqe_sp.type) { case CORE_RX_CQE_TYPE_SLOW_PATH: - DP_NOTICE(p_hwfn, "LL2 - unexpected Rx CQE slowpath\n"); - rc = -EINVAL; + rc = qed_ll2_handle_slowpath(p_hwfn, p_ll2_conn, + cqe, &flags); break; case CORE_RX_CQE_TYPE_GSI_OFFLOAD: case CORE_RX_CQE_TYPE_REGULAR: @@ -1214,6 +1249,7 @@ static int qed_ll2_acquire_connection_tx(struct qed_hwfn *p_hwfn, p_ll2_info->cbs.rx_release_cb = cbs->rx_release_cb; p_ll2_info->cbs.tx_comp_cb = cbs->tx_comp_cb; p_ll2_info->cbs.tx_release_cb = cbs->tx_release_cb; + p_ll2_info->cbs.slowpath_cb = cbs->slowpath_cb; p_ll2_info->cbs.cookie = cbs->cookie; return 0; diff --git a/include/linux/qed/qed_ll2_if.h b/include/linux/qed/qed_ll2_if.h index 95fdf02..e755954 100644 --- a/include/linux/qed/qed_ll2_if.h +++ b/include/linux/qed/qed_ll2_if.h @@ -151,11 +151,16 @@ struct qed_ll2_comp_rx_data { dma_addr_t first_frag_addr, bool b_last_fragment, bool b_last_packet); +typedef +void (*qed_ll2_slowpath_cb)(void *cxt, u8 connection_handle, + u32 opaque_data_0, u32 opaque_data_1); + struct qed_ll2_cbs { qed_ll2_complete_rx_packet_cb rx_comp_cb; qed_ll2_release_rx_packet_cb rx_release_cb; qed_ll2_complete_tx_packet_cb tx_comp_cb; qed_ll2_release_tx_packet_cb tx_release_cb; + qed_ll2_slowpath_cb slowpath_cb; void *cookie; };