From patchwork Mon Oct 9 09:37:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kalderon, Michal" X-Patchwork-Id: 9992461 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 7F12760223 for ; Mon, 9 Oct 2017 09:40:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 703BC2877B for ; Mon, 9 Oct 2017 09:40:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 632BB28786; Mon, 9 Oct 2017 09:40:02 +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 AB3792877B for ; Mon, 9 Oct 2017 09:40:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753991AbdJIJiw (ORCPT ); Mon, 9 Oct 2017 05:38:52 -0400 Received: from mail-dm3nam03on0056.outbound.protection.outlook.com ([104.47.41.56]:30144 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751184AbdJIJiu (ORCPT ); Mon, 9 Oct 2017 05:38:50 -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=BLjQATnph/OEAYlZgkIElvLo/257ybRuStSXvjkzAZRPVhUBLCssKvVf+JiTFzcbP514K5ZJT2MgxAA+tFaKppXoXZt2DEDOd1mHs7wnEK+NoxWqaBRE702rGtp9yQZRGsB52xie6J7lpr+WDxt5mvs9s4FeBvJ5R/nBlJdQIi8= Received: from SN1PR0701CA0028.namprd07.prod.outlook.com (2a01:111:e400:5173::38) by CY4PR0701MB3811.namprd07.prod.outlook.com (2603:10b6:910:94::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Mon, 9 Oct 2017 09:38:48 +0000 Received: from BL2FFO11FD005.protection.gbl (2a01:111:f400:7c09::186) by SN1PR0701CA0028.outlook.office365.com (2a01:111:e400:5173::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.7 via Frontend Transport; Mon, 9 Oct 2017 09:38:48 +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 BL2FFO11FD005.mail.protection.outlook.com (10.173.161.1) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.77.10 via Frontend Transport; Mon, 9 Oct 2017 09:38:48 +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; Mon, 9 Oct 2017 02:38:44 -0700 From: Michal Kalderon To: CC: , , , Michal Kalderon , "Ariel Elior" Subject: [PATCH v3 net-next 06/12] qed: Add LL2 slowpath handling Date: Mon, 9 Oct 2017 12:37:48 +0300 Message-ID: <1507541874-18344-7-git-send-email-Michal.Kalderon@cavium.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1507541874-18344-1-git-send-email-Michal.Kalderon@cavium.com> References: <1507541874-18344-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)(104016004)(77096006)(36756003)(478600001)(8936002)(72206003)(2906002)(81166006)(81156014)(8676002)(107886003)(50466002)(2950100002)(6916009)(48376002)(69596002)(105586002)(189998001)(47776003)(50226002)(4326008)(5660300001)(106466001)(2351001)(356003)(16586007)(86362001)(101416001)(316002)(305945005)(50986999)(76176999)(5003940100001)(54906003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3811; 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; BL2FFO11FD005; 1:xVlddyIDwhEeK4qgDtNCQmxX6oYh8onR69isbUQoBHXQZo9j3xJ//wvsDeIIZYEUXZtEFfrPpn3kUP6e1ekiCrt/QE12PBmHRfKfoCv2i9KMUAmpKURw2+AA1A/8ieKA X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1d0adbc-56a8-4f02-e1df-08d50ef98af6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY4PR0701MB3811; X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3811; 3:MI6yuQ4jAheYnFPE4mL8KHdJ9kz3zSJwYW+7DRSwzRI3YgfOmC7J4Vg7HVLYfpXbMWxl7GDeS6e3sJP0s1r9JR5tm0AZ02hBeC2Z2ddq1hqXi4ZuH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+f7TSpOIjHdCZWDbaJeet5qGlIZAqDMEdUEkFEjEtLIf6umFjIkvGqGBLyxydb6oO/Y30s4w2TKRfFrMIOFJqkn7NY+0ddhksRkykfyoO5eVhgFOV5va+kEgn3Kie/LqqEGh3uVI5fVs84uokbWYlScG5eC0bdlUx0eGd+t8oTw5JBBRr2Ol4UZbbGKqRScwvc8pP8I8f4QTnX11GNsd3TxLGXNSOMZSyRqYOtvu/MpSCQUArx+wPFm2Akork5r9bzNxe9NOmMZoQ7/omG9p8H8if4zw3q7sD6enDn3SY+UfaId9K/SS3s/2EcdJ+2hiS2xDhNZm90PCc9lJxHG6cU1vW+l3CSBT81AB 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)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR0701MB3811; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR0701MB3811; X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3811; 4:Eu5wVayuL/8yO5YwxHEXtOGFyZF2mpfTDA5gwPJIXntnEqMA1FB/+etGvBFE4MPm0ROuHmz+9Rnw+MxYAN1lrut1IWgcPx9NQvGFW0fjZbl5huySZ1c1k/o8zzPpOnf9QFd5x3dT0V6HFcvnp0S6yzdpFDueDYO9YN7H5/rGuXnV9aa9AK3CzmNabcaZDBYBtZSkx5i02JnyVDL4vE81Uc4onLVEuOrRNivv9ACcUhrP+6Q1nEklvkKBs3BXX3PR X-Forefront-PRVS: 045584D28C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR0701MB3811; 23:OPX/zy/kmekuGlpcHFidZ7C37yKCunI5c6ouRgm?= =?us-ascii?Q?Qucw0SbFuIRJRgVsDZGO5EJOp4GFypu+Oh3DqpQ/VEpauLsG3uJ4XgiqsqD6?= =?us-ascii?Q?yQOGdDvS9T8BqpETc1DJMNSP7FsWALHaJRD66FzXD/CsAI+ozbTO3eEcMqtS?= =?us-ascii?Q?uZdkoqgw6HfheFSXg2vjzU05cI1X+kOouvxZHV+nvt/pgrdi3Y4SOi1BM3zU?= =?us-ascii?Q?fKZ6Z2CD9rhJPa0ztMdRzKeu2ZKLFRtsvU4E0ICn2ESvZ5iuusBY3vcXciOz?= =?us-ascii?Q?O4ch9hISIjj8NrX180OCBIRwmDpQxUPXO4WRtleh5VEqNfSz5BJ+WA9MXWmP?= =?us-ascii?Q?h2ay1RJedqvKci86+0wAl965dRTe47A86CdywBknm7b8dy+l3wn8QJU3oJ4/?= =?us-ascii?Q?HM4IWM9yguV2UbFzArMkXMcfjrHISWqmLL0MFQakkx/tZJsM9appDTkMIESv?= =?us-ascii?Q?QuuRqBOqHOdd6RTNw+uLLT1w8Sn7mI4Oj5mgR83FB9h1lb+S47hs4VomyRFc?= =?us-ascii?Q?BvghYRPm/kyVmPhCsSmcW40n9CB3PfHO2Tziai801sG2eLrzpovLXsY+g7qR?= =?us-ascii?Q?nMTzozmXxg9J+tMBnQ3ug29yY1wCHS42B5o8bHovXIb4h7krGmaWl/5eHf9u?= =?us-ascii?Q?Erfb/oyRDh6t11qkxf6J6k7cuh3l6y5eSirTBp7D+9z1Ibwjw0MaXpPNUDkv?= =?us-ascii?Q?SGCrowcZsDUVCzEedd/nXfdA8bGHlcdyPZkjzci1FIQUVBBJicTtP27raKDQ?= =?us-ascii?Q?izhfEFIRoG68rfJ/4GcmkIGo4qpnMQGT8Bm8K4akATO8HhFRNVrcyq8VOEDU?= =?us-ascii?Q?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2XXtugLmFvzfuHA9ywiD00s+ld/9ed78nHVxnHzYdaBZI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2017 09:38:48.0442 (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: CY4PR0701MB3811 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; };