~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/rdma/rw.h

Version: ~ [ linux-5.4-rc3 ] ~ [ linux-5.3.6 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.79 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.149 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.196 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.196 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.75 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (c) 2016 HGST, a Western Digital Company.
  3  *
  4  * This program is free software; you can redistribute it and/or modify it
  5  * under the terms and conditions of the GNU General Public License,
  6  * version 2, as published by the Free Software Foundation.
  7  *
  8  * This program is distributed in the hope it will be useful, but WITHOUT
  9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 11  * more details.
 12  */
 13 #ifndef _RDMA_RW_H
 14 #define _RDMA_RW_H
 15 
 16 #include <linux/dma-mapping.h>
 17 #include <linux/scatterlist.h>
 18 #include <rdma/ib_verbs.h>
 19 #include <rdma/rdma_cm.h>
 20 #include <rdma/mr_pool.h>
 21 
 22 struct rdma_rw_ctx {
 23         /* number of RDMA READ/WRITE WRs (not counting MR WRs) */
 24         u32                     nr_ops;
 25 
 26         /* tag for the union below: */
 27         u8                      type;
 28 
 29         union {
 30                 /* for mapping a single SGE: */
 31                 struct {
 32                         struct ib_sge           sge;
 33                         struct ib_rdma_wr       wr;
 34                 } single;
 35 
 36                 /* for mapping of multiple SGEs: */
 37                 struct {
 38                         struct ib_sge           *sges;
 39                         struct ib_rdma_wr       *wrs;
 40                 } map;
 41 
 42                 /* for registering multiple WRs: */
 43                 struct rdma_rw_reg_ctx {
 44                         struct ib_sge           sge;
 45                         struct ib_rdma_wr       wr;
 46                         struct ib_reg_wr        reg_wr;
 47                         struct ib_send_wr       inv_wr;
 48                         struct ib_mr            *mr;
 49                 } *reg;
 50 
 51                 struct {
 52                         struct rdma_rw_reg_ctx  data;
 53                         struct rdma_rw_reg_ctx  prot;
 54                         struct ib_send_wr       sig_inv_wr;
 55                         struct ib_mr            *sig_mr;
 56                         struct ib_sge           sig_sge;
 57                         struct ib_sig_handover_wr sig_wr;
 58                 } *sig;
 59         };
 60 };
 61 
 62 int rdma_rw_ctx_init(struct rdma_rw_ctx *ctx, struct ib_qp *qp, u8 port_num,
 63                 struct scatterlist *sg, u32 sg_cnt, u32 sg_offset,
 64                 u64 remote_addr, u32 rkey, enum dma_data_direction dir);
 65 void rdma_rw_ctx_destroy(struct rdma_rw_ctx *ctx, struct ib_qp *qp, u8 port_num,
 66                 struct scatterlist *sg, u32 sg_cnt,
 67                 enum dma_data_direction dir);
 68 
 69 int rdma_rw_ctx_signature_init(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
 70                 u8 port_num, struct scatterlist *sg, u32 sg_cnt,
 71                 struct scatterlist *prot_sg, u32 prot_sg_cnt,
 72                 struct ib_sig_attrs *sig_attrs, u64 remote_addr, u32 rkey,
 73                 enum dma_data_direction dir);
 74 void rdma_rw_ctx_destroy_signature(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
 75                 u8 port_num, struct scatterlist *sg, u32 sg_cnt,
 76                 struct scatterlist *prot_sg, u32 prot_sg_cnt,
 77                 enum dma_data_direction dir);
 78 
 79 struct ib_send_wr *rdma_rw_ctx_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
 80                 u8 port_num, struct ib_cqe *cqe, struct ib_send_wr *chain_wr);
 81 int rdma_rw_ctx_post(struct rdma_rw_ctx *ctx, struct ib_qp *qp, u8 port_num,
 82                 struct ib_cqe *cqe, struct ib_send_wr *chain_wr);
 83 
 84 unsigned int rdma_rw_mr_factor(struct ib_device *device, u8 port_num,
 85                 unsigned int maxpages);
 86 void rdma_rw_init_qp(struct ib_device *dev, struct ib_qp_init_attr *attr);
 87 int rdma_rw_init_mrs(struct ib_qp *qp, struct ib_qp_init_attr *attr);
 88 void rdma_rw_cleanup_mrs(struct ib_qp *qp);
 89 
 90 #endif /* _RDMA_RW_H */
 91 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp