From patchwork Mon Oct 2 08:23:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kalderon, Michal" X-Patchwork-Id: 9980381 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 A81E66029B for ; Mon, 2 Oct 2017 08:24:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9802028952 for ; Mon, 2 Oct 2017 08:24:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 897FC28955; Mon, 2 Oct 2017 08:24:56 +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 E547D28952 for ; Mon, 2 Oct 2017 08:24:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750983AbdJBIYv (ORCPT ); Mon, 2 Oct 2017 04:24:51 -0400 Received: from mail-cys01nam02on0078.outbound.protection.outlook.com ([104.47.37.78]:34399 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750984AbdJBIYr (ORCPT ); Mon, 2 Oct 2017 04:24:47 -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=0oW46LQoqU9Ww3WaK7IlePJmz9TOzAXFmd6t1P6iVMY=; b=L4LZCLy6FiHMcS1nZZvqngB5oJESu2FcV4JoVsiq0HCEln0qRX3b8OlcCxC80dm/WJf3/ElQb8oHwgyZydwQvuW4iMKrOCu/dkzPYZ9N5NroueeII39JbiXtiaLeqzNE3XC0tGUgRFMIhmAKzBHo/achTrGnYK342JAl6jf6I/0= Received: from BY2PR07CA0029.namprd07.prod.outlook.com (10.166.107.24) by CO2PR07MB489.namprd07.prod.outlook.com (10.141.197.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Mon, 2 Oct 2017 08:24:45 +0000 Received: from BL2FFO11FD047.protection.gbl (2a01:111:f400:7c09::115) by BY2PR07CA0029.outlook.office365.com (2a01:111:e400:7bff::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.56.11 via Frontend Transport; Mon, 2 Oct 2017 08:24:45 +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 BL2FFO11FD047.mail.protection.outlook.com (10.173.161.209) 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; Mon, 2 Oct 2017 08:24:44 +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, 2 Oct 2017 01:24:41 -0700 From: Michal Kalderon To: CC: , , , Michal Kalderon , "Ariel Elior" Subject: [PATCH net-next 03/12] qed: Add ll2 option for dropping a tx packet Date: Mon, 2 Oct 2017 11:23:49 +0300 Message-ID: <1506932638-26268-4-git-send-email-Michal.Kalderon@cavium.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1506932638-26268-1-git-send-email-Michal.Kalderon@cavium.com> References: <1506932638-26268-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)(72206003)(86362001)(54906003)(4326008)(575784001)(8676002)(2950100002)(107886003)(81156014)(8936002)(81166006)(2351001)(478600001)(36756003)(6916009)(16586007)(69596002)(316002)(189998001)(106466001)(105586002)(101416001)(77096006)(5660300001)(2906002)(356003)(104016004)(5003940100001)(76176999)(305945005)(50986999)(50226002)(47776003)(48376002)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB489; 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; BL2FFO11FD047; 1:U3hJHOVyiAxvta+WKj1Na8TSWZTWew8vU0Se0V1zuL317Xy2jLm6NKk2sSswWEEHi2HN+HO2Ga9BwmfPylNGv2I+XhlCRgDzx3Xne3fPVk2W/k88Sarna4Yi5dBmCWh1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 80af751c-e1f2-48b8-9f72-08d5096f0972 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CO2PR07MB489; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB489; 3:n+EDI0/FPgxeE3LtDDtQ7gsXs3lo0jis9FBmZzNzPQIm3PRYy1KQSHwiZJ3IlG5zw0lrjtUCQCpxfpsrv0OXsxCTV2r5Rrg46u7QdA18fEieyMvLAiqn2LEmPgqRADtvjCShx603jz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brV8RcwSepXEleGwVPX27WwD2wH1FyMJZEAtrWB7cHwPaG1x0cVez1A1kFZNUC9jJqLXDhm0wHJG/Fk7L1LaCw44WtlxRLXqBr3ncdENpXD4HuQRcg8KxGMNCAyMXjiyKGk1PrkDVwtZE+S0mmyPGeVwk3H5TOeGit7g0uxpNd2mws8HBia66JS51BBJppy3k6Wn4+HIZ7EBbwynk7QyIPVHUm4iG+15XA5+OrNyLFix0Wa3eMszYqeotNJ5Cgw0LU4Oneff9yMBCgupEz+WVEj+Q2urM7AyS6; 4:K7qK3a8ievPk66IeQkmLfByeHjlGXNFED7bqaeq05Xn4N5CSfknrfn+T902zr0uZDl7maOnBNHaAbk3ADvDp7au1uQQi51sVbKBanKap35tjKW313rXBJwST4NkwRUOouKWBfm0dAc9iiqELa9rYrysQ4V4Qs45TQwLGHCMso5QoTolBH4gzNrSTWvYfrG/CUGCLFhmauuPAxkN3M8Lubnh8PrVPFa2zGgNXmDtCQHMM1xy3qxFL482dSPo/FdSB 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)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6041248)(20161123564025)(20161123555025)(20161123560025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR07MB489; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR07MB489; X-Forefront-PRVS: 0448A97BF2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR07MB489; 23:N5gzpZWs7pIRc6Px+e5UdCWlyvihqDt3mvtNi9rayx?= =?us-ascii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kheMJBqm5rVEf6hIGbYB?= =?us-ascii?Q?D1UHamePjizn00p8eiJTeRxJvA1q9yhYRtXl2t0V8Bs8tPb0PDJ7WMztGXo/?= =?us-ascii?Q?ALTsPqt7WG95BAkAOV2soC?= X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB489; 6:ccoWct9tuZN7a4GccQlTwQqlR+zbqHJ4aRT0V/rIRK24Zid53IeAa9x8PQqVny60ZImNCwUYWcRcJ1oseg3N3drzVmlceG+HEha20xbJYVkbaXQZSz/rYLx5a+8ApFgCuMdcSLu59ekoSiOqiNPmRJW1dzWmdmgrQUNA0OZfa+8L1NNTpiuwKIE95cFSHpdYvTzgspBi/5fiS9UlQtBAHTLr0y+h49tS/BHOM8OAf0u9GSQcqzzczdi5t320FJRi3ig+mlHYCVB3RqalmBnVzBekc2RErDhYGjgmvp+i096b3kuNtXHHtSTxZAgiWpAqWjOEoMOCTB3NABE7RC2iNA==; 5:EfDYQhIZ+t9gULqPpufVGxEkgxlTE9is+4MWR/X0UUbD6C/VmvSNaMQUl5SQD5zullEtIMVvEZJD/6cdxJ+l3d005kyvn87RfoXf7l6MZlIgOeDinLL/J9fPNfjvMxoC5Xelte/LkMBc+8suDma1Kg==; 24:yzu62aG7ebzDJdOFRsu+RFM8vwxmTQq7zEAyvsw2G7fQBB9mveAT8GzPjNKY35jVFyt/x1Mgl7qSTLAukAqOv5Wn47WLO17p4SPOqHqUN5A=; 7:uIG5uxmCsXfbhWoADhb4zG4kLR/LNuu1wwgvYiw1vNzgKiEMB5TW83DAyq4THx0JvqBahKmzawxztxPKLNCraE2k3s1qtA7uZkTfmlnuJoLKuALdemGApg3LhQX8X2N5iE+qaFxxh9myW/cHPReGxMBDLZHQIHnnhh8dzZOoOvmlY8KXDXm1VY2NC1X2mqyOenOV2L7nwCWwDaWfjNNpiLYXR/hznAcPfyA28NrZG1M= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2017 08:24:44.3887 (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: CO2PR07MB489 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 The option of sending a packet on the ll2 and dropping it exists in hardware and was not used until now, thus not exposed. The iWARP unaligned MPA flow requires this functionality for flushing the tx queue. Signed-off-by: Michal Kalderon Signed-off-by: Ariel Elior --- drivers/net/ethernet/qlogic/qed/qed_ll2.c | 16 ++++++++++++++-- include/linux/qed/qed_ll2_if.h | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_ll2.c b/drivers/net/ethernet/qlogic/qed/qed_ll2.c index 1dd0cca..49fcfda 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_ll2.c +++ b/drivers/net/ethernet/qlogic/qed/qed_ll2.c @@ -1597,8 +1597,20 @@ static void qed_ll2_prepare_tx_packet_set(struct qed_hwfn *p_hwfn, roce_flavor = (pkt->qed_roce_flavor == QED_LL2_ROCE) ? CORE_ROCE : CORE_RROCE; - tx_dest = (pkt->tx_dest == QED_LL2_TX_DEST_NW) ? CORE_TX_DEST_NW - : CORE_TX_DEST_LB; + switch (pkt->tx_dest) { + case QED_LL2_TX_DEST_NW: + tx_dest = CORE_TX_DEST_NW; + break; + case QED_LL2_TX_DEST_LB: + tx_dest = CORE_TX_DEST_LB; + break; + case QED_LL2_TX_DEST_DROP: + tx_dest = CORE_TX_DEST_DROP; + break; + default: + tx_dest = CORE_TX_DEST_LB; + break; + } start_bd = (struct core_tx_bd *)qed_chain_produce(p_tx_chain); start_bd->nw_vlan_or_lb_echo = cpu_to_le16(pkt->vlan); diff --git a/include/linux/qed/qed_ll2_if.h b/include/linux/qed/qed_ll2_if.h index 25153ff..aa7cb3b 100644 --- a/include/linux/qed/qed_ll2_if.h +++ b/include/linux/qed/qed_ll2_if.h @@ -64,6 +64,7 @@ enum qed_ll2_roce_flavor_type { enum qed_ll2_tx_dest { QED_LL2_TX_DEST_NW, /* Light L2 TX Destination to the Network */ QED_LL2_TX_DEST_LB, /* Light L2 TX Destination to the Loopback */ + QED_LL2_TX_DEST_DROP, /* Light L2 Drop the TX packet */ QED_LL2_TX_DEST_MAX };