svn commit: r258898 - in stable/9: share/man/man4 sys/conf sys/dev/qlxgbe sys/modules sys/modules/qlxgbe

David C Somayajulu davidcs at FreeBSD.org
Tue Dec 3 22:31:10 UTC 2013


Author: davidcs
Date: Tue Dec  3 22:31:08 2013
New Revision: 258898
URL: http://svnweb.freebsd.org/changeset/base/258898

Log:
  MFC 250661,251076,251605,252580,254976,255003,258155
  port dev/qlxgbe from HEAD

Added:
  stable/9/share/man/man4/qlxgbe.4
     - copied unchanged from r250661, head/share/man/man4/qlxgbe.4
  stable/9/sys/dev/qlxgbe/
     - copied from r250661, head/sys/dev/qlxgbe/
  stable/9/sys/modules/qlxgbe/
     - copied from r250661, head/sys/modules/qlxgbe/
Modified:
  stable/9/share/man/man4/Makefile
  stable/9/sys/conf/files.amd64
  stable/9/sys/dev/qlxgbe/ql_hw.c
  stable/9/sys/dev/qlxgbe/ql_hw.h
  stable/9/sys/dev/qlxgbe/ql_ioctl.c
  stable/9/sys/dev/qlxgbe/ql_isr.c
  stable/9/sys/dev/qlxgbe/ql_misc.c
  stable/9/sys/dev/qlxgbe/ql_os.c
  stable/9/sys/modules/Makefile
Directory Properties:
  stable/9/share/   (props changed)
  stable/9/share/man/   (props changed)
  stable/9/share/man/man4/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/share/man/man4/Makefile
==============================================================================
--- stable/9/share/man/man4/Makefile	Tue Dec  3 22:26:38 2013	(r258897)
+++ stable/9/share/man/man4/Makefile	Tue Dec  3 22:31:08 2013	(r258898)
@@ -362,6 +362,7 @@ MAN=	aac.4 \
 	pty.4 \
 	puc.4 \
 	${_qlxgb.4} \
+	${_qlxgbe.4} \
 	ral.4 \
 	random.4 \
 	rc.4 \
@@ -771,9 +772,11 @@ MLINKS+=lindev.4 full.4
 
 .if ${MACHINE_CPUARCH} == "amd64"
 _qlxgb.4=	qlxgb.4
+_qlxgbe.4=	qlxgbe.4
 _sfxge.4=	sfxge.4
 
 MLINKS+=qlxgb.4 if_qlxgb.4
+MLINKS+=qlxgbe.4 if_qlxgbe.4
 MLINKS+=sfxge.4 if_sfxge.4
 .endif
 

Copied: stable/9/share/man/man4/qlxgbe.4 (from r250661, head/share/man/man4/qlxgbe.4)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/9/share/man/man4/qlxgbe.4	Tue Dec  3 22:31:08 2013	(r258898, copy of r250661, head/share/man/man4/qlxgbe.4)
@@ -0,0 +1,91 @@
+.\"-
+.\" Copyright (c) 2013 Qlogic Corportaion 
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd April 1, 2013
+.Dt QLXGBE 4
+.Os
+.Sh NAME
+.Nm qlxgbe
+.Nd "QLogic 10 Gigabit Ethernet & CNA Adapter Driver"
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device qlxgbe"
+.Ed
+.Pp
+To load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_qlxgbe_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver supports IPv4 checksum offload,
+TCP and UDP checksum offload for both IPv4 and IPv6,
+Large Segment Offload for both IPv4 and IPv6,
+Jumbo frames, VLAN Tag, and
+Receive Side scaling.
+For further hardware information, see
+.Pa http://www.qlogic.com/ .
+.Sh HARDWARE
+The
+.Nm
+driver supports 10 Gigabit Ethernet & CNA Adapter based on the following
+chipsets:
+.Pp
+.Bl -bullet -compact
+.It
+QLogic 8300 series
+.El
+.Sh SUPPORT
+For support questions please contact your QLogic approved reseller or
+QLogic Technical Support at
+.Pa http://support.qlogic.com ,
+or by E-mail at
+.Aq support at qlogic.com .
+.Sh SEE ALSO
+.Xr altq 4 ,
+.Xr arp 4 ,
+.Xr netintro 4 ,
+.Xr ng_ether 4 ,
+.Xr ifconfig 8
+.Sh HISTORY
+The
+.Nm
+device driver first appeared in
+.Fx 10.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An David C Somayajulu
+at QLogic Corporation.

