| .. | .. |
|---|
| 76 | 76 | #define ULP2_MAX_PDU_PAYLOAD \ |
|---|
| 77 | 77 | (ULP2_MAX_PKT_SIZE - ISCSI_PDU_NONPAYLOAD_LEN) |
|---|
| 78 | 78 | |
|---|
| 79 | +#define CXGBI_ULP2_MAX_ISO_PAYLOAD 65535 |
|---|
| 80 | + |
|---|
| 81 | +#define CXGBI_MAX_ISO_DATA_IN_SKB \ |
|---|
| 82 | + min_t(u32, MAX_SKB_FRAGS << PAGE_SHIFT, CXGBI_ULP2_MAX_ISO_PAYLOAD) |
|---|
| 83 | + |
|---|
| 84 | +#define cxgbi_is_iso_config(csk) ((csk)->cdev->skb_iso_txhdr) |
|---|
| 85 | +#define cxgbi_is_iso_disabled(csk) ((csk)->disable_iso) |
|---|
| 86 | + |
|---|
| 79 | 87 | /* |
|---|
| 80 | 88 | * For iscsi connections HW may inserts digest bytes into the pdu. Those digest |
|---|
| 81 | 89 | * bytes are not sent by the host but are part of the TCP payload and therefore |
|---|
| .. | .. |
|---|
| 120 | 128 | int wr_max_cred; |
|---|
| 121 | 129 | int wr_cred; |
|---|
| 122 | 130 | int wr_una_cred; |
|---|
| 131 | +#ifdef CONFIG_CHELSIO_T4_DCB |
|---|
| 132 | + u8 dcb_priority; |
|---|
| 133 | +#endif |
|---|
| 123 | 134 | unsigned char hcrc_len; |
|---|
| 124 | 135 | unsigned char dcrc_len; |
|---|
| 125 | 136 | |
|---|
| .. | .. |
|---|
| 159 | 170 | u32 write_seq; |
|---|
| 160 | 171 | u32 snd_win; |
|---|
| 161 | 172 | u32 rcv_win; |
|---|
| 173 | + |
|---|
| 174 | + bool disable_iso; |
|---|
| 175 | + u32 no_tx_credits; |
|---|
| 176 | + unsigned long prev_iso_ts; |
|---|
| 162 | 177 | }; |
|---|
| 163 | 178 | |
|---|
| 164 | 179 | /* |
|---|
| .. | .. |
|---|
| 200 | 215 | void *handle; |
|---|
| 201 | 216 | void *arp_err_handler; |
|---|
| 202 | 217 | struct sk_buff *wr_next; |
|---|
| 218 | + u16 iscsi_hdr_len; |
|---|
| 219 | + u8 ulp_mode; |
|---|
| 203 | 220 | }; |
|---|
| 204 | 221 | |
|---|
| 205 | 222 | enum cxgbi_skcb_flags { |
|---|
| .. | .. |
|---|
| 215 | 232 | SKCBF_RX_HCRC_ERR, /* header digest error */ |
|---|
| 216 | 233 | SKCBF_RX_DCRC_ERR, /* data digest error */ |
|---|
| 217 | 234 | SKCBF_RX_PAD_ERR, /* padding byte error */ |
|---|
| 235 | + SKCBF_TX_ISO, /* iso cpl in tx skb */ |
|---|
| 218 | 236 | }; |
|---|
| 219 | 237 | |
|---|
| 220 | 238 | struct cxgbi_skb_cb { |
|---|
| .. | .. |
|---|
| 222 | 240 | struct cxgbi_skb_rx_cb rx; |
|---|
| 223 | 241 | struct cxgbi_skb_tx_cb tx; |
|---|
| 224 | 242 | }; |
|---|
| 225 | | - unsigned char ulp_mode; |
|---|
| 226 | 243 | unsigned long flags; |
|---|
| 227 | 244 | unsigned int seq; |
|---|
| 228 | 245 | }; |
|---|
| 229 | 246 | |
|---|
| 230 | 247 | #define CXGBI_SKB_CB(skb) ((struct cxgbi_skb_cb *)&((skb)->cb[0])) |
|---|
| 231 | 248 | #define cxgbi_skcb_flags(skb) (CXGBI_SKB_CB(skb)->flags) |
|---|
| 232 | | -#define cxgbi_skcb_ulp_mode(skb) (CXGBI_SKB_CB(skb)->ulp_mode) |
|---|
| 233 | 249 | #define cxgbi_skcb_tcp_seq(skb) (CXGBI_SKB_CB(skb)->seq) |
|---|
| 234 | 250 | #define cxgbi_skcb_rx_ddigest(skb) (CXGBI_SKB_CB(skb)->rx.ddigest) |
|---|
| 235 | 251 | #define cxgbi_skcb_rx_pdulen(skb) (CXGBI_SKB_CB(skb)->rx.pdulen) |
|---|
| 236 | 252 | #define cxgbi_skcb_tx_wr_next(skb) (CXGBI_SKB_CB(skb)->tx.wr_next) |
|---|
| 253 | +#define cxgbi_skcb_tx_iscsi_hdrlen(skb) (CXGBI_SKB_CB(skb)->tx.iscsi_hdr_len) |
|---|
| 254 | +#define cxgbi_skcb_tx_ulp_mode(skb) (CXGBI_SKB_CB(skb)->tx.ulp_mode) |
|---|
| 237 | 255 | |
|---|
| 238 | 256 | static inline void cxgbi_skcb_set_flag(struct sk_buff *skb, |
|---|
| 239 | 257 | enum cxgbi_skcb_flags flag) |
|---|
| .. | .. |
|---|
| 455 | 473 | #define CXGBI_FLAG_IPV4_SET 0x10 |
|---|
| 456 | 474 | #define CXGBI_FLAG_USE_PPOD_OFLDQ 0x40 |
|---|
| 457 | 475 | #define CXGBI_FLAG_DDP_OFF 0x100 |
|---|
| 476 | +#define CXGBI_FLAG_DEV_ISO_OFF 0x400 |
|---|
| 458 | 477 | |
|---|
| 459 | 478 | struct cxgbi_device { |
|---|
| 460 | 479 | struct list_head list_head; |
|---|
| .. | .. |
|---|
| 474 | 493 | unsigned int pfvf; |
|---|
| 475 | 494 | unsigned int rx_credit_thres; |
|---|
| 476 | 495 | unsigned int skb_tx_rsvd; |
|---|
| 496 | + u32 skb_iso_txhdr; |
|---|
| 477 | 497 | unsigned int skb_rx_extra; /* for msg coalesced mode */ |
|---|
| 478 | 498 | unsigned int tx_max_size; |
|---|
| 479 | 499 | unsigned int rx_max_size; |
|---|
| .. | .. |
|---|
| 520 | 540 | struct cxgbi_sock *csk; |
|---|
| 521 | 541 | }; |
|---|
| 522 | 542 | |
|---|
| 523 | | -#define MAX_PDU_FRAGS ((ULP2_MAX_PDU_PAYLOAD + 512 - 1) / 512) |
|---|
| 524 | 543 | struct cxgbi_task_data { |
|---|
| 544 | +#define CXGBI_TASK_SGL_CHECKED 0x1 |
|---|
| 545 | +#define CXGBI_TASK_SGL_COPY 0x2 |
|---|
| 546 | + u8 flags; |
|---|
| 525 | 547 | unsigned short nr_frags; |
|---|
| 526 | | - struct page_frag frags[MAX_PDU_FRAGS]; |
|---|
| 548 | + struct page_frag frags[MAX_SKB_FRAGS]; |
|---|
| 527 | 549 | struct sk_buff *skb; |
|---|
| 528 | 550 | unsigned int dlen; |
|---|
| 529 | 551 | unsigned int offset; |
|---|
| 530 | 552 | unsigned int count; |
|---|
| 531 | 553 | unsigned int sgoffset; |
|---|
| 554 | + u32 total_count; |
|---|
| 555 | + u32 total_offset; |
|---|
| 556 | + u32 max_xmit_dlength; |
|---|
| 532 | 557 | struct cxgbi_task_tag_info ttinfo; |
|---|
| 533 | 558 | }; |
|---|
| 534 | 559 | #define iscsi_task_cxgbi_data(task) \ |
|---|
| 535 | 560 | ((task)->dd_data + sizeof(struct iscsi_tcp_task)) |
|---|
| 536 | 561 | |
|---|
| 537 | | -static inline void *cxgbi_alloc_big_mem(unsigned int size, |
|---|
| 538 | | - gfp_t gfp) |
|---|
| 539 | | -{ |
|---|
| 540 | | - void *p = kzalloc(size, gfp | __GFP_NOWARN); |
|---|
| 541 | | - |
|---|
| 542 | | - if (!p) |
|---|
| 543 | | - p = vzalloc(size); |
|---|
| 544 | | - |
|---|
| 545 | | - return p; |
|---|
| 546 | | -} |
|---|
| 547 | | - |
|---|
| 548 | | -static inline void cxgbi_free_big_mem(void *addr) |
|---|
| 549 | | -{ |
|---|
| 550 | | - kvfree(addr); |
|---|
| 551 | | -} |
|---|
| 562 | +struct cxgbi_iso_info { |
|---|
| 563 | +#define CXGBI_ISO_INFO_FSLICE 0x1 |
|---|
| 564 | +#define CXGBI_ISO_INFO_LSLICE 0x2 |
|---|
| 565 | +#define CXGBI_ISO_INFO_IMM_ENABLE 0x4 |
|---|
| 566 | + u8 flags; |
|---|
| 567 | + u8 op; |
|---|
| 568 | + u8 ahs; |
|---|
| 569 | + u8 num_pdu; |
|---|
| 570 | + u32 mpdu; |
|---|
| 571 | + u32 burst_size; |
|---|
| 572 | + u32 len; |
|---|
| 573 | + u32 segment_offset; |
|---|
| 574 | + u32 datasn_offset; |
|---|
| 575 | + u32 buffer_offset; |
|---|
| 576 | +}; |
|---|
| 552 | 577 | |
|---|
| 553 | 578 | static inline void cxgbi_set_iscsi_ipv4(struct cxgbi_hba *chba, __be32 ipaddr) |
|---|
| 554 | 579 | { |
|---|
| .. | .. |
|---|
| 614 | 639 | void cxgbi_ddp_set_one_ppod(struct cxgbi_pagepod *, |
|---|
| 615 | 640 | struct cxgbi_task_tag_info *, |
|---|
| 616 | 641 | struct scatterlist **sg_pp, unsigned int *sg_off); |
|---|
| 617 | | -void cxgbi_ddp_ppm_setup(void **ppm_pp, struct cxgbi_device *, |
|---|
| 618 | | - struct cxgbi_tag_format *, unsigned int ppmax, |
|---|
| 619 | | - unsigned int llimit, unsigned int start, |
|---|
| 620 | | - unsigned int rsvd_factor); |
|---|
| 642 | +int cxgbi_ddp_ppm_setup(void **ppm_pp, struct cxgbi_device *cdev, |
|---|
| 643 | + struct cxgbi_tag_format *tformat, |
|---|
| 644 | + unsigned int iscsi_size, unsigned int llimit, |
|---|
| 645 | + unsigned int start, unsigned int rsvd_factor, |
|---|
| 646 | + unsigned int edram_start, unsigned int edram_size); |
|---|
| 621 | 647 | #endif /*__LIBCXGBI_H__*/ |
|---|