summaryrefslogtreecommitdiffstats
path: root/sys/dev/cxgbe/tom/t4_tom.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/cxgbe/tom/t4_tom.h')
-rw-r--r--sys/dev/cxgbe/tom/t4_tom.h40
1 files changed, 33 insertions, 7 deletions
diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h
index bab9ef6..48223b0 100644
--- a/sys/dev/cxgbe/tom/t4_tom.h
+++ b/sys/dev/cxgbe/tom/t4_tom.h
@@ -51,6 +51,9 @@
#define USE_DDP_RX_FLOW_CONTROL
+#define PPOD_SZ(n) ((n) * sizeof(struct pagepod))
+#define PPOD_SIZE (PPOD_SZ(1))
+
/* TOE PCB flags */
enum {
TPF_ATTACHED = (1 << 0), /* a tcpcb refers to this toepcb */
@@ -83,16 +86,31 @@ struct ofld_tx_sdesc {
uint8_t tx_credits; /* firmware tx credits (unit is 16B) */
};
+struct ppod_region {
+ u_int pr_start;
+ u_int pr_len;
+ u_int pr_page_shift[4];
+ uint32_t pr_tag_mask; /* hardware tagmask for this region. */
+ uint32_t pr_invalid_bit; /* OR with this to invalidate tag. */
+ uint32_t pr_alias_mask; /* AND with tag to get alias bits. */
+ u_int pr_alias_shift; /* shift this much for first alias bit. */
+ vmem_t *pr_arena;
+};
+
+struct ppod_reservation {
+ struct ppod_region *prsv_pr;
+ uint32_t prsv_tag; /* Full tag: pgsz, alias, tag, color */
+ u_int prsv_nppods;
+};
+
struct pageset {
TAILQ_ENTRY(pageset) link;
vm_page_t *pages;
int npages;
int flags;
- u_int ppod_addr;
- int nppods;
- uint32_t tag; /* includes color, page pod addr, and DDP page size */
int offset; /* offset in first page */
int len;
+ struct ppod_reservation prsv;
struct vmspace *vm;
u_int vm_timestamp;
};
@@ -239,8 +257,7 @@ struct tom_data {
u_long listen_mask;
int lctx_count; /* # of lctx in the hash table */
- u_int ppod_start;
- vmem_t *ppod_arena;
+ struct ppod_region pr;
struct mtx clip_table_lock;
struct clip_head clip_table;
@@ -345,8 +362,17 @@ void t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop);
int do_set_tcb_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *);
/* t4_ddp.c */
-void t4_init_ddp(struct adapter *, struct tom_data *);
-void t4_uninit_ddp(struct adapter *, struct tom_data *);
+int t4_init_ppod_region(struct ppod_region *, struct t4_range *, u_int,
+ const char *);
+void t4_free_ppod_region(struct ppod_region *);
+int t4_alloc_page_pods_for_ps(struct ppod_region *, struct pageset *);
+int t4_alloc_page_pods_for_buf(struct ppod_region *, vm_offset_t, int,
+ struct ppod_reservation *);
+int t4_write_page_pods_for_ps(struct adapter *, struct sge_wrq *, int,
+ struct pageset *);
+int t4_write_page_pods_for_buf(struct adapter *, struct sge_wrq *, int tid,
+ struct ppod_reservation *, vm_offset_t, int);
+void t4_free_page_pods(struct ppod_reservation *);
int t4_soreceive_ddp(struct socket *, struct sockaddr **, struct uio *,
struct mbuf **, struct mbuf **, int *);
int t4_aio_queue_ddp(struct socket *, struct kaiocb *);
OpenPOWER on IntegriCloud