Modified: stable/9/sys/conf/files.amd64
==============================================================================
--- stable/9/sys/conf/files.amd64	Tue Dec  3 22:26:38 2013	(r258897)
+++ stable/9/sys/conf/files.amd64	Tue Dec  3 22:31:08 2013	(r258898)
@@ -243,6 +243,13 @@ dev/qlxgb/qla_ioctl.c		optional	qlxgb pc
 dev/qlxgb/qla_isr.c		optional	qlxgb pci
 dev/qlxgb/qla_misc.c		optional	qlxgb pci
 dev/qlxgb/qla_os.c		optional	qlxgb pci
+dev/qlxgbe/ql_dbg.c		optional	qlxgbe pci
+dev/qlxgbe/ql_hw.c		optional	qlxgbe pci
+dev/qlxgbe/ql_ioctl.c		optional	qlxgbe pci
+dev/qlxgbe/ql_isr.c		optional	qlxgbe pci
+dev/qlxgbe/ql_misc.c		optional	qlxgbe pci
+dev/qlxgbe/ql_os.c		optional	qlxgbe pci
+dev/qlxgbe/ql_reset.c		optional	qlxgbe pci
 dev/sfxge/common/efx_bootcfg.c	optional sfxge inet pci
 dev/sfxge/common/efx_ev.c	optional sfxge inet pci
 dev/sfxge/common/efx_filter.c	optional sfxge inet pci

Modified: stable/9/sys/dev/qlxgbe/ql_hw.c
==============================================================================
--- head/sys/dev/qlxgbe/ql_hw.c	Wed May 15 17:03:09 2013	(r250661)
+++ stable/9/sys/dev/qlxgbe/ql_hw.c	Tue Dec  3 22:31:08 2013	(r258898)
@@ -212,6 +212,12 @@ ql_hw_add_sysctls(qla_host_t *ha)
 		"Number of Rcv Rings Entries to post before updating"
 		" RDS Ring Producer Index");
 
+	ha->hw.min_lro_pkt_size = 512;
+	SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+		SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+		OID_AUTO, "min_lro_pkt_size", CTLFLAG_RD, &ha->hw.min_lro_pkt_size,
+		ha->hw.min_lro_pkt_size, "minimum packet size to trigger lro");
+
 	ha->hw.mdump_active = 0;
         SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
                 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
