Blob Blame Raw
From 669d4aeb6103c236e7cba94bbbb3c3098f8b4b15 Mon Sep 17 00:00:00 2001
From: Eddie Wai <eddie.wai@broadcom.com>
Date: Wed, 19 Jun 2013 14:48:27 -0700
Subject: ISCSIUIO: Updated iscsiuio to version 0.7.8.1b for perf optimization

uIP v0.7.8.1b (May 01, 2013)
=======================================================
   Enhancements
   ------------
   1. Change:  Performance optimization by caching the page size
      Impact:  All

   2. Change:  Fixed a bug in the tx completion interrupt handler
      Impact:  10G only

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
---
 iscsiuio/README                |   9 ++-
 iscsiuio/RELEASE.TXT           |  15 ++++-
 iscsiuio/configure             | 124 ++++++++++++++++++++---------------------
 iscsiuio/configure.ac          |   4 +-
 iscsiuio/docs/iscsiuio.8       |   8 +--
 iscsiuio/src/unix/libs/bnx2.c  |  14 ++---
 iscsiuio/src/unix/libs/bnx2x.c |  19 ++++---
 iscsiuio/src/unix/nic.c        |   1 +
 iscsiuio/src/unix/nic.h        |   6 +-
 9 files changed, 108 insertions(+), 92 deletions(-)

diff --git a/iscsiuio/README b/iscsiuio/README
index 1a6386f..e7e5fe4 100644
--- a/iscsiuio/README
+++ b/iscsiuio/README
@@ -1,6 +1,6 @@
 Iscsiuio Userspace Tool
-Version 0.7.6.1g
-Jan 14, 2013
+Version 0.7.8.1b
+May 01, 2013
 ------------------------------------------------------
 
 This tool is to be used in conjunction with the Broadcom NetXtreme II Linux
@@ -189,9 +189,8 @@ To run the daemon in debug mode please pass the parameter  '-d <debug level>'
 
 where the following debug levels are defined:
 
-PACKET        5 - Print all messages
-DEBUG         4 - Print debug messages
-INFO          3 - Print messages needed to follow the uIP code
+DEBUG         4 - Print all messages
+INFO          3 - Print messages needed to follow the uIP code (default)
 WARN          2 - Print warning messages
 ERROR         1 - Only print critical errors
 
diff --git a/iscsiuio/RELEASE.TXT b/iscsiuio/RELEASE.TXT
index 2fa19bb..de70667 100644
--- a/iscsiuio/RELEASE.TXT
+++ b/iscsiuio/RELEASE.TXT
@@ -1,7 +1,7 @@
                               Release Notes
                         Broadcom uIP Linux Driver
-                            Version 0.7.6.1g
-                               01/14/2013
+                            Version 0.7.8.1b
+                               05/01/2013
 
                           Broadcom Corporation
                          5300 California Avenue,
@@ -10,6 +10,16 @@
                Copyright (c) 2004 - 2013 Broadcom Corporation
                            All rights reserved
 
+uIP v0.7.8.1b (May 01, 2013)
+=======================================================
+   Enhancements
+   ------------
+   1. Change:  Performance optimization by caching the page size
+      Impact:  All
+
+   2. Change:  Fixed a bug in the tx completion interrupt handler
+      Impact:  10G only
+
 
 uIP v0.7.6.1g (Jan 14, 2013)
 =======================================================
@@ -1986,3 +1996,4 @@ uIP v0.5.0b (Nov 24, 2009)
    1. Change: Add Broadcom 10G iSCSI offload support
 
       Impact: Linux
+
diff --git a/iscsiuio/configure b/iscsiuio/configure
index 1852551..2740598 100755
--- a/iscsiuio/configure
+++ b/iscsiuio/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for iscsiuio 0.7.6.1g.
+# Generated by GNU Autoconf 2.59 for iscsiuio 0.7.8.1b.
 #
 # Report bugs to <eddie.wai@broadcom.com>.
 #
