RE: svn commit: r322331 - in head/sys: dev/qlnx/qlnxe modules/qlnx/qlnxe

2017-08-11 Thread Somayajulu, David
HI All,
Apologize for the inconvenience. 
I forgot to mention the following.

MFC after:5 days

Thanks
David S. (davi...@freebsd.org)
-Original Message-
From: owner-src-committ...@freebsd.org 
[mailto:owner-src-committ...@freebsd.org] On Behalf Of David C Somayajulu
Sent: Wednesday, August 09, 2017 3:19 PM
To: src-committ...@freebsd.org; svn-src-all@freebsd.org; 
svn-src-h...@freebsd.org
Subject: svn commit: r322331 - in head/sys: dev/qlnx/qlnxe modules/qlnx/qlnxe

Author: davidcs
Date: Wed Aug  9 22:18:49 2017
New Revision: 322331
URL: https://svnweb.freebsd.org/changeset/base/322331

Log:
  Provide compile to choose receive processing in either Ithread or Taskqueue 
Thread.

Modified:
  head/sys/dev/qlnx/qlnxe/qlnx_os.c
  head/sys/dev/qlnx/qlnxe/qlnx_ver.h
  head/sys/modules/qlnx/qlnxe/Makefile

Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c 
==
--- head/sys/dev/qlnx/qlnxe/qlnx_os.c   Wed Aug  9 21:44:55 2017
(r322330)
+++ head/sys/dev/qlnx/qlnxe/qlnx_os.c   Wed Aug  9 22:18:49 2017
(r322331)
@@ -397,10 +397,14 @@ qlnx_fp_taskqueue(void *context, int pending)
 struct ifnet   *ifp;
 struct mbuf*mp;
 intret = -1;
+   struct thread   *cthread;
+
+#ifdef QLNX_RCV_IN_TASKQ
int lro_enable;
int rx_int = 0, total_rx_count = 0;
-   struct thread   *cthread;
 
+#endif /* #ifdef QLNX_RCV_IN_TASKQ */
+
 fp = context;
 
 if (fp == NULL)
@@ -419,55 +423,60 @@ qlnx_fp_taskqueue(void *context, int pending)
 
 ifp = ha->ifp;
 
