Skip to content

Commit

Permalink
include/scsi/srp.h: Add support for immediate data
Browse files Browse the repository at this point in the history
Add constants and data structures to support immediate data. These
changes conform to SRP2r04.

Cc: Sergey Gorenko <sergeygo@mellanox.com>
Cc: Max Gurtovoy <maxg@mellanox.com>
Cc: Laurence Oberman <loberman@redhat.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
  • Loading branch information
Bart Van Assche authored and Doug Ledford committed Dec 19, 2018
1 parent feafa20 commit 16d14e0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions drivers/infiniband/ulp/srp/ib_srp.c
Original file line number Diff line number Diff line change
Expand Up @@ -4174,6 +4174,11 @@ static int __init srp_init_module(void)
{
int ret;

BUILD_BUG_ON(sizeof(struct srp_imm_buf) != 4);
BUILD_BUG_ON(sizeof(struct srp_login_req) != 64);
BUILD_BUG_ON(sizeof(struct srp_login_req_rdma) != 56);
BUILD_BUG_ON(sizeof(struct srp_cmd) != 48);

if (srp_sg_tablesize) {
pr_warn("srp_sg_tablesize is deprecated, please use cmd_sg_entries\n");
if (!cmd_sg_entries)
Expand Down
19 changes: 16 additions & 3 deletions include/scsi/srp.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ enum {
enum {
SRP_NO_DATA_DESC = 0,
SRP_DATA_DESC_DIRECT = 1,
SRP_DATA_DESC_INDIRECT = 2
SRP_DATA_DESC_INDIRECT = 2,
SRP_DATA_DESC_IMM = 3, /* new in SRP2 */
};

enum {
Expand Down Expand Up @@ -111,9 +112,16 @@ struct srp_indirect_buf {
struct srp_direct_buf desc_list[0];
} __attribute__((packed));

/* Immediate data buffer descriptor as defined in SRP2. */
struct srp_imm_buf {
__be32 len;
};

/* srp_login_req.flags */
enum {
SRP_MULTICHAN_SINGLE = 0,
SRP_MULTICHAN_MULTI = 1
SRP_MULTICHAN_MULTI = 1,
SRP_IMMED_REQUESTED = 0x80, /* new in SRP2 */
};

struct srp_login_req {
Expand All @@ -124,7 +132,9 @@ struct srp_login_req {
u8 reserved2[4];
__be16 req_buf_fmt;
u8 req_flags;
u8 reserved3[5];
u8 reserved3[1];
__be16 imm_data_offset; /* new in SRP2 */
u8 reserved4[2];
u8 initiator_port_id[16];
u8 target_port_id[16];
};
Expand All @@ -144,13 +154,16 @@ struct srp_login_req_rdma {
__be32 req_it_iu_len;
u8 initiator_port_id[16];
u8 target_port_id[16];
__be16 imm_data_offset;
u8 reserved[6];
};

/* srp_login_rsp.rsp_flags */
enum {
SRP_LOGIN_RSP_MULTICHAN_NO_CHAN = 0x0,
SRP_LOGIN_RSP_MULTICHAN_TERMINATED = 0x1,
SRP_LOGIN_RSP_MULTICHAN_MAINTAINED = 0x2,
SRP_LOGIN_RSP_IMMED_SUPP = 0x80, /* new in SRP2 */
};

/*
Expand Down

0 comments on commit 16d14e0

Please sign in to comment.