2 * Copyright (c) 2016 Chelsio Communications, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation.
10 #ifndef __CXGBIT_LRO_H__
11 #define __CXGBIT_LRO_H__
13 #include <linux/kernel.h>
14 #include <linux/module.h>
15 #include <linux/errno.h>
16 #include <linux/types.h>
17 #include <linux/skbuff.h>
19 #define LRO_FLUSH_LEN_MAX 65535
21 struct cxgbit_lro_cb
{
22 struct cxgbit_sock
*csk
;
29 enum cxgbit_pducb_flags
{
30 PDUCBF_RX_HDR
= (1 << 0), /* received pdu header */
31 PDUCBF_RX_DATA
= (1 << 1), /* received pdu payload */
32 PDUCBF_RX_STATUS
= (1 << 2), /* received ddp status */
33 PDUCBF_RX_DATA_DDPD
= (1 << 3), /* pdu payload ddp'd */
34 PDUCBF_RX_HCRC_ERR
= (1 << 4), /* header digest error */
35 PDUCBF_RX_DCRC_ERR
= (1 << 5), /* data digest error */
38 struct cxgbit_lro_pdu_cb
{
54 #define LRO_SKB_MAX_HEADROOM \
55 (sizeof(struct cxgbit_lro_cb) + \
56 (MAX_SKB_FRAGS * sizeof(struct cxgbit_lro_pdu_cb)))
58 #define LRO_SKB_MIN_HEADROOM \
59 (sizeof(struct cxgbit_lro_cb) + \
60 sizeof(struct cxgbit_lro_pdu_cb))
62 #define cxgbit_skb_lro_cb(skb) ((struct cxgbit_lro_cb *)skb->data)
63 #define cxgbit_skb_lro_pdu_cb(skb, i) \
64 ((struct cxgbit_lro_pdu_cb *)(skb->data + sizeof(struct cxgbit_lro_cb) \
65 + (i * sizeof(struct cxgbit_lro_pdu_cb))))
67 #define CPL_RX_ISCSI_DDP_STATUS_DDP_SHIFT 16 /* ddp'able */
68 #define CPL_RX_ISCSI_DDP_STATUS_PAD_SHIFT 19 /* pad error */
69 #define CPL_RX_ISCSI_DDP_STATUS_HCRC_SHIFT 20 /* hcrc error */
70 #define CPL_RX_ISCSI_DDP_STATUS_DCRC_SHIFT 21 /* dcrc error */
72 #endif /*__CXGBIT_LRO_H_*/