@@ -1069,6 +1075,11 @@ qla_config_fw_lro(qla_host_t *ha, uint16
 
 	fw_lro->cntxt_id = cntxt_id;
 
+	if (ha->hw.min_lro_pkt_size) {
+		fw_lro->flags |= Q8_MBX_FW_LRO_LOW_THRESHOLD;
+		fw_lro->low_threshold = ha->hw.min_lro_pkt_size;
+	}
+
 	if (qla_mbx_cmd(ha, (uint32_t *)fw_lro,
 		(sizeof (q80_config_fw_lro_t) >> 2),
 		ha->hw.mbox, (sizeof (q80_config_fw_lro_rsp_t) >> 2), 0)) {

Modified: stable/9/sys/dev/qlxgbe/ql_hw.h
==============================================================================
--- head/sys/dev/qlxgbe/ql_hw.h	Wed May 15 17:03:09 2013	(r250661)
+++ stable/9/sys/dev/qlxgbe/ql_hw.h	Tue Dec  3 22:31:08 2013	(r258898)
@@ -568,9 +568,13 @@ typedef struct _q80_config_fw_lro {
 #define Q8_MBX_FW_LRO_IPV6                     0x2
 #define Q8_MBX_FW_LRO_IPV4_WO_DST_IP_CHK       0x4
 #define Q8_MBX_FW_LRO_IPV6_WO_DST_IP_CHK       0x8
+#define Q8_MBX_FW_LRO_LOW_THRESHOLD            0x10
 
 	uint8_t		rsrvd;
 	uint16_t	cntxt_id;
+
+	uint16_t	low_threshold;
+	uint16_t	rsrvd0;
 } __packed q80_config_fw_lro_t;
 
 typedef struct _q80_config_fw_lro_rsp {
@@ -1521,6 +1525,7 @@ typedef struct _qla_hw {
 	uint32_t	health_count;
 
 	uint32_t	max_tx_segs;
+	uint32_t	min_lro_pkt_size;
 	
 	/* Flash Descriptor Table */
 	qla_flash_desc_table_t fdt;
@@ -1533,16 +1538,16 @@ typedef struct _qla_hw {
 } qla_hw_t;
 
 #define QL_UPDATE_RDS_PRODUCER_INDEX(ha, prod_reg, val) \
-		WRITE_REG32(ha, prod_reg, val);
+		bus_write_4((ha->pci_reg), prod_reg, val);
 
 #define QL_UPDATE_TX_PRODUCER_INDEX(ha, val, i) \
-	WRITE_REG32(ha, ha->hw.tx_cntxt[i].tx_prod_reg, val)
+		WRITE_REG32(ha, ha->hw.tx_cntxt[i].tx_prod_reg, val)
 
 #define QL_UPDATE_SDS_CONSUMER_INDEX(ha, i, val) \
-	WRITE_REG32(ha, ha->hw.sds[i].sds_consumer, val)
-
-#define QL_ENABLE_INTERRUPTS(ha, i) WRITE_REG32(ha, ha->hw.intr_src[i], 0);
+	bus_write_4((ha->pci_reg), (ha->hw.sds[i].sds_consumer), val);
 
+#define QL_ENABLE_INTERRUPTS(ha, i) \
+		bus_write_4((ha->pci_reg), (ha->hw.intr_src[i]), 0);
 
 #define QL_BUFFER_ALIGN                16
 

Modified: stable/9/sys/dev/qlxgbe/ql_ioctl.c
==============================================================================
--- head/sys/dev/qlxgbe/ql_ioctl.c	Wed May 15 17:03:09 2013	(r250661)
+++ stable/9/sys/dev/qlxgbe/ql_ioctl.c	Tue Dec  3 22:31:08 2013	(r258898)
@@ -223,6 +223,13 @@ ql_eioctl(struct cdev *dev, u_long cmd, 
 		}
 		
 		fw_dump = (qla_rd_fw_dump_t *)data;
+
+		if ((fw_dump->md_template == NULL) ||
+			(fw_dump->template_size != ha->hw.dma_buf.minidump.size)) {
+			rval = EINVAL;
+			break;
+		}
+
 		if ((rval = copyout(ha->hw.dma_buf.minidump.dma_b,
 			fw_dump->md_template, fw_dump->template_size)))
 			rval = ENXIO;

Modified: stable/9/sys/dev/qlxgbe/ql_isr.c
==============================================================================
--- head/sys/dev/qlxgbe/ql_isr.c	Wed May 15 17:03:09 2013	(r250661)
+++ stable/9/sys/dev/qlxgbe/ql_isr.c	Tue Dec  3 22:31:08 2013	(r258898)
@@ -858,7 +858,6 @@ ql_isr(void *arg)
 	int idx;
 	qla_hw_t *hw;
 	struct ifnet *ifp;
-	uint32_t data = 0;
 	uint32_t ret = 0;
 
 	ha = ivec->ha;
@@ -871,12 +870,7 @@ ql_isr(void *arg)
 	if (idx == 0)
 		taskqueue_enqueue(ha->tx_tq, &ha->tx_task);
 	
-
-
-	data = READ_REG32(ha, ha->hw.intr_src[idx]);
-
-	if (data & 0x1 ) 
-		ret = qla_rcv_isr(ha, idx, -1);
+	ret = qla_rcv_isr(ha, idx, -1);
 
 	if (idx == 0)
 		taskqueue_enqueue(ha->tx_tq, &ha->tx_task);

Modified: stable/9/sys/dev/qlxgbe/ql_misc.c
==============================================================================
--- head/sys/dev/qlxgbe/ql_misc.c	Wed May 15 17:03:09 2013	(r250661)
+++ stable/9/sys/dev/qlxgbe/ql_misc.c	Tue Dec  3 22:31:08 2013	(r258898)
@@ -321,7 +321,7 @@ qla_get_fdt(qla_host_t *ha)
 
 	} while ((count < 10000) && (data32 != 0x6));
 
-	if (count == 0 && data32 != 0x6) {
+	if (data32 != 0x6) {
 		qla_sem_unlock(ha, Q8_FLASH_UNLOCK);
 		device_printf(ha->pci_dev,
 			"%s: Poll Q8_FLASH_STATUS failed\n",
@@ -401,7 +401,7 @@ qla_flash_write_enable(qla_host_t *ha, i
 
 	} while ((count < 10000) && (data32 != 0x6));
 			
-	if (count == 0 && data32 != 0x6) {
+	if (data32 != 0x6) {
 		device_printf(ha->pci_dev,
 			"%s: Poll Q8_FLASH_STATUS failed\n",
 			__func__);
@@ -432,7 +432,7 @@ qla_erase_flash_sector(qla_host_t *ha, u
 
 	} while (((count++) < 1000) && (data32 != 0x6));
 
-	if (count == 0 && data32 != 0x6) {
+	if (data32 != 0x6) {
 		device_printf(ha->pci_dev,
 			"%s: Poll Q8_FLASH_STATUS failed\n",
 			__func__);
@@ -479,7 +479,7 @@ qla_erase_flash_sector(qla_host_t *ha, u
 
 	} while (((count++) < 1000) && (data32 != 0x6));
 
-	if (count == 0 && data32 != 0x6) {
+	if (data32 != 0x6) {
 		device_printf(ha->pci_dev,
 			"%s: Poll Q8_FLASH_STATUS failed\n",
 			__func__);
@@ -575,7 +575,7 @@ qla_wr_flash32(qla_host_t *ha, uint32_t 
 
 	} while ((count < 10000) && (data32 != 0x6)); 
 
-	if (count == 0 && data32 != 0x6) {
+	if (data32 != 0x6) {
 		device_printf(ha->pci_dev,
 			"%s: Poll Q8_FLASH_STATUS failed\n",
 			__func__);

Modified: stable/9/sys/dev/qlxgbe/ql_os.c
==============================================================================
--- head/sys/dev/qlxgbe/ql_os.c	Wed May 15 17:03:09 2013	(r250661)
+++ stable/9/sys/dev/qlxgbe/ql_os.c	Tue Dec  3 22:31:08 2013	(r258898)
@@ -1642,18 +1642,20 @@ qla_error_recovery(void *context, int pe
 
         QLA_UNLOCK(ha, __func__);
 
-	ql_minidump(ha);
-	
 	if ((ha->pci_func & 0x1) == 0) {
 
-		if (!ha->msg_from_peer) 
+		if (!ha->msg_from_peer) {
 			qla_send_msg_to_peer(ha, QL_PEER_MSG_RESET);
 
-		while ((ha->msg_from_peer != QL_PEER_MSG_ACK)  && msecs_100--)
-			qla_mdelay(__func__, 100);
+			while ((ha->msg_from_peer != QL_PEER_MSG_ACK) &&
+				msecs_100--)
+				qla_mdelay(__func__, 100);
+		}
 
 		ha->msg_from_peer = 0;
 
+		ql_minidump(ha);
+
 		(void) ql_init_hw(ha);
         	qla_free_xmt_bufs(ha);
 	        qla_free_rcv_bufs(ha);

Modified: stable/9/sys/modules/Makefile
==============================================================================
--- stable/9/sys/modules/Makefile	Tue Dec  3 22:26:38 2013	(r258897)
+++ stable/9/sys/modules/Makefile	Tue Dec  3 22:31:08 2013	(r258898)
@@ -271,6 +271,7 @@ SUBDIR=	\
 	pty  \
 	puc \
 	${_qlxgb} \
+	${_qlxgbe} \
 	ral \
 	${_ralfw} \
 	${_random} \
@@ -713,7 +714,8 @@ _padlock=	padlock
 .endif
 _pccard=	pccard
 _qlxgb=		qlxgb
-_rdma=		rdma	
+_qlxgbe=	qlxgbe
+_rdma=		rdma
 _s3=		s3
 _safe=		safe
 _scsi_low=	scsi_low


More information about the svn-src-stable-9 mailing list