[PATCH net-next 3/3] cxgb4i: add iscsi LRO for chelsio t4/t5 adapters

2016-01-06 Thread Hariprasad Shenai
Signed-off-by: Karen Xie 
Signed-off-by: Manoj Malviya 
Signed-off-by: Hariprasad Shenai 
---
 drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | 396 +++--
 1 file changed, 382 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c 
b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
index 804806e..68e94e6 100644
--- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
+++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
@@ -33,6 +33,7 @@
 static unsigned int dbg_level;
 
 #include "../libcxgbi.h"
+#include "../cxgbi_lro.h"
 
 #defineDRV_MODULE_NAME "cxgb4i"
 #define DRV_MODULE_DESC"Chelsio T4/T5 iSCSI Driver"
@@ -81,13 +82,6 @@ static int t4_uld_rx_handler(void *, const __be64 *, const 
struct pkt_gl *);
 static int t4_uld_state_change(void *, enum cxgb4_state state);
 static inline int send_tx_flowc_wr(struct cxgbi_sock *);
 
-static const struct cxgb4_uld_info cxgb4i_uld_info = {
-   .name = DRV_MODULE_NAME,
-   .add = t4_uld_add,
-   .rx_handler = t4_uld_rx_handler,
-   .state_change = t4_uld_state_change,
-};
-
 static struct scsi_host_template cxgb4i_host_template = {
.module = THIS_MODULE,
.name   = DRV_MODULE_NAME,
@@ -1182,8 +1176,9 @@ static void do_rx_data_ddp(struct cxgbi_device *cdev,
}
 
log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_PDU_RX,
-   "csk 0x%p,%u,0x%lx, skb 0x%p,0x%x, lhdr 0x%p.\n",
-   csk, csk->state, csk->flags, skb, status, csk->skb_ulp_lhdr);
+   "csk 0x%p,%u,0x%lx, skb 0x%p,0x%x, lhdr 0x%p, len %u.\n",
+   csk, csk->state, csk->flags, skb, status, csk->skb_ulp_lhdr,
+   ntohs(rpl->len));
 
spin_lock_bh(>lock);
 
@@ -1212,13 +1207,13 @@ static void do_rx_data_ddp(struct cxgbi_device *cdev,
csk->tid, ntohs(rpl->len), cxgbi_skcb_rx_pdulen(lskb));
 
if (status & (1 << CPL_RX_DDP_STATUS_HCRC_SHIFT)) {
-   pr_info("csk 0x%p, lhdr 0x%p, status 0x%x, hcrc bad 0x%lx.\n",
-   csk, lskb, status, cxgbi_skcb_flags(lskb));
+   pr_info("csk 0x%p, lhdr 0x%p, status 0x%x, hcrc bad.\n",
+   csk, lskb, status);
cxgbi_skcb_set_flag(lskb, SKCBF_RX_HCRC_ERR);
}
if (status & (1 << CPL_RX_DDP_STATUS_DCRC_SHIFT)) {
-   pr_info("csk 0x%p, lhdr 0x%p, status 0x%x, dcrc bad 0x%lx.\n",
-   csk, lskb, status, cxgbi_skcb_flags(lskb));
+   pr_info("csk 0x%p, lhdr 0x%p, status 0x%x, dcrc bad.\n",
+   csk, lskb, status);
cxgbi_skcb_set_flag(lskb, SKCBF_RX_DCRC_ERR);
}
if (status & (1 << CPL_RX_DDP_STATUS_PAD_SHIFT)) {
@@ -1311,6 +1306,12 @@ static int alloc_cpls(struct cxgbi_sock *csk)
0, GFP_KERNEL);
if (!csk->cpl_abort_rpl)
goto free_cpls;
+
+   csk->skb_lro_hold = alloc_skb(LRO_SKB_MIN_HEADROOM, GFP_KERNEL);
+   if (unlikely(!csk->skb_lro_hold))
+   goto free_cpls;
+   memset(csk->skb_lro_hold->data, 0, LRO_SKB_MIN_HEADROOM);
+
return 0;
 
 free_cpls:
@@ -1539,7 +1540,7 @@ int cxgb4i_ofld_init(struct cxgbi_device *cdev)
cdev->csk_alloc_cpls = alloc_cpls;
cdev->csk_init_act_open = init_act_open;
 
-   pr_info("cdev 0x%p, offload up, added.\n", cdev);
+   pr_info("cdev 0x%p, offload up, added, f 0x%x.\n", cdev, cdev->flags);
return 0;
 }
 
@@ -1891,6 +1892,373 @@ static int t4_uld_state_change(void *handle, enum 
cxgb4_state state)
return 0;
 }
 
+static void proc_ddp_status(unsigned int tid, struct cpl_rx_data_ddp *cpl,
+   struct cxgbi_rx_pdu_cb *pdu_cb)
+{
+   unsigned int status = ntohl(cpl->ddpvld);
+
+   cxgbi_rx_cb_set_flag(pdu_cb, SKCBF_RX_STATUS);
+
+   pdu_cb->ddigest = ntohl(cpl->ulp_crc);
+   pdu_cb->pdulen = ntohs(cpl->len);
+
+   if (status & (1 << CPL_RX_DDP_STATUS_HCRC_SHIFT)) {
+   pr_info("tid 0x%x, status 0x%x, hcrc bad.\n", tid, status);
+   cxgbi_rx_cb_set_flag(pdu_cb, SKCBF_RX_HCRC_ERR);
+   }
+   if (status & (1 << CPL_RX_DDP_STATUS_DCRC_SHIFT)) {
+   pr_info("tid 0x%x, status 0x%x, dcrc bad.\n", tid, status);
+   cxgbi_rx_cb_set_flag(pdu_cb, SKCBF_RX_DCRC_ERR);
+   }
+   if (status & (1 << CPL_RX_DDP_STATUS_PAD_SHIFT)) {
+   pr_info("tid 0x%x, status 0x%x, pad bad.\n", tid, status);
+   cxgbi_rx_cb_set_flag(pdu_cb, SKCBF_RX_PAD_ERR);
+   }
+   if ((status & (1 << CPL_RX_DDP_STATUS_DDP_SHIFT)) &&
+   !cxgbi_rx_cb_test_flag(pdu_cb, SKCBF_RX_DATA)) {
+   cxgbi_rx_cb_set_flag(pdu_cb, SKCBF_RX_DATA_DDPD);
+   }
+}
+
+static void lro_skb_add_packet_rsp(struct sk_buff *skb, u8 op,
+  const __be64 *rsp)
+{
+   

Re: [PATCH net-next 3/3] cxgb4i: add iscsi LRO for chelsio t4/t5 adapters

2016-01-06 Thread kbuild test robot
Hi Hariprasad,

[auto build test ERROR on net-next/master]

url:
https://github.com/0day-ci/linux/commits/Hariprasad-Shenai/cxgb4-Add-LRO-infrastructure-for-cxgb4i-driver/20160106-203040
config: i386-allmodconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All errors (new ones prefixed by >>):

>> drivers/scsi/cxgbi/cxgb4i/cxgb4i.c:36:26: fatal error: ../cxgbi_lro.h: No 
>> such file or directory
   compilation terminated.

vim +36 drivers/scsi/cxgbi/cxgb4i/cxgb4i.c

30  #include "cxgb4i.h"
31  #include "clip_tbl.h"
32  
33  static unsigned int dbg_level;
34  
35  #include "../libcxgbi.h"
  > 36  #include "../cxgbi_lro.h"
37  
38  #define DRV_MODULE_NAME "cxgb4i"
39  #define DRV_MODULE_DESC "Chelsio T4/T5 iSCSI Driver"

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data