@@ -72,9 +72,9 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 .     : '\(.\)' 2>/dev/null ||
 echo X/"$0" |
     sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-	  /^X\/\(\/\).*/{ s//\1/; q; }
-	  s/.*/./; q'`
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
 
 
 # PATH needs CR, and LINENO needs CR and PATH.
@@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='iscsiuio'
 PACKAGE_TARNAME='iscsiuio'
-PACKAGE_VERSION='0.7.6.1g'
-PACKAGE_STRING='iscsiuio 0.7.6.1g'
+PACKAGE_VERSION='0.7.8.1b'
+PACKAGE_STRING='iscsiuio 0.7.8.1b'
 PACKAGE_BUGREPORT='eddie.wai@broadcom.com'
 
 # Factoring default headers for most tests.
@@ -870,10 +870,10 @@ $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 .     : '\(.\)' 2>/dev/null ||
 echo X"$0" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-	  /^X\(\/\/\)$/{ s//\1/; q; }
-	  /^X\(\/\).*/{ s//\1/; q; }
-	  s/.*/./; q'`
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
   srcdir=$ac_confdir
   if test ! -r $srcdir/$ac_unique_file; then
     srcdir=..
@@ -954,7 +954,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures iscsiuio 0.7.6.1g to adapt to many kinds of systems.
+\`configure' configures iscsiuio 0.7.8.1b to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1020,7 +1020,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of iscsiuio 0.7.6.1g:";;
+     short | recursive ) echo "Configuration of iscsiuio 0.7.8.1b:";;
    esac
   cat <<\_ACEOF
 
@@ -1160,7 +1160,7 @@ fi
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
-iscsiuio configure 0.7.6.1g
+iscsiuio configure 0.7.8.1b
 generated by GNU Autoconf 2.59
 
 Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1174,7 +1174,7 @@ cat >&5 <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by iscsiuio $as_me 0.7.6.1g, which was
+It was created by iscsiuio $as_me 0.7.8.1b, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
@@ -11743,7 +11743,7 @@ echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
 if test "${lt_cv_dlopen_self+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-	  if test "$cross_compiling" = yes; then :
+  	  if test "$cross_compiling" = yes; then :
   lt_cv_dlopen_self=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -11843,7 +11843,7 @@ echo $ECHO_N "checking whether a statically linked program can dlopen itself...
 if test "${lt_cv_dlopen_self_static+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-	  if test "$cross_compiling" = yes; then :
+  	  if test "$cross_compiling" = yes; then :
   lt_cv_dlopen_self_static=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -21519,9 +21519,9 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 .     : '\(.\)' 2>/dev/null ||
 echo X/"$0" |
     sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-	  /^X\/\(\/\).*/{ s//\1/; q; }
-	  s/.*/./; q'`
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
 
 
 # PATH needs CR, and LINENO needs CR and PATH.
@@ -21705,7 +21705,7 @@ _ASBOX
 } >&5
 cat >&5 <<_CSEOF
 
-This file was extended by iscsiuio $as_me 0.7.6.1g, which was
+This file was extended by iscsiuio $as_me 0.7.8.1b, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21768,7 +21768,7 @@ _ACEOF
 
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-iscsiuio config.status 0.7.6.1g
+iscsiuio config.status 0.7.8.1b
 configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -22113,10 +22113,10 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 .     : '\(.\)' 2>/dev/null ||
 echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-	  /^X\(\/\/\)$/{ s//\1/; q; }
-	  /^X\(\/\).*/{ s//\1/; q; }
-	  s/.*/./; q'`
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
   { if $as_mkdir_p; then
     mkdir -p "$ac_dir"
   else
@@ -22132,10 +22132,10 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 .     : '\(.\)' 2>/dev/null ||
 echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-	  /^X\(\/\/\)$/{ s//\1/; q; }
-	  /^X\(\/\).*/{ s//\1/; q; }
-	  s/.*/./; q'`
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
     done
     test ! -n "$as_dirs" || mkdir $as_dirs
   fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
@@ -22470,10 +22470,10 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 .     : '\(.\)' 2>/dev/null ||
 echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-	  /^X\(\/\/\)$/{ s//\1/; q; }
-	  /^X\(\/\).*/{ s//\1/; q; }
-	  s/.*/./; q'`
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
       { if $as_mkdir_p; then
     mkdir -p "$ac_dir"
   else
@@ -22489,10 +22489,10 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 .     : '\(.\)' 2>/dev/null ||
 echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-	  /^X\(\/\/\)$/{ s//\1/; q; }
-	  /^X\(\/\).*/{ s//\1/; q; }
-	  s/.*/./; q'`
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
     done
     test ! -n "$as_dirs" || mkdir $as_dirs
   fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
@@ -22524,10 +22524,10 @@ $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 .     : '\(.\)' 2>/dev/null ||
 echo X$ac_file |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-	  /^X\(\/\/\)$/{ s//\1/; q; }
-	  /^X\(\/\).*/{ s//\1/; q; }
-	  s/.*/./; q'`/stamp-h$_am_stamp_count
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`/stamp-h$_am_stamp_count
 done
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF
@@ -22546,10 +22546,10 @@ $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 .     : '\(.\)' 2>/dev/null ||
 echo X"$ac_dest" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-	  /^X\(\/\/\)$/{ s//\1/; q; }
-	  /^X\(\/\).*/{ s//\1/; q; }
-	  s/.*/./; q'`
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
   { if $as_mkdir_p; then
     mkdir -p "$ac_dir"
   else
@@ -22565,10 +22565,10 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 .     : '\(.\)' 2>/dev/null ||
 echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-	  /^X\(\/\/\)$/{ s//\1/; q; }
-	  /^X\(\/\).*/{ s//\1/; q; }
-	  s/.*/./; q'`
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
     done
     test ! -n "$as_dirs" || mkdir $as_dirs
   fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
@@ -22662,10 +22662,10 @@ $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 .     : '\(.\)' 2>/dev/null ||
 echo X"$mf" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-	  /^X\(\/\/\)$/{ s//\1/; q; }
-	  /^X\(\/\).*/{ s//\1/; q; }
-	  s/.*/./; q'`
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
   else
     continue
   fi
@@ -22695,10 +22695,10 @@ $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 .     : '\(.\)' 2>/dev/null ||
 echo X"$file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-	  /^X\(\/\/\)$/{ s//\1/; q; }
-	  /^X\(\/\).*/{ s//\1/; q; }
-	  s/.*/./; q'`
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
     { if $as_mkdir_p; then
     mkdir -p $dirpart/$fdir
   else
@@ -22714,10 +22714,10 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 .     : '\(.\)' 2>/dev/null ||
 echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-	  /^X\(\/\/\)$/{ s//\1/; q; }
-	  /^X\(\/\).*/{ s//\1/; q; }
-	  s/.*/./; q'`
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
     done
     test ! -n "$as_dirs" || mkdir $as_dirs
   fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
@@ -22762,4 +22762,4 @@ if test "$no_create" != yes; then
   # would make configure fail if this is the last instruction.
   $ac_cs_success || { (exit 1); exit 1; }
 fi
-#
+
diff --git a/iscsiuio/configure.ac b/iscsiuio/configure.ac
index 34f0481..e9a5e32 100644
--- a/iscsiuio/configure.ac
+++ b/iscsiuio/configure.ac
@@ -11,9 +11,9 @@ dnl             Benjamin Li  (benli@broadcom.com)
 dnl
 
 PACKAGE=iscsiuio
-VERSION=0.7.6.1g
+VERSION=0.7.8.1b
 
-AC_INIT(iscsiuio, 0.7.6.1g, eddie.wai@broadcom.com)
+AC_INIT(iscsiuio, 0.7.8.1b, eddie.wai@broadcom.com)
 
 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
 AC_CONFIG_HEADER(config.h)
diff --git a/iscsiuio/docs/iscsiuio.8 b/iscsiuio/docs/iscsiuio.8
index 2f577bc..ea21d78 100644
--- a/iscsiuio/docs/iscsiuio.8
+++ b/iscsiuio/docs/iscsiuio.8
@@ -3,9 +3,9 @@
 .\" modify it under the terms of the GNU General Public License as
 .\" published by the Free Software Foundation.
 .\"
-.\" bnx2.4,v 0.7.6.1g
+.\" bnx2.4,v 0.7.8.1b
 .\"
-.TH iscsiuio 8 "01/14/2013" "Broadcom Corporation"
+.TH iscsiuio 8 "05/01/2013" "Broadcom Corporation"
 .\"
 .\" NAME part
 .\"
@@ -81,6 +81,6 @@ Display this help and exit.
 .\" AUTHOR part
 .\"
 .SH AUTHOR
-Eddie Wai \- eddie.wai@broadcom.com
-.P
 Benjamin Li \- benli@broadcom.com
+.P
+Eddie Wai \- eddie.wai@broadcom.com
diff --git a/iscsiuio/src/unix/libs/bnx2.c b/iscsiuio/src/unix/libs/bnx2.c
index b72b8ce..91c44e5 100644
--- a/iscsiuio/src/unix/libs/bnx2.c
+++ b/iscsiuio/src/unix/libs/bnx2.c
@@ -576,7 +576,7 @@ static int bnx2_open(nic_t *nic)
 
 	bp->sblk_map = mmap(NULL, bp->status_blk_size,
 			    PROT_READ | PROT_WRITE, MAP_SHARED,
-			    nic->fd, (off_t) getpagesize());
+			    nic->fd, (off_t) nic->page_size);
 	if (bp->sblk_map == MAP_FAILED) {
 		LOG_INFO(PFX "%s: Could not mmap status block: %s",
 			 nic->log_name, strerror(errno));
@@ -602,9 +602,9 @@ static int bnx2_open(nic_t *nic)
 			  BNX2_SBLK_EVEN_IDX(bp->status_blk.msi->rx2));
 	}
 
-	bp->tx_ring = mmap(NULL, 2 * getpagesize(),
+	bp->tx_ring = mmap(NULL, 2 * nic->page_size,
 			   PROT_READ | PROT_WRITE, MAP_SHARED, nic->fd,
-			   (off_t) 2 * getpagesize());
+			   (off_t) 2 * nic->page_size);
 	if (bp->tx_ring == MAP_FAILED) {
 		LOG_INFO(PFX "%s: Could not mmap tx ring: %s",
 			 nic->log_name, strerror(errno));
@@ -614,7 +614,7 @@ static int bnx2_open(nic_t *nic)
 
 	bp->bufs = mmap(NULL, (bp->rx_ring_size + 1) * bp->rx_buffer_size,
 			PROT_READ | PROT_WRITE,
-			MAP_SHARED, nic->fd, (off_t) 3 * getpagesize());
+			MAP_SHARED, nic->fd, (off_t) 3 * nic->page_size);
 	if (bp->bufs == MAP_FAILED) {
 		LOG_INFO(PFX "%s: Could not mmap buffers: %s",
 			 nic->log_name, strerror(errno));
@@ -693,7 +693,7 @@ static int bnx2_open(nic_t *nic)
 	return 0;
 
 error_bufs:
-	munmap(bp->tx_ring, 2 * getpagesize());
+	munmap(bp->tx_ring, 2 * nic->page_size);
 
 error_tx_ring:
 	munmap(bp->status_blk.msi, bp->status_blk_size);
@@ -765,7 +765,7 @@ static int bnx2_uio_close_resources(nic_t *nic, NIC_SHUTDOWN_T graceful)
 	}
 
 	if (bp->tx_ring != NULL) {
-		rc = munmap(bp->tx_ring, 2 * getpagesize());
+		rc = munmap(bp->tx_ring, 2 * nic->page_size);
 		if (rc != 0)
 			LOG_WARN(PFX "%s: Couldn't unmap tx_rings",
 				 nic->log_name);
@@ -884,7 +884,7 @@ void bnx2_start_xmit(nic_t *nic, size_t len, u16_t vlan_id)
 	uint16_t ring_prod;
 	struct tx_bd *txbd;
 	struct rx_bd *rxbd;
-	rxbd = (struct rx_bd *)(((__u8 *) bp->tx_ring) + getpagesize());
+	rxbd = (struct rx_bd *)(((__u8 *) bp->tx_ring) + nic->page_size);
 
 	if ((rxbd->rx_bd_haddr_hi == 0) && (rxbd->rx_bd_haddr_lo == 0)) {
 		LOG_PACKET(PFX "%s: trying to transmit when device is closed",
diff --git a/iscsiuio/src/unix/libs/bnx2x.c b/iscsiuio/src/unix/libs/bnx2x.c
index c6e92cf..36fc48e 100644
--- a/iscsiuio/src/unix/libs/bnx2x.c
+++ b/iscsiuio/src/unix/libs/bnx2x.c
@@ -818,7 +818,7 @@ static int bnx2x_open(nic_t *nic)
 
 	bp->status_blk.def = mmap(NULL, bp->status_blk_size,
 				  PROT_READ | PROT_WRITE, MAP_SHARED,
-				  nic->fd, (off_t) getpagesize());
+				  nic->fd, (off_t) nic->page_size);
 	if (bp->status_blk.def == MAP_FAILED) {
 		LOG_INFO(PFX "%s: Could not mmap status block: %s",
 			 nic->log_name, strerror(errno));
@@ -827,10 +827,10 @@ static int bnx2x_open(nic_t *nic)
 		goto open_error;
 	}
 
-	bp->tx_ring = mmap(NULL, 4 * getpagesize(),
+	bp->tx_ring = mmap(NULL, 4 * nic->page_size,
 			   PROT_READ | PROT_WRITE,
 			   MAP_SHARED | MAP_LOCKED,
-			   nic->fd, (off_t) 2 * getpagesize());
+			   nic->fd, (off_t) 2 * nic->page_size);
 	if (bp->tx_ring == MAP_FAILED) {
 		LOG_INFO(PFX "%s: Could not mmap tx ring: %s",
 			 nic->log_name, strerror(errno));
@@ -840,12 +840,12 @@ static int bnx2x_open(nic_t *nic)
 	}
 
 	bp->rx_comp_ring.cqe = (union eth_rx_cqe *)
-	    (((__u8 *) bp->tx_ring) + 2 * getpagesize());
+	    (((__u8 *) bp->tx_ring) + 2 * nic->page_size);
 
 	bp->bufs = mmap(NULL, (bp->rx_ring_size + 1) * bp->rx_buffer_size,
 			PROT_READ | PROT_WRITE,
 			MAP_SHARED | MAP_LOCKED,
-			nic->fd, (off_t) 3 * getpagesize());
+			nic->fd, (off_t) 3 * nic->page_size);
 	if (bp->bufs == MAP_FAILED) {
 		LOG_INFO(PFX "%s: Could not mmap buffers: %s",
 			 nic->log_name, strerror(errno));
@@ -937,7 +937,7 @@ static int bnx2x_open(nic_t *nic)
 		bp->rx_prod_io = BAR_USTRORM_INTMEM +
 		    USTORM_RX_PRODS_OFFSET(bp->port, bp->client_id);
 
-		bp->tx_doorbell = bp->cid * getpagesize() + 0x40;
+		bp->tx_doorbell = bp->cid * nic->page_size + 0x40;
 
 		bp->get_rx_cons = bnx2x_get_rx;
 		bp->get_tx_cons = bnx2x_get_tx;
@@ -1073,7 +1073,7 @@ SF:
 
 open_error:
 	if (bp->tx_ring) {
-		munmap(bp->tx_ring, 4 * getpagesize());
+		munmap(bp->tx_ring, 4 * nic->page_size);
 		bp->tx_ring = NULL;
 	}
 
@@ -1150,7 +1150,7 @@ static int bnx2x_uio_close_resources(nic_t *nic, NIC_SHUTDOWN_T graceful)
 	}
 
 	if (bp->tx_ring != NULL) {
-		rc = munmap(bp->tx_ring, 4 * getpagesize());
+		rc = munmap(bp->tx_ring, 4 * nic->page_size);
 		if (rc != 0)
 			LOG_WARN(PFX "%s: Couldn't unmap tx_rings",
 				 nic->log_name);
@@ -1284,7 +1284,7 @@ void bnx2x_start_xmit(nic_t *nic, size_t len, u16_t vlan_id)
 	struct eth_tx_start_bd *txbd;
 	struct eth_tx_bd *txbd2;
 	struct eth_rx_bd *rx_bd;
-	rx_bd = (struct eth_rx_bd *)(((__u8 *) bp->tx_ring) + getpagesize());
+	rx_bd = (struct eth_rx_bd *)(((__u8 *) bp->tx_ring) + nic->page_size);
 
 	if ((rx_bd->addr_hi == 0) && (rx_bd->addr_lo == 0)) {
 		LOG_PACKET(PFX "%s: trying to transmit when device is closed",
@@ -1539,6 +1539,7 @@ static int bnx2x_clear_tx_intr(nic_t *nic)
 				LOG_ERR(PFX "bnx2x tx lock with prod == cons");
 
 			pthread_mutex_unlock(&nic->xmit_mutex);
+			return 0;
 		}
 		return -EAGAIN;
 	}
diff --git a/iscsiuio/src/unix/nic.c b/iscsiuio/src/unix/nic.c
index 457797d..7c3f4d5 100644
--- a/iscsiuio/src/unix/nic.c
+++ b/iscsiuio/src/unix/nic.c
@@ -400,6 +400,7 @@ nic_t *nic_init()
 	nic->tx_packet_queue = NULL;
 	nic->nic_library = NULL;
 	nic->pci_id = NULL;
+	nic->page_size = getpagesize();
 
 	/* nic_mutex is used to protect nic ops */
 	pthread_mutex_init(&nic->nic_mutex, NULL);
diff --git a/iscsiuio/src/unix/nic.h b/iscsiuio/src/unix/nic.h
index 7d2d078..7d1ae28 100644
--- a/iscsiuio/src/unix/nic.h
+++ b/iscsiuio/src/unix/nic.h
@@ -140,7 +140,9 @@ typedef struct nic_interface {
 	time_t start_time;
 
 	struct uip_stack ustack;
-#define IFACE_NUM_INVALID	-1
+
+#define IFACE_NUM_PRESENT (1<<0)
+#define IFACE_NUM_INVALID -1
 	int iface_num;
 	int request_type;
 } nic_interface_t;
@@ -247,6 +249,8 @@ typedef struct nic {
 
 	uint32_t intr_count;	/* Total UIO interrupt count            */
 
+	int page_size;
+
 	/* Held for nic ops manipulation */
 	pthread_mutex_t nic_mutex;
 
-- 
1.8.1.4