19ba682f0Skxie@chelsio.com /* 29ba682f0Skxie@chelsio.com * libcxgbi.h: Chelsio common library for T3/T4 iSCSI driver. 39ba682f0Skxie@chelsio.com * 41149a5edSKaren Xie * Copyright (c) 2010-2015 Chelsio Communications, Inc. 59ba682f0Skxie@chelsio.com * 69ba682f0Skxie@chelsio.com * This program is free software; you can redistribute it and/or modify 79ba682f0Skxie@chelsio.com * it under the terms of the GNU General Public License as published by 89ba682f0Skxie@chelsio.com * the Free Software Foundation. 99ba682f0Skxie@chelsio.com * 109ba682f0Skxie@chelsio.com * Written by: Karen Xie (kxie@chelsio.com) 119ba682f0Skxie@chelsio.com * Written by: Rakesh Ranjan (rranjan@chelsio.com) 129ba682f0Skxie@chelsio.com */ 139ba682f0Skxie@chelsio.com 149ba682f0Skxie@chelsio.com #ifndef __LIBCXGBI_H__ 159ba682f0Skxie@chelsio.com #define __LIBCXGBI_H__ 169ba682f0Skxie@chelsio.com 179ba682f0Skxie@chelsio.com #include <linux/kernel.h> 189ba682f0Skxie@chelsio.com #include <linux/errno.h> 199ba682f0Skxie@chelsio.com #include <linux/types.h> 209ba682f0Skxie@chelsio.com #include <linux/debugfs.h> 219ba682f0Skxie@chelsio.com #include <linux/list.h> 229ba682f0Skxie@chelsio.com #include <linux/netdevice.h> 239ba682f0Skxie@chelsio.com #include <linux/if_vlan.h> 249ba682f0Skxie@chelsio.com #include <linux/scatterlist.h> 259ba682f0Skxie@chelsio.com #include <linux/skbuff.h> 269ba682f0Skxie@chelsio.com #include <linux/vmalloc.h> 2771f7a00bSVarun Prakash #include <linux/version.h> 289ba682f0Skxie@chelsio.com #include <scsi/scsi_device.h> 299ba682f0Skxie@chelsio.com #include <scsi/libiscsi_tcp.h> 309ba682f0Skxie@chelsio.com 3171f7a00bSVarun Prakash #include <libcxgb_ppm.h> 3271f7a00bSVarun Prakash 339ba682f0Skxie@chelsio.com enum cxgbi_dbg_flag { 349ba682f0Skxie@chelsio.com CXGBI_DBG_ISCSI, 359ba682f0Skxie@chelsio.com CXGBI_DBG_DDP, 369ba682f0Skxie@chelsio.com CXGBI_DBG_TOE, 379ba682f0Skxie@chelsio.com CXGBI_DBG_SOCK, 389ba682f0Skxie@chelsio.com 399ba682f0Skxie@chelsio.com CXGBI_DBG_PDU_TX, 409ba682f0Skxie@chelsio.com CXGBI_DBG_PDU_RX, 419ba682f0Skxie@chelsio.com CXGBI_DBG_DEV, 429ba682f0Skxie@chelsio.com }; 439ba682f0Skxie@chelsio.com 449ba682f0Skxie@chelsio.com #define log_debug(level, fmt, ...) \ 459ba682f0Skxie@chelsio.com do { \ 469ba682f0Skxie@chelsio.com if (dbg_level & (level)) \ 479ba682f0Skxie@chelsio.com pr_info(fmt, ##__VA_ARGS__); \ 489ba682f0Skxie@chelsio.com } while (0) 499ba682f0Skxie@chelsio.com 50fc8d0590SAnish Bhatt #define pr_info_ipaddr(fmt_trail, \ 51fc8d0590SAnish Bhatt addr1, addr2, args_trail...) \ 52fc8d0590SAnish Bhatt do { \ 53fc8d0590SAnish Bhatt if (!((1 << CXGBI_DBG_SOCK) & dbg_level)) \ 54fc8d0590SAnish Bhatt break; \ 55fc8d0590SAnish Bhatt pr_info("%pISpc - %pISpc, " fmt_trail, \ 56fc8d0590SAnish Bhatt addr1, addr2, args_trail); \ 57fc8d0590SAnish Bhatt } while (0) 58fc8d0590SAnish Bhatt 599ba682f0Skxie@chelsio.com /* max. connections per adapter */ 609ba682f0Skxie@chelsio.com #define CXGBI_MAX_CONN 16384 619ba682f0Skxie@chelsio.com 629ba682f0Skxie@chelsio.com /* always allocate rooms for AHS */ 639ba682f0Skxie@chelsio.com #define SKB_TX_ISCSI_PDU_HEADER_MAX \ 649ba682f0Skxie@chelsio.com (sizeof(struct iscsi_hdr) + ISCSI_MAX_AHS_SIZE) 659ba682f0Skxie@chelsio.com 669ba682f0Skxie@chelsio.com #define ISCSI_PDU_NONPAYLOAD_LEN 312 /* bhs(48) + ahs(256) + digest(8)*/ 679ba682f0Skxie@chelsio.com 689ba682f0Skxie@chelsio.com /* 699ba682f0Skxie@chelsio.com * align pdu size to multiple of 512 for better performance 709ba682f0Skxie@chelsio.com */ 719ba682f0Skxie@chelsio.com #define cxgbi_align_pdu_size(n) do { n = (n) & (~511); } while (0) 729ba682f0Skxie@chelsio.com 739ba682f0Skxie@chelsio.com #define ULP2_MODE_ISCSI 2 749ba682f0Skxie@chelsio.com 759ba682f0Skxie@chelsio.com #define ULP2_MAX_PKT_SIZE 16224 769ba682f0Skxie@chelsio.com #define ULP2_MAX_PDU_PAYLOAD \ 779ba682f0Skxie@chelsio.com (ULP2_MAX_PKT_SIZE - ISCSI_PDU_NONPAYLOAD_LEN) 789ba682f0Skxie@chelsio.com 799ba682f0Skxie@chelsio.com /* 809ba682f0Skxie@chelsio.com * For iscsi connections HW may inserts digest bytes into the pdu. Those digest 819ba682f0Skxie@chelsio.com * bytes are not sent by the host but are part of the TCP payload and therefore 829ba682f0Skxie@chelsio.com * consume TCP sequence space. 839ba682f0Skxie@chelsio.com */ 849ba682f0Skxie@chelsio.com static const unsigned int ulp2_extra_len[] = { 0, 4, 4, 8 }; 859ba682f0Skxie@chelsio.com static inline unsigned int cxgbi_ulp_extra_len(int submode) 869ba682f0Skxie@chelsio.com { 879ba682f0Skxie@chelsio.com return ulp2_extra_len[submode & 3]; 889ba682f0Skxie@chelsio.com } 899ba682f0Skxie@chelsio.com 909ba682f0Skxie@chelsio.com #define CPL_RX_DDP_STATUS_DDP_SHIFT 16 /* ddp'able */ 919ba682f0Skxie@chelsio.com #define CPL_RX_DDP_STATUS_PAD_SHIFT 19 /* pad error */ 929ba682f0Skxie@chelsio.com #define CPL_RX_DDP_STATUS_HCRC_SHIFT 20 /* hcrc error */ 939ba682f0Skxie@chelsio.com #define CPL_RX_DDP_STATUS_DCRC_SHIFT 21 /* dcrc error */ 949ba682f0Skxie@chelsio.com 959ba682f0Skxie@chelsio.com /* 969ba682f0Skxie@chelsio.com * sge_opaque_hdr - 979ba682f0Skxie@chelsio.com * Opaque version of structure the SGE stores at skb->head of TX_DATA packets 989ba682f0Skxie@chelsio.com * and for which we must reserve space. 999ba682f0Skxie@chelsio.com */ 1009ba682f0Skxie@chelsio.com struct sge_opaque_hdr { 1019ba682f0Skxie@chelsio.com void *dev; 1029ba682f0Skxie@chelsio.com dma_addr_t addr[MAX_SKB_FRAGS + 1]; 1039ba682f0Skxie@chelsio.com }; 1049ba682f0Skxie@chelsio.com 1059ba682f0Skxie@chelsio.com struct cxgbi_sock { 1069ba682f0Skxie@chelsio.com struct cxgbi_device *cdev; 1079ba682f0Skxie@chelsio.com 1089ba682f0Skxie@chelsio.com int tid; 1099ba682f0Skxie@chelsio.com int atid; 1109ba682f0Skxie@chelsio.com unsigned long flags; 1119ba682f0Skxie@chelsio.com unsigned int mtu; 1129ba682f0Skxie@chelsio.com unsigned short rss_qid; 1139ba682f0Skxie@chelsio.com unsigned short txq_idx; 1149ba682f0Skxie@chelsio.com unsigned short advmss; 1159ba682f0Skxie@chelsio.com unsigned int tx_chan; 1169ba682f0Skxie@chelsio.com unsigned int rx_chan; 1179ba682f0Skxie@chelsio.com unsigned int mss_idx; 1189ba682f0Skxie@chelsio.com unsigned int smac_idx; 1199ba682f0Skxie@chelsio.com unsigned char port_id; 1209ba682f0Skxie@chelsio.com int wr_max_cred; 1219ba682f0Skxie@chelsio.com int wr_cred; 1229ba682f0Skxie@chelsio.com int wr_una_cred; 123b5a5fe4eSVarun Prakash #ifdef CONFIG_CHELSIO_T4_DCB 124b5a5fe4eSVarun Prakash u8 dcb_priority; 125b5a5fe4eSVarun Prakash #endif 1269ba682f0Skxie@chelsio.com unsigned char hcrc_len; 1279ba682f0Skxie@chelsio.com unsigned char dcrc_len; 1289ba682f0Skxie@chelsio.com 1299ba682f0Skxie@chelsio.com void *l2t; 1309ba682f0Skxie@chelsio.com struct sk_buff *wr_pending_head; 1319ba682f0Skxie@chelsio.com struct sk_buff *wr_pending_tail; 1329ba682f0Skxie@chelsio.com struct sk_buff *cpl_close; 1339ba682f0Skxie@chelsio.com struct sk_buff *cpl_abort_req; 1349ba682f0Skxie@chelsio.com struct sk_buff *cpl_abort_rpl; 1359ba682f0Skxie@chelsio.com struct sk_buff *skb_ulp_lhdr; 1369ba682f0Skxie@chelsio.com spinlock_t lock; 1379ba682f0Skxie@chelsio.com struct kref refcnt; 1389ba682f0Skxie@chelsio.com unsigned int state; 139fc8d0590SAnish Bhatt unsigned int csk_family; 140fc8d0590SAnish Bhatt union { 1419ba682f0Skxie@chelsio.com struct sockaddr_in saddr; 142fc8d0590SAnish Bhatt struct sockaddr_in6 saddr6; 143fc8d0590SAnish Bhatt }; 144fc8d0590SAnish Bhatt union { 1459ba682f0Skxie@chelsio.com struct sockaddr_in daddr; 146fc8d0590SAnish Bhatt struct sockaddr_in6 daddr6; 147fc8d0590SAnish Bhatt }; 1489ba682f0Skxie@chelsio.com struct dst_entry *dst; 1499ba682f0Skxie@chelsio.com struct sk_buff_head receive_queue; 1509ba682f0Skxie@chelsio.com struct sk_buff_head write_queue; 1519ba682f0Skxie@chelsio.com struct timer_list retry_timer; 1529ba682f0Skxie@chelsio.com int err; 1539ba682f0Skxie@chelsio.com rwlock_t callback_lock; 1549ba682f0Skxie@chelsio.com void *user_data; 1559ba682f0Skxie@chelsio.com 1569ba682f0Skxie@chelsio.com u32 rcv_nxt; 1579ba682f0Skxie@chelsio.com u32 copied_seq; 1589ba682f0Skxie@chelsio.com u32 rcv_wup; 1599ba682f0Skxie@chelsio.com u32 snd_nxt; 1609ba682f0Skxie@chelsio.com u32 snd_una; 1619ba682f0Skxie@chelsio.com u32 write_seq; 16281daf10cSKaren Xie u32 snd_win; 16381daf10cSKaren Xie u32 rcv_win; 1649ba682f0Skxie@chelsio.com }; 1659ba682f0Skxie@chelsio.com 1669ba682f0Skxie@chelsio.com /* 1679ba682f0Skxie@chelsio.com * connection states 1689ba682f0Skxie@chelsio.com */ 1699ba682f0Skxie@chelsio.com enum cxgbi_sock_states{ 1709ba682f0Skxie@chelsio.com CTP_CLOSED, 1719ba682f0Skxie@chelsio.com CTP_CONNECTING, 1729ba682f0Skxie@chelsio.com CTP_ACTIVE_OPEN, 1739ba682f0Skxie@chelsio.com CTP_ESTABLISHED, 1749ba682f0Skxie@chelsio.com CTP_ACTIVE_CLOSE, 1759ba682f0Skxie@chelsio.com CTP_PASSIVE_CLOSE, 1769ba682f0Skxie@chelsio.com CTP_CLOSE_WAIT_1, 1779ba682f0Skxie@chelsio.com CTP_CLOSE_WAIT_2, 1789ba682f0Skxie@chelsio.com CTP_ABORTING, 1799ba682f0Skxie@chelsio.com }; 1809ba682f0Skxie@chelsio.com 1819ba682f0Skxie@chelsio.com /* 1829ba682f0Skxie@chelsio.com * Connection flags -- many to track some close related events. 1839ba682f0Skxie@chelsio.com */ 1849ba682f0Skxie@chelsio.com enum cxgbi_sock_flags { 1859ba682f0Skxie@chelsio.com CTPF_ABORT_RPL_RCVD, /*received one ABORT_RPL_RSS message */ 1869ba682f0Skxie@chelsio.com CTPF_ABORT_REQ_RCVD, /*received one ABORT_REQ_RSS message */ 1879ba682f0Skxie@chelsio.com CTPF_ABORT_RPL_PENDING, /* expecting an abort reply */ 1889ba682f0Skxie@chelsio.com CTPF_TX_DATA_SENT, /* already sent a TX_DATA WR */ 1899ba682f0Skxie@chelsio.com CTPF_ACTIVE_CLOSE_NEEDED,/* need to be closed */ 1909ba682f0Skxie@chelsio.com CTPF_HAS_ATID, /* reserved atid */ 1919ba682f0Skxie@chelsio.com CTPF_HAS_TID, /* reserved hw tid */ 1929ba682f0Skxie@chelsio.com CTPF_OFFLOAD_DOWN, /* offload function off */ 193e0f8e8cfSVarun Prakash CTPF_LOGOUT_RSP_RCVD, /* received logout response */ 1949ba682f0Skxie@chelsio.com }; 1959ba682f0Skxie@chelsio.com 1969ba682f0Skxie@chelsio.com struct cxgbi_skb_rx_cb { 1979ba682f0Skxie@chelsio.com __u32 ddigest; 1989ba682f0Skxie@chelsio.com __u32 pdulen; 1999ba682f0Skxie@chelsio.com }; 2009ba682f0Skxie@chelsio.com 2019ba682f0Skxie@chelsio.com struct cxgbi_skb_tx_cb { 20275b61250SVarun Prakash void *handle; 20375b61250SVarun Prakash void *arp_err_handler; 2049ba682f0Skxie@chelsio.com struct sk_buff *wr_next; 2059ba682f0Skxie@chelsio.com }; 2069ba682f0Skxie@chelsio.com 2079ba682f0Skxie@chelsio.com enum cxgbi_skcb_flags { 2089ba682f0Skxie@chelsio.com SKCBF_TX_NEED_HDR, /* packet needs a header */ 20971f7a00bSVarun Prakash SKCBF_TX_MEM_WRITE, /* memory write */ 21071f7a00bSVarun Prakash SKCBF_TX_FLAG_COMPL, /* wr completion flag */ 2119ba682f0Skxie@chelsio.com SKCBF_RX_COALESCED, /* received whole pdu */ 21225985edcSLucas De Marchi SKCBF_RX_HDR, /* received pdu header */ 21325985edcSLucas De Marchi SKCBF_RX_DATA, /* received pdu payload */ 21425985edcSLucas De Marchi SKCBF_RX_STATUS, /* received ddp status */ 21544830d8fSVarun Prakash SKCBF_RX_ISCSI_COMPL, /* received iscsi completion */ 2169ba682f0Skxie@chelsio.com SKCBF_RX_DATA_DDPD, /* pdu payload ddp'd */ 2179ba682f0Skxie@chelsio.com SKCBF_RX_HCRC_ERR, /* header digest error */ 2189ba682f0Skxie@chelsio.com SKCBF_RX_DCRC_ERR, /* data digest error */ 2199ba682f0Skxie@chelsio.com SKCBF_RX_PAD_ERR, /* padding byte error */ 2209ba682f0Skxie@chelsio.com }; 2219ba682f0Skxie@chelsio.com 2229ba682f0Skxie@chelsio.com struct cxgbi_skb_cb { 2239ba682f0Skxie@chelsio.com union { 2249ba682f0Skxie@chelsio.com struct cxgbi_skb_rx_cb rx; 2259ba682f0Skxie@chelsio.com struct cxgbi_skb_tx_cb tx; 2269ba682f0Skxie@chelsio.com }; 22775b61250SVarun Prakash unsigned char ulp_mode; 22875b61250SVarun Prakash unsigned long flags; 22975b61250SVarun Prakash unsigned int seq; 2309ba682f0Skxie@chelsio.com }; 2319ba682f0Skxie@chelsio.com 2329ba682f0Skxie@chelsio.com #define CXGBI_SKB_CB(skb) ((struct cxgbi_skb_cb *)&((skb)->cb[0])) 2339ba682f0Skxie@chelsio.com #define cxgbi_skcb_flags(skb) (CXGBI_SKB_CB(skb)->flags) 2349ba682f0Skxie@chelsio.com #define cxgbi_skcb_ulp_mode(skb) (CXGBI_SKB_CB(skb)->ulp_mode) 2359ba682f0Skxie@chelsio.com #define cxgbi_skcb_tcp_seq(skb) (CXGBI_SKB_CB(skb)->seq) 2369ba682f0Skxie@chelsio.com #define cxgbi_skcb_rx_ddigest(skb) (CXGBI_SKB_CB(skb)->rx.ddigest) 2379ba682f0Skxie@chelsio.com #define cxgbi_skcb_rx_pdulen(skb) (CXGBI_SKB_CB(skb)->rx.pdulen) 2389ba682f0Skxie@chelsio.com #define cxgbi_skcb_tx_wr_next(skb) (CXGBI_SKB_CB(skb)->tx.wr_next) 2399ba682f0Skxie@chelsio.com 2409ba682f0Skxie@chelsio.com static inline void cxgbi_skcb_set_flag(struct sk_buff *skb, 2419ba682f0Skxie@chelsio.com enum cxgbi_skcb_flags flag) 2429ba682f0Skxie@chelsio.com { 2439ba682f0Skxie@chelsio.com __set_bit(flag, &(cxgbi_skcb_flags(skb))); 2449ba682f0Skxie@chelsio.com } 2459ba682f0Skxie@chelsio.com 2469ba682f0Skxie@chelsio.com static inline void cxgbi_skcb_clear_flag(struct sk_buff *skb, 2479ba682f0Skxie@chelsio.com enum cxgbi_skcb_flags flag) 2489ba682f0Skxie@chelsio.com { 2499ba682f0Skxie@chelsio.com __clear_bit(flag, &(cxgbi_skcb_flags(skb))); 2509ba682f0Skxie@chelsio.com } 2519ba682f0Skxie@chelsio.com 25284944d8cSKaren Xie static inline int cxgbi_skcb_test_flag(const struct sk_buff *skb, 2539ba682f0Skxie@chelsio.com enum cxgbi_skcb_flags flag) 2549ba682f0Skxie@chelsio.com { 2559ba682f0Skxie@chelsio.com return test_bit(flag, &(cxgbi_skcb_flags(skb))); 2569ba682f0Skxie@chelsio.com } 2579ba682f0Skxie@chelsio.com 2589ba682f0Skxie@chelsio.com static inline void cxgbi_sock_set_flag(struct cxgbi_sock *csk, 2599ba682f0Skxie@chelsio.com enum cxgbi_sock_flags flag) 2609ba682f0Skxie@chelsio.com { 2619ba682f0Skxie@chelsio.com __set_bit(flag, &csk->flags); 2629ba682f0Skxie@chelsio.com log_debug(1 << CXGBI_DBG_SOCK, 2639ba682f0Skxie@chelsio.com "csk 0x%p,%u,0x%lx, bit %d.\n", 2649ba682f0Skxie@chelsio.com csk, csk->state, csk->flags, flag); 2659ba682f0Skxie@chelsio.com } 2669ba682f0Skxie@chelsio.com 2679ba682f0Skxie@chelsio.com static inline void cxgbi_sock_clear_flag(struct cxgbi_sock *csk, 2689ba682f0Skxie@chelsio.com enum cxgbi_sock_flags flag) 2699ba682f0Skxie@chelsio.com { 2709ba682f0Skxie@chelsio.com __clear_bit(flag, &csk->flags); 2719ba682f0Skxie@chelsio.com log_debug(1 << CXGBI_DBG_SOCK, 2729ba682f0Skxie@chelsio.com "csk 0x%p,%u,0x%lx, bit %d.\n", 2739ba682f0Skxie@chelsio.com csk, csk->state, csk->flags, flag); 2749ba682f0Skxie@chelsio.com } 2759ba682f0Skxie@chelsio.com 2769ba682f0Skxie@chelsio.com static inline int cxgbi_sock_flag(struct cxgbi_sock *csk, 2779ba682f0Skxie@chelsio.com enum cxgbi_sock_flags flag) 2789ba682f0Skxie@chelsio.com { 2799ba682f0Skxie@chelsio.com if (csk == NULL) 2809ba682f0Skxie@chelsio.com return 0; 2819ba682f0Skxie@chelsio.com return test_bit(flag, &csk->flags); 2829ba682f0Skxie@chelsio.com } 2839ba682f0Skxie@chelsio.com 2849ba682f0Skxie@chelsio.com static inline void cxgbi_sock_set_state(struct cxgbi_sock *csk, int state) 2859ba682f0Skxie@chelsio.com { 2869ba682f0Skxie@chelsio.com log_debug(1 << CXGBI_DBG_SOCK, 2879ba682f0Skxie@chelsio.com "csk 0x%p,%u,0x%lx, state -> %u.\n", 2889ba682f0Skxie@chelsio.com csk, csk->state, csk->flags, state); 2899ba682f0Skxie@chelsio.com csk->state = state; 2909ba682f0Skxie@chelsio.com } 2919ba682f0Skxie@chelsio.com 2929ba682f0Skxie@chelsio.com static inline void cxgbi_sock_free(struct kref *kref) 2939ba682f0Skxie@chelsio.com { 2949ba682f0Skxie@chelsio.com struct cxgbi_sock *csk = container_of(kref, 2959ba682f0Skxie@chelsio.com struct cxgbi_sock, 2969ba682f0Skxie@chelsio.com refcnt); 2979ba682f0Skxie@chelsio.com if (csk) { 2989ba682f0Skxie@chelsio.com log_debug(1 << CXGBI_DBG_SOCK, 2999ba682f0Skxie@chelsio.com "free csk 0x%p, state %u, flags 0x%lx\n", 3009ba682f0Skxie@chelsio.com csk, csk->state, csk->flags); 3019ba682f0Skxie@chelsio.com kfree(csk); 3029ba682f0Skxie@chelsio.com } 3039ba682f0Skxie@chelsio.com } 3049ba682f0Skxie@chelsio.com 3059ba682f0Skxie@chelsio.com static inline void __cxgbi_sock_put(const char *fn, struct cxgbi_sock *csk) 3069ba682f0Skxie@chelsio.com { 3079ba682f0Skxie@chelsio.com log_debug(1 << CXGBI_DBG_SOCK, 3089ba682f0Skxie@chelsio.com "%s, put csk 0x%p, ref %u-1.\n", 3092c935bc5SPeter Zijlstra fn, csk, kref_read(&csk->refcnt)); 3109ba682f0Skxie@chelsio.com kref_put(&csk->refcnt, cxgbi_sock_free); 3119ba682f0Skxie@chelsio.com } 3129ba682f0Skxie@chelsio.com #define cxgbi_sock_put(csk) __cxgbi_sock_put(__func__, csk) 3139ba682f0Skxie@chelsio.com 3149ba682f0Skxie@chelsio.com static inline void __cxgbi_sock_get(const char *fn, struct cxgbi_sock *csk) 3159ba682f0Skxie@chelsio.com { 3169ba682f0Skxie@chelsio.com log_debug(1 << CXGBI_DBG_SOCK, 3179ba682f0Skxie@chelsio.com "%s, get csk 0x%p, ref %u+1.\n", 3182c935bc5SPeter Zijlstra fn, csk, kref_read(&csk->refcnt)); 3199ba682f0Skxie@chelsio.com kref_get(&csk->refcnt); 3209ba682f0Skxie@chelsio.com } 3219ba682f0Skxie@chelsio.com #define cxgbi_sock_get(csk) __cxgbi_sock_get(__func__, csk) 3229ba682f0Skxie@chelsio.com 3239ba682f0Skxie@chelsio.com static inline int cxgbi_sock_is_closing(struct cxgbi_sock *csk) 3249ba682f0Skxie@chelsio.com { 3259ba682f0Skxie@chelsio.com return csk->state >= CTP_ACTIVE_CLOSE; 3269ba682f0Skxie@chelsio.com } 3279ba682f0Skxie@chelsio.com 3289ba682f0Skxie@chelsio.com static inline int cxgbi_sock_is_established(struct cxgbi_sock *csk) 3299ba682f0Skxie@chelsio.com { 3309ba682f0Skxie@chelsio.com return csk->state == CTP_ESTABLISHED; 3319ba682f0Skxie@chelsio.com } 3329ba682f0Skxie@chelsio.com 3339ba682f0Skxie@chelsio.com static inline void cxgbi_sock_purge_write_queue(struct cxgbi_sock *csk) 3349ba682f0Skxie@chelsio.com { 3359ba682f0Skxie@chelsio.com struct sk_buff *skb; 3369ba682f0Skxie@chelsio.com 3379ba682f0Skxie@chelsio.com while ((skb = __skb_dequeue(&csk->write_queue))) 3389ba682f0Skxie@chelsio.com __kfree_skb(skb); 3399ba682f0Skxie@chelsio.com } 3409ba682f0Skxie@chelsio.com 3419ba682f0Skxie@chelsio.com static inline unsigned int cxgbi_sock_compute_wscale(unsigned int win) 3429ba682f0Skxie@chelsio.com { 3439ba682f0Skxie@chelsio.com unsigned int wscale = 0; 3449ba682f0Skxie@chelsio.com 3459ba682f0Skxie@chelsio.com while (wscale < 14 && (65535 << wscale) < win) 3469ba682f0Skxie@chelsio.com wscale++; 3479ba682f0Skxie@chelsio.com return wscale; 3489ba682f0Skxie@chelsio.com } 3499ba682f0Skxie@chelsio.com 35024d3f95aSkxie@chelsio.com static inline struct sk_buff *alloc_wr(int wrlen, int dlen, gfp_t gfp) 3519ba682f0Skxie@chelsio.com { 3529ba682f0Skxie@chelsio.com struct sk_buff *skb = alloc_skb(wrlen + dlen, gfp); 3539ba682f0Skxie@chelsio.com 3549ba682f0Skxie@chelsio.com if (skb) { 3559ba682f0Skxie@chelsio.com __skb_put(skb, wrlen); 3569ba682f0Skxie@chelsio.com memset(skb->head, 0, wrlen + dlen); 3579ba682f0Skxie@chelsio.com } else 35824d3f95aSkxie@chelsio.com pr_info("alloc cpl wr skb %u+%u, OOM.\n", wrlen, dlen); 3599ba682f0Skxie@chelsio.com return skb; 3609ba682f0Skxie@chelsio.com } 3619ba682f0Skxie@chelsio.com 3629ba682f0Skxie@chelsio.com 3639ba682f0Skxie@chelsio.com /* 3649ba682f0Skxie@chelsio.com * The number of WRs needed for an skb depends on the number of fragments 3659ba682f0Skxie@chelsio.com * in the skb and whether it has any payload in its main body. This maps the 3669ba682f0Skxie@chelsio.com * length of the gather list represented by an skb into the # of necessary WRs. 3679ba682f0Skxie@chelsio.com * The extra two fragments are for iscsi bhs and payload padding. 3689ba682f0Skxie@chelsio.com */ 3699ba682f0Skxie@chelsio.com #define SKB_WR_LIST_SIZE (MAX_SKB_FRAGS + 2) 3709ba682f0Skxie@chelsio.com 3719ba682f0Skxie@chelsio.com static inline void cxgbi_sock_reset_wr_list(struct cxgbi_sock *csk) 3729ba682f0Skxie@chelsio.com { 3739ba682f0Skxie@chelsio.com csk->wr_pending_head = csk->wr_pending_tail = NULL; 3749ba682f0Skxie@chelsio.com } 3759ba682f0Skxie@chelsio.com 3769ba682f0Skxie@chelsio.com static inline void cxgbi_sock_enqueue_wr(struct cxgbi_sock *csk, 3779ba682f0Skxie@chelsio.com struct sk_buff *skb) 3789ba682f0Skxie@chelsio.com { 3799ba682f0Skxie@chelsio.com cxgbi_skcb_tx_wr_next(skb) = NULL; 3809ba682f0Skxie@chelsio.com /* 3819ba682f0Skxie@chelsio.com * We want to take an extra reference since both us and the driver 38275b61250SVarun Prakash * need to free the packet before it's really freed. 3839ba682f0Skxie@chelsio.com */ 38475b61250SVarun Prakash skb_get(skb); 3859ba682f0Skxie@chelsio.com 3869ba682f0Skxie@chelsio.com if (!csk->wr_pending_head) 3879ba682f0Skxie@chelsio.com csk->wr_pending_head = skb; 3889ba682f0Skxie@chelsio.com else 3899ba682f0Skxie@chelsio.com cxgbi_skcb_tx_wr_next(csk->wr_pending_tail) = skb; 3909ba682f0Skxie@chelsio.com csk->wr_pending_tail = skb; 3919ba682f0Skxie@chelsio.com } 3929ba682f0Skxie@chelsio.com 3939ba682f0Skxie@chelsio.com static inline int cxgbi_sock_count_pending_wrs(const struct cxgbi_sock *csk) 3949ba682f0Skxie@chelsio.com { 3959ba682f0Skxie@chelsio.com int n = 0; 3969ba682f0Skxie@chelsio.com const struct sk_buff *skb = csk->wr_pending_head; 3979ba682f0Skxie@chelsio.com 3989ba682f0Skxie@chelsio.com while (skb) { 3999ba682f0Skxie@chelsio.com n += skb->csum; 4009ba682f0Skxie@chelsio.com skb = cxgbi_skcb_tx_wr_next(skb); 4019ba682f0Skxie@chelsio.com } 4029ba682f0Skxie@chelsio.com return n; 4039ba682f0Skxie@chelsio.com } 4049ba682f0Skxie@chelsio.com 4059ba682f0Skxie@chelsio.com static inline struct sk_buff *cxgbi_sock_peek_wr(const struct cxgbi_sock *csk) 4069ba682f0Skxie@chelsio.com { 4079ba682f0Skxie@chelsio.com return csk->wr_pending_head; 4089ba682f0Skxie@chelsio.com } 4099ba682f0Skxie@chelsio.com 4109ba682f0Skxie@chelsio.com static inline struct sk_buff *cxgbi_sock_dequeue_wr(struct cxgbi_sock *csk) 4119ba682f0Skxie@chelsio.com { 4129ba682f0Skxie@chelsio.com struct sk_buff *skb = csk->wr_pending_head; 4139ba682f0Skxie@chelsio.com 4149ba682f0Skxie@chelsio.com if (likely(skb)) { 4159ba682f0Skxie@chelsio.com csk->wr_pending_head = cxgbi_skcb_tx_wr_next(skb); 4169ba682f0Skxie@chelsio.com cxgbi_skcb_tx_wr_next(skb) = NULL; 4179ba682f0Skxie@chelsio.com } 4189ba682f0Skxie@chelsio.com return skb; 4199ba682f0Skxie@chelsio.com } 4209ba682f0Skxie@chelsio.com 4219ba682f0Skxie@chelsio.com void cxgbi_sock_check_wr_invariants(const struct cxgbi_sock *); 4229ba682f0Skxie@chelsio.com void cxgbi_sock_purge_wr_queue(struct cxgbi_sock *); 4239ba682f0Skxie@chelsio.com void cxgbi_sock_skb_entail(struct cxgbi_sock *, struct sk_buff *); 4249ba682f0Skxie@chelsio.com void cxgbi_sock_fail_act_open(struct cxgbi_sock *, int); 4259ba682f0Skxie@chelsio.com void cxgbi_sock_act_open_req_arp_failure(void *, struct sk_buff *); 4269ba682f0Skxie@chelsio.com void cxgbi_sock_closed(struct cxgbi_sock *); 4279ba682f0Skxie@chelsio.com void cxgbi_sock_established(struct cxgbi_sock *, unsigned int, unsigned int); 4289ba682f0Skxie@chelsio.com void cxgbi_sock_rcv_abort_rpl(struct cxgbi_sock *); 4299ba682f0Skxie@chelsio.com void cxgbi_sock_rcv_peer_close(struct cxgbi_sock *); 4309ba682f0Skxie@chelsio.com void cxgbi_sock_rcv_close_conn_rpl(struct cxgbi_sock *, u32); 4319ba682f0Skxie@chelsio.com void cxgbi_sock_rcv_wr_ack(struct cxgbi_sock *, unsigned int, unsigned int, 4329ba682f0Skxie@chelsio.com int); 4339ba682f0Skxie@chelsio.com unsigned int cxgbi_sock_select_mss(struct cxgbi_sock *, unsigned int); 4349ba682f0Skxie@chelsio.com void cxgbi_sock_free_cpl_skbs(struct cxgbi_sock *); 4359ba682f0Skxie@chelsio.com 4369ba682f0Skxie@chelsio.com struct cxgbi_hba { 4379ba682f0Skxie@chelsio.com struct net_device *ndev; 4380b3d8947Skxie@chelsio.com struct net_device *vdev; /* vlan dev */ 4399ba682f0Skxie@chelsio.com struct Scsi_Host *shost; 4409ba682f0Skxie@chelsio.com struct cxgbi_device *cdev; 4419ba682f0Skxie@chelsio.com __be32 ipv4addr; 4429ba682f0Skxie@chelsio.com unsigned char port_id; 4439ba682f0Skxie@chelsio.com }; 4449ba682f0Skxie@chelsio.com 4459ba682f0Skxie@chelsio.com struct cxgbi_ports_map { 4469ba682f0Skxie@chelsio.com unsigned int max_connect; 4479ba682f0Skxie@chelsio.com unsigned int used; 4489ba682f0Skxie@chelsio.com unsigned short sport_base; 4499ba682f0Skxie@chelsio.com spinlock_t lock; 4509ba682f0Skxie@chelsio.com unsigned int next; 4519ba682f0Skxie@chelsio.com struct cxgbi_sock **port_csk; 4529ba682f0Skxie@chelsio.com }; 4539ba682f0Skxie@chelsio.com 4549ba682f0Skxie@chelsio.com #define CXGBI_FLAG_DEV_T3 0x1 4559ba682f0Skxie@chelsio.com #define CXGBI_FLAG_DEV_T4 0x2 4569ba682f0Skxie@chelsio.com #define CXGBI_FLAG_ADAPTER_RESET 0x4 4579ba682f0Skxie@chelsio.com #define CXGBI_FLAG_IPV4_SET 0x10 45871f7a00bSVarun Prakash #define CXGBI_FLAG_USE_PPOD_OFLDQ 0x40 45971f7a00bSVarun Prakash #define CXGBI_FLAG_DDP_OFF 0x100 46071f7a00bSVarun Prakash 4619ba682f0Skxie@chelsio.com struct cxgbi_device { 4629ba682f0Skxie@chelsio.com struct list_head list_head; 463078efae0SAnish Bhatt struct list_head rcu_node; 4649ba682f0Skxie@chelsio.com unsigned int flags; 4659ba682f0Skxie@chelsio.com struct net_device **ports; 4669ba682f0Skxie@chelsio.com void *lldev; 4679ba682f0Skxie@chelsio.com struct cxgbi_hba **hbas; 4689ba682f0Skxie@chelsio.com const unsigned short *mtus; 4699ba682f0Skxie@chelsio.com unsigned char nmtus; 4709ba682f0Skxie@chelsio.com unsigned char nports; 4719ba682f0Skxie@chelsio.com struct pci_dev *pdev; 4729ba682f0Skxie@chelsio.com struct dentry *debugfs_root; 4739ba682f0Skxie@chelsio.com struct iscsi_transport *itp; 4741fe1fdb0SVarun Prakash struct module *owner; 4759ba682f0Skxie@chelsio.com 4769ba682f0Skxie@chelsio.com unsigned int pfvf; 4779ba682f0Skxie@chelsio.com unsigned int rx_credit_thres; 4789ba682f0Skxie@chelsio.com unsigned int skb_tx_rsvd; 4799ba682f0Skxie@chelsio.com unsigned int skb_rx_extra; /* for msg coalesced mode */ 4809ba682f0Skxie@chelsio.com unsigned int tx_max_size; 4819ba682f0Skxie@chelsio.com unsigned int rx_max_size; 4826c9e2770SVarun Prakash unsigned int rxq_idx_cntr; 4839ba682f0Skxie@chelsio.com struct cxgbi_ports_map pmap; 4849ba682f0Skxie@chelsio.com 4859ba682f0Skxie@chelsio.com void (*dev_ddp_cleanup)(struct cxgbi_device *); 48671f7a00bSVarun Prakash struct cxgbi_ppm* (*cdev2ppm)(struct cxgbi_device *); 48771f7a00bSVarun Prakash int (*csk_ddp_set_map)(struct cxgbi_ppm *, struct cxgbi_sock *, 48871f7a00bSVarun Prakash struct cxgbi_task_tag_info *); 48971f7a00bSVarun Prakash void (*csk_ddp_clear_map)(struct cxgbi_device *cdev, 49071f7a00bSVarun Prakash struct cxgbi_ppm *, 49171f7a00bSVarun Prakash struct cxgbi_task_tag_info *); 4929ba682f0Skxie@chelsio.com int (*csk_ddp_setup_digest)(struct cxgbi_sock *, 4939ba682f0Skxie@chelsio.com unsigned int, int, int, int); 4949ba682f0Skxie@chelsio.com int (*csk_ddp_setup_pgidx)(struct cxgbi_sock *, 4959ba682f0Skxie@chelsio.com unsigned int, int, bool); 4969ba682f0Skxie@chelsio.com 4979ba682f0Skxie@chelsio.com void (*csk_release_offload_resources)(struct cxgbi_sock *); 4989ba682f0Skxie@chelsio.com int (*csk_rx_pdu_ready)(struct cxgbi_sock *, struct sk_buff *); 4999ba682f0Skxie@chelsio.com u32 (*csk_send_rx_credits)(struct cxgbi_sock *, u32); 5009ba682f0Skxie@chelsio.com int (*csk_push_tx_frames)(struct cxgbi_sock *, int); 5019ba682f0Skxie@chelsio.com void (*csk_send_abort_req)(struct cxgbi_sock *); 5029ba682f0Skxie@chelsio.com void (*csk_send_close_req)(struct cxgbi_sock *); 5039ba682f0Skxie@chelsio.com int (*csk_alloc_cpls)(struct cxgbi_sock *); 5049ba682f0Skxie@chelsio.com int (*csk_init_act_open)(struct cxgbi_sock *); 5059ba682f0Skxie@chelsio.com 5069ba682f0Skxie@chelsio.com void *dd_data; 5079ba682f0Skxie@chelsio.com }; 5089ba682f0Skxie@chelsio.com #define cxgbi_cdev_priv(cdev) ((cdev)->dd_data) 5099ba682f0Skxie@chelsio.com 5109ba682f0Skxie@chelsio.com struct cxgbi_conn { 5119ba682f0Skxie@chelsio.com struct cxgbi_endpoint *cep; 5129ba682f0Skxie@chelsio.com struct iscsi_conn *iconn; 5139ba682f0Skxie@chelsio.com struct cxgbi_hba *chba; 5149ba682f0Skxie@chelsio.com u32 task_idx_bits; 51571f7a00bSVarun Prakash unsigned int ddp_full; 51671f7a00bSVarun Prakash unsigned int ddp_tag_full; 5179ba682f0Skxie@chelsio.com }; 5189ba682f0Skxie@chelsio.com 5199ba682f0Skxie@chelsio.com struct cxgbi_endpoint { 5209ba682f0Skxie@chelsio.com struct cxgbi_conn *cconn; 5219ba682f0Skxie@chelsio.com struct cxgbi_hba *chba; 5229ba682f0Skxie@chelsio.com struct cxgbi_sock *csk; 5239ba682f0Skxie@chelsio.com }; 5249ba682f0Skxie@chelsio.com 5259ba682f0Skxie@chelsio.com #define MAX_PDU_FRAGS ((ULP2_MAX_PDU_PAYLOAD + 512 - 1) / 512) 5269ba682f0Skxie@chelsio.com struct cxgbi_task_data { 5279ba682f0Skxie@chelsio.com unsigned short nr_frags; 5286a39a16aSIan Campbell struct page_frag frags[MAX_PDU_FRAGS]; 5299ba682f0Skxie@chelsio.com struct sk_buff *skb; 53071f7a00bSVarun Prakash unsigned int dlen; 5319ba682f0Skxie@chelsio.com unsigned int offset; 5329ba682f0Skxie@chelsio.com unsigned int count; 5339ba682f0Skxie@chelsio.com unsigned int sgoffset; 53471f7a00bSVarun Prakash struct cxgbi_task_tag_info ttinfo; 5359ba682f0Skxie@chelsio.com }; 536e3d2ad8cSkxie@chelsio.com #define iscsi_task_cxgbi_data(task) \ 537e3d2ad8cSkxie@chelsio.com ((task)->dd_data + sizeof(struct iscsi_tcp_task)) 5389ba682f0Skxie@chelsio.com 5399ba682f0Skxie@chelsio.com static inline void *cxgbi_alloc_big_mem(unsigned int size, 5409ba682f0Skxie@chelsio.com gfp_t gfp) 5419ba682f0Skxie@chelsio.com { 5428be04b93SJoe Perches void *p = kzalloc(size, gfp | __GFP_NOWARN); 5438be04b93SJoe Perches 5449ba682f0Skxie@chelsio.com if (!p) 5458be04b93SJoe Perches p = vzalloc(size); 5468be04b93SJoe Perches 5479ba682f0Skxie@chelsio.com return p; 5489ba682f0Skxie@chelsio.com } 5499ba682f0Skxie@chelsio.com 5509ba682f0Skxie@chelsio.com static inline void cxgbi_free_big_mem(void *addr) 5519ba682f0Skxie@chelsio.com { 55232a78facSPekka Enberg kvfree(addr); 5539ba682f0Skxie@chelsio.com } 5549ba682f0Skxie@chelsio.com 5559ba682f0Skxie@chelsio.com static inline void cxgbi_set_iscsi_ipv4(struct cxgbi_hba *chba, __be32 ipaddr) 5569ba682f0Skxie@chelsio.com { 5579ba682f0Skxie@chelsio.com if (chba->cdev->flags & CXGBI_FLAG_IPV4_SET) 5589ba682f0Skxie@chelsio.com chba->ipv4addr = ipaddr; 5599ba682f0Skxie@chelsio.com else 5609ba682f0Skxie@chelsio.com pr_info("set iscsi ipv4 NOT supported, using %s ipv4.\n", 5619ba682f0Skxie@chelsio.com chba->ndev->name); 5629ba682f0Skxie@chelsio.com } 5639ba682f0Skxie@chelsio.com 5649ba682f0Skxie@chelsio.com struct cxgbi_device *cxgbi_device_register(unsigned int, unsigned int); 5659ba682f0Skxie@chelsio.com void cxgbi_device_unregister(struct cxgbi_device *); 5669ba682f0Skxie@chelsio.com void cxgbi_device_unregister_all(unsigned int flag); 5679ba682f0Skxie@chelsio.com struct cxgbi_device *cxgbi_device_find_by_lldev(void *); 568fc8d0590SAnish Bhatt struct cxgbi_device *cxgbi_device_find_by_netdev(struct net_device *, int *); 569078efae0SAnish Bhatt struct cxgbi_device *cxgbi_device_find_by_netdev_rcu(struct net_device *, 570078efae0SAnish Bhatt int *); 5711abf635dSHannes Reinecke int cxgbi_hbas_add(struct cxgbi_device *, u64, unsigned int, 5729ba682f0Skxie@chelsio.com struct scsi_host_template *, 5739ba682f0Skxie@chelsio.com struct scsi_transport_template *); 5749ba682f0Skxie@chelsio.com void cxgbi_hbas_remove(struct cxgbi_device *); 5759ba682f0Skxie@chelsio.com 5769ba682f0Skxie@chelsio.com int cxgbi_device_portmap_create(struct cxgbi_device *cdev, unsigned int base, 5779ba682f0Skxie@chelsio.com unsigned int max_conn); 5789ba682f0Skxie@chelsio.com void cxgbi_device_portmap_cleanup(struct cxgbi_device *cdev); 5799ba682f0Skxie@chelsio.com 5809ba682f0Skxie@chelsio.com void cxgbi_conn_tx_open(struct cxgbi_sock *); 5819ba682f0Skxie@chelsio.com void cxgbi_conn_pdu_ready(struct cxgbi_sock *); 5829ba682f0Skxie@chelsio.com int cxgbi_conn_alloc_pdu(struct iscsi_task *, u8); 5839ba682f0Skxie@chelsio.com int cxgbi_conn_init_pdu(struct iscsi_task *, unsigned int , unsigned int); 5849ba682f0Skxie@chelsio.com int cxgbi_conn_xmit_pdu(struct iscsi_task *); 5859ba682f0Skxie@chelsio.com 5869ba682f0Skxie@chelsio.com void cxgbi_cleanup_task(struct iscsi_task *task); 5879ba682f0Skxie@chelsio.com 588587a1f16SAl Viro umode_t cxgbi_attr_is_visible(int param_type, int param); 5899ba682f0Skxie@chelsio.com void cxgbi_get_conn_stats(struct iscsi_cls_conn *, struct iscsi_stats *); 5909ba682f0Skxie@chelsio.com int cxgbi_set_conn_param(struct iscsi_cls_conn *, 5919ba682f0Skxie@chelsio.com enum iscsi_param, char *, int); 592c71b9b66SMike Christie int cxgbi_get_ep_param(struct iscsi_endpoint *ep, enum iscsi_param, char *); 5939ba682f0Skxie@chelsio.com struct iscsi_cls_conn *cxgbi_create_conn(struct iscsi_cls_session *, u32); 5949ba682f0Skxie@chelsio.com int cxgbi_bind_conn(struct iscsi_cls_session *, 5959ba682f0Skxie@chelsio.com struct iscsi_cls_conn *, u64, int); 5969ba682f0Skxie@chelsio.com void cxgbi_destroy_session(struct iscsi_cls_session *); 5979ba682f0Skxie@chelsio.com struct iscsi_cls_session *cxgbi_create_session(struct iscsi_endpoint *, 5989ba682f0Skxie@chelsio.com u16, u16, u32); 5999ba682f0Skxie@chelsio.com int cxgbi_set_host_param(struct Scsi_Host *, 6009ba682f0Skxie@chelsio.com enum iscsi_host_param, char *, int); 6019ba682f0Skxie@chelsio.com int cxgbi_get_host_param(struct Scsi_Host *, enum iscsi_host_param, char *); 6029ba682f0Skxie@chelsio.com struct iscsi_endpoint *cxgbi_ep_connect(struct Scsi_Host *, 6039ba682f0Skxie@chelsio.com struct sockaddr *, int); 6049ba682f0Skxie@chelsio.com int cxgbi_ep_poll(struct iscsi_endpoint *, int); 6059ba682f0Skxie@chelsio.com void cxgbi_ep_disconnect(struct iscsi_endpoint *); 6069ba682f0Skxie@chelsio.com 6079ba682f0Skxie@chelsio.com int cxgbi_iscsi_init(struct iscsi_transport *, 6089ba682f0Skxie@chelsio.com struct scsi_transport_template **); 6099ba682f0Skxie@chelsio.com void cxgbi_iscsi_cleanup(struct iscsi_transport *, 6109ba682f0Skxie@chelsio.com struct scsi_transport_template **); 6119ba682f0Skxie@chelsio.com void cxgbi_parse_pdu_itt(struct iscsi_conn *, itt_t, int *, int *); 6129ba682f0Skxie@chelsio.com int cxgbi_ddp_init(struct cxgbi_device *, unsigned int, unsigned int, 6139ba682f0Skxie@chelsio.com unsigned int, unsigned int); 6149ba682f0Skxie@chelsio.com int cxgbi_ddp_cleanup(struct cxgbi_device *); 6159ba682f0Skxie@chelsio.com void cxgbi_ddp_page_size_factor(int *); 61671f7a00bSVarun Prakash void cxgbi_ddp_set_one_ppod(struct cxgbi_pagepod *, 61771f7a00bSVarun Prakash struct cxgbi_task_tag_info *, 61871f7a00bSVarun Prakash struct scatterlist **sg_pp, unsigned int *sg_off); 61971f7a00bSVarun Prakash void cxgbi_ddp_ppm_setup(void **ppm_pp, struct cxgbi_device *, 62071f7a00bSVarun Prakash struct cxgbi_tag_format *, unsigned int ppmax, 62171f7a00bSVarun Prakash unsigned int llimit, unsigned int start, 62271f7a00bSVarun Prakash unsigned int rsvd_factor); 6239ba682f0Skxie@chelsio.com #endif /*__LIBCXGBI_H__*/ 624