aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-07-03 04:43:46 -0400
committerDavid S. Miller <davem@davemloft.net>2017-07-03 04:43:46 -0400
commit2da95be940714f6e75054a81e6484f5349b66f5f (patch)
treee9f4168cb685ffd42c3dc25fa45703d9e03089f9 /include/linux
parenta5192c52377e6d283abb5dcd5d25d65bf2316f62 (diff)
parent93c45984d385bddf156735991ee0cd15c0753e4d (diff)
Merge branch 'qed-Add-iWARP-support-for-QL4xxxx'
Michal Kalderon says: ==================== qed: Add iWARP support for QL4xxxx This patch series adds iWARP support to our QL4xxxx networking adapters. The code changes span across qed and qedr drivers, but this series contains changes to qed only. Once the series is accepted, the qedr series will be submitted to the rdma tree. There is one additional qed patch which enables the iWARP, this patch is delayed until the qedr series will be accepted. The patches were previously sent as an RFC, and these are the first 12 patches in the RFC series: https://www.spinics.net/lists/linux-rdma/msg51416.html This series was tested and built against net-next. MAINTAINERS file is not updated in this PATCH as there is a pending patch for qedr driver update https://patchwork.kernel.org/patch/9752761. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/qed/common_hsi.h4
-rw-r--r--include/linux/qed/iwarp_common.h53
-rw-r--r--include/linux/qed/qed_ll2_if.h3
-rw-r--r--include/linux/qed/qed_rdma_if.h114
4 files changed, 172 insertions, 2 deletions
diff --git a/include/linux/qed/common_hsi.h b/include/linux/qed/common_hsi.h
index a567cbf8c5b4..39e2a2ac2471 100644
--- a/include/linux/qed/common_hsi.h
+++ b/include/linux/qed/common_hsi.h
@@ -38,6 +38,8 @@
38#include <linux/slab.h> 38#include <linux/slab.h>
39 39
40/* dma_addr_t manip */ 40/* dma_addr_t manip */
41#define PTR_LO(x) ((u32)(((uintptr_t)(x)) & 0xffffffff))
42#define PTR_HI(x) ((u32)((((uintptr_t)(x)) >> 16) >> 16))
41#define DMA_LO_LE(x) cpu_to_le32(lower_32_bits(x)) 43#define DMA_LO_LE(x) cpu_to_le32(lower_32_bits(x))
42#define DMA_HI_LE(x) cpu_to_le32(upper_32_bits(x)) 44#define DMA_HI_LE(x) cpu_to_le32(upper_32_bits(x))
43#define DMA_REGPAIR_LE(x, val) do { \ 45#define DMA_REGPAIR_LE(x, val) do { \
@@ -778,7 +780,7 @@ enum protocol_type {
778 PROTOCOLID_ROCE, 780 PROTOCOLID_ROCE,
779 PROTOCOLID_CORE, 781 PROTOCOLID_CORE,
780 PROTOCOLID_ETH, 782 PROTOCOLID_ETH,
781 PROTOCOLID_RESERVED4, 783 PROTOCOLID_IWARP,
782 PROTOCOLID_RESERVED5, 784 PROTOCOLID_RESERVED5,
783 PROTOCOLID_PREROCE, 785 PROTOCOLID_PREROCE,
784 PROTOCOLID_COMMON, 786 PROTOCOLID_COMMON,
diff --git a/include/linux/qed/iwarp_common.h b/include/linux/qed/iwarp_common.h
new file mode 100644
index 000000000000..b8b3e1cfae90
--- /dev/null
+++ b/include/linux/qed/iwarp_common.h
@@ -0,0 +1,53 @@
1/* QLogic qed NIC Driver
2 * Copyright (c) 2015-2017 QLogic Corporation
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and /or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32#ifndef __IWARP_COMMON__
33#define __IWARP_COMMON__
34#include <linux/qed/rdma_common.h>
35/************************/
36/* IWARP FW CONSTANTS */
37/************************/
38
39#define IWARP_ACTIVE_MODE 0
40#define IWARP_PASSIVE_MODE 1
41
42#define IWARP_SHARED_QUEUE_PAGE_SIZE (0x8000)
43#define IWARP_SHARED_QUEUE_PAGE_RQ_PBL_OFFSET (0x4000)
44#define IWARP_SHARED_QUEUE_PAGE_RQ_PBL_MAX_SIZE (0x1000)
45#define IWARP_SHARED_QUEUE_PAGE_SQ_PBL_OFFSET (0x5000)
46#define IWARP_SHARED_QUEUE_PAGE_SQ_PBL_MAX_SIZE (0x3000)
47
48#define IWARP_REQ_MAX_INLINE_DATA_SIZE (128)
49#define IWARP_REQ_MAX_SINGLE_SQ_WQE_SIZE (176)
50
51#define IWARP_MAX_QPS (64 * 1024)
52
53#endif /* __IWARP_COMMON__ */
diff --git a/include/linux/qed/qed_ll2_if.h b/include/linux/qed/qed_ll2_if.h
index 5958b45eb699..dd7a3b86bb9e 100644
--- a/include/linux/qed/qed_ll2_if.h
+++ b/include/linux/qed/qed_ll2_if.h
@@ -47,9 +47,10 @@ enum qed_ll2_conn_type {
47 QED_LL2_TYPE_FCOE, 47 QED_LL2_TYPE_FCOE,
48 QED_LL2_TYPE_ISCSI, 48 QED_LL2_TYPE_ISCSI,
49 QED_LL2_TYPE_TEST, 49 QED_LL2_TYPE_TEST,
50 QED_LL2_TYPE_ISCSI_OOO, 50 QED_LL2_TYPE_OOO,
51 QED_LL2_TYPE_RESERVED2, 51 QED_LL2_TYPE_RESERVED2,
52 QED_LL2_TYPE_ROCE, 52 QED_LL2_TYPE_ROCE,
53 QED_LL2_TYPE_IWARP,
53 QED_LL2_TYPE_RESERVED3, 54 QED_LL2_TYPE_RESERVED3,
54 MAX_QED_LL2_RX_CONN_TYPE 55 MAX_QED_LL2_RX_CONN_TYPE
55}; 56};
diff --git a/include/linux/qed/qed_rdma_if.h b/include/linux/qed/qed_rdma_if.h
index ff9be01b5f53..4dd72ba210f5 100644
--- a/include/linux/qed/qed_rdma_if.h
+++ b/include/linux/qed/qed_rdma_if.h
@@ -470,6 +470,101 @@ struct qed_rdma_counters_out_params {
470#define QED_ROCE_TX_HEAD_FAILURE (1) 470#define QED_ROCE_TX_HEAD_FAILURE (1)
471#define QED_ROCE_TX_FRAG_FAILURE (2) 471#define QED_ROCE_TX_FRAG_FAILURE (2)
472 472
473enum qed_iwarp_event_type {
474 QED_IWARP_EVENT_MPA_REQUEST, /* Passive side request received */
475 QED_IWARP_EVENT_PASSIVE_COMPLETE, /* ack on mpa response */
476 QED_IWARP_EVENT_ACTIVE_COMPLETE, /* Active side reply received */
477 QED_IWARP_EVENT_DISCONNECT,
478 QED_IWARP_EVENT_CLOSE,
479 QED_IWARP_EVENT_IRQ_FULL,
480 QED_IWARP_EVENT_RQ_EMPTY,
481 QED_IWARP_EVENT_LLP_TIMEOUT,
482 QED_IWARP_EVENT_REMOTE_PROTECTION_ERROR,
483 QED_IWARP_EVENT_CQ_OVERFLOW,
484 QED_IWARP_EVENT_QP_CATASTROPHIC,
485 QED_IWARP_EVENT_ACTIVE_MPA_REPLY,
486 QED_IWARP_EVENT_LOCAL_ACCESS_ERROR,
487 QED_IWARP_EVENT_REMOTE_OPERATION_ERROR,
488 QED_IWARP_EVENT_TERMINATE_RECEIVED
489};
490
491enum qed_tcp_ip_version {
492 QED_TCP_IPV4,
493 QED_TCP_IPV6,
494};
495
496struct qed_iwarp_cm_info {
497 enum qed_tcp_ip_version ip_version;
498 u32 remote_ip[4];
499 u32 local_ip[4];
500 u16 remote_port;
501 u16 local_port;
502 u16 vlan;
503 u8 ord;
504 u8 ird;
505 u16 private_data_len;
506 const void *private_data;
507};
508
509struct qed_iwarp_cm_event_params {
510 enum qed_iwarp_event_type event;
511 const struct qed_iwarp_cm_info *cm_info;
512 void *ep_context; /* To be passed to accept call */
513 int status;
514};
515
516typedef int (*iwarp_event_handler) (void *context,
517 struct qed_iwarp_cm_event_params *event);
518
519struct qed_iwarp_connect_in {
520 iwarp_event_handler event_cb;
521 void *cb_context;
522 struct qed_rdma_qp *qp;
523 struct qed_iwarp_cm_info cm_info;
524 u16 mss;
525 u8 remote_mac_addr[ETH_ALEN];
526 u8 local_mac_addr[ETH_ALEN];
527};
528
529struct qed_iwarp_connect_out {
530 void *ep_context;
531};
532
533struct qed_iwarp_listen_in {
534 iwarp_event_handler event_cb;
535 void *cb_context; /* passed to event_cb */
536 u32 max_backlog;
537 enum qed_tcp_ip_version ip_version;
538 u32 ip_addr[4];
539 u16 port;
540 u16 vlan;
541};
542
543struct qed_iwarp_listen_out {
544 void *handle;
545};
546
547struct qed_iwarp_accept_in {
548 void *ep_context;
549 void *cb_context;
550 struct qed_rdma_qp *qp;
551 const void *private_data;
552 u16 private_data_len;
553 u8 ord;
554 u8 ird;
555};
556
557struct qed_iwarp_reject_in {
558 void *ep_context;
559 void *cb_context;
560 const void *private_data;
561 u16 private_data_len;
562};
563
564struct qed_iwarp_send_rtr_in {
565 void *ep_context;
566};
567