-   lro_enable = ha->ifp->if_capenable & IFCAP_LRO;
+#ifdef QLNX_RCV_IN_TASKQ
+   {
+   lro_enable = ifp->if_capenable & IFCAP_LRO;
 
-   rx_int = qlnx_rx_int(ha, fp, ha->rx_pkt_threshold, lro_enable);
+   rx_int = qlnx_rx_int(ha, fp, ha->rx_pkt_threshold, lro_enable);
 
-   if (rx_int) {
-   fp->rx_pkts += rx_int;
-   total_rx_count += rx_int;
-   }
+   if (rx_int) {
+   fp->rx_pkts += rx_int;
+   total_rx_count += rx_int;
+   }
 
 #ifdef QLNX_SOFT_LRO
-   {
-   struct lro_ctrl *lro;
+   {
+   struct lro_ctrl *lro;
+   
+   lro = &fp->rxq->lro;
 
-   lro = &fp->rxq->lro;
+   if (lro_enable && total_rx_count) {
 
-   if (lro_enable && total_rx_count) {
-
 #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO)
 
-   if (ha->dbg_trace_lro_cnt) {
-   if (lro->lro_mbuf_count & ~1023)
-   fp->lro_cnt_1024++;
-   else if (lro->lro_mbuf_count & ~511)
-   fp->lro_cnt_512++;
-   else if (lro->lro_mbuf_count & ~255)
-   fp->lro_cnt_256++;
-   else if (lro->lro_mbuf_count & ~127)
-   fp->lro_cnt_128++;
-   else if (lro->lro_mbuf_count & ~63)
-   fp->lro_cnt_64++;
-   }
-   tcp_lro_flush_all(lro);
+   if (ha->dbg_trace_lro_cnt) {
+   if (lro->lro_mbuf_count & ~1023)
+   fp->lro_cnt_1024++;
+   else if (lro->lro_mbuf_count & ~511)
+   fp->lro_cnt_512++;
+   else if (lro->lro_mbuf_count & ~255)
+   fp->lro_cnt_256++;
+   else if (lro->lro_mbuf_count & ~127)
+   fp->lro_cnt_128++;
+   else if (lro->lro_mbuf_count & ~63)
+   fp->lro_cnt_64++;
+   }
+   tcp_lro_flush_all(lro);
 
 #else
-   struct lro_entry *queued;
+   struct lro_entry *queued;
 
-   while ((!SLIST_EMPTY(&lro->lro_active))) {
-   queued = SLIST_FIRST(&lro->lro_active);
-   SLIST_REMOVE_HEAD(&lro->lro_active, next);
-   tcp_lro_flush(lro, queued);
-   }
+   while 

svn commit: r322331 - in head/sys: dev/qlnx/qlnxe modules/qlnx/qlnxe

2017-08-09 Thread David C Somayajulu
Author: davidcs
Date: Wed Aug  9 22:18:49 2017
New Revision: 322331
URL: https://svnweb.freebsd.org/changeset/base/322331

Log:
  Provide compile to choose receive processing in either Ithread or Taskqueue 
Thread.

Modified:
  head/sys/dev/qlnx/qlnxe/qlnx_os.c
  head/sys/dev/qlnx/qlnxe/qlnx_ver.h
  head/sys/modules/qlnx/qlnxe/Makefile

Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c
==
--- head/sys/dev/qlnx/qlnxe/qlnx_os.c   Wed Aug  9 21:44:55 2017
(r322330)
+++ head/sys/dev/qlnx/qlnxe/qlnx_os.c   Wed Aug  9 22:18:49 2017
(r322331)
@@ -397,10 +397,14 @@ qlnx_fp_taskqueue(void *context, int pending)
 struct ifnet   *ifp;
 struct mbuf*mp;
 intret = -1;
+   struct thread   *cthread;
+
+#ifdef QLNX_RCV_IN_TASKQ
int lro_enable;
int rx_int = 0, total_rx_count = 0;
-   struct thread   *cthread;
 
+#endif /* #ifdef QLNX_RCV_IN_TASKQ */
+
 fp = context;
 
 if (fp == NULL)
@@ -419,55 +423,60 @@ qlnx_fp_taskqueue(void *context, int pending)
 
 ifp = ha->ifp;
 
-   lro_enable = ha->ifp->if_capenable & IFCAP_LRO;
+#ifdef QLNX_RCV_IN_TASKQ
+   {
+   lro_enable = ifp->if_capenable & IFCAP_LRO;
 
-   rx_int = qlnx_rx_int(ha, fp, ha->rx_pkt_threshold, lro_enable);
+   rx_int = qlnx_rx_int(ha, fp, ha->rx_pkt_threshold, lro_enable);
 
-   if (rx_int) {
-   fp->rx_pkts += rx_int;
-   total_rx_count += rx_int;
-   }
+   if (rx_int) {
+   fp->rx_pkts += rx_int;
+   total_rx_count += rx_int;
+   }
 
 #ifdef QLNX_SOFT_LRO
-   {
-   struct lro_ctrl *lro;
+   {
+   struct lro_ctrl *lro;
+   
+   lro = &fp->rxq->lro;
 
-   lro = &fp->rxq->lro;
+   if (lro_enable && total_rx_count) {
 
-   if (lro_enable && total_rx_count) {
-
 #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO)
 
-   if (ha->dbg_trace_lro_cnt) {
-   if (lro->lro_mbuf_count & ~1023)
-   fp->lro_cnt_1024++;
-   else if (lro->lro_mbuf_count & ~511)
-   fp->lro_cnt_512++;
-   else if (lro->lro_mbuf_count & ~255)
-   fp->lro_cnt_256++;
-   else if (lro->lro_mbuf_count & ~127)
-   fp->lro_cnt_128++;
-   else if (lro->lro_mbuf_count & ~63)
-   fp->lro_cnt_64++;
-   }
-   tcp_lro_flush_all(lro);
+   if (ha->dbg_trace_lro_cnt) {
+   if (lro->lro_mbuf_count & ~1023)
+   fp->lro_cnt_1024++;
+   else if (lro->lro_mbuf_count & ~511)
+   fp->lro_cnt_512++;
+   else if (lro->lro_mbuf_count & ~255)
+   fp->lro_cnt_256++;
+   else if (lro->lro_mbuf_count & ~127)
+   fp->lro_cnt_128++;
+   else if (lro->lro_mbuf_count & ~63)
+   fp->lro_cnt_64++;
+   }
+   tcp_lro_flush_all(lro);
 
 #else
-   struct lro_entry *queued;
+   struct lro_entry *queued;
 
-   while ((!SLIST_EMPTY(&lro->lro_active))) {
-   queued = SLIST_FIRST(&lro->lro_active);
-   SLIST_REMOVE_HEAD(&lro->lro_active, next);
-   tcp_lro_flush(lro, queued);
-   }
+   while ((!SLIST_EMPTY(&lro->lro_active))) {
+   queued = SLIST_FIRST(&lro->lro_active);
+   SLIST_REMOVE_HEAD(&lro->lro_active, 
next);
+   tcp_lro_flush(lro, queued);
+   }
 #endif /* #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) */
+   }
}
-   }
 #endif /* #ifdef QLNX_SOFT_LRO */
 
-   ecore_sb_update_sb_idx(fp->sb_info);
-   rmb();
+   ecore_sb_update_sb_idx(fp->sb_info);
+   rmb();
+   }
 
+#endif /* #ifdef QLNX_RCV_IN_TASKQ */
+
 mtx_lock(&fp->tx_mtx);
 
 if (((ifp->i