svn commit: r258936 - in stable/9: share/man/man4 sys/conf sys/dev/qlxge sys/modules sys/modules/qlxge
Author: davidcs Date: Wed Dec 4 20:05:20 2013 New Revision: 258936 URL: http://svnweb.freebsd.org/changeset/base/258936 Log: MFC: 252206,258156 port dev/qlxge from head Added: stable/9/share/man/man4/qlxge.4 - copied unchanged from r252206, head/share/man/man4/qlxge.4 stable/9/sys/dev/qlxge/ - copied from r252206, head/sys/dev/qlxge/ stable/9/sys/modules/qlxge/ - copied from r252206, head/sys/modules/qlxge/ Modified: stable/9/share/man/man4/Makefile stable/9/sys/conf/files.amd64 stable/9/sys/dev/qlxge/qls_ioctl.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/MakefileWed Dec 4 20:04:34 2013 (r258935) +++ stable/9/share/man/man4/MakefileWed Dec 4 20:05:20 2013 (r258936) @@ -361,6 +361,7 @@ MAN=aac.4 \ pts.4 \ pty.4 \ puc.4 \ + ${_qlxge.4} \ ${_qlxgb.4} \ ${_qlxgbe.4} \ ral.4 \ @@ -771,10 +772,12 @@ MLINKS+=lindev.4 full.4 .endif .if ${MACHINE_CPUARCH} == amd64 +_qlxge.4= qlxge.4 _qlxgb.4= qlxgb.4 _qlxgbe.4= qlxgbe.4 _sfxge.4= sfxge.4 +MLINKS+=qlxge.4 if_qlxge.4 MLINKS+=qlxgb.4 if_qlxgb.4 MLINKS+=qlxgbe.4 if_qlxgbe.4 MLINKS+=sfxge.4 if_sfxge.4 Copied: stable/9/share/man/man4/qlxge.4 (from r252206, head/share/man/man4/qlxge.4) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man4/qlxge.4 Wed Dec 4 20:05:20 2013 (r258936, copy of r252206, head/share/man/man4/qlxge.4) @@ -0,0 +1,91 @@ +.\- +.\ Copyright (c) 2013-2014 Qlogic Corporation +.\ 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 June 21, 2013 +.Dt QLXGE 4 +.Os +.Sh NAME +.Nm qlxge +.Nd QLogic 8100 Series 10 Gigabit Ethernet 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 qlxge +.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_qlxge_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 8100 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 supp...@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 Wed Dec 4 20:04:34 2013 (r258935) +++ stable/9
svn commit: r265796 - in stable/9/sys: dev/bxe modules/bxe
Author: davidcs Date: Sat May 10 02:09:09 2014 New Revision: 265796 URL: http://svnweb.freebsd.org/changeset/base/265796 Log: MFC r265411 Modify Copyright information to reflect Qlogic Corporation's purchase of Broadcom's NetXtreme business Submitted by:David C Somayajulu (davi...@freebsd.org) QLogic Corporation Modified: stable/9/sys/dev/bxe/57710_init_values.c stable/9/sys/dev/bxe/57710_int_offsets.h stable/9/sys/dev/bxe/57711_init_values.c stable/9/sys/dev/bxe/57711_int_offsets.h stable/9/sys/dev/bxe/57712_init_values.c stable/9/sys/dev/bxe/57712_int_offsets.h stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe.h stable/9/sys/dev/bxe/bxe_dcb.h stable/9/sys/dev/bxe/bxe_debug.c stable/9/sys/dev/bxe/bxe_elink.c stable/9/sys/dev/bxe/bxe_elink.h stable/9/sys/dev/bxe/bxe_stats.c stable/9/sys/dev/bxe/bxe_stats.h stable/9/sys/dev/bxe/ecore_fw_defs.h stable/9/sys/dev/bxe/ecore_hsi.h stable/9/sys/dev/bxe/ecore_init.h stable/9/sys/dev/bxe/ecore_init_ops.h stable/9/sys/dev/bxe/ecore_mfw_req.h stable/9/sys/dev/bxe/ecore_reg.h stable/9/sys/dev/bxe/ecore_sp.c stable/9/sys/dev/bxe/ecore_sp.h stable/9/sys/modules/bxe/Makefile Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/bxe/57710_init_values.c == --- stable/9/sys/dev/bxe/57710_init_values.cSat May 10 02:08:04 2014 (r265795) +++ stable/9/sys/dev/bxe/57710_init_values.cSat May 10 02:09:09 2014 (r265796) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Daviseda...@broadcom.com - * David Christensen davi...@broadcom.com - * Gary Zambrano zambr...@broadcom.com + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - *may be used to endorse or promote products derived from this software - *without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/dev/bxe/57710_int_offsets.h == --- stable/9/sys/dev/bxe/57710_int_offsets.hSat May 10 02:08:04 2014 (r265795) +++ stable/9/sys/dev/bxe/57710_int_offsets.hSat May 10 02:09:09 2014 (r265796) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Daviseda...@broadcom.com - * David Christensen davi...@broadcom.com - * Gary Zambrano zambr...@broadcom.com + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 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. - * 3. Neither the name of Broadcom Corporation nor the name of its contributors - *may be used to endorse or promote products derived from this software - *without specific prior written consent. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/dev/bxe/57711_init_values.c == --- stable/9/sys/dev/bxe/57711_init_values.cSat May 10 02:08:04 2014 (r265795) +++ stable/9/sys/dev/bxe/57711_init_values.cSat May 10 02:09:09 2014 (r265796) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Daviseda...@broadcom.com - * David Christensen davi...@broadcom.com - * Gary Zambrano zambr...@broadcom.com + * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the
svn commit: r265918 - in stable/9: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce
Author: davidcs Date: Mon May 12 15:56:11 2014 New Revision: 265918 URL: http://svnweb.freebsd.org/changeset/base/265918 Log: MFC r265703 Modify Copyright information and other strings to reflect Qlogic Corporation's purchase of Broadcom's NetXtreme business. Added clean option to Makefile Submitted by:David C Somayajulu (davi...@freebsd.org) QLogic Corporation Modified: stable/9/share/man/man4/bce.4 stable/9/share/man/man4/bxe.4 stable/9/sys/dev/bce/if_bce.c stable/9/sys/dev/bce/if_bcefw.h stable/9/sys/dev/bce/if_bcereg.h stable/9/sys/dev/bxe/bxe.c stable/9/sys/modules/bce/Makefile Directory Properties: stable/9/ (props changed) 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/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/share/man/man4/bce.4 == --- stable/9/share/man/man4/bce.4 Mon May 12 15:52:49 2014 (r265917) +++ stable/9/share/man/man4/bce.4 Mon May 12 15:56:11 2014 (r265918) @@ -1,5 +1,4 @@ -.\ Copyright (c) 2006 Broadcom Corporation -.\ David Christensen davi...@broadcom.com. All rights reserved. +.\ Copyright (c) 2006-2014 QLogic Corporation .\ .\ Redistribution and use in source and binary forms, with or without .\ modification, are permitted provided that the following conditions @@ -10,9 +9,6 @@ .\ 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. -.\ 3. Neither the name of Broadcom Corporation nor the name of its contributors -.\may be used to endorse or promote products derived from this software -.\without specific prior written consent. .\ .\ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS' .\ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -33,7 +29,7 @@ .Os .Sh NAME .Nm bce -.Nd Broadcom NetXtreme II (BCM5706/5708/5709/5716) PCI/PCIe Gigabit Ethernet adapter driver +.Nd QLogic NetXtreme II (BCM5706/5708/5709/5716) PCI/PCIe Gigabit Ethernet adapter driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -52,7 +48,7 @@ if_bce_load=YES .Sh DESCRIPTION The .Nm -driver supports Broadcom's NetXtreme II product family, including the +driver supports QLogic's NetXtreme II product family, including the BCM5706, BCM5708, BCM5709 and BCM5716 Ethernet controllers. .Pp The NetXtreme II product family is composed of various Converged NIC (or CNIC) @@ -141,25 +137,25 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver provides support for various NICs based on the Broadcom NetXtreme II +driver provides support for various NICs based on the QLogic NetXtreme II family of Gigabit Ethernet controllers, including the following: .Pp .Bl -bullet -compact .It -Broadcom NetXtreme II BCM5706 1000Base-SX +QLogic NetXtreme II BCM5706 1000Base-SX .It -Broadcom NetXtreme II BCM5706 1000Base-T +QLogic NetXtreme II BCM5706 1000Base-T .It -Broadcom NetXtreme II BCM5708 1000Base-SX +QLogic NetXtreme II BCM5708 1000Base-SX .It -Broadcom NetXtreme II BCM5708 1000Base-T +QLogic NetXtreme II BCM5708 1000Base-T .It -Broadcom NetXtreme II BCM5709 1000Base-SX +QLogic NetXtreme II BCM5709 1000Base-SX .It -Broadcom NetXtreme II BCM5709 1000Base-T +QLogic NetXtreme II BCM5709 1000Base-T .It -Broadcom NetXtreme II BCM5716 1000Base-T +QLogic NetXtreme II BCM5716 1000Base-T .It Dell PowerEdge 1950 integrated BCM5708 NIC .It @@ -411,9 +407,11 @@ A controller hardware failure has occurr If the problem continues replace the controller. .El .Sh SUPPORT -For general information and support, -go to the Broadcom NIC Open Source Developer Resource Site: -.Pa http://www.broadcom.com/support/ethernet_nic/open_source.php . +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 supp...@qlogic.com . .Sh SEE ALSO .Xr altq 4 , .Xr arp 4 , Modified: stable/9/share/man/man4/bxe.4 == --- stable/9/share/man/man4/bxe.4 Mon May 12 15:52:49 2014 (r265917) +++ stable/9/share/man/man4/bxe.4 Mon May 12 15:56:11 2014 (r265918) @@ -1,4 +1,4 @@ -.\ Copyright (c) 2013 Broadcom Corporation. All rights reserved. +.\ Copyright (c) 2014 Qlogic Corporation. All rights reserved. .\ .\ Redistribution and use in source and binary forms, with or without .\ modification, are permitted provided that the following conditions @@ -9,9 +9,6 @@ .\ 2. Redistributions in binary form must reproduce the above copyright .\notice, this list of
svn commit: r271476 - stable/9/sys/dev/bxe
Author: davidcs Date: Fri Sep 12 18:20:35 2014 New Revision: 271476 URL: http://svnweb.freebsd.org/changeset/base/271476 Log: MFC r268854 Initiate error recovery stats fail to update after 3 retries. Change bxe_panic() ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() to panic only if ECORE_STOP_ON_ERROR is defined. Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe.h stable/9/sys/dev/bxe/bxe_stats.c stable/9/sys/dev/bxe/ecore_reg.h stable/9/sys/dev/bxe/ecore_sp.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Fri Sep 12 17:32:28 2014(r271475) +++ stable/9/sys/dev/bxe/bxe.c Fri Sep 12 18:20:35 2014(r271476) @@ -11486,6 +11486,10 @@ bxe_process_kill(struct bxe_softc *sc, bxe_process_kill_chip_reset(sc, global); mb(); +/* clear errors in PGB */ +if (!CHIP_IS_E1(sc)) +REG_WR(sc, PGLUE_B_REG_LATCHED_ERRORS_CLR, 0x7f); + /* Recover after reset: */ /* MCP */ if (global bxe_reset_mcp_comp(sc, val)) { Modified: stable/9/sys/dev/bxe/bxe.h == --- stable/9/sys/dev/bxe/bxe.h Fri Sep 12 17:32:28 2014(r271475) +++ stable/9/sys/dev/bxe/bxe.h Fri Sep 12 18:20:35 2014(r271476) @@ -2301,11 +2301,20 @@ void ecore_storm_memset_struct(struct bx } \ } while(0) +#ifdef ECORE_STOP_ON_ERROR + #define bxe_panic(sc, msg) \ do { \ panic msg; \ } while (0) +#else + +#define bxe_panic(sc, msg) \ +device_printf((sc)-dev, %s (%s,%d)\n, __FUNCTION__, __FILE__, __LINE__); + +#endif + #define CATC_TRIGGER(sc, data) REG_WR((sc), 0x2000, (data)); #define CATC_TRIGGER_START(sc) CATC_TRIGGER((sc), 0xcafecafe) Modified: stable/9/sys/dev/bxe/bxe_stats.c == --- stable/9/sys/dev/bxe/bxe_stats.cFri Sep 12 17:32:28 2014 (r271475) +++ stable/9/sys/dev/bxe/bxe_stats.cFri Sep 12 18:20:35 2014 (r271476) @@ -1306,7 +1306,10 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc-stats_pending++ == 3) { -bxe_panic(sc, (storm stats not updated for 3 times\n)); + if (sc-ifnet-if_drv_flags IFF_DRV_RUNNING) { + atomic_store_rel_long(sc-chip_tq_flags, CHIP_TQ_REINIT); + taskqueue_enqueue(sc-chip_tq, sc-chip_tq_task); + } } return; } Modified: stable/9/sys/dev/bxe/ecore_reg.h == --- stable/9/sys/dev/bxe/ecore_reg.hFri Sep 12 17:32:28 2014 (r271475) +++ stable/9/sys/dev/bxe/ecore_reg.hFri Sep 12 18:20:35 2014 (r271476) @@ -1039,6 +1039,8 @@ __FBSDID($FreeBSD$); 0x942cUL #define PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ \ 0x9430UL +#define PGLUE_B_REG_LATCHED_ERRORS_CLR \ + 0x943CUL #define PGLUE_B_REG_PGLUE_B_INT_STS \ 0x9298UL #define PGLUE_B_REG_PGLUE_B_INT_STS_CLR \ Modified: stable/9/sys/dev/bxe/ecore_sp.h == --- stable/9/sys/dev/bxe/ecore_sp.h Fri Sep 12 17:32:28 2014 (r271475) +++ stable/9/sys/dev/bxe/ecore_sp.h Fri Sep 12 18:20:35 2014 (r271476) @@ -223,6 +223,8 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m #define ecore_sp_post(_sc, _a, _b, _c, _d) \ bxe_sp_post(_sc, _a, _b, U64_HI(_c), U64_LO(_c), _d) +#ifdef ECORE_STOP_ON_ERROR + #define ECORE_DBG_BREAK_IF(exp) \ do {\ if (__predict_false(exp)) { \ @@ -242,6 +244,20 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m }\ } while (0) +#else + +#define ECORE_DBG_BREAK_IF(exp) \ +printf(%s (%s,%d)\n, __FUNCTION__, __FILE__, __LINE__); + +#define ECORE_BUG(exp) \ +printf(%s (%s,%d)\n, __FUNCTION__, __FILE__, __LINE__); + +#define ECORE_BUG_ON(exp) \ +printf(%s (%s,%d)\n, __FUNCTION__, __FILE__, __LINE__); + + +#endif /* #ifdef ECORE_STOP_ON_ERROR */ + #define ECORE_ERR(str, ...) \ BLOGE(sc, ECORE: str, ##__VA_ARGS__) ___ svn-src-stable-9@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to svn-src-stable-9-unsubscr...@freebsd.org
svn commit: r271993 - stable/9/sys/modules/bxe
Author: davidcs Date: Mon Sep 22 19:28:21 2014 New Revision: 271993 URL: http://svnweb.freebsd.org/changeset/base/271993 Log: MFC r271726 remove clean option from Makefile Modified: stable/9/sys/modules/bxe/Makefile Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/modules/bxe/Makefile == --- stable/9/sys/modules/bxe/Makefile Mon Sep 22 19:14:27 2014 (r271992) +++ stable/9/sys/modules/bxe/Makefile Mon Sep 22 19:28:21 2014 (r271993) @@ -15,9 +15,4 @@ SRCS += bxe.c \ CFLAGS += -I${BXE} -clean: - rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms - rm -f *.o *.kld *.ko - rm -f @ machine x86 - .include bsd.kmod.mk ___ svn-src-stable-9@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to svn-src-stable-9-unsubscr...@freebsd.org
svn commit: r271994 - stable/9/sys/modules/bce
Author: davidcs Date: Mon Sep 22 19:37:03 2014 New Revision: 271994 URL: http://svnweb.freebsd.org/changeset/base/271994 Log: MFC r271727 remove clean option from Makefile Modified: stable/9/sys/modules/bce/Makefile Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/modules/bce/Makefile == --- stable/9/sys/modules/bce/Makefile Mon Sep 22 19:28:21 2014 (r271993) +++ stable/9/sys/modules/bce/Makefile Mon Sep 22 19:37:03 2014 (r271994) @@ -5,9 +5,4 @@ SRCS= opt_bce.h if_bce.c miibus_if.h mii #CFLAGS += -DBCE_DEBUG=0 -clean: - rm -f opt_bdg.h device_if.h bus_if.h pci_if.h export_syms - rm -f *.o *.kld *.ko - rm -f @ machine x86 miibus_if.h miidevs.h opt_bce.h - .include bsd.kmod.mk ___ svn-src-stable-9@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to svn-src-stable-9-unsubscr...@freebsd.org
svn commit: r271995 - stable/9/sys/dev/bxe
Author: davidcs Date: Mon Sep 22 19:42:18 2014 New Revision: 271995 URL: http://svnweb.freebsd.org/changeset/base/271995 Log: MFC r271728 For ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() check bxe_debug flag before printing error message. Modified: stable/9/sys/dev/bxe/ecore_sp.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/ecore_sp.h == --- stable/9/sys/dev/bxe/ecore_sp.h Mon Sep 22 19:37:03 2014 (r271994) +++ stable/9/sys/dev/bxe/ecore_sp.h Mon Sep 22 19:42:18 2014 (r271995) @@ -246,14 +246,23 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m #else +extern unsigned long bxe_debug; + +#define BXE_DEBUG_ECORE_DBG_BREAK_IF 0x01 +#define BXE_DEBUG_ECORE_BUG0x02 +#define BXE_DEBUG_ECORE_BUG_ON 0x04 + #define ECORE_DBG_BREAK_IF(exp) \ -printf(%s (%s,%d)\n, __FUNCTION__, __FILE__, __LINE__); +if (bxe_debug BXE_DEBUG_ECORE_DBG_BREAK_IF) \ +printf(%s (%s,%d)\n, __FUNCTION__, __FILE__, __LINE__); #define ECORE_BUG(exp) \ -printf(%s (%s,%d)\n, __FUNCTION__, __FILE__, __LINE__); +if (bxe_debug BXE_DEBUG_ECORE_BUG) \ +printf(%s (%s,%d)\n, __FUNCTION__, __FILE__, __LINE__); #define ECORE_BUG_ON(exp) \ -printf(%s (%s,%d)\n, __FUNCTION__, __FILE__, __LINE__); +if (bxe_debug BXE_DEBUG_ECORE_BUG_ON) \ +printf(%s (%s,%d)\n, __FUNCTION__, __FILE__, __LINE__); #endif /* #ifdef ECORE_STOP_ON_ERROR */ ___ svn-src-stable-9@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to svn-src-stable-9-unsubscr...@freebsd.org
svn commit: r281217 - stable/9/sys/dev/bxe
Author: davidcs Date: Tue Apr 7 18:07:16 2015 New Revision: 281217 URL: https://svnweb.freebsd.org/changeset/base/281217 Log: MFC r281006 When an mbuf allocation fails in the receive path, the mbuf containing the received packet is not sent to the host network stack and is reused again on the receive ring. Remaining received packets in the ring are not processed in that invocation of bxe_rxeof() and defered to the task thread Modified: stable/9/sys/dev/bxe/bxe.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Tue Apr 7 18:06:46 2015(r281216) +++ stable/9/sys/dev/bxe/bxe.c Tue Apr 7 18:07:16 2015(r281217) @@ -3257,7 +3257,7 @@ bxe_rxeof(struct bxe_softc*sc, uint16_t bd_cons, bd_prod, bd_prod_fw, comp_ring_cons; uint16_t hw_cq_cons, sw_cq_cons, sw_cq_prod; int rx_pkts = 0; -int rc; +int rc = 0; BXE_FP_RX_LOCK(fp); @@ -3399,6 +3399,10 @@ bxe_rxeof(struct bxe_softc*sc, (sc-max_rx_bufs != RX_BD_USABLE) ? bd_prod : bd_cons); if (rc != 0) { + +/* we simply reuse the received mbuf and don't post it to the stack */ +m = NULL; + BLOGE(sc, mbuf alloc fail for fp[%02d] rx chain (%d)\n, fp-index, rc); fp-eth_q_stats.rx_soft_errors++; @@ -3487,6 +3491,9 @@ next_cqe: sw_cq_cons = RCQ_NEXT(sw_cq_cons); /* limit spinning on the queue */ +if (rc != 0) +break; + if (rx_pkts == sc-rx_budget) { fp-eth_q_stats.rx_budget_reached++; break; ___ svn-src-stable-9@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to svn-src-stable-9-unsubscr...@freebsd.org
svn commit: r283757 - stable/9/sys/dev/bxe
Author: davidcs Date: Fri May 29 22:33:06 2015 New Revision: 283757 URL: https://svnweb.freebsd.org/changeset/base/283757 Log: MFC r283274 Submitted by: gary.zambr...@qlogic.com Approved by:davi...@freebsd.org Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe_stats.c stable/9/sys/dev/bxe/bxe_stats.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Fri May 29 22:27:48 2015(r283756) +++ stable/9/sys/dev/bxe/bxe.c Fri May 29 22:33:06 2015(r283757) @@ -27,7 +27,7 @@ #include sys/cdefs.h __FBSDID($FreeBSD$); -#define BXE_DRIVER_VERSION 1.78.78 +#define BXE_DRIVER_VERSION 1.78.79 #include bxe.h #include ecore_sp.h @@ -483,6 +483,8 @@ static const struct { 4, STATS_FLAGS_FUNC, rx_pkts}, { STATS_OFFSET32(rx_tpa_pkts), 4, STATS_FLAGS_FUNC, rx_tpa_pkts}, +{ STATS_OFFSET32(rx_jumbo_sge_pkts), +4, STATS_FLAGS_FUNC, rx_jumbo_sge_pkts}, { STATS_OFFSET32(rx_soft_errors), 4, STATS_FLAGS_FUNC, rx_soft_errors}, { STATS_OFFSET32(rx_hw_csum_errors), @@ -594,6 +596,8 @@ static const struct { 4, rx_pkts}, { Q_STATS_OFFSET32(rx_tpa_pkts), 4, rx_tpa_pkts}, +{ Q_STATS_OFFSET32(rx_jumbo_sge_pkts), +4, rx_jumbo_sge_pkts}, { Q_STATS_OFFSET32(rx_soft_errors), 4, rx_soft_errors}, { Q_STATS_OFFSET32(rx_hw_csum_errors), @@ -3477,6 +3481,7 @@ bxe_rxeof(struct bxe_softc*sc, rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp); if (rc) break; +fp-eth_q_stats.rx_jumbo_sge_pkts++; } /* assign packet to this interface interface */ @@ -6860,42 +6865,40 @@ bxe_alloc_fp_buffers(struct bxe_softc *s fp-rx_cq_prod = cqe_ring_prod; fp-eth_q_stats.rx_calls = fp-eth_q_stats.rx_pkts = 0; -if (sc-ifnet-if_capenable IFCAP_LRO) { -max_agg_queues = MAX_AGG_QS(sc); +max_agg_queues = MAX_AGG_QS(sc); -fp-tpa_enable = TRUE; +fp-tpa_enable = TRUE; -/* fill the TPA pool */ -for (j = 0; j max_agg_queues; j++) { -rc = bxe_alloc_rx_tpa_mbuf(fp, j); -if (rc != 0) { -BLOGE(sc, mbuf alloc fail for fp[%02d] TPA queue %d\n, +/* fill the TPA pool */ +for (j = 0; j max_agg_queues; j++) { +rc = bxe_alloc_rx_tpa_mbuf(fp, j); +if (rc != 0) { +BLOGE(sc, mbuf alloc fail for fp[%02d] TPA queue %d\n, i, j); -fp-tpa_enable = FALSE; -goto bxe_alloc_fp_buffers_error; -} - -fp-rx_tpa_info[j].state = BXE_TPA_STATE_STOP; +fp-tpa_enable = FALSE; +goto bxe_alloc_fp_buffers_error; } -if (fp-tpa_enable) { -/* fill the RX SGE chain */ -ring_prod = 0; -for (j = 0; j RX_SGE_USABLE; j++) { -rc = bxe_alloc_rx_sge_mbuf(fp, ring_prod); -if (rc != 0) { -BLOGE(sc, mbuf alloc fail for fp[%02d] SGE %d\n, - i, ring_prod); -fp-tpa_enable = FALSE; -ring_prod = 0; -goto bxe_alloc_fp_buffers_error; -} +fp-rx_tpa_info[j].state = BXE_TPA_STATE_STOP; +} -ring_prod = RX_SGE_NEXT(ring_prod); +if (fp-tpa_enable) { +/* fill the RX SGE chain */ +ring_prod = 0; +for (j = 0; j RX_SGE_USABLE; j++) { +rc = bxe_alloc_rx_sge_mbuf(fp, ring_prod); +if (rc != 0) { +BLOGE(sc, mbuf alloc fail for fp[%02d] SGE %d\n, + i, ring_prod); +fp-tpa_enable = FALSE; +ring_prod = 0; +goto bxe_alloc_fp_buffers_error; } -fp-rx_sge_prod = ring_prod; +ring_prod = RX_SGE_NEXT(ring_prod); } + +fp-rx_sge_prod = ring_prod; } } @@ -11779,28 +11782,26 @@ bxe_pf_rx_q_prep(struct bxe_softc uint16_t sge_sz = 0; uint16_t tpa_agg_size = 0; -if (sc-ifnet-if_capenable IFCAP_LRO) { -pause-sge_th_lo = SGE_TH_LO(sc); -pause-sge_th_hi = SGE_TH_HI(sc); +pause-sge_th_lo = SGE_TH_LO(sc); +pause-sge_th_hi = SGE_TH_HI(sc); -/* validate SGE ring has enough to cross high threshold */ -if (sc-dropless_fc +/* validate SGE ring has enough to cross high threshold */ +if (sc-dropless_fc
svn commit: r284975 - stable/9/sys/dev/bxe
Author: davidcs Date: Tue Jun 30 20:17:38 2015 New Revision: 284975 URL: https://svnweb.freebsd.org/changeset/base/284975 Log: MFC r284739 tx_mtx should be grabbed before calling buf_ring_dequeue_sc() Submitted by:attilio@isilon.com Modified: stable/9/sys/dev/bxe/bxe.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Tue Jun 30 20:11:48 2015(r284974) +++ stable/9/sys/dev/bxe/bxe.c Tue Jun 30 20:17:38 2015(r284975) @@ -6562,10 +6562,14 @@ bxe_free_fp_buffers(struct bxe_softc *sc #if __FreeBSD_version = 80 if (fp-tx_br != NULL) { -struct mbuf *m; /* just in case bxe_mq_flush() wasn't called */ -while ((m = buf_ring_dequeue_sc(fp-tx_br)) != NULL) { -m_freem(m); +if (mtx_initialized(fp-tx_mtx)) { +struct mbuf *m; + +BXE_FP_TX_LOCK(fp); +while ((m = buf_ring_dequeue_sc(fp-tx_br)) != NULL) +m_freem(m); +BXE_FP_TX_UNLOCK(fp); } buf_ring_free(fp-tx_br, M_DEVBUF); fp-tx_br = NULL; ___ svn-src-stable-9@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to svn-src-stable-9-unsubscr...@freebsd.org
svn commit: r284974 - stable/9
Author: davidcs Date: Tue Jun 30 20:11:48 2015 New Revision: 284974 URL: https://svnweb.freebsd.org/changeset/base/284974 Log: reverse r284973 Modified: Directory Properties: stable/9/ (props changed) ___ svn-src-stable-9@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to svn-src-stable-9-unsubscr...@freebsd.org
svn commit: r284971 - stable/9/sys/dev/bxe
Author: davidcs Date: Tue Jun 30 19:53:59 2015 New Revision: 284971 URL: https://svnweb.freebsd.org/changeset/base/284971 Log: MFC r284335 PHY LOCK acquires the hardware lock via bxe_acquire_phy_lock() and releases it via bxe_release_phy_lock(). It was simply acquiring a mutex earlier which can cause the PHY to use bogus values. Fixes intermittent link failures. bxe_ioctl() completes all functions within its context as opposed to a taskqueue earlier. bxe_handle_rx_mode_tq() no longer required. bxe_set_rx_mode() handles the functionality within its context Submitted by:gary.zambr...@qlogic.com Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe.h stable/9/sys/dev/bxe/ecore_reg.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Tue Jun 30 19:53:26 2015(r284970) +++ stable/9/sys/dev/bxe/bxe.c Tue Jun 30 19:53:59 2015(r284971) @@ -737,7 +737,6 @@ static __noinline int bxe_nic_unload(str uint8_t keep_link); static void bxe_handle_sp_tq(void *context, int pending); -static void bxe_handle_rx_mode_tq(void *context, int pending); static void bxe_handle_fp_tq(void *context, int pending); @@ -1185,7 +1184,17 @@ bxe_release_hw_lock(struct bxe_softc *sc REG_WR(sc, hw_lock_control_reg, resource_bit); return (0); } +static void bxe_acquire_phy_lock(struct bxe_softc *sc) +{ + BXE_PHY_LOCK(sc); + bxe_acquire_hw_lock(sc,HW_LOCK_RESOURCE_MDIO); +} +static void bxe_release_phy_lock(struct bxe_softc *sc) +{ + bxe_release_hw_lock(sc,HW_LOCK_RESOURCE_MDIO); + BXE_PHY_UNLOCK(sc); +} /* * Per pf misc lock must be acquired before the per port mcp lock. Otherwise, * had we done things the other way around, if two pfs from the same port @@ -4775,29 +4784,6 @@ bxe_handle_chip_tq(void *context, switch (work) { -case CHIP_TQ_START: -if ((sc-ifnet-if_flags IFF_UP) -!(sc-ifnet-if_drv_flags IFF_DRV_RUNNING)) { -/* start the interface */ -BLOGD(sc, DBG_LOAD, Starting the interface...\n); -BXE_CORE_LOCK(sc); -bxe_init_locked(sc); -BXE_CORE_UNLOCK(sc); -} -break; - -case CHIP_TQ_STOP: -if (!(sc-ifnet-if_flags IFF_UP) -(sc-ifnet-if_drv_flags IFF_DRV_RUNNING)) { -/* bring down the interface */ -BLOGD(sc, DBG_LOAD, Stopping the interface...\n); -bxe_periodic_stop(sc); -BXE_CORE_LOCK(sc); -bxe_stop_locked(sc); -BXE_CORE_UNLOCK(sc); -} -break; - case CHIP_TQ_REINIT: if (sc-ifnet-if_drv_flags IFF_DRV_RUNNING) { /* restart the interface */ @@ -4867,21 +4853,22 @@ bxe_ioctl(struct ifnet *ifp, /* toggle the interface state up or down */ BLOGD(sc, DBG_IOCTL, Received SIOCSIFFLAGS ioctl\n); + BXE_CORE_LOCK(sc); /* check if the interface is up */ if (ifp-if_flags IFF_UP) { if (ifp-if_drv_flags IFF_DRV_RUNNING) { /* set the receive mode flags */ bxe_set_rx_mode(sc); } else { -atomic_store_rel_long(sc-chip_tq_flags, CHIP_TQ_START); -taskqueue_enqueue(sc-chip_tq, sc-chip_tq_task); + bxe_init_locked(sc); } } else { if (ifp-if_drv_flags IFF_DRV_RUNNING) { -atomic_store_rel_long(sc-chip_tq_flags, CHIP_TQ_STOP); -taskqueue_enqueue(sc-chip_tq, sc-chip_tq_task); + bxe_periodic_stop(sc); + bxe_stop_locked(sc); } } + BXE_CORE_UNLOCK(sc); break; @@ -4893,7 +4880,9 @@ bxe_ioctl(struct ifnet *ifp, /* check if the interface is up */ if (ifp-if_drv_flags IFF_DRV_RUNNING) { /* set the receive mode flags */ + BXE_CORE_LOCK(sc); bxe_set_rx_mode(sc); + BXE_CORE_UNLOCK(sc); } break; @@ -5051,8 +5040,11 @@ bxe_ioctl(struct ifnet *ifp, if (reinit (sc-ifnet-if_drv_flags IFF_DRV_RUNNING)) { BLOGD(sc, DBG_LOAD | DBG_IOCTL, Re-initializing hardware from IOCTL change\n); -atomic_store_rel_long(sc-chip_tq_flags, CHIP_TQ_REINIT); -taskqueue_enqueue(sc-chip_tq, sc-chip_tq_task); + bxe_periodic_stop(sc); + BXE_CORE_LOCK(sc); + bxe_stop_locked(sc); + bxe_init_locked(sc); + BXE_CORE_UNLOCK(sc); } return (error); @@ -7503,8 +7495,7 @@ bxe_attn_int_asserted(struct bxe_softc * if (asserted ATTN_HARD_WIRED_MASK) { if (asserted ATTN_NIG_FOR_FUNC) { -BXE_PHY_LOCK(sc); - +
svn commit: r284972 - stable/9/sys/dev/bxe
Author: davidcs Date: Tue Jun 30 19:59:19 2015 New Revision: 284972 URL: https://svnweb.freebsd.org/changeset/base/284972 Log: MFC r284470 In bxe_init_mcast_macs_list(): mc_mac-mac needs to point to the multicast mac address In bxe_set_mc_list(): added missing BXE_MCAST_UNLOCK() In __ecore_vlan_mac_h_exec_pending(): need to check for ECORE_PENDING Submitted by:gary.zambr...@qlogic.com Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/ecore_sp.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Tue Jun 30 19:53:59 2015(r284971) +++ stable/9/sys/dev/bxe/bxe.c Tue Jun 30 19:59:19 2015(r284972) @@ -12544,6 +12544,7 @@ bxe_init_mcast_macs_list(struct bxe_soft BLOGE(sc, Failed to allocate temp mcast list\n); return (-1); } +bzero(mc_mac, (sizeof(*mc_mac) * mc_count)); TAILQ_FOREACH(ifma, ifp-if_multiaddrs, ifma_link) { if (ifma-ifma_addr-sa_family != AF_LINK) { @@ -12594,6 +12595,7 @@ bxe_set_mc_list(struct bxe_softc *sc) rc = ecore_config_mcast(sc, rparam, ECORE_MCAST_CMD_DEL); if (rc 0) { BLOGE(sc, Failed to clear multicast configuration: %d\n, rc); +BXE_MCAST_UNLOCK(sc); return (rc); } Modified: stable/9/sys/dev/bxe/ecore_sp.c == --- stable/9/sys/dev/bxe/ecore_sp.c Tue Jun 30 19:53:59 2015 (r284971) +++ stable/9/sys/dev/bxe/ecore_sp.c Tue Jun 30 19:59:19 2015 (r284972) @@ -474,7 +474,7 @@ static void __ecore_vlan_mac_h_exec_pend o-head_exe_request = FALSE; o-saved_ramrod_flags = 0; rc = ecore_exe_queue_step(sc, o-exe_queue, ramrod_flags); - if (rc != ECORE_SUCCESS) { + if ((rc != ECORE_SUCCESS) (rc != ECORE_PENDING)) { ECORE_ERR(execution of pending commands failed with rc %d\n, rc); #ifdef ECORE_STOP_ON_ERROR ___ svn-src-stable-9@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to svn-src-stable-9-unsubscr...@freebsd.org
svn commit: r284983 - in stable/9/sys: dev/qlxgbe modules/qlxgbe
Author: davidcs Date: Tue Jun 30 21:19:27 2015 New Revision: 284983 URL: https://svnweb.freebsd.org/changeset/base/284983 Log: MFC r284741 Updated Copyright information Added support for the following: - iSCSI TLV (requires 64 Tx and 32 Rx rings - 9K receive buffers for jumbo frames (feature may be enabled/disabled) - builtin firmware, bootloader and minidump template - quick stats - async event handling for SFP insertion/removal and DCBX changes - Configuring DCBX and interrupt coalescing parameters Added: stable/9/sys/dev/qlxgbe/ql_boot.c - copied unchanged from r284741, head/sys/dev/qlxgbe/ql_boot.c stable/9/sys/dev/qlxgbe/ql_fw.c - copied unchanged from r284741, head/sys/dev/qlxgbe/ql_fw.c stable/9/sys/dev/qlxgbe/ql_minidump.c - copied unchanged from r284741, head/sys/dev/qlxgbe/ql_minidump.c Modified: stable/9/sys/dev/qlxgbe/ql_dbg.c stable/9/sys/dev/qlxgbe/ql_dbg.h stable/9/sys/dev/qlxgbe/ql_def.h stable/9/sys/dev/qlxgbe/ql_glbl.h stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_hw.h stable/9/sys/dev/qlxgbe/ql_inline.h stable/9/sys/dev/qlxgbe/ql_ioctl.c stable/9/sys/dev/qlxgbe/ql_ioctl.h 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/dev/qlxgbe/ql_os.h stable/9/sys/dev/qlxgbe/ql_reset.c stable/9/sys/dev/qlxgbe/ql_tmplt.h stable/9/sys/dev/qlxgbe/ql_ver.h stable/9/sys/modules/qlxgbe/Makefile Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Copied: stable/9/sys/dev/qlxgbe/ql_boot.c (from r284741, head/sys/dev/qlxgbe/ql_boot.c) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/qlxgbe/ql_boot.c Tue Jun 30 21:19:27 2015 (r284983, copy of r284741, head/sys/dev/qlxgbe/ql_boot.c) @@ -0,0 +1,10964 @@ +/* + * Copyright (c) 2012-2016 Qlogic Corporation + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + */ + +/* + * File: ql_boot.c + */ +#include sys/cdefs.h +__FBSDID($FreeBSD$); + +#include ql_os.h + +unsigned int ql83xx_bootloader_version_major = 5; +unsigned int ql83xx_bootloader_version_minor = 2; +unsigned int ql83xx_bootloader_version_sub = 7; +unsigned char ql83xx_bootloader[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, + 0x04, 0x00, 0x80, 0x82, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x1e, 0x02, 0x21, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x20, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x21, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, + 0x00, 0x00, 0x00, 0x00, 0x00,
svn commit: r292617 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Tue Dec 22 19:41:40 2015 New Revision: 292617 URL: https://svnweb.freebsd.org/changeset/base/292617 Log: MFC r289635 ql_hw.c: fixed error code INJCT_HEARTBEAT_FAILURE ql_os.c: removed unnecessary debug printf ql_ver.h: updated version number Modified: stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Tue Dec 22 19:40:34 2015 (r292616) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Tue Dec 22 19:41:40 2015 (r292617) @@ -387,6 +387,7 @@ ql_hw_add_sysctls(qla_host_t *ha) "Minidump Utility can start minidump process"); #ifdef QL_DBG + ha->err_inject = 0; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "err_inject", @@ -3057,7 +3058,7 @@ ql_hw_check_health(qla_host_t *ha) val = READ_REG32(ha, Q8_FIRMWARE_HEARTBEAT); if ((val != ha->hw.hbeat_value) && - (!(QL_ERR_INJECT(ha, INJCT_TEMPERATURE_FAILURE { + (!(QL_ERR_INJECT(ha, INJCT_HEARTBEAT_FAILURE { ha->hw.hbeat_value = val; return 0; } Modified: stable/9/sys/dev/qlxgbe/ql_os.c == --- stable/9/sys/dev/qlxgbe/ql_os.c Tue Dec 22 19:40:34 2015 (r292616) +++ stable/9/sys/dev/qlxgbe/ql_os.c Tue Dec 22 19:41:40 2015 (r292617) @@ -289,8 +289,6 @@ qla_pci_attach(device_t dev) int i; uint32_t num_rcvq = 0; - QL_DPRINT2(ha, (dev, "%s: enter\n", __func__)); - if ((ha = device_get_softc(dev)) == NULL) { device_printf(dev, "cannot get softc\n"); return (ENOMEM); Modified: stable/9/sys/dev/qlxgbe/ql_ver.h == --- stable/9/sys/dev/qlxgbe/ql_ver.hTue Dec 22 19:40:34 2015 (r292616) +++ stable/9/sys/dev/qlxgbe/ql_ver.hTue Dec 22 19:41:40 2015 (r292617) @@ -36,6 +36,6 @@ #define QLA_VERSION_MAJOR 3 #define QLA_VERSION_MINOR 10 -#define QLA_VERSION_BUILD 24 +#define QLA_VERSION_BUILD 25 #endif /* #ifndef _QL_VER_H_ */ ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r293789 - stable/9/sys/dev/bxe
Author: davidcs Date: Tue Jan 12 23:26:45 2016 New Revision: 293789 URL: https://svnweb.freebsd.org/changeset/base/293789 Log: MFC r289199 Add support for reading device temperature Modified: stable/9/sys/dev/bxe/bxe.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Tue Jan 12 23:16:27 2016(r293788) +++ stable/9/sys/dev/bxe/bxe.c Tue Jan 12 23:26:45 2016(r293789) @@ -16163,9 +16163,12 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS) } if (result == 1) { + uint32_t temp; sc = (struct bxe_softc *)arg1; + BLOGI(sc, "... dumping driver state ...\n"); -/* XXX */ + temp = SHMEM2_RD(sc, temperature_in_half_celsius); + BLOGI(sc, "\t Device Temperature = %d Celsius\n", (temp/2)); } return (error); ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r293790 - stable/9/sys/dev/bxe
Author: davidcs Date: Tue Jan 12 23:44:03 2016 New Revision: 293790 URL: https://svnweb.freebsd.org/changeset/base/293790 Log: MFC r292638 Check for packet_length is greater than 60 bytes as well as packet_length is greater than len_on_bd, before invoking the routine to handle jumbo over SGL (bxe_service_rxsgl()). Add counters for number of jumbo_over_SGL packets (rx_bxe_service_rxsgl) and erroneous jumbo_over_SGL packets (rx_erroneous_jumbo_sge_pkts) Fix formatting in bxe_sysctl_state() Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe_stats.c stable/9/sys/dev/bxe/bxe_stats.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Tue Jan 12 23:26:45 2016(r293789) +++ stable/9/sys/dev/bxe/bxe.c Tue Jan 12 23:44:03 2016(r293790) @@ -483,6 +483,10 @@ static const struct { 4, STATS_FLAGS_FUNC, "rx_pkts"}, { STATS_OFFSET32(rx_tpa_pkts), 4, STATS_FLAGS_FUNC, "rx_tpa_pkts"}, +{ STATS_OFFSET32(rx_erroneous_jumbo_sge_pkts), +4, STATS_FLAGS_FUNC, "rx_erroneous_jumbo_sge_pkts"}, +{ STATS_OFFSET32(rx_bxe_service_rxsgl), +4, STATS_FLAGS_FUNC, "rx_bxe_service_rxsgl"}, { STATS_OFFSET32(rx_jumbo_sge_pkts), 4, STATS_FLAGS_FUNC, "rx_jumbo_sge_pkts"}, { STATS_OFFSET32(rx_soft_errors), @@ -596,6 +600,10 @@ static const struct { 4, "rx_pkts"}, { Q_STATS_OFFSET32(rx_tpa_pkts), 4, "rx_tpa_pkts"}, +{ Q_STATS_OFFSET32(rx_erroneous_jumbo_sge_pkts), +4, "rx_erroneous_jumbo_sge_pkts"}, +{ Q_STATS_OFFSET32(rx_bxe_service_rxsgl), +4, "rx_bxe_service_rxsgl"}, { Q_STATS_OFFSET32(rx_jumbo_sge_pkts), 4, "rx_jumbo_sge_pkts"}, { Q_STATS_OFFSET32(rx_soft_errors), @@ -3486,11 +3494,14 @@ bxe_rxeof(struct bxe_softc*sc, m_adj(m, pad); m->m_pkthdr.len = m->m_len = len; -if (len != lenonbd){ +if ((len > 60) && (len > lenonbd)) { +fp->eth_q_stats.rx_bxe_service_rxsgl++; rc = bxe_service_rxsgl(fp, len, lenonbd, m, cqe_fp); if (rc) break; fp->eth_q_stats.rx_jumbo_sge_pkts++; +} else if (lenonbd < len) { +fp->eth_q_stats.rx_erroneous_jumbo_sge_pkts++; } /* assign packet to this interface interface */ @@ -16163,12 +16174,12 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS) } if (result == 1) { - uint32_t temp; +uint32_t temp; sc = (struct bxe_softc *)arg1; BLOGI(sc, "... dumping driver state ...\n"); - temp = SHMEM2_RD(sc, temperature_in_half_celsius); - BLOGI(sc, "\t Device Temperature = %d Celsius\n", (temp/2)); +temp = SHMEM2_RD(sc, temperature_in_half_celsius); +BLOGI(sc, "\t Device Temperature = %d Celsius\n", (temp/2)); } return (error); Modified: stable/9/sys/dev/bxe/bxe_stats.c == --- stable/9/sys/dev/bxe/bxe_stats.cTue Jan 12 23:26:45 2016 (r293789) +++ stable/9/sys/dev/bxe/bxe_stats.cTue Jan 12 23:44:03 2016 (r293790) @@ -1227,6 +1227,8 @@ bxe_drv_stats_update(struct bxe_softc *s UPDATE_ESTAT_QSTAT(rx_calls); UPDATE_ESTAT_QSTAT(rx_pkts); UPDATE_ESTAT_QSTAT(rx_tpa_pkts); +UPDATE_ESTAT_QSTAT(rx_erroneous_jumbo_sge_pkts); +UPDATE_ESTAT_QSTAT(rx_bxe_service_rxsgl); UPDATE_ESTAT_QSTAT(rx_jumbo_sge_pkts); UPDATE_ESTAT_QSTAT(rx_soft_errors); UPDATE_ESTAT_QSTAT(rx_hw_csum_errors); Modified: stable/9/sys/dev/bxe/bxe_stats.h == --- stable/9/sys/dev/bxe/bxe_stats.hTue Jan 12 23:26:45 2016 (r293789) +++ stable/9/sys/dev/bxe/bxe_stats.hTue Jan 12 23:44:03 2016 (r293790) @@ -218,6 +218,8 @@ struct bxe_eth_stats { uint32_t rx_calls; uint32_t rx_pkts; uint32_t rx_tpa_pkts; +uint32_t rx_erroneous_jumbo_sge_pkts; +uint32_t rx_bxe_service_rxsgl; uint32_t rx_jumbo_sge_pkts; uint32_t rx_soft_errors; uint32_t rx_hw_csum_errors; @@ -319,6 +321,8 @@ struct bxe_eth_q_stats { uint32_t rx_calls; uint32_t rx_pkts; uint32_t rx_tpa_pkts; +uint32_t rx_erroneous_jumbo_sge_pkts; +uint32_t rx_bxe_service_rxsgl; uint32_t rx_jumbo_sge_pkts; uint32_t rx_soft_errors; uint32_t rx_hw_csum_errors; @@ -413,6 +417,8 @@ struct bxe_eth_q_stats_old { uint32_t rx_calls_old; uint32_t rx_pkts_old; uint32_t rx_tpa_pkts_old; +uint32_t rx_erroneous_jumbo_sge_pkts_old; +uint32_t rx_bxe_service_rxsgl_old;
svn commit: r296048 - stable/9/sys/dev/bxe
Author: davidcs Date: Thu Feb 25 18:25:36 2016 New Revision: 296048 URL: https://svnweb.freebsd.org/changeset/base/296048 Log: MFC r295823 Modified the use of bxe_grc_dump() function so that it can be invoked directly at any potential error path, where a fwdump is needed. The fwdump (a.k.a grcdump) is stored in a driver buffer. The sysctl grcdump_done indicates if a fwdump was taken and waiting to be retrieved. The sysctl trigger_grcdump can be used to manually trigger a fwdump. Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Thu Feb 25 18:23:40 2016(r296047) +++ stable/9/sys/dev/bxe/bxe.c Thu Feb 25 18:25:36 2016(r296048) @@ -749,6 +749,7 @@ static void bxe_handle_fp_tq(void *conte static int bxe_add_cdev(struct bxe_softc *sc); static void bxe_del_cdev(struct bxe_softc *sc); +static int bxe_grc_dump(struct bxe_softc *sc); /* calculate crc32 on a buffer (NOTE: crc32_length MUST be aligned to 8) */ uint32_t @@ -7949,6 +7950,16 @@ bxe_chk_parity_attn(struct bxe_softc *sc attn.sig[2] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_3_FUNC_0 + port*4); attn.sig[3] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_4_FUNC_0 + port*4); +/* + * Since MCP attentions can't be disabled inside the block, we need to + * read AEU registers to see whether they're currently disabled + */ +attn.sig[3] &= ((REG_RD(sc, (!port ? MISC_REG_AEU_ENABLE4_FUNC_0_OUT_0 + : MISC_REG_AEU_ENABLE4_FUNC_1_OUT_0)) & + MISC_AEU_ENABLE_MCP_PRTY_BITS) | +~MISC_AEU_ENABLE_MCP_PRTY_BITS); + + if (!CHIP_IS_E1x(sc)) attn.sig[4] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_5_FUNC_0 + port*4); @@ -16189,6 +16200,30 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS) } static int +bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS) +{ +struct bxe_softc *sc; +int error, result; + +result = 0; +error = sysctl_handle_int(oidp, , 0, req); + +if (error || !req->newptr) { +return (error); +} + +if (result == 1) { +sc = (struct bxe_softc *)arg1; + +BLOGI(sc, "... grcdump start ...\n"); +bxe_grc_dump(sc); +BLOGI(sc, "... grcdump done ...\n"); +} + +return (error); +} + +static int bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS) { struct bxe_softc *sc = (struct bxe_softc *)arg1; @@ -16320,11 +16355,15 @@ bxe_add_sysctls(struct bxe_softc *sc) CTLFLAG_RW, >debug, "debug logging mode"); -sc->trigger_grcdump = 0; -SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump", -CTLFLAG_RW, >trigger_grcdump, 0, +SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump", +CTLTYPE_UINT | CTLFLAG_RW, sc, 0, +bxe_sysctl_trigger_grcdump, "IU", "set by driver when a grcdump is needed"); +sc->grcdump_done = 0; +SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done", + CTLFLAG_RW, >grcdump_done, 0, + "set by driver when grcdump is done"); sc->rx_budget = bxe_rx_budget; SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "rx_budget", @@ -18942,26 +18981,6 @@ bxe_get_preset_regs_len(struct bxe_softc } static int -bxe_get_max_regs_len(struct bxe_softc *sc) -{ -uint32_t preset_idx; -int regdump_len32, len32; - -regdump_len32 = bxe_get_preset_regs_len(sc, 1); - -/* Calculate the total preset regs length */ -for (preset_idx = 2; preset_idx <= DUMP_MAX_PRESETS; preset_idx++) { - -len32 = bxe_get_preset_regs_len(sc, preset_idx); - -if (regdump_len32 < len32) -regdump_len32 = len32; -} - -return regdump_len32; -} - -static int bxe_get_total_regs_len32(struct bxe_softc *sc) { uint32_t preset_idx; @@ -19188,18 +19207,21 @@ bxe_get_preset_regs(struct bxe_softc *sc } static int -bxe_grc_dump(struct bxe_softc *sc, bxe_grcdump_t *dump) +bxe_grc_dump(struct bxe_softc *sc) { int rval = 0; uint32_t preset_idx; uint8_t *buf; uint32_t size; struct dump_header *d_hdr; + +if (sc->grcdump_done) + return (rval); ecore_disable_blocks_parity(sc); -buf = dump->grcdump; -d_hdr = dump->grcdump; +buf = sc->grc_dump; +d_hdr = sc->grc_dump; d_hdr->header_size = (sizeof(struct dump_header) >> 2) - 1; d_hdr->version = BNX2X_DUMP_VERSION; @@ -19220,7 +19242,6 @@ bxe_grc_dump(struct bxe_softc *sc, bxe_g (BXE_PATH(sc) ? DUMP_PATH_1 : DUMP_PATH_0); } -dump->grcdump_dwords = sizeof(struct dump_header) >> 2; buf += sizeof(struct dump_header); for
svn commit: r296050 - stable/9/sys/dev/bxe
Author: davidcs Date: Thu Feb 25 18:28:56 2016 New Revision: 296050 URL: https://svnweb.freebsd.org/changeset/base/296050 Log: MFC r295830 Remove dead code. Code Cleanup. Improve clarity in debug messages Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe.h stable/9/sys/dev/bxe/bxe_stats.c stable/9/sys/dev/bxe/ecore_init.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Thu Feb 25 18:27:22 2016(r296049) +++ stable/9/sys/dev/bxe/bxe.c Thu Feb 25 18:28:56 2016(r296050) @@ -124,14 +124,6 @@ static struct bxe_device_type bxe_devs[] PCI_ANY_ID, PCI_ANY_ID, "QLogic NetXtreme II BCM57712 MF 10GbE" }, -#if 0 -{ -BRCM_VENDORID, -CHIP_NUM_57712_VF, -PCI_ANY_ID, PCI_ANY_ID, -"QLogic NetXtreme II BCM57712 VF 10GbE" -}, -#endif { BRCM_VENDORID, CHIP_NUM_57800, @@ -144,14 +136,6 @@ static struct bxe_device_type bxe_devs[] PCI_ANY_ID, PCI_ANY_ID, "QLogic NetXtreme II BCM57800 MF 10GbE" }, -#if 0 -{ -BRCM_VENDORID, -CHIP_NUM_57800_VF, -PCI_ANY_ID, PCI_ANY_ID, -"QLogic NetXtreme II BCM57800 VF 10GbE" -}, -#endif { BRCM_VENDORID, CHIP_NUM_57810, @@ -164,14 +148,6 @@ static struct bxe_device_type bxe_devs[] PCI_ANY_ID, PCI_ANY_ID, "QLogic NetXtreme II BCM57810 MF 10GbE" }, -#if 0 -{ -BRCM_VENDORID, -CHIP_NUM_57810_VF, -PCI_ANY_ID, PCI_ANY_ID, -"QLogic NetXtreme II BCM57810 VF 10GbE" -}, -#endif { BRCM_VENDORID, CHIP_NUM_57811, @@ -184,42 +160,18 @@ static struct bxe_device_type bxe_devs[] PCI_ANY_ID, PCI_ANY_ID, "QLogic NetXtreme II BCM57811 MF 10GbE" }, -#if 0 -{ -BRCM_VENDORID, -CHIP_NUM_57811_VF, -PCI_ANY_ID, PCI_ANY_ID, -"QLogic NetXtreme II BCM57811 VF 10GbE" -}, -#endif { BRCM_VENDORID, CHIP_NUM_57840_4_10, PCI_ANY_ID, PCI_ANY_ID, "QLogic NetXtreme II BCM57840 4x10GbE" }, -#if 0 -{ -BRCM_VENDORID, -CHIP_NUM_57840_2_20, -PCI_ANY_ID, PCI_ANY_ID, -"QLogic NetXtreme II BCM57840 2x20GbE" -}, -#endif { BRCM_VENDORID, CHIP_NUM_57840_MF, PCI_ANY_ID, PCI_ANY_ID, "QLogic NetXtreme II BCM57840 MF 10GbE" }, -#if 0 -{ -BRCM_VENDORID, -CHIP_NUM_57840_VF, -PCI_ANY_ID, PCI_ANY_ID, -"QLogic NetXtreme II BCM57840 VF 10GbE" -}, -#endif { 0, 0, 0, 0, NULL } @@ -245,10 +197,6 @@ static device_method_t bxe_methods[] = { DEVMETHOD(device_attach,bxe_attach), DEVMETHOD(device_detach,bxe_detach), DEVMETHOD(device_shutdown, bxe_shutdown), -#if 0 -DEVMETHOD(device_suspend, bxe_suspend), -DEVMETHOD(device_resume,bxe_resume), -#endif /* Bus interface (bus_if.h) */ DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_driver_added, bus_generic_driver_added), @@ -469,12 +417,6 @@ static const struct { 8, STATS_FLAGS_FUNC, "tpa_aggregated_frames"}, { STATS_OFFSET32(total_tpa_bytes_hi), 8, STATS_FLAGS_FUNC, "tpa_bytes"}, -#if 0 -{ STATS_OFFSET32(recoverable_error), -4, STATS_FLAGS_FUNC, "recoverable_errors" }, -{ STATS_OFFSET32(unrecoverable_error), -4, STATS_FLAGS_FUNC, "unrecoverable_errors" }, -#endif { STATS_OFFSET32(eee_tx_lpi), 4, STATS_FLAGS_PORT, "eee_tx_lpi"}, { STATS_OFFSET32(rx_calls), @@ -527,12 +469,6 @@ static const struct { 4, STATS_FLAGS_FUNC, "tx_window_violation_std"}, { STATS_OFFSET32(tx_window_violation_tso), 4, STATS_FLAGS_FUNC, "tx_window_violation_tso"}, -#if 0 -{ STATS_OFFSET32(tx_unsupported_tso_request_ipv6), -4, STATS_FLAGS_FUNC, "tx_unsupported_tso_request_ipv6"}, -{ STATS_OFFSET32(tx_unsupported_tso_request_not_tcp), -4, STATS_FLAGS_FUNC, "tx_unsupported_tso_request_not_tcp"}, -#endif { STATS_OFFSET32(tx_chain_lost_mbuf), 4, STATS_FLAGS_FUNC, "tx_chain_lost_mbuf"}, { STATS_OFFSET32(tx_frames_deferred), @@ -644,12 +580,6 @@ static const struct { 4, "tx_window_violation_std"}, { Q_STATS_OFFSET32(tx_window_violation_tso), 4, "tx_window_violation_tso"}, -#if 0 -{ Q_STATS_OFFSET32(tx_unsupported_tso_request_ipv6), -4, "tx_unsupported_tso_request_ipv6"}, -{ Q_STATS_OFFSET32(tx_unsupported_tso_request_not_tcp), -4, "tx_unsupported_tso_request_not_tcp"}, -#endif { Q_STATS_OFFSET32(tx_chain_lost_mbuf),
svn commit: r296877 - stable/9/sys/dev/bxe
Author: davidcs Date: Mon Mar 14 23:33:38 2016 New Revision: 296877 URL: https://svnweb.freebsd.org/changeset/base/296877 Log: MFC r296579 Fix code so that buf_ring allocation for Tx Queues and their mutexes is done during during bxe_attach() and freed during bxe_detach() Modified: stable/9/sys/dev/bxe/bxe.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Mon Mar 14 23:21:06 2016(r296876) +++ stable/9/sys/dev/bxe/bxe.c Mon Mar 14 23:33:38 2016(r296877) @@ -680,6 +680,8 @@ static void bxe_handle_fp_tq(void *conte static int bxe_add_cdev(struct bxe_softc *sc); static void bxe_del_cdev(struct bxe_softc *sc); static int bxe_grc_dump(struct bxe_softc *sc); +static int bxe_alloc_buf_rings(struct bxe_softc *sc); +static void bxe_free_buf_rings(struct bxe_softc *sc); /* calculate crc32 on a buffer (NOTE: crc32_length MUST be aligned to 8) */ uint32_t @@ -4204,9 +4206,20 @@ bxe_nic_unload(struct bxe_softc *sc, { uint8_t global = FALSE; uint32_t val; +int i; BXE_CORE_LOCK_ASSERT(sc); +sc->ifnet->if_drv_flags &= ~IFF_DRV_RUNNING; + +for (i = 0; i < sc->num_queues; i++) { +struct bxe_fastpath *fp; + +fp = >fp[i]; +BXE_FP_TX_LOCK(fp); +BXE_FP_TX_UNLOCK(fp); +} + BLOGD(sc, DBG_LOAD, "Starting NIC unload...\n"); /* mark driver as unloaded in shmem2 */ @@ -6254,8 +6267,6 @@ bxe_free_fp_buffers(struct bxe_softc *sc m_freem(m); BXE_FP_TX_UNLOCK(fp); } -buf_ring_free(fp->tx_br, M_DEVBUF); -fp->tx_br = NULL; } #endif @@ -6285,14 +6296,6 @@ bxe_free_fp_buffers(struct bxe_softc *sc } /* XXX verify all mbufs were reclaimed */ - -if (mtx_initialized(>tx_mtx)) { -mtx_destroy(>tx_mtx); -} - -if (mtx_initialized(>rx_mtx)) { -mtx_destroy(>rx_mtx); -} } } @@ -6514,15 +6517,6 @@ bxe_alloc_fp_buffers(struct bxe_softc *s for (i = 0; i < sc->num_queues; i++) { fp = >fp[i]; -#if __FreeBSD_version >= 80 -fp->tx_br = buf_ring_alloc(BXE_BR_SIZE, M_DEVBUF, - M_DONTWAIT, >tx_mtx); -if (fp->tx_br == NULL) { -BLOGE(sc, "buf_ring alloc fail for fp[%02d]\n", i); -goto bxe_alloc_fp_buffers_error; -} -#endif - ring_prod = cqe_ring_prod = 0; fp->rx_bd_cons = 0; fp->rx_cq_cons = 0; @@ -9630,14 +9624,6 @@ bxe_init_eth_fp(struct bxe_softc *sc, fp->sc= sc; fp->index = idx; -snprintf(fp->tx_mtx_name, sizeof(fp->tx_mtx_name), - "bxe%d_fp%d_tx_lock", sc->unit, idx); -mtx_init(>tx_mtx, fp->tx_mtx_name, NULL, MTX_DEF); - -snprintf(fp->rx_mtx_name, sizeof(fp->rx_mtx_name), - "bxe%d_fp%d_rx_lock", sc->unit, idx); -mtx_init(>rx_mtx, fp->rx_mtx_name, NULL, MTX_DEF); - fp->igu_sb_id = (sc->igu_base_sb + idx + CNIC_SUPPORT(sc)); fp->fw_sb_id = (sc->base_fw_ndsb + idx + CNIC_SUPPORT(sc)); @@ -15829,6 +15815,89 @@ bxe_add_sysctls(struct bxe_softc *sc) } } +static int +bxe_alloc_buf_rings(struct bxe_softc *sc) +{ +#if __FreeBSD_version >= 80 + +int i; +struct bxe_fastpath *fp; + +for (i = 0; i < sc->num_queues; i++) { + +fp = >fp[i]; + +fp->tx_br = buf_ring_alloc(BXE_BR_SIZE, M_DEVBUF, + M_NOWAIT, >tx_mtx); +if (fp->tx_br == NULL) +return (-1); +} +#endif +return (0); +} + +static void +bxe_free_buf_rings(struct bxe_softc *sc) +{ +#if __FreeBSD_version >= 80 + +int i; +struct bxe_fastpath *fp; + +for (i = 0; i < sc->num_queues; i++) { + +fp = >fp[i]; + +if (fp->tx_br) { +buf_ring_free(fp->tx_br, M_DEVBUF); +fp->tx_br = NULL; +} +} + +#endif +} + +static void +bxe_init_fp_mutexs(struct bxe_softc *sc) +{ +int i; +struct bxe_fastpath *fp; + +for (i = 0; i < sc->num_queues; i++) { + +fp = >fp[i]; + +snprintf(fp->tx_mtx_name, sizeof(fp->tx_mtx_name), +"bxe%d_fp%d_tx_lock", sc->unit, i); +mtx_init(>tx_mtx, fp->tx_mtx_name, NULL, MTX_DEF); + +snprintf(fp->rx_mtx_name, sizeof(fp->rx_mtx_name), +"bxe%d_fp%d_rx_lock", sc->unit, i); +mtx_init(>rx_mtx, fp->rx_mtx_name, NULL, MTX_DEF); +} +} + +static void +bxe_destroy_fp_mutexs(struct bxe_softc *sc) +{ +int i; +struct bxe_fastpath *fp; + +for (i = 0; i < sc->num_queues; i++) { + +fp = >fp[i]; + +if (mtx_initialized(>tx_mtx)) { +mtx_destroy(>tx_mtx); +} + +if (mtx_initialized(>rx_mtx)) { +mtx_destroy(>rx_mtx); +} +
svn commit: r296581 - in stable/9/sys: dev/bxe modules/bxe
Author: davidcs Date: Wed Mar 9 21:40:00 2016 New Revision: 296581 URL: https://svnweb.freebsd.org/changeset/base/296581 Log: MFC r296071 Upgrade the firmware carried in driver and loaded during hardware initialization (a.k.a STORM firmware) to version 7.13.1 (latest version) Modified: stable/9/sys/dev/bxe/57710_init_values.c stable/9/sys/dev/bxe/57710_int_offsets.h stable/9/sys/dev/bxe/57711_init_values.c stable/9/sys/dev/bxe/57711_int_offsets.h stable/9/sys/dev/bxe/57712_init_values.c stable/9/sys/dev/bxe/57712_int_offsets.h stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe.h stable/9/sys/dev/bxe/bxe_elink.c stable/9/sys/dev/bxe/bxe_elink.h stable/9/sys/dev/bxe/bxe_stats.c stable/9/sys/dev/bxe/ecore_fw_defs.h stable/9/sys/dev/bxe/ecore_hsi.h stable/9/sys/dev/bxe/ecore_init.h stable/9/sys/dev/bxe/ecore_init_ops.h stable/9/sys/dev/bxe/ecore_mfw_req.h stable/9/sys/dev/bxe/ecore_reg.h stable/9/sys/dev/bxe/ecore_sp.c stable/9/sys/dev/bxe/ecore_sp.h stable/9/sys/modules/bxe/Makefile Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/bxe/57710_init_values.c == --- stable/9/sys/dev/bxe/57710_init_values.cWed Mar 9 21:30:21 2016 (r296580) +++ stable/9/sys/dev/bxe/57710_init_values.cWed Mar 9 21:40:00 2016 (r296581) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. + * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -11,7 +11,7 @@ *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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER OR CONTRIBUTORS @@ -104,19 +104,19 @@ static const struct raw_op init_ops_e1[] /* #define CFC_COMMON_START88 */ {OP_ZR, 0x104c00, 0x100}, {OP_WR, 0x104028, 0x10}, - {OP_WR, 0x104044, 0x3fff}, + {OP_SW, 0x104040, 0x20469}, {OP_WR, 0x104058, 0x28}, {OP_WR, 0x104084, 0x84924a}, {OP_WR, 0x104058, 0x0}, /* #define CFC_COMMON_END 89 */ /* #define CSDM_COMMON_START110 */ - {OP_SW, 0xc2008, 0x30469}, - {OP_SW, 0xc201c, 0x4046c}, - {OP_SW, 0xc2038, 0x110470}, + {OP_SW, 0xc2008, 0x3046b}, + {OP_SW, 0xc201c, 0x4046e}, + {OP_SW, 0xc2038, 0x110472}, {OP_ZR, 0xc207c, 0x4f}, - {OP_SW, 0xc21b8, 0x110481}, + {OP_SW, 0xc21b8, 0x110483}, {OP_ZR, 0xc21fc, 0xf}, - {OP_SW, 0xc2238, 0x40492}, + {OP_SW, 0xc2238, 0x40494}, {OP_RD, 0xc2248, 0x0}, {OP_RD, 0xc224c, 0x0}, {OP_RD, 0xc2250, 0x0}, @@ -141,76 +141,76 @@ static const struct raw_op init_ops_e1[] /* #define CSDM_COMMON_END 111 */ /* #define CSEM_COMMON_START132 */ {OP_FW, 0x200400, 0xe0}, - {OP_WR_64, 0x200780, 0x100496}, + {OP_WR_64, 0x200780, 0x100498}, {OP_ZR, 0x22, 0x1600}, {OP_ZR, 0x228000, 0x40}, {OP_ZR, 0x223bd0, 0x8}, {OP_ZR, 0x224800, 0x6}, - {OP_SW, 0x224818, 0x40498}, + {OP_SW, 0x224818, 0x4049a}, {OP_ZR, 0x224828, 0xc}, - {OP_SW, 0x224858, 0x4049c}, + {OP_SW, 0x224858, 0x4049e}, {OP_ZR, 0x224868, 0xc}, - {OP_SW, 0x224898, 0x404a0}, + {OP_SW, 0x224898, 0x404a2}, {OP_ZR, 0x2248a8, 0xc}, - {OP_SW, 0x2248d8, 0x404a4}, + {OP_SW, 0x2248d8, 0x404a6}, {OP_ZR, 0x2248e8, 0xc}, - {OP_SW, 0x224918, 0x404a8}, + {OP_SW, 0x224918, 0x404aa}, {OP_ZR, 0x224928, 0xc}, - {OP_SW, 0x224958, 0x404ac}, + {OP_SW, 0x224958, 0x404ae}, {OP_ZR, 0x224968, 0xc}, - {OP_SW, 0x224998, 0x404b0}, + {OP_SW, 0x224998, 0x404b2}, {OP_ZR, 0x2249a8, 0xc}, - {OP_SW, 0x2249d8, 0x404b4}, + {OP_SW, 0x2249d8, 0x404b6}, {OP_ZR, 0x2249e8, 0xc}, - {OP_SW, 0x224a18, 0x404b8}, + {OP_SW, 0x224a18, 0x404ba}, {OP_ZR, 0x224a28, 0xc}, - {OP_SW, 0x224a58, 0x404bc}, + {OP_SW, 0x224a58, 0x404be}, {OP_ZR, 0x224a68, 0xc}, - {OP_SW, 0x224a98, 0x404c0}, + {OP_SW, 0x224a98, 0x404c2}, {OP_ZR, 0x224aa8, 0xc}, - {OP_SW, 0x224ad8, 0x404c4}, + {OP_SW, 0x224ad8, 0x404c6}, {OP_ZR, 0x224ae8, 0xc}, -
svn commit: r299300 - stable/9/sys/dev/bxe
Author: davidcs Date: Tue May 10 02:44:23 2016 New Revision: 299300 URL: https://svnweb.freebsd.org/changeset/base/299300 Log: MFC r298294 1. modify fwdump (a.k.a grcdump) so that grcdump memory is allocated and freed on as needed basis. 2. grcdump can be taken at failure points by invoking bxe_grc_dump() when trigger_grcdump sysctl flag is set. When grcdump is taken grcdump_done sysctl flag is set. 3. grcdump_done can be monitored by the user to retrieve the grcdump Submitted by:vaishali.kulka...@qlogic.com Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe.h stable/9/sys/dev/bxe/bxe_stats.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Tue May 10 02:35:13 2016(r299299) +++ stable/9/sys/dev/bxe/bxe.c Tue May 10 02:44:23 2016(r299300) @@ -683,7 +683,6 @@ static void bxe_handle_fp_tq(void *conte static int bxe_add_cdev(struct bxe_softc *sc); static void bxe_del_cdev(struct bxe_softc *sc); -static int bxe_grc_dump(struct bxe_softc *sc); static int bxe_alloc_buf_rings(struct bxe_softc *sc); static void bxe_free_buf_rings(struct bxe_softc *sc); @@ -3460,6 +3459,10 @@ bxe_watchdog(struct bxe_softc*sc, } BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index); +if(sc->trigger_grcdump) { + /* taking grcdump */ + bxe_grc_dump(sc); +} BXE_FP_TX_UNLOCK(fp); @@ -15677,30 +15680,6 @@ bxe_sysctl_state(SYSCTL_HANDLER_ARGS) } static int -bxe_sysctl_trigger_grcdump(SYSCTL_HANDLER_ARGS) -{ -struct bxe_softc *sc; -int error, result; - -result = 0; -error = sysctl_handle_int(oidp, , 0, req); - -if (error || !req->newptr) { -return (error); -} - -if (result == 1) { -sc = (struct bxe_softc *)arg1; - -BLOGI(sc, "... grcdump start ...\n"); -bxe_grc_dump(sc); -BLOGI(sc, "... grcdump done ...\n"); -} - -return (error); -} - -static int bxe_sysctl_eth_stat(SYSCTL_HANDLER_ARGS) { struct bxe_softc *sc = (struct bxe_softc *)arg1; @@ -15851,14 +15830,16 @@ bxe_add_sysctls(struct bxe_softc *sc) "debug logging mode"); #endif /* #if __FreeBSD_version >= 90 */ -SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump", -CTLTYPE_UINT | CTLFLAG_RW, sc, 0, -bxe_sysctl_trigger_grcdump, "IU", -"set by driver when a grcdump is needed"); +sc->trigger_grcdump = 0; +SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump", + CTLFLAG_RW, >trigger_grcdump, 0, + "trigger grcdump should be invoked" + " before collecting grcdump"); +sc->grcdump_started = 0; sc->grcdump_done = 0; SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done", - CTLFLAG_RW, >grcdump_done, 0, + CTLFLAG_RD, >grcdump_done, 0, "set by driver when grcdump is done"); sc->rx_budget = bxe_rx_budget; @@ -18690,7 +18671,7 @@ bxe_get_preset_regs(struct bxe_softc *sc return 0; } -static int +int bxe_grc_dump(struct bxe_softc *sc) { int rval = 0; @@ -18698,12 +18679,53 @@ bxe_grc_dump(struct bxe_softc *sc) uint8_t *buf; uint32_t size; struct dump_header *d_hdr; +uint32_t i; +uint32_t reg_val; +uint32_t reg_addr; +uint32_t cmd_offset; +int context_size; +int allocated; +struct ecore_ilt *ilt = SC_ILT(sc); +struct bxe_fastpath *fp; +struct ilt_client_info *ilt_cli; +int grc_dump_size; -if (sc->grcdump_done) + +if (sc->grcdump_done || sc->grcdump_started) return (rval); +sc->grcdump_started = 1; +BLOGI(sc, "Started collecting grcdump\n"); + +grc_dump_size = (bxe_get_total_regs_len32(sc) * sizeof(uint32_t)) + +sizeof(struct dump_header); + +sc->grc_dump = malloc(grc_dump_size, M_DEVBUF, M_NOWAIT); + +if (sc->grc_dump == NULL) { +BLOGW(sc, "Unable to allocate memory for grcdump collection\n"); +return(ENOMEM); +} + + + +/* Disable parity attentions as long as following dump may + * cause false alarms by reading never written registers. We + * will re-enable parity attentions right after the dump. + */ + +/* Disable parity on path 0 */ +bxe_pretend_func(sc, 0); + ecore_disable_blocks_parity(sc); +/* Disable parity on path 1 */ +bxe_pretend_func(sc, 1); +ecore_disable_blocks_parity(sc); + +/* Return to current function */ +bxe_pretend_func(sc, SC_ABS_FUNC(sc)); + buf = sc->grc_dump; d_hdr = sc->grc_dump; @@ -18735,7 +18757,7 @@ bxe_grc_dump(struct bxe_softc *sc) (preset_idx == 11))
svn commit: r299301 - stable/9/sys/dev/bxe
Author: davidcs Date: Tue May 10 02:47:40 2016 New Revision: 299301 URL: https://svnweb.freebsd.org/changeset/base/299301 Log: MFC r298496 Remove Unused/Dead Code Modified: stable/9/sys/dev/bxe/bxe.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Tue May 10 02:44:23 2016(r299300) +++ stable/9/sys/dev/bxe/bxe.c Tue May 10 02:47:40 2016(r299301) @@ -4440,115 +4440,6 @@ bxe_ifmedia_status(struct ifnet *ifp, st } } -static int -bxe_ioctl_nvram(struct bxe_softc *sc, -uint32_t priv_op, -struct ifreq *ifr) -{ -struct bxe_nvram_data nvdata_base; -struct bxe_nvram_data *nvdata; -int len; -int error = 0; - -copyin(ifr->ifr_data, _base, sizeof(nvdata_base)); - -len = (sizeof(struct bxe_nvram_data) + - nvdata_base.len - - sizeof(uint32_t)); - -if (len > sizeof(struct bxe_nvram_data)) { -if ((nvdata = (struct bxe_nvram_data *) - malloc(len, M_DEVBUF, -(M_NOWAIT | M_ZERO))) == NULL) { -BLOGE(sc, "BXE_IOC_RD_NVRAM malloc failed priv_op 0x%x " -" len = 0x%x\n", priv_op, len); -return (1); -} -memcpy(nvdata, _base, sizeof(struct bxe_nvram_data)); -} else { -nvdata = _base; -} - -if (priv_op == BXE_IOC_RD_NVRAM) { -BLOGD(sc, DBG_IOCTL, "IOC_RD_NVRAM 0x%x %d\n", - nvdata->offset, nvdata->len); -error = bxe_nvram_read(sc, - nvdata->offset, - (uint8_t *)nvdata->value, - nvdata->len); -copyout(nvdata, ifr->ifr_data, len); -} else { /* BXE_IOC_WR_NVRAM */ -BLOGD(sc, DBG_IOCTL, "IOC_WR_NVRAM 0x%x %d\n", - nvdata->offset, nvdata->len); -copyin(ifr->ifr_data, nvdata, len); -error = bxe_nvram_write(sc, -nvdata->offset, -(uint8_t *)nvdata->value, -nvdata->len); -} - -if (len > sizeof(struct bxe_nvram_data)) { -free(nvdata, M_DEVBUF); -} - -return (error); -} - -static int -bxe_ioctl_stats_show(struct bxe_softc *sc, - uint32_t priv_op, - struct ifreq *ifr) -{ -const size_t str_size = (BXE_NUM_ETH_STATS * STAT_NAME_LEN); -const size_t stats_size = (BXE_NUM_ETH_STATS * sizeof(uint64_t)); -caddr_t p_tmp; -uint32_t *offset; -int i; - -switch (priv_op) -{ -case BXE_IOC_STATS_SHOW_NUM: -memset(ifr->ifr_data, 0, sizeof(union bxe_stats_show_data)); -((union bxe_stats_show_data *)ifr->ifr_data)->desc.num = -BXE_NUM_ETH_STATS; -((union bxe_stats_show_data *)ifr->ifr_data)->desc.len = -STAT_NAME_LEN; -return (0); - -case BXE_IOC_STATS_SHOW_STR: -memset(ifr->ifr_data, 0, str_size); -p_tmp = ifr->ifr_data; -for (i = 0; i < BXE_NUM_ETH_STATS; i++) { -strcpy(p_tmp, bxe_eth_stats_arr[i].string); -p_tmp += STAT_NAME_LEN; -} -return (0); - -case BXE_IOC_STATS_SHOW_CNT: -memset(ifr->ifr_data, 0, stats_size); -p_tmp = ifr->ifr_data; -for (i = 0; i < BXE_NUM_ETH_STATS; i++) { -offset = ((uint32_t *)>eth_stats + - bxe_eth_stats_arr[i].offset); -switch (bxe_eth_stats_arr[i].size) { -case 4: -*((uint64_t *)p_tmp) = (uint64_t)*offset; -break; -case 8: -*((uint64_t *)p_tmp) = HILO_U64(*offset, *(offset + 1)); -break; -default: -*((uint64_t *)p_tmp) = 0; -} -p_tmp += sizeof(uint64_t); -} -return (0); - -default: -return (-1); -} -} - static void bxe_handle_chip_tq(void *context, int pending) @@ -4588,8 +4479,6 @@ bxe_ioctl(struct ifnet *ifp, { struct bxe_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; -struct bxe_nvram_data *nvdata; -uint32_t priv_op; int mask = 0; int reinit = 0; int error = 0; @@ -4774,36 +4663,6 @@ bxe_ioctl(struct ifnet *ifp, error = ifmedia_ioctl(ifp, ifr, >ifmedia, command); break; -case SIOCGPRIVATE_0: -copyin(ifr->ifr_data, _op, sizeof(priv_op)); - -switch (priv_op) -{ -case BXE_IOC_RD_NVRAM: -case BXE_IOC_WR_NVRAM: -nvdata = (struct bxe_nvram_data *)ifr->ifr_data; -BLOGD(sc, DBG_IOCTL, - "Received Private NVRAM ioctl addr=0x%x size=%u\n", -
svn commit: r299302 - in stable/9/sys: dev/bxe modules/bxe
Author: davidcs Date: Tue May 10 02:50:54 2016 New Revision: 299302 URL: https://svnweb.freebsd.org/changeset/base/299302 Log: MFC r298591 1. Removed -Wno-shift-negative-value from Makefile 2. Fixed warning its absence caused in bxe_elink.c Modified: stable/9/sys/dev/bxe/bxe_elink.c stable/9/sys/modules/bxe/Makefile Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/bxe/bxe_elink.c == --- stable/9/sys/dev/bxe/bxe_elink.cTue May 10 02:47:40 2016 (r299301) +++ stable/9/sys/dev/bxe/bxe_elink.cTue May 10 02:50:54 2016 (r299302) @@ -11969,8 +11969,8 @@ static elink_status_t elink_54618se_conf elink_eee_disable(phy, params, vars); } } else { - vars->eee_status &= ~SHMEM_EEE_1G_ADV << - SHMEM_EEE_SUPPORTED_SHIFT; + vars->eee_status &= ((uint32_t)(~SHMEM_EEE_1G_ADV) << + SHMEM_EEE_SUPPORTED_SHIFT); if (phy->flags & ELINK_FLAGS_EEE) { /* Handle legacy auto-grEEEn */ Modified: stable/9/sys/modules/bxe/Makefile == --- stable/9/sys/modules/bxe/Makefile Tue May 10 02:47:40 2016 (r299301) +++ stable/9/sys/modules/bxe/Makefile Tue May 10 02:50:54 2016 (r299302) @@ -14,6 +14,5 @@ SRCS += bxe.c \ 57712_init_values.c CFLAGS += -I${BXE} -#CFLAGS += -Wno-shift-negative-value .include ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r298283 - stable/9/sys/dev/bxe
Author: davidcs Date: Tue Apr 19 18:57:31 2016 New Revision: 298283 URL: https://svnweb.freebsd.org/changeset/base/298283 Log: MFC r297873 1. Process tx completions in bxe_periodic_callout_func() and restart transmissions if possible. 2. For SIOCSIFFLAGS call bxe_init_locked() only if !BXE_STATE_DISABLED 3. remove code not needed in bxe_init_internal_common() Submitted by:vaishali.kulka...@qlogic.com;venkata.bhavar...@qlogic.com Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe_stats.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Tue Apr 19 18:47:34 2016(r298282) +++ stable/9/sys/dev/bxe/bxe.c Tue Apr 19 18:57:31 2016(r298283) @@ -498,7 +498,9 @@ static const struct { { STATS_OFFSET32(mbuf_alloc_sge), 4, STATS_FLAGS_FUNC, "mbuf_alloc_sge"}, { STATS_OFFSET32(mbuf_alloc_tpa), -4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"} +4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"}, +{ STATS_OFFSET32(tx_queue_full_return), +4, STATS_FLAGS_FUNC, "tx_queue_full_return"} }; static const struct { @@ -609,7 +611,9 @@ static const struct { { Q_STATS_OFFSET32(mbuf_alloc_sge), 4, "mbuf_alloc_sge"}, { Q_STATS_OFFSET32(mbuf_alloc_tpa), -4, "mbuf_alloc_tpa"} +4, "mbuf_alloc_tpa"}, +{ Q_STATS_OFFSET32(tx_queue_full_return), +4, "tx_queue_full_return"} }; #define BXE_NUM_ETH_STATS ARRAY_SIZE(bxe_eth_stats_arr) @@ -4626,7 +4630,7 @@ bxe_ioctl(struct ifnet *ifp, if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* set the receive mode flags */ bxe_set_rx_mode(sc); -} else { +} else if(sc->state != BXE_STATE_DISABLED) { bxe_init_locked(sc); } } else { @@ -5737,11 +5741,6 @@ bxe_tx_start(struct ifnet *ifp) return; } -if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { -BLOGW(sc, "Interface TX queue is full, ignoring transmit request\n"); -return; -} - if (!sc->link_vars.link_up) { BLOGW(sc, "Interface link is down, ignoring transmit request\n"); return; @@ -5749,6 +5748,11 @@ bxe_tx_start(struct ifnet *ifp) fp = >fp[0]; +if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { +fp->eth_q_stats.tx_queue_full_return++; +return; +} + BXE_FP_TX_LOCK(fp); bxe_tx_start_locked(sc, ifp, fp); BXE_FP_TX_UNLOCK(fp); @@ -9950,21 +9954,6 @@ bxe_init_internal_common(struct bxe_soft { int i; -if (IS_MF_SI(sc)) { -/* - * In switch independent mode, the TSTORM needs to accept - * packets that failed classification, since approximate match - * mac addresses aren't written to NIG LLH. - */ -REG_WR8(sc, -(BAR_TSTRORM_INTMEM + TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET), -2); -} else if (!CHIP_IS_E1(sc)) { /* 57710 doesn't support MF */ -REG_WR8(sc, -(BAR_TSTRORM_INTMEM + TSTORM_ACCEPT_CLASSIFY_FAILED_OFFSET), -0); -} - /* * Zero this manually as its initialization is currently missing * in the initTool. @@ -12307,6 +12296,8 @@ static void bxe_periodic_callout_func(void *xsc) { struct bxe_softc *sc = (struct bxe_softc *)xsc; +struct bxe_fastpath *fp; +uint16_t tx_bd_avail; int i; if (!BXE_CORE_TRYLOCK(sc)) { @@ -12329,6 +12320,48 @@ bxe_periodic_callout_func(void *xsc) return; } +#if __FreeBSD_version >= 80 + +FOR_EACH_QUEUE(sc, i) { +fp = >fp[i]; + +if (BXE_FP_TX_TRYLOCK(fp)) { +struct ifnet *ifp = sc->ifnet; +/* + * If interface was stopped due to unavailable + * bds, try to process some tx completions + */ +(void) bxe_txeof(sc, fp); + +tx_bd_avail = bxe_tx_avail(sc, fp); +if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { +bxe_tx_mq_start_locked(sc, ifp, fp, NULL); +} +BXE_FP_TX_UNLOCK(fp); +} +} + +#else + +fp = >fp[0]; +if (BXE_FP_TX_TRYLOCK(fp)) { +struct ifnet *ifp = sc->ifnet; +/* + * If interface was stopped due to unavailable + * bds, try to process some tx completions + */ +(void) bxe_txeof(sc, fp); + +tx_bd_avail = bxe_tx_avail(sc, fp); +if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) { +bxe_tx_start_locked(sc, ifp, fp); +} + +BXE_FP_TX_UNLOCK(fp); +} + +#endif /* #if __FreeBSD_version >= 80 */ + /* Check for TX timeouts on any fastpath. */
svn commit: r298284 - stable/9/sys/dev/bxe
Author: davidcs Date: Tue Apr 19 19:03:06 2016 New Revision: 298284 URL: https://svnweb.freebsd.org/changeset/base/298284 Log: MFC r297884 Add support for Flash Update Submitted by:nrapendra.si...@qlogic.com;vaishali.kulka...@qlogic.com;davi...@freebsd.org Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe.h stable/9/sys/dev/bxe/bxe_ioctl.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Tue Apr 19 18:57:31 2016(r298283) +++ stable/9/sys/dev/bxe/bxe.c Tue Apr 19 19:03:06 2016(r298284) @@ -13693,49 +13693,60 @@ bxe_get_tunable_params(struct bxe_softc sc->udp_rss); } -static void +static int bxe_media_detect(struct bxe_softc *sc) { +int port_type; uint32_t phy_idx = bxe_get_cur_phy_idx(sc); + switch (sc->link_params.phy[phy_idx].media_type) { case ELINK_ETH_PHY_SFPP_10G_FIBER: case ELINK_ETH_PHY_XFP_FIBER: BLOGI(sc, "Found 10Gb Fiber media.\n"); sc->media = IFM_10G_SR; +port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_SFP_1G_FIBER: BLOGI(sc, "Found 1Gb Fiber media.\n"); sc->media = IFM_1000_SX; +port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_KR: case ELINK_ETH_PHY_CX4: BLOGI(sc, "Found 10GBase-CX4 media.\n"); sc->media = IFM_10G_CX4; +port_type = PORT_FIBRE; break; case ELINK_ETH_PHY_DA_TWINAX: BLOGI(sc, "Found 10Gb Twinax media.\n"); sc->media = IFM_10G_TWINAX; +port_type = PORT_DA; break; case ELINK_ETH_PHY_BASE_T: if (sc->link_params.speed_cap_mask[0] & PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) { BLOGI(sc, "Found 10GBase-T media.\n"); sc->media = IFM_10G_T; +port_type = PORT_TP; } else { BLOGI(sc, "Found 1000Base-T media.\n"); sc->media = IFM_1000_T; +port_type = PORT_TP; } break; case ELINK_ETH_PHY_NOT_PRESENT: BLOGI(sc, "Media not present.\n"); sc->media = 0; +port_type = PORT_OTHER; break; case ELINK_ETH_PHY_UNSPECIFIED: default: BLOGI(sc, "Unknown media!\n"); sc->media = 0; +port_type = PORT_OTHER; break; } +return port_type; } #define GET_FIELD(value, fname) \ @@ -18754,6 +18765,14 @@ bxe_add_cdev(struct bxe_softc *sc) if (sc->grc_dump == NULL) return (-1); +sc->eeprom = malloc(BXE_EEPROM_MAX_DATA_LEN, M_DEVBUF, M_NOWAIT); + +if (sc->eeprom == NULL) { +BLOGW(sc, "Unable to alloc for eeprom size buffer\n"); +free(sc->grc_dump, M_DEVBUF); sc->grc_dump = NULL; +return (-1); +} + sc->ioctl_dev = make_dev(_cdevsw, sc->ifnet->if_dunit, UID_ROOT, @@ -18765,6 +18784,8 @@ bxe_add_cdev(struct bxe_softc *sc) if (sc->ioctl_dev == NULL) { free(sc->grc_dump, M_DEVBUF); +free(sc->eeprom, M_DEVBUF); +sc->eeprom = NULL; return (-1); } @@ -18780,12 +18801,152 @@ bxe_del_cdev(struct bxe_softc *sc) if (sc->ioctl_dev != NULL) destroy_dev(sc->ioctl_dev); -if (sc->grc_dump == NULL) +if (sc->grc_dump != NULL) free(sc->grc_dump, M_DEVBUF); +if (sc->eeprom != NULL) { +free(sc->eeprom, M_DEVBUF); +sc->eeprom = NULL; +} + return; } +static bool bxe_is_nvram_accessible(struct bxe_softc *sc) +{ + +if ((sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) == 0) +return FALSE; + +return TRUE; +} + + +static int +bxe_wr_eeprom(struct bxe_softc *sc, void *data, uint32_t offset, uint32_t len) +{ +int rval = 0; + +if(!bxe_is_nvram_accessible(sc)) { +BLOGW(sc, "Cannot access eeprom when interface is down\n"); +return (-EAGAIN); +} +rval = bxe_nvram_write(sc, offset, (uint8_t *)data, len); + + + return (rval); +} + +static int +bxe_rd_eeprom(struct bxe_softc *sc, void *data, uint32_t offset, uint32_t len) +{ +int rval = 0; + +if(!bxe_is_nvram_accessible(sc)) { +BLOGW(sc, "Cannot access eeprom when interface is down\n"); +return (-EAGAIN); +} +rval = bxe_nvram_read(sc, offset, (uint8_t *)data, len); + + return (rval); +} + +static int +bxe_eeprom_rd_wr(struct bxe_softc *sc, bxe_eeprom_t *eeprom) +{ +int rval = 0; + +switch (eeprom->eeprom_cmd) { + +case BXE_EEPROM_CMD_SET_EEPROM: + +rval = copyin(eeprom->eeprom_data, sc->eeprom, + eeprom->eeprom_data_len); + +if (rval) +break; + +rval = bxe_wr_eeprom(sc, sc->eeprom, eeprom->eeprom_offset, +
svn commit: r313073 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Thu Feb 2 00:37:21 2017 New Revision: 313073 URL: https://svnweb.freebsd.org/changeset/base/313073 Log: MFC r312728 Added support for if_transmit and if_qflush Removed if_start updated version to 3.10.33 Modified: stable/9/sys/dev/qlxgbe/ql_def.h stable/9/sys/dev/qlxgbe/ql_glbl.h stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_hw.h stable/9/sys/dev/qlxgbe/ql_isr.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_os.h stable/9/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_def.h == --- stable/9/sys/dev/qlxgbe/ql_def.hThu Feb 2 00:20:53 2017 (r313072) +++ stable/9/sys/dev/qlxgbe/ql_def.hThu Feb 2 00:37:21 2017 (r313073) @@ -112,6 +112,16 @@ typedef struct _qla_tx_ring { uint64_tcount; } qla_tx_ring_t; +typedef struct _qla_tx_fp { + struct mtx tx_mtx; + chartx_mtx_name[32]; + struct buf_ring *tx_br; + struct task fp_task; + struct taskqueue*fp_taskqueue; + void*ha; + uint32_ttxr_idx; +} qla_tx_fp_t; + /* * Adapter structure contains the hardware independant information of the * pci function. @@ -178,10 +188,9 @@ struct qla_host { qla_tx_ring_t tx_ring[NUM_TX_RINGS]; bus_dma_tag_t tx_tag; - struct task tx_task; - struct taskqueue*tx_tq; struct callout tx_callout; - struct mtx tx_lock; + + qla_tx_fp_t tx_fp[MAX_SDS_RINGS]; qla_rx_ring_t rx_ring[MAX_RDS_RINGS]; bus_dma_tag_t rx_tag; Modified: stable/9/sys/dev/qlxgbe/ql_glbl.h == --- stable/9/sys/dev/qlxgbe/ql_glbl.h Thu Feb 2 00:20:53 2017 (r313072) +++ stable/9/sys/dev/qlxgbe/ql_glbl.h Thu Feb 2 00:37:21 2017 (r313073) @@ -39,6 +39,7 @@ */ extern void ql_mbx_isr(void *arg); extern void ql_isr(void *arg); +extern uint32_t ql_rcv_isr(qla_host_t *ha, uint32_t sds_idx, uint32_t count); /* * from ql_os.c @@ -66,7 +67,7 @@ extern void qla_reset_promisc(qla_host_t extern int ql_set_allmulti(qla_host_t *ha); extern void qla_reset_allmulti(qla_host_t *ha); extern void ql_update_link_state(qla_host_t *ha); -extern void ql_hw_tx_done(qla_host_t *ha); +extern void ql_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx); extern int ql_set_max_mtu(qla_host_t *ha, uint32_t mtu, uint16_t cntxt_id); extern void ql_hw_stop_rcv(qla_host_t *ha); extern void ql_get_stats(qla_host_t *ha); @@ -76,7 +77,7 @@ extern void qla_hw_async_event(qla_host_ extern int qla_get_nic_partition(qla_host_t *ha, uint32_t *supports_9kb, uint32_t *num_rcvq); -extern int qla_iscsi_pdu(qla_host_t *ha, struct mbuf *mp); +extern int ql_iscsi_pdu(qla_host_t *ha, struct mbuf *mp); extern void ql_minidump(qla_host_t *ha); extern int ql_minidump_init(qla_host_t *ha); Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Thu Feb 2 00:20:53 2017 (r313072) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Thu Feb 2 00:37:21 2017 (r313073) @@ -51,7 +51,6 @@ static void qla_del_rcv_cntxt(qla_host_t static int qla_init_rcv_cntxt(qla_host_t *ha); static void qla_del_xmt_cntxt(qla_host_t *ha); static int qla_init_xmt_cntxt(qla_host_t *ha); -static void qla_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx); static int qla_mbx_cmd(qla_host_t *ha, uint32_t *h_mbox, uint32_t n_hmbox, uint32_t *fw_mbox, uint32_t n_fwmbox, uint32_t no_pause); static int qla_config_intr_cntxt(qla_host_t *ha, uint32_t start_idx, @@ -2047,7 +2046,7 @@ ql_hw_send(qla_host_t *ha, bus_dma_segme ha->hw.iscsi_pkt_count++; if (hw->tx_cntxt[txr_idx].txr_free <= (num_tx_cmds + QLA_TX_MIN_FREE)) { - qla_hw_tx_done_locked(ha, txr_idx); + ql_hw_tx_done_locked(ha, txr_idx); if (hw->tx_cntxt[txr_idx].txr_free <= (num_tx_cmds + QLA_TX_MIN_FREE)) { QL_DPRINT8(ha, (dev, "%s: (hw->txr_free <= " @@ -2552,15 +2551,8 @@ qla_init_rcv_cntxt(qla_host_t *ha) qla_host_to_le64(hw->dma_buf.sds_ring[i].dma_addr); rcntxt->sds[i].size = qla_host_to_le32(NUM_STATUS_DESCRIPTORS); - if (ha->msix_count == 2) { - rcntxt->sds[i].intr_id = - qla_host_to_le16(hw->intr_id[0]); -
svn commit: r305499 - in stable/9/sys: dev/qlxgbe modules/qlxgbe
Author: davidcs Date: Tue Sep 6 20:53:23 2016 New Revision: 305499 URL: https://svnweb.freebsd.org/changeset/base/305499 Log: MFC r394247 Upgrade fw, bootloader and minidump template to version 5.4.58 Add minidump retrieval code MFC r394248 Add ql_minidump.h Added CFLAGS +=-fms-extensions in qlxgbe/Makefile Added: stable/9/sys/dev/qlxgbe/ql_minidump.h - copied unchanged from r304248, head/sys/dev/qlxgbe/ql_minidump.h Modified: stable/9/sys/dev/qlxgbe/ql_boot.c stable/9/sys/dev/qlxgbe/ql_def.h stable/9/sys/dev/qlxgbe/ql_fw.c stable/9/sys/dev/qlxgbe/ql_glbl.h 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_ioctl.h stable/9/sys/dev/qlxgbe/ql_isr.c stable/9/sys/dev/qlxgbe/ql_minidump.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_reset.c stable/9/sys/dev/qlxgbe/ql_ver.h stable/9/sys/modules/qlxgbe/Makefile Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_boot.c == --- stable/9/sys/dev/qlxgbe/ql_boot.c Tue Sep 6 20:43:26 2016 (r305498) +++ stable/9/sys/dev/qlxgbe/ql_boot.c Tue Sep 6 20:53:23 2016 (r305499) @@ -34,14 +34,14 @@ __FBSDID("$FreeBSD$"); #include "ql_os.h" unsigned int ql83xx_bootloader_version_major = 5; -unsigned int ql83xx_bootloader_version_minor = 2; -unsigned int ql83xx_bootloader_version_sub = 7; +unsigned int ql83xx_bootloader_version_minor = 4; +unsigned int ql83xx_bootloader_version_sub = 58; unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x04, 0x00, 0x80, 0x82, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0xc0, 0x81, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1e, 0x02, 0x21, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, @@ -1384,7 +1384,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x81, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x14, 0xe0, 0x11, 0x20, 0xa2, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbb, 0x11, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x80, 0x40, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0b, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, @@ -1421,14 +1421,14 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x11, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x02, 0x16, 0x04, 0x00, 0x00, 0x00, 0x60, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x49, 0x07, + 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x49, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa2, 0x07, 0x00, 0x00, 0x26, 0x00, 0xe0, 0x04, 0x00, 0xa0, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x80, 0x01, 0xa0, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x40, 0x00, 0x00, 0x0c, 0x1c, 0x00, 0x00, 0x00, 0x40, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x00, 0x5e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfe, 0x1f, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, @@ -1535,7 +1535,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x20, 0x50, 0x00, 0x02, 0x00, 0x00, 0x00, 0x60, 0x52, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb8, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, + 0xb5, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0xa0, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0,
svn commit: r305500 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 6 20:55:59 2016 New Revision: 305500 URL: https://svnweb.freebsd.org/changeset/base/305500 Log: MFC 304249 Add support for set/get cam search mode Modified: stable/9/sys/dev/qlxgbe/ql_dbg.h stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_hw.h stable/9/sys/dev/qlxgbe/ql_isr.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_dbg.h == --- stable/9/sys/dev/qlxgbe/ql_dbg.hTue Sep 6 20:53:23 2016 (r305499) +++ stable/9/sys/dev/qlxgbe/ql_dbg.hTue Sep 6 20:55:59 2016 (r305500) @@ -52,6 +52,7 @@ extern void ql_dump_buf32(qla_host_t *ha #define INJCT_MBX_CMD_FAILURE 0x8 #define INJCT_HEARTBEAT_FAILURE0x9 #define INJCT_TEMPERATURE_FAILURE 0xA +#define INJCT_M_GETCL_M_GETJCL_FAILURE 0xB #ifdef QL_DBG Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Tue Sep 6 20:53:23 2016 (r305499) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Tue Sep 6 20:55:59 2016 (r305500) @@ -74,6 +74,8 @@ static int qla_query_fw_dcbx_caps(qla_ho static int qla_set_port_config(qla_host_t *ha, uint32_t cfg_bits); static int qla_get_port_config(qla_host_t *ha, uint32_t *cfg_bits); static void qla_get_quick_stats(qla_host_t *ha); +static int qla_set_cam_search_mode(qla_host_t *ha, uint32_t search_mode); +static int qla_get_cam_search_mode(qla_host_t *ha); static void ql_minidump_free(qla_host_t *ha); @@ -94,11 +96,22 @@ qla_sysctl_get_drvr_stats(SYSCTL_HANDLER ha = (qla_host_t *)arg1; - for (i = 0; i < ha->hw.num_sds_rings; i++) + for (i = 0; i < ha->hw.num_sds_rings; i++) { + device_printf(ha->pci_dev, "%s: sds_ring[%d] = %p\n", __func__,i, (void *)ha->hw.sds[i].intr_count); + device_printf(ha->pci_dev, + "%s: sds_ring[%d].spurious_intr_count = %p\n", + __func__, + i, (void *)ha->hw.sds[i].spurious_intr_count); + + device_printf(ha->pci_dev, + "%s: sds_ring[%d].rx_free = %d\n", __func__,i, + ha->hw.sds[i].rx_free); + } + for (i = 0; i < ha->hw.num_tx_rings; i++) device_printf(ha->pci_dev, "%s: tx[%d] = %p\n", __func__,i, @@ -255,6 +268,47 @@ qla_sysctl_set_port_cfg_exit: return err; } +static int +qla_sysctl_set_cam_search_mode(SYSCTL_HANDLER_ARGS) +{ + int err, ret = 0; + qla_host_t *ha; + + err = sysctl_handle_int(oidp, , 0, req); + + if (err || !req->newptr) + return (err); + + ha = (qla_host_t *)arg1; + + if ((ret == Q8_HW_CONFIG_CAM_SEARCH_MODE_INTERNAL) || + (ret == Q8_HW_CONFIG_CAM_SEARCH_MODE_AUTO)) { + err = qla_set_cam_search_mode(ha, (uint32_t)ret); + } else { + device_printf(ha->pci_dev, "%s: ret = %d\n", __func__, ret); + } + + return (err); +} + +static int +qla_sysctl_get_cam_search_mode(SYSCTL_HANDLER_ARGS) +{ + int err, ret = 0; + qla_host_t *ha; + + err = sysctl_handle_int(oidp, , 0, req); + + if (err || !req->newptr) + return (err); + + ha = (qla_host_t *)arg1; + err = qla_get_cam_search_mode(ha); + + return (err); +} + + /* * Name: ql_hw_add_sysctls * Function: Add P3Plus specific sysctls @@ -362,6 +416,24 @@ ql_hw_add_sysctls(qla_host_t *ha) " 1 = xmt only; 2 = rcv only;\n" ); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "set_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW, + (void *)ha, 0, + qla_sysctl_set_cam_search_mode, "I", + "Set CAM Search Mode" + "\t 1 = search mode internal\n" + "\t 2 = search mode auto\n"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "get_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW, + (void *)ha, 0, + qla_sysctl_get_cam_search_mode, "I", + "Get CAM Search Mode" + "\t 1 = search mode internal\n" + "\t 2 = search mode auto\n"); + ha->hw.enable_9kb = 1;
svn commit: r306780 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Thu Oct 6 19:06:10 2016 New Revision: 306780 URL: https://svnweb.freebsd.org/changeset/base/306780 Log: MFC r306522 Upgrade Firmware/Bootloader/ResetSeq/Minidump to revision 5.4.62 Modified: stable/9/sys/dev/qlxgbe/ql_boot.c stable/9/sys/dev/qlxgbe/ql_fw.c stable/9/sys/dev/qlxgbe/ql_minidump.c stable/9/sys/dev/qlxgbe/ql_reset.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_boot.c == --- stable/9/sys/dev/qlxgbe/ql_boot.c Thu Oct 6 18:56:06 2016 (r306779) +++ stable/9/sys/dev/qlxgbe/ql_boot.c Thu Oct 6 19:06:10 2016 (r306780) @@ -35,13 +35,13 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_bootloader_version_major = 5; unsigned int ql83xx_bootloader_version_minor = 4; -unsigned int ql83xx_bootloader_version_sub = 58; +unsigned int ql83xx_bootloader_version_sub = 62; unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x04, 0x00, 0xc0, 0x81, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0xc0, 0x83, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1e, 0x02, 0x21, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, @@ -71,7 +71,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x83, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, + 0x8b, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -703,11 +703,11 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x80, 0x02, 0xe0, 0x0e, 0x07, 0x84, 0x0b, 0x08, 0x60, 0x00, 0xa0, 0xc3, 0x01, 0x81, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x4f, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x0c, 0x00, 0x0d, 0x01, + 0x57, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x0c, 0x00, 0x0d, 0x01, 0x40, 0x04, 0x1a, 0x03, 0x00, 0x10, 0x78, 0x02, 0x00, 0x82, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x4c, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, + 0x54, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0xc0, 0x41, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1384,7 +1384,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x81, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x14, 0xe0, 0x11, 0x20, 0xa2, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbb, 0x11, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x64, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x80, 0x40, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0b, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, @@ -1421,14 +1421,14 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x11, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x02, 0x16, 0x04, 0x00, 0x00, 0x00, 0x60, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x49, 0x07, + 0x64, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x49, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa2, 0x07, 0x00, 0x00, 0x26, 0x00, 0xe0, 0x04, 0x00, 0xa0, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x80, 0x01, 0xa0,
svn commit: r307974 - stable/9/sys/dev/bxe
Author: davidcs Date: Wed Oct 26 18:20:06 2016 New Revision: 307974 URL: https://svnweb.freebsd.org/changeset/base/307974 Log: MFC r307578 1. Use taskqueue_create() instead of taskqueue_create_fast() for both fastpath and slowpath taskqueues. 2. Service all transmits in taskqueue threads. 3. additional stats counters for keeping track of - bd availability - tx buf ring not emptied in the fp task queue. These are drained via timeout taskqueue. - tx attempts during link down. Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe.h stable/9/sys/dev/bxe/bxe_stats.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Wed Oct 26 18:13:30 2016(r307973) +++ stable/9/sys/dev/bxe/bxe.c Wed Oct 26 18:20:06 2016(r307974) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.81" +#define BXE_DRIVER_VERSION "1.78.89" #include "bxe.h" #include "ecore_sp.h" @@ -500,7 +500,14 @@ static const struct { { STATS_OFFSET32(mbuf_alloc_tpa), 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"}, { STATS_OFFSET32(tx_queue_full_return), -4, STATS_FLAGS_FUNC, "tx_queue_full_return"} +4, STATS_FLAGS_FUNC, "tx_queue_full_return"}, +{ STATS_OFFSET32(tx_request_link_down_failures), +4, STATS_FLAGS_FUNC, "tx_request_link_down_failures"}, +{ STATS_OFFSET32(bd_avail_too_less_failures), +4, STATS_FLAGS_FUNC, "bd_avail_too_less_failures"}, +{ STATS_OFFSET32(tx_mq_not_empty), +4, STATS_FLAGS_FUNC, "tx_mq_not_empty"} + }; static const struct { @@ -613,7 +620,14 @@ static const struct { { Q_STATS_OFFSET32(mbuf_alloc_tpa), 4, "mbuf_alloc_tpa"}, { Q_STATS_OFFSET32(tx_queue_full_return), -4, "tx_queue_full_return"} +4, "tx_queue_full_return"}, +{ Q_STATS_OFFSET32(tx_request_link_down_failures), +4, "tx_request_link_down_failures"}, +{ Q_STATS_OFFSET32(bd_avail_too_less_failures), +4, "bd_avail_too_less_failures"}, +{ Q_STATS_OFFSET32(tx_mq_not_empty), +4, "tx_mq_not_empty"} + }; #define BXE_NUM_ETH_STATS ARRAY_SIZE(bxe_eth_stats_arr) @@ -5620,7 +5634,7 @@ bxe_tx_start(struct ifnet *ifp) BXE_FP_TX_UNLOCK(fp); } -#if __FreeBSD_version >= 80 +#if __FreeBSD_version >= 901504 static int bxe_tx_mq_start_locked(struct bxe_softc*sc, @@ -5642,10 +5656,16 @@ bxe_tx_mq_start_locked(struct bxe_softc return (EINVAL); } -if (!sc->link_vars.link_up || -(ifp->if_drv_flags & -(IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { +if (m != NULL) { rc = drbr_enqueue(ifp, tx_br, m); +if (rc != 0) { +fp->eth_q_stats.tx_soft_errors++; +goto bxe_tx_mq_start_locked_exit; +} +} + +if (!sc->link_vars.link_up || !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { +fp->eth_q_stats.tx_request_link_down_failures++; goto bxe_tx_mq_start_locked_exit; } @@ -5655,24 +5675,22 @@ bxe_tx_mq_start_locked(struct bxe_softc fp->eth_q_stats.tx_max_drbr_queue_depth = depth; } -if (m == NULL) { -/* no new work, check for pending frames */ -next = drbr_dequeue(ifp, tx_br); -} else if (drbr_needs_enqueue(ifp, tx_br)) { -/* have both new and pending work, maintain packet order */ -rc = drbr_enqueue(ifp, tx_br, m); -if (rc != 0) { -fp->eth_q_stats.tx_soft_errors++; -goto bxe_tx_mq_start_locked_exit; -} -next = drbr_dequeue(ifp, tx_br); -} else { -/* new work only and nothing pending */ -next = m; -} - /* keep adding entries while there are frames to send */ -while (next != NULL) { +while ((next = drbr_peek(ifp, tx_br)) != NULL) { +/* handle any completions if we're running low */ +tx_bd_avail = bxe_tx_avail(sc, fp); +if (tx_bd_avail < BXE_TX_CLEANUP_THRESHOLD) { +/* bxe_txeof will set IFF_DRV_OACTIVE appropriately */ +bxe_txeof(sc, fp); +tx_bd_avail = bxe_tx_avail(sc, fp); +if (tx_bd_avail < (BXE_TSO_MAX_SEGMENTS + 1)) { +fp->eth_q_stats.bd_avail_too_less_failures++; +m_freem(next); +drbr_advance(ifp, tx_br); +rc = ENOBUFS; +break; +} +} /* the mbuf now belongs to us */ fp->eth_q_stats.mbuf_alloc_tx++; @@ -5688,11 +5706,11 @@ bxe_tx_mq_start_locked(struct bxe_softc if (next != NULL) { /* mark the TX queue as full and save the frame */
svn commit: r307526 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Mon Oct 17 18:14:31 2016 New Revision: 307526 URL: https://svnweb.freebsd.org/changeset/base/307526 Log: MFC r306790 Add support for adding up to 64 Multicast addresses with a single mailbox command Modified: stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_hw.h stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Mon Oct 17 18:07:51 2016 (r307525) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Mon Oct 17 18:14:31 2016 (r307526) @@ -1128,12 +1128,21 @@ qla_config_intr_coalesce(qla_host_t *ha, * Can be unicast, multicast or broadcast. */ static int -qla_config_mac_addr(qla_host_t *ha, uint8_t *mac_addr, uint32_t add_mac) +qla_config_mac_addr(qla_host_t *ha, uint8_t *mac_addr, uint32_t add_mac, + uint32_t num_mac) { q80_config_mac_addr_t *cmac; q80_config_mac_addr_rsp_t *cmac_rsp; uint32_terr; device_tdev = ha->pci_dev; + int i; + uint8_t *mac_cpy = mac_addr; + + if (num_mac > Q8_MAX_MAC_ADDRS) { + device_printf(dev, "%s: %s num_mac [0x%x] > Q8_MAX_MAC_ADDRS\n", + __func__, (add_mac ? "Add" : "Del"), num_mac); + return (-1); + } cmac = (q80_config_mac_addr_t *)ha->hw.mbox; bzero(cmac, (sizeof (q80_config_mac_addr_t))); @@ -1149,9 +1158,13 @@ qla_config_mac_addr(qla_host_t *ha, uint cmac->cmd |= Q8_MBX_CMAC_CMD_CAM_INGRESS; - cmac->nmac_entries = 1; + cmac->nmac_entries = num_mac; cmac->cntxt_id = ha->hw.rcv_cntxt_id; - bcopy(mac_addr, cmac->mac_addr[0].addr, 6); + + for (i = 0; i < num_mac; i++) { + bcopy(mac_addr, cmac->mac_addr[i].addr, Q8_ETHER_ADDR_LEN); + mac_addr = mac_addr + ETHER_ADDR_LEN; + } if (qla_mbx_cmd(ha, (uint32_t *)cmac, (sizeof (q80_config_mac_addr_t) >> 2), @@ -1165,11 +1178,14 @@ qla_config_mac_addr(qla_host_t *ha, uint err = Q8_MBX_RSP_STATUS(cmac_rsp->regcnt_status); if (err) { - device_printf(dev, "%s: %s " - "%02x:%02x:%02x:%02x:%02x:%02x failed1 [0x%08x]\n", - __func__, (add_mac ? "Add" : "Del"), - mac_addr[0], mac_addr[1], mac_addr[2], - mac_addr[3], mac_addr[4], mac_addr[5], err); + device_printf(dev, "%s: %s failed1 [0x%08x]\n", __func__, + (add_mac ? "Add" : "Del"), err); + for (i = 0; i < num_mac; i++) { + device_printf(dev, "%s: %02x:%02x:%02x:%02x:%02x:%02x\n", + __func__, mac_cpy[0], mac_cpy[1], mac_cpy[2], + mac_cpy[3], mac_cpy[4], mac_cpy[5]); + mac_cpy += ETHER_ADDR_LEN; + } return (-1); } @@ -2254,6 +2270,7 @@ ql_del_hw_if(qla_host_t *ha) (void)qla_stop_nic_func(ha); qla_del_rcv_cntxt(ha); + qla_del_xmt_cntxt(ha); if (ha->hw.flags.init_intr_cnxt) { @@ -2270,6 +2287,7 @@ ql_del_hw_if(qla_host_t *ha) ha->hw.flags.init_intr_cnxt = 0; } + return; } @@ -2368,7 +2386,7 @@ ql_init_hw_if(qla_host_t *ha) } ha->hw.max_tx_segs = 0; - if (qla_config_mac_addr(ha, ha->hw.mac_addr, 1)) + if (qla_config_mac_addr(ha, ha->hw.mac_addr, 1, 1)) return(-1); ha->hw.flags.unicast_mac = 1; @@ -2376,7 +2394,7 @@ ql_init_hw_if(qla_host_t *ha) bcast_mac[0] = 0xFF; bcast_mac[1] = 0xFF; bcast_mac[2] = 0xFF; bcast_mac[3] = 0xFF; bcast_mac[4] = 0xFF; bcast_mac[5] = 0xFF; - if (qla_config_mac_addr(ha, bcast_mac, 1)) + if (qla_config_mac_addr(ha, bcast_mac, 1, 1)) return (-1); ha->hw.flags.bcast_mac = 1; @@ -2733,14 +2751,14 @@ qla_del_rcv_cntxt(qla_host_t *ha) bcast_mac[0] = 0xFF; bcast_mac[1] = 0xFF; bcast_mac[2] = 0xFF; bcast_mac[3] = 0xFF; bcast_mac[4] = 0xFF; bcast_mac[5] = 0xFF; - if (qla_config_mac_addr(ha, bcast_mac, 0)) + if (qla_config_mac_addr(ha, bcast_mac, 0, 1)) return; ha->hw.flags.bcast_mac = 0; } if (ha->hw.flags.unicast_mac) { - if (qla_config_mac_addr(ha, ha->hw.mac_addr, 0)) + if (qla_config_mac_addr(ha, ha->hw.mac_addr, 0, 1)) return; ha->hw.flags.unicast_mac = 0; } @@ -2926,12 +2944,20 @@
svn commit: r315883 - stable/9/sys/dev/bxe
Author: davidcs Date: Fri Mar 24 03:17:59 2017 New Revision: 315883 URL: https://svnweb.freebsd.org/changeset/base/315883 Log: MFC r314365 1. state checks in bxe_tx_mq_start_locked() and bxe_tx_mq_start() to sync threads during interface down or detach. 2. add sysctl to set pause frame parameters 3. increase max segs for TSO packets to BXE_TSO_MAX_SEGMENTS (32) 4. add debug messages for PHY 5. HW LRO support restricted to FreeBSD versions 8.x and above. Submitted by: vaishali.kulka...@cavium.com Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe.h stable/9/sys/dev/bxe/bxe_elink.c stable/9/sys/dev/bxe/bxe_stats.c stable/9/sys/dev/bxe/bxe_stats.h Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Fri Mar 24 03:11:11 2017(r315882) +++ stable/9/sys/dev/bxe/bxe.c Fri Mar 24 03:17:59 2017(r315883) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.89" +#define BXE_DRIVER_VERSION "1.78.90" #include "bxe.h" #include "ecore_sp.h" @@ -501,12 +501,19 @@ static const struct { 4, STATS_FLAGS_FUNC, "mbuf_alloc_tpa"}, { STATS_OFFSET32(tx_queue_full_return), 4, STATS_FLAGS_FUNC, "tx_queue_full_return"}, +{ STATS_OFFSET32(bxe_tx_mq_sc_state_failures), +4, STATS_FLAGS_FUNC, "bxe_tx_mq_sc_state_failures"}, { STATS_OFFSET32(tx_request_link_down_failures), 4, STATS_FLAGS_FUNC, "tx_request_link_down_failures"}, { STATS_OFFSET32(bd_avail_too_less_failures), 4, STATS_FLAGS_FUNC, "bd_avail_too_less_failures"}, { STATS_OFFSET32(tx_mq_not_empty), -4, STATS_FLAGS_FUNC, "tx_mq_not_empty"} +4, STATS_FLAGS_FUNC, "tx_mq_not_empty"}, +{ STATS_OFFSET32(nsegs_path1_errors), +4, STATS_FLAGS_FUNC, "nsegs_path1_errors"}, +{ STATS_OFFSET32(nsegs_path2_errors), +4, STATS_FLAGS_FUNC, "nsegs_path2_errors"} + }; @@ -621,12 +628,19 @@ static const struct { 4, "mbuf_alloc_tpa"}, { Q_STATS_OFFSET32(tx_queue_full_return), 4, "tx_queue_full_return"}, +{ Q_STATS_OFFSET32(bxe_tx_mq_sc_state_failures), +4, "bxe_tx_mq_sc_state_failures"}, { Q_STATS_OFFSET32(tx_request_link_down_failures), 4, "tx_request_link_down_failures"}, { Q_STATS_OFFSET32(bd_avail_too_less_failures), 4, "bd_avail_too_less_failures"}, { Q_STATS_OFFSET32(tx_mq_not_empty), -4, "tx_mq_not_empty"} +4, "tx_mq_not_empty"}, +{ Q_STATS_OFFSET32(nsegs_path1_errors), +4, "nsegs_path1_errors"}, +{ Q_STATS_OFFSET32(nsegs_path2_errors), +4, "nsegs_path2_errors"} + }; @@ -697,6 +711,7 @@ static void bxe_handle_fp_tq(void *conte static int bxe_add_cdev(struct bxe_softc *sc); static void bxe_del_cdev(struct bxe_softc *sc); +int bxe_grc_dump(struct bxe_softc *sc); static int bxe_alloc_buf_rings(struct bxe_softc *sc); static void bxe_free_buf_rings(struct bxe_softc *sc); @@ -5246,12 +5261,24 @@ bxe_tx_encap(struct bxe_fastpath *fp, st fp->eth_q_stats.tx_dma_mapping_failure++; /* No sense in trying to defrag/copy chain, drop it. :( */ rc = error; -} -else { -/* if the chain is still too long then drop it */ -if (__predict_false(nsegs > BXE_MAX_SEGMENTS)) { -bus_dmamap_unload(fp->tx_mbuf_tag, tx_buf->m_map); -rc = ENODEV; +} else { + /* if the chain is still too long then drop it */ +if(m0->m_pkthdr.csum_flags & CSUM_TSO) { +/* + * in case TSO is enabled nsegs should be checked against + * BXE_TSO_MAX_SEGMENTS + */ +if (__predict_false(nsegs > BXE_TSO_MAX_SEGMENTS)) { +bus_dmamap_unload(fp->tx_mbuf_tag, tx_buf->m_map); +fp->eth_q_stats.nsegs_path1_errors++; +rc = ENODEV; +} +} else { +if (__predict_false(nsegs > BXE_MAX_SEGMENTS)) { +bus_dmamap_unload(fp->tx_mbuf_tag, tx_buf->m_map); +fp->eth_q_stats.nsegs_path2_errors++; +rc = ENODEV; +} } } } @@ -5651,6 +5678,11 @@ bxe_tx_mq_start_locked(struct bxe_softc BXE_FP_TX_LOCK_ASSERT(fp); +if (sc->state != BXE_STATE_OPEN) { +fp->eth_q_stats.bxe_tx_mq_sc_state_failures++; +return ENETDOWN; +} + if (!tx_br) { BLOGE(sc, "Multiqueue TX and no buf_ring!\n"); return (EINVAL); @@
svn commit: r317184 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Thu Apr 20 04:36:49 2017 New Revision: 317184 URL: https://svnweb.freebsd.org/changeset/base/317184 Log: MFC r316183 Upgrade firmware and other related files to version 5.4.64 Modified: stable/9/sys/dev/qlxgbe/ql_boot.c stable/9/sys/dev/qlxgbe/ql_fw.c stable/9/sys/dev/qlxgbe/ql_minidump.c stable/9/sys/dev/qlxgbe/ql_reset.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_boot.c == --- stable/9/sys/dev/qlxgbe/ql_boot.c Thu Apr 20 04:33:47 2017 (r317183) +++ stable/9/sys/dev/qlxgbe/ql_boot.c Thu Apr 20 04:36:49 2017 (r317184) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_bootloader_version_major = 5; unsigned int ql83xx_bootloader_version_minor = 4; -unsigned int ql83xx_bootloader_version_sub = 62; +unsigned int ql83xx_bootloader_version_sub = 64; unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -10957,9 +10957,9 @@ unsigned char ql83xx_bootloader[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x02, 0x00, 0x40, 0x40, 0x05, 0x04, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x40, 0x40, 0x05, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x9b, 0x64, 0x97, 0x0e + 0x00, 0x00, 0x00, 0x00, 0x9b, 0x64, 0x95, 0x0e }; unsigned int ql83xx_bootloader_len = 131072; Modified: stable/9/sys/dev/qlxgbe/ql_fw.c == --- stable/9/sys/dev/qlxgbe/ql_fw.c Thu Apr 20 04:33:47 2017 (r317183) +++ stable/9/sys/dev/qlxgbe/ql_fw.c Thu Apr 20 04:36:49 2017 (r317184) @@ -35,32 +35,32 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_firmware_version_major = 5; unsigned int ql83xx_firmware_version_minor = 4; -unsigned int ql83xx_firmware_version_sub = 62; +unsigned int ql83xx_firmware_version_sub = 64; unsigned char ql83xx_firmware[] = { - 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc4, 0x5e, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0xcd, 0x7d, 0x72, 0x3d, 0x1f, 0x5f, 0xe0, + 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe4, 0x42, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5f, 0x7e, 0x74, 0x37, 0x27, 0xc9, 0xab, 0x39, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8b, 0xef, 0x03, 0x00, + 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0xef, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x44, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6b, 0xf9, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7a, 0x9f, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x46, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xdd, 0x4e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, 0xf9, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x9f, 0x90, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x46, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x9f, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xe5, 0x98, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x71, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x65, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfc, 0x89, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x73, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
svn commit: r314792 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Mon Mar 6 20:47:53 2017 New Revision: 314792 URL: https://svnweb.freebsd.org/changeset/base/314792 Log: MFC r314062 add bus_dmamap_unload in ql_free_dmabuf() Modified: stable/9/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_os.c == --- stable/9/sys/dev/qlxgbe/ql_os.c Mon Mar 6 20:35:03 2017 (r314791) +++ stable/9/sys/dev/qlxgbe/ql_os.c Mon Mar 6 20:47:53 2017 (r314792) @@ -735,6 +735,7 @@ ql_alloc_dmabuf_exit: void ql_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf) { + bus_dmamap_unload(dma_buf->dma_tag, dma_buf->dma_map); bus_dmamem_free(dma_buf->dma_tag, dma_buf->dma_b, dma_buf->dma_map); bus_dma_tag_destroy(dma_buf->dma_tag); } ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r317113 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Wed Apr 19 03:02:23 2017 New Revision: 317113 URL: https://svnweb.freebsd.org/changeset/base/317113 Log: MFC r316309 Add support for optional Soft LRO Modified: stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_hw.h stable/9/sys/dev/qlxgbe/ql_isr.c stable/9/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Wed Apr 19 02:59:26 2017 (r317112) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Wed Apr 19 03:02:23 2017 (r317113) @@ -440,6 +440,17 @@ ql_hw_add_sysctls(qla_host_t *ha) OID_AUTO, "enable_9kb", CTLFLAG_RW, >hw.enable_9kb, ha->hw.enable_9kb, "Enable 9Kbyte Buffers when MTU = 9000"); +ha->hw.enable_hw_lro = 1; + +SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), +SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), +OID_AUTO, "enable_hw_lro", CTLFLAG_RW, >hw.enable_hw_lro, +ha->hw.enable_hw_lro, "Enable Hardware LRO; Default is true \n" + "\t 1 : Hardware LRO if LRO is enabled\n" + "\t 0 : Software LRO if LRO is enabled\n" + "\t Any change requires ifconfig down/up to take effect\n" + "\t Note that LRO may be turned off/on via ifconfig\n"); + ha->hw.mdump_active = 0; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -2255,6 +2266,83 @@ qla_config_rss_ind_table(qla_host_t *ha) return (0); } +static int +qla_config_soft_lro(qla_host_t *ha) +{ +int i; +qla_hw_t *hw = >hw; +struct lro_ctrl *lro; + +for (i = 0; i < hw->num_sds_rings; i++) { +lro = >sds[i].lro; + + bzero(lro, sizeof(struct lro_ctrl)); + +#if (__FreeBSD_version >= 1100101) +if (tcp_lro_init_args(lro, ha->ifp, 0, NUM_RX_DESCRIPTORS)) { +device_printf(ha->pci_dev, + "%s: tcp_lro_init_args [%d] failed\n", +__func__, i); +return (-1); +} +#else +if (tcp_lro_init(lro)) { +device_printf(ha->pci_dev, + "%s: tcp_lro_init [%d] failed\n", +__func__, i); +return (-1); +} +#endif /* #if (__FreeBSD_version >= 1100101) */ + +lro->ifp = ha->ifp; +} + +QL_DPRINT2(ha, (ha->pci_dev, "%s: LRO initialized\n", __func__)); +return (0); +} + +static void +qla_drain_soft_lro(qla_host_t *ha) +{ +int i; +qla_hw_t *hw = >hw; +struct lro_ctrl *lro; + + for (i = 0; i < hw->num_sds_rings; i++) { + lro = >sds[i].lro; + +#if (__FreeBSD_version >= 1100101) + tcp_lro_flush_all(lro); +#else +struct lro_entry *queued; + + while ((!SLIST_EMPTY(>lro_active))) { + queued = SLIST_FIRST(>lro_active); + SLIST_REMOVE_HEAD(>lro_active, next); + tcp_lro_flush(lro, queued); + } +#endif /* #if (__FreeBSD_version >= 1100101) */ + } + + return; +} + +static void +qla_free_soft_lro(qla_host_t *ha) +{ +int i; +qla_hw_t *hw = >hw; +struct lro_ctrl *lro; + +for (i = 0; i < hw->num_sds_rings; i++) { + lro = >sds[i].lro; + tcp_lro_free(lro); + } + + return; +} + + /* * Name: ql_del_hw_if * Function: Destroys the hardware specific entities corresponding to an @@ -2287,6 +2375,11 @@ ql_del_hw_if(qla_host_t *ha) ha->hw.flags.init_intr_cnxt = 0; } + if (ha->hw.enable_soft_lro) { + qla_drain_soft_lro(ha); + qla_free_soft_lro(ha); + } + return; } @@ -2309,7 +2402,6 @@ qla_confirm_9kb_enable(qla_host_t *ha) return; } - /* * Name: ql_init_hw_if * Function: Creates the hardware specific entities corresponding to an @@ -2416,8 +2508,19 @@ ql_init_hw_if(qla_host_t *ha) if (qla_link_event_req(ha, ha->hw.rcv_cntxt_id)) return (-1); - if (qla_config_fw_lro(ha, ha->hw.rcv_cntxt_id)) - return (-1); + if (ha->ifp->if_capenable & IFCAP_LRO) { + if (ha->hw.enable_hw_lro) { + ha->hw.enable_soft_lro = 0; + + if (qla_config_fw_lro(ha, ha->hw.rcv_cntxt_id)) + return (-1); + } else { + ha->hw.enable_soft_lro = 1; + + if (qla_config_soft_lro(ha)) + return
svn commit: r317114 - stable/9/share/man/man4
Author: davidcs Date: Wed Apr 19 03:03:46 2017 New Revision: 317114 URL: https://svnweb.freebsd.org/changeset/base/317114 Log: MFC r316310 Update man page for commit r316309 "Add support for optional Soft LRO". The driver provides the ability to select either HW or Software LRO, when LRO is enabled (default HW LRO). Modified: stable/9/share/man/man4/qlxgbe.4 Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/qlxgbe.4 == --- stable/9/share/man/man4/qlxgbe.4Wed Apr 19 03:02:23 2017 (r317113) +++ stable/9/share/man/man4/qlxgbe.4Wed Apr 19 03:03:46 2017 (r317114) @@ -52,7 +52,8 @@ 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. +Receive Side scaling, ability to select either HW or Software LRO, +when LRO is enabled (default HW LRO). For further hardware information, see .Pa http://www.qlogic.com/ . .Sh HARDWARE ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r321501 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Wed Jul 26 01:46:25 2017 New Revision: 321501 URL: https://svnweb.freebsd.org/changeset/base/321501 Log: MFC 320705 Release mtx hw_lock before calling pause() in qla_stop() and qla_error_recovery() Modified: stable/9/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_os.c == --- stable/9/sys/dev/qlxgbe/ql_os.c Wed Jul 26 01:43:44 2017 (r321500) +++ stable/9/sys/dev/qlxgbe/ql_os.c Wed Jul 26 01:46:25 2017 (r321501) @@ -1540,8 +1540,11 @@ qla_stop(qla_host_t *ha) ha->flags.qla_watchdog_pause = 1; - while (!ha->qla_watchdog_paused) + while (!ha->qla_watchdog_paused) { + QLA_UNLOCK(ha); qla_mdelay(__func__, 1); + QLA_LOCK(ha); + } ha->flags.qla_interface_up = 0; @@ -1936,7 +1939,10 @@ qla_error_recovery(void *context, int pending) if (ha->flags.qla_interface_up) { ha->hw.imd_compl = 1; + + QLA_UNLOCK(ha); qla_mdelay(__func__, 300); + QLA_LOCK(ha); ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE | IFF_DRV_RUNNING); ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r321503 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Wed Jul 26 01:48:57 2017 New Revision: 321503 URL: https://svnweb.freebsd.org/changeset/base/321503 Log: MFC 321233 Raise the watchdog timer interval to 2 ticks, there by guaranteeing that it fires between 1ms and 2ms. ` Treat two consecutive occurrences of Heartbeat failures as a legitimate Heartbeat failure Modified: stable/9/sys/dev/qlxgbe/ql_def.h stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_hw.h stable/9/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_def.h == --- stable/9/sys/dev/qlxgbe/ql_def.hWed Jul 26 01:48:13 2017 (r321502) +++ stable/9/sys/dev/qlxgbe/ql_def.hWed Jul 26 01:48:57 2017 (r321503) @@ -105,7 +105,7 @@ struct qla_ivec { typedef struct qla_ivec qla_ivec_t; -#define QLA_WATCHDOG_CALLOUT_TICKS 1 +#define QLA_WATCHDOG_CALLOUT_TICKS 2 typedef struct _qla_tx_ring { qla_tx_buf_ttx_buf[NUM_TX_DESCRIPTORS]; Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Wed Jul 26 01:48:13 2017 (r321502) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Wed Jul 26 01:48:57 2017 (r321503) @@ -3366,7 +3366,7 @@ ql_hw_check_health(qla_host_t *ha) ha->hw.health_count++; - if (ha->hw.health_count < 1000) + if (ha->hw.health_count < 500) return 0; ha->hw.health_count = 0; @@ -3385,10 +3385,18 @@ ql_hw_check_health(qla_host_t *ha) if ((val != ha->hw.hbeat_value) && (!(QL_ERR_INJECT(ha, INJCT_HEARTBEAT_FAILURE { ha->hw.hbeat_value = val; + ha->hw.hbeat_failure = 0; return 0; } - device_printf(ha->pci_dev, "%s: Heartbeat Failue [0x%08x]\n", - __func__, val); + + ha->hw.hbeat_failure++; + + if (ha->hw.hbeat_failure < 2) /* we ignore the first failure */ + return 0; + else + device_printf(ha->pci_dev, "%s: Heartbeat Failue [0x%08x]\n", + __func__, val); + return -1; } Modified: stable/9/sys/dev/qlxgbe/ql_hw.h == --- stable/9/sys/dev/qlxgbe/ql_hw.h Wed Jul 26 01:48:13 2017 (r321502) +++ stable/9/sys/dev/qlxgbe/ql_hw.h Wed Jul 26 01:48:57 2017 (r321503) @@ -1671,6 +1671,7 @@ typedef struct _qla_hw { /* heart beat register value */ uint32_thbeat_value; uint32_thealth_count; + uint32_thbeat_failure; uint32_tmax_tx_segs; uint32_tmin_lro_pkt_size; Modified: stable/9/sys/dev/qlxgbe/ql_os.c == --- stable/9/sys/dev/qlxgbe/ql_os.c Wed Jul 26 01:48:13 2017 (r321502) +++ stable/9/sys/dev/qlxgbe/ql_os.c Wed Jul 26 01:48:57 2017 (r321503) @@ -276,7 +276,7 @@ qla_watchdog(void *arg) ha->qla_watchdog_paused = 1; } - ha->watchdog_ticks = ha->watchdog_ticks++ % 1000; + ha->watchdog_ticks = ha->watchdog_ticks++ % 500; callout_reset(>tx_callout, QLA_WATCHDOG_CALLOUT_TICKS, qla_watchdog, ha); } ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r321500 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Wed Jul 26 01:43:44 2017 New Revision: 321500 URL: https://svnweb.freebsd.org/changeset/base/321500 Log: MFC 320694 Allow MTU changes without ifconfig down/up Modified: stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Wed Jul 26 01:28:27 2017 (r321499) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Wed Jul 26 01:43:44 2017 (r321500) @@ -2498,6 +2498,9 @@ ql_init_hw_if(qla_host_t *ha) if (qla_hw_add_all_mcast(ha)) return (-1); + if (ql_set_max_mtu(ha, ha->max_frame_size, ha->hw.rcv_cntxt_id)) + return (-1); + if (qla_config_rss(ha, ha->hw.rcv_cntxt_id)) return (-1); Modified: stable/9/sys/dev/qlxgbe/ql_os.c == --- stable/9/sys/dev/qlxgbe/ql_os.c Wed Jul 26 01:28:27 2017 (r321499) +++ stable/9/sys/dev/qlxgbe/ql_os.c Wed Jul 26 01:43:44 2017 (r321500) @@ -985,8 +985,7 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) { - ret = ql_set_max_mtu(ha, ha->max_frame_size, - ha->hw.rcv_cntxt_id); + qla_init_locked(ha); } if (ifp->if_mtu > ETHERMTU) @@ -1019,11 +1018,9 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) ret = ql_set_allmulti(ha); } } else { - qla_init_locked(ha); ha->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; - ret = ql_set_max_mtu(ha, ha->max_frame_size, - ha->hw.rcv_cntxt_id); + qla_init_locked(ha); } } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r318309 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Mon May 15 18:24:14 2017 New Revision: 318309 URL: https://svnweb.freebsd.org/changeset/base/318309 Log: MFC r317996 Fix bug where MTX_DEF lock was held while taskqueue_drain() was invoked. Check IFF_DRV_RUNNING flag is set prior to calling ql_hw_set_multi() Modified: stable/9/sys/dev/qlxgbe/ql_isr.c stable/9/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_isr.c == --- stable/9/sys/dev/qlxgbe/ql_isr.cMon May 15 18:21:36 2017 (r318308) +++ stable/9/sys/dev/qlxgbe/ql_isr.cMon May 15 18:24:14 2017 (r318309) @@ -983,7 +983,8 @@ ql_isr(void *arg) fp = >tx_fp[idx]; - if (fp->fp_taskqueue != NULL) + if ((fp->fp_taskqueue != NULL) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) taskqueue_enqueue(fp->fp_taskqueue, >fp_task); return; Modified: stable/9/sys/dev/qlxgbe/ql_os.c == --- stable/9/sys/dev/qlxgbe/ql_os.c Mon May 15 18:21:36 2017 (r318308) +++ stable/9/sys/dev/qlxgbe/ql_os.c Mon May 15 18:24:14 2017 (r318309) @@ -930,7 +930,9 @@ qla_set_multi(qla_host_t *ha, uint32_t a if_maddr_runlock(ifp); QLA_LOCK(ha); - ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); + } QLA_UNLOCK(ha); return (ret); @@ -1036,20 +1038,16 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, QL_DPRINT4(ha, (ha->pci_dev, "%s: %s (0x%lx)\n", __func__, "SIOCADDMULTI", cmd)); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - if (qla_set_multi(ha, 1)) - ret = EINVAL; - } + if (qla_set_multi(ha, 1)) + ret = EINVAL; break; case SIOCDELMULTI: QL_DPRINT4(ha, (ha->pci_dev, "%s: %s (0x%lx)\n", __func__, "SIOCDELMULTI", cmd)); - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - if (qla_set_multi(ha, 0)) - ret = EINVAL; - } + if (qla_set_multi(ha, 0)) + ret = EINVAL; break; case SIOCSIFMEDIA: @@ -1550,9 +1548,9 @@ qla_stop(qla_host_t *ha) ha->flags.qla_interface_up = 0; + QLA_UNLOCK(ha); qla_drain_fp_taskqueues(ha); - - ql_hw_stop_rcv(ha); + QLA_LOCK(ha); ql_del_hw_if(ha); @@ -1943,8 +1941,6 @@ qla_error_recovery(void *context, int pe ha->hw.imd_compl = 1; qla_mdelay(__func__, 300); - ql_hw_stop_rcv(ha); - ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE | IFF_DRV_RUNNING); for (i = 0; i < ha->hw.num_sds_rings; i++) { @@ -1964,6 +1960,8 @@ qla_error_recovery(void *context, int pe QLA_UNLOCK(ha); + qla_drain_fp_taskqueues(ha); + if ((ha->pci_func & 0x1) == 0) { if (!ha->msg_from_peer) { ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r320371 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Mon Jun 26 19:40:10 2017 New Revision: 320371 URL: https://svnweb.freebsd.org/changeset/base/320371 Log: MFC r320175 Add pkts_cnt_oversized to stats. Modified: stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_hw.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Mon Jun 26 19:36:24 2017 (r320370) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Mon Jun 26 19:40:10 2017 (r320371) @@ -1554,6 +1554,8 @@ qla_rcv_stats(qla_host_t *ha, q80_rcv_stats_t *rstat) rstat->lro_flows_active); device_printf(dev, "%s: pkts_droped_unknown\t\t%" PRIu64 "\n", __func__, rstat->pkts_droped_unknown); + device_printf(dev, "%s: pkts_cnt_oversized\t\t%" PRIu64 "\n", + __func__, rstat->pkts_cnt_oversized); } static void Modified: stable/9/sys/dev/qlxgbe/ql_hw.h == --- stable/9/sys/dev/qlxgbe/ql_hw.h Mon Jun 26 19:36:24 2017 (r320370) +++ stable/9/sys/dev/qlxgbe/ql_hw.h Mon Jun 26 19:40:10 2017 (r320371) @@ -748,6 +748,7 @@ typedef struct _q80_rcv_stats { uint64_tlro_flows_deleted; uint64_tlro_flows_active; uint64_tpkts_droped_unknown; + uint64_tpkts_cnt_oversized; } __packed q80_rcv_stats_t; typedef struct _q80_xmt_stats { ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r317992 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Mon May 8 22:44:16 2017 New Revision: 317992 URL: https://svnweb.freebsd.org/changeset/base/317992 Log: MFC r317180 Cleanup QLA_LOCK/QLA_UNLOCK macros remove unused QLA_TX_LOCK/QLA_TX_UNLOCK macros format qla_error_recovery() Modified: stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_ioctl.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_os.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Mon May 8 22:41:13 2017 (r317991) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Mon May 8 22:44:16 2017 (r317992) @@ -183,9 +183,9 @@ qla_sysctl_stop_pegs(SYSCTL_HANDLER_ARGS if (ret == 1) { ha = (qla_host_t *)arg1; - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); qla_stop_pegs(ha); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); } return err; Modified: stable/9/sys/dev/qlxgbe/ql_ioctl.c == --- stable/9/sys/dev/qlxgbe/ql_ioctl.c Mon May 8 22:41:13 2017 (r317991) +++ stable/9/sys/dev/qlxgbe/ql_ioctl.c Mon May 8 22:44:16 2017 (r317992) @@ -233,10 +233,10 @@ ql_eioctl(struct cdev *dev, u_long cmd, break; } - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); if (!ha->hw.mdump_done) ha->qla_initiate_recovery = 1; - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); #define QLNX_DUMP_WAIT_SECS30 @@ -254,9 +254,9 @@ ql_eioctl(struct cdev *dev, u_long cmd, break; } - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); ha->hw.mdump_done = 0; - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); if ((rval = copyout(ha->hw.mdump_template, fw_dump->minidump, ha->hw.mdump_template_size))) { Modified: stable/9/sys/dev/qlxgbe/ql_os.c == --- stable/9/sys/dev/qlxgbe/ql_os.c Mon May 8 22:41:13 2017 (r317991) +++ stable/9/sys/dev/qlxgbe/ql_os.c Mon May 8 22:44:16 2017 (r317992) @@ -519,9 +519,9 @@ qla_pci_detach(device_t dev) ifp = ha->ifp; - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); qla_stop(ha); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); qla_release(ha); @@ -895,9 +895,9 @@ qla_init(void *arg) QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); qla_init_locked(ha); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__)); } @@ -929,13 +929,9 @@ qla_set_multi(qla_host_t *ha, uint32_t a if_maddr_runlock(ifp); - //if (QLA_LOCK(ha, __func__, 1) == 0) { - // ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); - // QLA_UNLOCK(ha, __func__); - //} - QLA_LOCK(ha, __func__, 1); + QLA_LOCK(ha); ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); return (ret); } @@ -958,9 +954,9 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, if (ifa->ifa_addr->sa_family == AF_INET) { ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); qla_init_locked(ha); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); } QL_DPRINT4(ha, (ha->pci_dev, "%s: SIOCSIFADDR (0x%lx) ipv4 [0x%08x]\n", @@ -980,10 +976,12 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, if (ifr->ifr_mtu > QLA_MAX_MTU) { ret = EINVAL; } else { - (void) QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); + ifp->if_mtu = ifr->ifr_mtu; ha->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) { ret = ql_set_max_mtu(ha, ha->max_frame_size, ha->hw.rcv_cntxt_id); @@ -995,7 +993,7 @@ qla_ioctl(struct ifnet *ifp,
svn commit: r324333 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Thu Oct 5 19:03:50 2017 New Revision: 324333 URL: https://svnweb.freebsd.org/changeset/base/324333 Log: MFC r324065 Tx Ring Shadow Consumer Index Register needs to be cleared prior to passing it's physical address to the FW during Tx Create Context. Modified: stable/9/sys/dev/qlxgbe/ql_hw.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Thu Oct 5 19:01:47 2017 (r324332) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Thu Oct 5 19:03:50 2017 (r324333) @@ -3248,6 +3248,7 @@ qla_init_xmt_cntxt_i(qla_host_t *ha, uint32_t txr_idx) hw_tx_cntxt->txr_free = NUM_TX_DESCRIPTORS; hw_tx_cntxt->txr_next = hw_tx_cntxt->txr_comp = 0; + *hw_tx_cntxt->tx_cons = 0; if (qla_mbx_cmd(ha, (uint32_t *)tcntxt, (sizeof (q80_rq_tx_cntxt_t) >> 2), ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r324332 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Thu Oct 5 19:01:47 2017 New Revision: 324332 URL: https://svnweb.freebsd.org/changeset/base/324332 Log: MFC r324026 Fix delete all multicast addresses Submitted by: anand.kh...@cavium.com Modified: stable/9/sys/dev/qlxgbe/ql_glbl.h stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_glbl.h == --- stable/9/sys/dev/qlxgbe/ql_glbl.h Thu Oct 5 19:00:22 2017 (r324331) +++ stable/9/sys/dev/qlxgbe/ql_glbl.h Thu Oct 5 19:01:47 2017 (r324332) @@ -75,6 +75,7 @@ extern int ql_hw_check_health(qla_host_t *ha); extern void qla_hw_async_event(qla_host_t *ha); extern int qla_get_nic_partition(qla_host_t *ha, uint32_t *supports_9kb, uint32_t *num_rcvq); +extern int qla_hw_del_all_mcast(qla_host_t *ha); extern int ql_iscsi_pdu(qla_host_t *ha, struct mbuf *mp); extern void ql_minidump(qla_host_t *ha); Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Thu Oct 5 19:00:22 2017 (r324331) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Thu Oct 5 19:01:47 2017 (r324332) @@ -64,7 +64,6 @@ static int qla_link_event_req(qla_host_t *ha, uint16_t static int qla_tx_tso(qla_host_t *ha, struct mbuf *mp, q80_tx_cmd_t *tx_cmd, uint8_t *hdr); static int qla_hw_add_all_mcast(qla_host_t *ha); -static int qla_hw_del_all_mcast(qla_host_t *ha); static int qla_add_rcv_rings(qla_host_t *ha, uint32_t sds_idx, uint32_t nsds); static int qla_init_nic_func(qla_host_t *ha); @@ -3413,7 +3412,7 @@ qla_hw_add_all_mcast(qla_host_t *ha) return (ret); } -static int +int qla_hw_del_all_mcast(qla_host_t *ha) { int ret; Modified: stable/9/sys/dev/qlxgbe/ql_os.c == --- stable/9/sys/dev/qlxgbe/ql_os.c Thu Oct 5 19:00:22 2017 (r324331) +++ stable/9/sys/dev/qlxgbe/ql_os.c Thu Oct 5 19:01:47 2017 (r324332) @@ -980,7 +980,19 @@ qla_set_multi(qla_host_t *ha, uint32_t add_multi) return (-1); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); + + if (!add_multi) { + ret = qla_hw_del_all_mcast(ha); + + if (ret) + device_printf(ha->pci_dev, + "%s: qla_hw_del_all_mcast() failed\n", + __func__); + } + + if (!ret) + ret = ql_hw_set_multi(ha, mta, mcnt, 1); + } QLA_UNLOCK(ha, __func__); ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r324035 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 26 22:29:43 2017 New Revision: 324035 URL: https://svnweb.freebsd.org/changeset/base/324035 Log: MFC r323782 Add sysctl "enable_minidump" to turn on/off automatic minidump retrieval Modified: stable/9/sys/dev/qlxgbe/ql_def.h stable/9/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_def.h == --- stable/9/sys/dev/qlxgbe/ql_def.hTue Sep 26 22:28:00 2017 (r324034) +++ stable/9/sys/dev/qlxgbe/ql_def.hTue Sep 26 22:29:43 2017 (r324035) @@ -239,6 +239,7 @@ struct qla_host { volatile const char *qla_lock; volatile const char *qla_unlock; uint32_tdbg_level; + uint32_tenable_minidump; uint8_t fw_ver_str[32]; Modified: stable/9/sys/dev/qlxgbe/ql_os.c == --- stable/9/sys/dev/qlxgbe/ql_os.c Tue Sep 26 22:28:00 2017 (r324034) +++ stable/9/sys/dev/qlxgbe/ql_os.c Tue Sep 26 22:29:43 2017 (r324035) @@ -185,6 +185,13 @@ qla_add_sysctls(qla_host_t *ha) OID_AUTO, "debug", CTLFLAG_RW, >dbg_level, ha->dbg_level, "Debug Level"); + ha->enable_minidump = 1; + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "enable_minidump", CTLFLAG_RW, + >enable_minidump, ha->enable_minidump, + "Minidump retrival is enabled only when this is set"); + ha->std_replenish = QL_STD_REPLENISH_THRES; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -2046,7 +2053,8 @@ device_printf(ha->pci_dev, "%s: enter\n", __func__); ha->msg_from_peer = 0; - ql_minidump(ha); + if (ha->enable_minidump) + ql_minidump(ha); (void) ql_init_hw(ha); ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r324036 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 26 22:32:08 2017 New Revision: 324036 URL: https://svnweb.freebsd.org/changeset/base/324036 Log: MFC r323824 1. ql_hw.c: In ql_hw_send() return EINVAL when TSO framelength exceeds max supported length by HW.(davidcs) 2. ql_os.c: In qla_send() call bus_dmamap_unload before freeing mbuf or recreating dmmamap.(davidcs) In qla_fp_taskqueue() Add additional checks for IFF_DRV_RUNNING Fix qla_clear_tx_buf() call bus_dmamap_sync() before freeing mbuf. Submitted by: david.ba...@netapp.com Modified: stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Tue Sep 26 22:29:43 2017 (r324035) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Tue Sep 26 22:32:08 2017 (r324036) @@ -2324,7 +2324,7 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, in if (total_length > QLA_MAX_TSO_FRAME_SIZE) { device_printf(dev, "%s: total length exceeds maxlen(%d)\n", __func__, total_length); - return (-1); + return (EINVAL); } eh = mtod(mp, struct ether_vlan_header *); Modified: stable/9/sys/dev/qlxgbe/ql_os.c == --- stable/9/sys/dev/qlxgbe/ql_os.c Tue Sep 26 22:29:43 2017 (r324035) +++ stable/9/sys/dev/qlxgbe/ql_os.c Tue Sep 26 22:32:08 2017 (r324036) @@ -1308,6 +1308,7 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 ha->tx_ring[txr_idx].iscsi_pkt_count++; ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head = m_head; } else { + bus_dmamap_unload(ha->tx_tag, map); if (ret == EINVAL) { if (m_head) m_freem(m_head); @@ -1393,7 +1394,8 @@ qla_fp_taskqueue(void *context, int pending) goto qla_fp_taskqueue_exit; } - while (rx_pkts_left && !ha->stop_rcv) { + while (rx_pkts_left && !ha->stop_rcv && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { rx_pkts_left = ql_rcv_isr(ha, fp->txr_idx, 64); #ifdef QL_ENABLE_ISCSI_TLV @@ -1436,6 +1438,11 @@ qla_fp_taskqueue(void *context, int pending) drbr_advance(ifp, fp->tx_br); } + /* Send a copy of the frame to the BPF listener */ + ETHER_BPF_MTAP(ifp, mp); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + break; + mp = drbr_peek(ifp, fp->tx_br); } } @@ -1698,16 +1705,24 @@ qla_clear_tx_buf(qla_host_t *ha, qla_tx_buf_t *txb) { QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); - if (txb->m_head && txb->map) { + if (txb->m_head) { + bus_dmamap_sync(ha->tx_tag, txb->map, + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(ha->tx_tag, txb->map); m_freem(txb->m_head); txb->m_head = NULL; + + bus_dmamap_destroy(ha->tx_tag, txb->map); + txb->map = NULL; } - if (txb->map) + if (txb->map) { + bus_dmamap_unload(ha->tx_tag, txb->map); bus_dmamap_destroy(ha->tx_tag, txb->map); + txb->map = NULL; + } QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__)); } ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r322973 - in stable/9/sys: dev/qlxgbe modules/qlxgbe
Author: davidcs Date: Mon Aug 28 18:01:36 2017 New Revision: 322973 URL: https://svnweb.freebsd.org/changeset/base/322973 Log: MFC 322771 Upgrade FW to 5.4.66 sysctls to display stats, stats polled every 2 seconds Modify QLA_LOCK()/QLA_UNLOCK() to not sleep after acquiring mtx_lock Add support to turn OFF/ON error recovery following heartbeat failure for debug purposes. Set default max values to 32 Tx/Rx/SDS rings Modified: stable/9/sys/dev/qlxgbe/README.txt stable/9/sys/dev/qlxgbe/ql_boot.c stable/9/sys/dev/qlxgbe/ql_def.h stable/9/sys/dev/qlxgbe/ql_fw.c stable/9/sys/dev/qlxgbe/ql_glbl.h stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_hw.h stable/9/sys/dev/qlxgbe/ql_inline.h stable/9/sys/dev/qlxgbe/ql_ioctl.c stable/9/sys/dev/qlxgbe/ql_isr.c stable/9/sys/dev/qlxgbe/ql_minidump.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_os.h stable/9/sys/dev/qlxgbe/ql_reset.c stable/9/sys/dev/qlxgbe/ql_ver.h stable/9/sys/modules/qlxgbe/Makefile Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/qlxgbe/README.txt == --- stable/9/sys/dev/qlxgbe/README.txt Mon Aug 28 17:21:33 2017 (r322972) +++ stable/9/sys/dev/qlxgbe/README.txt Mon Aug 28 18:01:36 2017 (r322973) @@ -61,14 +61,17 @@ following OS platforms: - kldunload if_qlxgbe 5. Parameters to set prior to installing the driver + Please run "sysctl kern.ipc" and "sysctl net.inet.tcp" and see if these + values are already greater than shown below. Change only those which + are less than shown below. - Add the following lines to /etc/sysctl.conf and reboot the machine prior to installing the driver - kern.ipc.nmbjumbo9=262144 + kern.ipc.nmbjumbo9=200 + kern.ipc.nmbclusters=100 net.inet.tcp.recvbuf_max=262144 net.inet.tcp.recvbuf_inc=16384 - kern.ipc.nmbclusters=100 kern.ipc.maxsockbuf=2097152 net.inet.tcp.recvspace=131072 net.inet.tcp.sendbuf_max=262144 @@ -78,10 +81,10 @@ following OS platforms: login or su to root - sysctl kern.ipc.nmbjumbo9=262144 + sysctl kern.ipc.nmbjumbo9=200 + sysctl kern.ipc.nmbclusters=100 sysctl net.inet.tcp.recvbuf_max=262144 sysctl net.inet.tcp.recvbuf_inc=16384 - sysctl kern.ipc.nmbclusters=100 sysctl kern.ipc.maxsockbuf=2097152 sysctl net.inet.tcp.recvspace=131072 sysctl net.inet.tcp.sendbuf_max=262144 Modified: stable/9/sys/dev/qlxgbe/ql_boot.c == --- stable/9/sys/dev/qlxgbe/ql_boot.c Mon Aug 28 17:21:33 2017 (r322972) +++ stable/9/sys/dev/qlxgbe/ql_boot.c Mon Aug 28 18:01:36 2017 (r322973) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_bootloader_version_major = 5; unsigned int ql83xx_bootloader_version_minor = 4; -unsigned int ql83xx_bootloader_version_sub = 64; +unsigned int ql83xx_bootloader_version_sub = 66; unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -10957,9 +10957,8 @@ unsigned char ql83xx_bootloader[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x02, 0x00, 0x40, 0x40, 0x05, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x40, 0x40, 0x05, 0x04, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x9b, 0x64, 0x95, 0x0e + 0x00, 0x00, 0x00, 0x00, 0x9b, 0x64, 0x93, 0x0e }; unsigned int ql83xx_bootloader_len = 131072; - Modified: stable/9/sys/dev/qlxgbe/ql_def.h == --- stable/9/sys/dev/qlxgbe/ql_def.hMon Aug 28 17:21:33 2017 (r322972) +++ stable/9/sys/dev/qlxgbe/ql_def.hMon Aug 28 18:01:36 2017 (r322973) @@ -110,6 +110,7 @@ typedef struct qla_ivec qla_ivec_t; typedef struct _qla_tx_ring { qla_tx_buf_ttx_buf[NUM_TX_DESCRIPTORS]; uint64_tcount; + uint64_tiscsi_pkt_count; } qla_tx_ring_t; typedef struct _qla_tx_fp { @@ -129,19 +130,20 @@ typedef struct _qla_tx_fp { struct qla_host { volatile struct { volatile uint32_t - qla_interface_up:1, qla_callout_init:1, qla_watchdog_active :1, - qla_watchdog_exit :1, - qla_watchdog_pause
svn commit: r324766 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Thu Oct 19 17:57:38 2017 New Revision: 324766 URL: https://svnweb.freebsd.org/changeset/base/324766 Log: MFC r324538 Added support driver state capture/retrieval Modified: stable/9/sys/dev/qlxgbe/ql_def.h stable/9/sys/dev/qlxgbe/ql_glbl.h stable/9/sys/dev/qlxgbe/ql_hw.h stable/9/sys/dev/qlxgbe/ql_ioctl.c stable/9/sys/dev/qlxgbe/ql_ioctl.h stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_def.h == --- stable/9/sys/dev/qlxgbe/ql_def.hThu Oct 19 17:40:51 2017 (r324765) +++ stable/9/sys/dev/qlxgbe/ql_def.hThu Oct 19 17:57:38 2017 (r324766) @@ -201,7 +201,6 @@ struct qla_host { qla_rx_buf_t*rxb_free; uint32_trxb_free_count; - volatile uint32_t posting; /* stats */ uint32_terr_m_getcl; @@ -264,7 +263,7 @@ struct qla_host { typedef struct qla_host qla_host_t; /* note that align has to be a power of 2 */ -#define QL_ALIGN(size, align) (size + (align - 1)) & ~(align - 1); +#define QL_ALIGN(size, align) (((size) + ((align) - 1)) & (~((align) - 1))); #define QL_MIN(x, y) ((x < y) ? x : y) #define QL_RUNNING(ifp) (ifp->if_drv_flags & IFF_DRV_RUNNING) Modified: stable/9/sys/dev/qlxgbe/ql_glbl.h == --- stable/9/sys/dev/qlxgbe/ql_glbl.h Thu Oct 19 17:40:51 2017 (r324765) +++ stable/9/sys/dev/qlxgbe/ql_glbl.h Thu Oct 19 17:57:38 2017 (r324766) @@ -112,4 +112,8 @@ extern unsigned int ql83xx_resetseq_len; extern unsigned char ql83xx_minidump[]; extern unsigned int ql83xx_minidump_len; +extern void ql_alloc_drvr_state_buffer(qla_host_t *ha); +extern void ql_free_drvr_state_buffer(qla_host_t *ha); +extern void ql_capture_drvr_state(qla_host_t *ha); + #endif /* #ifndef_QL_GLBL_H_ */ Modified: stable/9/sys/dev/qlxgbe/ql_hw.h == --- stable/9/sys/dev/qlxgbe/ql_hw.h Thu Oct 19 17:40:51 2017 (r324765) +++ stable/9/sys/dev/qlxgbe/ql_hw.h Thu Oct 19 17:57:38 2017 (r324766) @@ -1703,6 +1703,9 @@ typedef struct _qla_hw { uint32_tmdump_buffer_size; void*mdump_template; uint32_tmdump_template_size; + + /* driver state related */ + void*drvr_state; } qla_hw_t; #define QL_UPDATE_RDS_PRODUCER_INDEX(ha, prod_reg, val) \ Modified: stable/9/sys/dev/qlxgbe/ql_ioctl.c == --- stable/9/sys/dev/qlxgbe/ql_ioctl.c Thu Oct 19 17:40:51 2017 (r324765) +++ stable/9/sys/dev/qlxgbe/ql_ioctl.c Thu Oct 19 17:57:38 2017 (r324766) @@ -39,7 +39,11 @@ __FBSDID("$FreeBSD$"); #include "ql_inline.h" #include "ql_glbl.h" #include "ql_ioctl.h" +#include "ql_ver.h" +#include "ql_dbg.h" +static int ql_drvr_state(qla_host_t *ha, qla_driver_state_t *drvr_state); +static uint32_t ql_drvr_state_size(qla_host_t *ha); static int ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td); @@ -279,6 +283,10 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, rval = ENXIO; break; + case QLA_RD_DRVR_STATE: + rval = ql_drvr_state(ha, (qla_driver_state_t *)data); + break; + case QLA_RD_PCI_IDS: pci_ids = (qla_rd_pci_ids_t *)data; pci_ids->ven_id = pci_get_vendor(pci_dev); @@ -293,5 +301,225 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, } return rval; +} + + +static int +ql_drvr_state(qla_host_t *ha, qla_driver_state_t *state) +{ + int rval = 0; + uint32_t drvr_state_size; + qla_drvr_state_hdr_t *hdr; + + drvr_state_size = ql_drvr_state_size(ha); + + if (state->buffer == NULL) { + state->size = drvr_state_size; + return (0); + } + + if (state->size < drvr_state_size) + return (ENXIO); + + if (ha->hw.drvr_state == NULL) + return (ENOMEM); + + hdr = ha->hw.drvr_state; + + if (!hdr->drvr_version_major) + ql_capture_drvr_state(ha); + + rval = copyout(ha->hw.drvr_state, state->buffer, drvr_state_size); + + bzero(ha->hw.drvr_state, drvr_state_size); + + return (rval); +} + +static uint32_t +ql_drvr_state_size(qla_host_t *ha) +{ + uint32_t drvr_state_size; + uint32_t size; + + size = sizeof (qla_drvr_state_hdr_t); + drvr_state_size = QL_ALIGN(size, 64); + + size = ha->hw.num_tx_rings * (sizeof (qla_drvr_state_tx_t)); + drvr_state_size +=
svn commit: r333423 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Wed May 9 18:39:31 2018 New Revision: 333423 URL: https://svnweb.freebsd.org/changeset/base/333423 Log: MFC r333003 Upgraded FW Related Files to version 5.4.67 Modified: stable/9/sys/dev/qlxgbe/ql_boot.c stable/9/sys/dev/qlxgbe/ql_fw.c stable/9/sys/dev/qlxgbe/ql_minidump.c stable/9/sys/dev/qlxgbe/ql_reset.c stable/9/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_boot.c == --- stable/9/sys/dev/qlxgbe/ql_boot.c Wed May 9 18:35:49 2018 (r333422) +++ stable/9/sys/dev/qlxgbe/ql_boot.c Wed May 9 18:39:31 2018 (r333423) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_bootloader_version_major = 5; unsigned int ql83xx_bootloader_version_minor = 4; -unsigned int ql83xx_bootloader_version_sub = 66; +unsigned int ql83xx_bootloader_version_sub = 67; unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -10957,8 +10957,9 @@ unsigned char ql83xx_bootloader[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x02, 0x00, 0x40, 0x40, 0x05, 0x04, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x40, 0x40, 0x05, 0x04, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x9b, 0x64, 0x93, 0x0e + 0x00, 0x00, 0x00, 0x00, 0x9b, 0x64, 0x92, 0x0e }; unsigned int ql83xx_bootloader_len = 131072; + Modified: stable/9/sys/dev/qlxgbe/ql_fw.c == --- stable/9/sys/dev/qlxgbe/ql_fw.c Wed May 9 18:35:49 2018 (r333422) +++ stable/9/sys/dev/qlxgbe/ql_fw.c Wed May 9 18:39:31 2018 (r333423) @@ -35,32 +35,32 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_firmware_version_major = 5; unsigned int ql83xx_firmware_version_minor = 4; -unsigned int ql83xx_firmware_version_sub = 66; +unsigned int ql83xx_firmware_version_sub = 67; unsigned char ql83xx_firmware[] = { - 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe8, 0x46, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x64, 0x27, 0xbc, 0x1f, 0xfc, 0x30, 0xf6, 0x92, + 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xa8, 0x49, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xba, 0x8f, 0x63, 0x84, 0x2f, 0x5a, 0x19, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0xf2, 0x03, 0x00, + 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xf3, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x52, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x56, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0xfc, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xf7, 0x90, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x54, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xa1, 0x4e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0xfd, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xa0, 0x91, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x58, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xa3, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xab, 0x8d, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x74, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x65, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7e, 0x8f, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x76, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
svn commit: r333432 - stable/9/sys/dev/bxe
Author: davidcs Date: Wed May 9 20:22:09 2018 New Revision: 333432 URL: https://svnweb.freebsd.org/changeset/base/333432 Log: MFC r333004 Fix Issue with adding MUltiCast Addresses. When multicast addresses are added/deleted, the delete the multicast addresses previously programmed in HW and reprogram the new set of multicast addresses. Submitted by:vaishali.kulka...@cavium.com Modified: stable/9/sys/dev/bxe/bxe.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Wed May 9 20:18:23 2018(r333431) +++ stable/9/sys/dev/bxe/bxe.c Wed May 9 20:22:09 2018(r333432) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.90" +#define BXE_DRIVER_VERSION "1.78.91" #include "bxe.h" #include "ecore_sp.h" @@ -12041,11 +12041,10 @@ bxe_init_mcast_macs_list(struct bxe_softc ECORE_LIST_PUSH_TAIL(_mac->link, >mcast_list); BLOGD(sc, DBG_LOAD, - "Setting MCAST %02X:%02X:%02X:%02X:%02X:%02X\n", + "Setting MCAST %02X:%02X:%02X:%02X:%02X:%02X and mc_count %d\n", mc_mac->mac[0], mc_mac->mac[1], mc_mac->mac[2], - mc_mac->mac[3], mc_mac->mac[4], mc_mac->mac[5]); - -mc_mac++; + mc_mac->mac[3], mc_mac->mac[4], mc_mac->mac[5], mc_count); + mc_mac++; } p->mcast_list_len = mc_count; @@ -12053,6 +12052,7 @@ bxe_init_mcast_macs_list(struct bxe_softc return (0); } + static void bxe_free_mcast_macs_list(struct ecore_mcast_ramrod_params *p) { @@ -12081,6 +12081,7 @@ bxe_set_mc_list(struct bxe_softc *sc) rc = ecore_config_mcast(sc, , ECORE_MCAST_CMD_DEL); if (rc < 0) { BLOGE(sc, "Failed to clear multicast configuration: %d\n", rc); +/* Manual backport parts of FreeBSD upstream r284470. */ BXE_MCAST_UNLOCK(sc); return (rc); } ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r324765 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Thu Oct 19 17:40:51 2017 New Revision: 324765 URL: https://svnweb.freebsd.org/changeset/base/324765 Log: MFC r324535 Add sanity checks in ql_hw_send() qla_send() to ensure that empty slots in Tx Ring map to empty slot in Tx_buf array before Transmits. If the checks fail further Transmission on that Tx Ring is prevented. Modified: stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_os.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Thu Oct 19 17:37:33 2017 (r324764) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Thu Oct 19 17:40:51 2017 (r324765) @@ -2374,6 +2374,20 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, in } } + for (i = 0; i < num_tx_cmds; i++) { + int j; + + j = (tx_idx+i) & (NUM_TX_DESCRIPTORS - 1); + + if (NULL != ha->tx_ring[txr_idx].tx_buf[j].m_head) { + QL_ASSERT(ha, 0, \ + ("%s [%d]: txr_idx = %d tx_idx = %d mbuf = %p\n",\ + __func__, __LINE__, txr_idx, j,\ + ha->tx_ring[txr_idx].tx_buf[j].m_head)); + return (EINVAL); + } + } + tx_cmd = >tx_cntxt[txr_idx].tx_ring_base[tx_idx]; if (!(mp->m_pkthdr.csum_flags & CSUM_TSO)) { Modified: stable/9/sys/dev/qlxgbe/ql_os.c == --- stable/9/sys/dev/qlxgbe/ql_os.c Thu Oct 19 17:37:33 2017 (r324764) +++ stable/9/sys/dev/qlxgbe/ql_os.c Thu Oct 19 17:40:51 2017 (r324765) @@ -1253,6 +1253,17 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next; + + if (NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) { + QL_ASSERT(ha, 0, ("%s [%d]: txr_idx = %d tx_idx = %d "\ + "mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx,\ + ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head)); + if (m_head) + m_freem(m_head); + *m_headp = NULL; + return (ret); + } + map = ha->tx_ring[txr_idx].tx_buf[tx_idx].map; ret = bus_dmamap_load_mbuf_sg(ha->tx_tag, map, m_head, segs, , ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r337512 - stable/9/sys/dev/bxe
Author: davidcs Date: Thu Aug 9 00:52:38 2018 New Revision: 337512 URL: https://svnweb.freebsd.org/changeset/base/337512 Log: MFC r336438 Fixes for the following issues: 1. Fix taskqueues drain/free to fix panic seen when interface is being bought down and in parallel asynchronous link events happening. 2. Fix bxe_ifmedia_status() Submitted by:vaishali.kulka...@cavium.com and anand.kh...@cavium.com Modified: stable/9/sys/dev/bxe/bxe.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Thu Aug 9 00:48:55 2018(r337511) +++ stable/9/sys/dev/bxe/bxe.c Thu Aug 9 00:52:38 2018(r337512) @@ -4398,6 +4398,8 @@ bxe_nic_unload(struct bxe_softc *sc, BLOGD(sc, DBG_LOAD, "Ended NIC unload\n"); +bxe_link_report(sc); + return (0); } @@ -4443,30 +4445,39 @@ bxe_ifmedia_status(struct ifnet *ifp, struct ifmediare { struct bxe_softc *sc = ifp->if_softc; +/* Bug 165447: the 'ifconfig' tool skips printing of the "status: ..." + line if the IFM_AVALID flag is *NOT* set. So we need to set this + flag unconditionally (irrespective of the admininistrative + 'up/down' state of the interface) to ensure that that line is always + displayed. +*/ +ifmr->ifm_status = IFM_AVALID; + +/* Setup the default interface info. */ +ifmr->ifm_active = IFM_ETHER; + /* Report link down if the driver isn't running. */ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { ifmr->ifm_active |= IFM_NONE; +BLOGD(sc, DBG_PHY, "in %s : nic still not loaded fully\n", __func__); +BLOGD(sc, DBG_PHY, "in %s : link_up (1) : %d\n", +__func__, sc->link_vars.link_up); return; } -/* Setup the default interface info. */ -ifmr->ifm_status = IFM_AVALID; -ifmr->ifm_active = IFM_ETHER; if (sc->link_vars.link_up) { ifmr->ifm_status |= IFM_ACTIVE; +ifmr->ifm_active |= IFM_FDX; } else { ifmr->ifm_active |= IFM_NONE; +BLOGD(sc, DBG_PHY, "in %s : setting IFM_NONE\n", +__func__); return; } ifmr->ifm_active |= sc->media; - -if (sc->link_vars.duplex == DUPLEX_FULL) { -ifmr->ifm_active |= IFM_FDX; -} else { -ifmr->ifm_active |= IFM_HDX; -} +return; } static void @@ -7043,7 +7054,7 @@ bxe_link_attn(struct bxe_softc *sc) /* Make sure that we are synced with the current statistics */ bxe_stats_handle(sc, STATS_EVENT_STOP); - BLOGI(sc, "link_vars phy_flags : %x\n", sc->link_vars.phy_flags); +BLOGD(sc, DBG_LOAD, "link_vars phy_flags : %x\n", sc->link_vars.phy_flags); elink_link_update(>link_params, >link_vars); if (sc->link_vars.link_up) { @@ -9132,11 +9143,16 @@ bxe_interrupt_detach(struct bxe_softc *sc) while (taskqueue_cancel_timeout(fp->tq, >tx_timeout_task, NULL)) taskqueue_drain_timeout(fp->tq, >tx_timeout_task); -taskqueue_free(fp->tq); -fp->tq = NULL; } -} +for (i = 0; i < sc->num_queues; i++) { +fp = >fp[i]; +if (fp->tq != NULL) { +taskqueue_free(fp->tq); +fp->tq = NULL; +} +} +} if (sc->sp_tq) { taskqueue_drain(sc->sp_tq, >sp_tq_task); ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r330557 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Tue Mar 6 23:28:12 2018 New Revision: 330557 URL: https://svnweb.freebsd.org/changeset/base/330557 Log: MFC r329855 1. Added support to offline a port if is error recovery on successful. 2. Sysctls to enable/disable driver_state_dump and error_recovery. 3. Sysctl to control the delay between hw/fw reinitialization and restarting the fastpath. 4. Stop periodic stats retrieval if interface has IFF_DRV_RUNNING flag off. 5. Print contents of PEG_HALT_STATUS1 and PEG_HALT_STATUS2 on heartbeat failure. 6. Speed up slowpath shutdown during error recovery. 7. link_state update using atomic_store. 8. Added timestamp information on driver state and minidump captures. 9. Added support for Slowpath event logging 10.Added additional failure injection types to simulate failures. Modified: stable/9/sys/dev/qlxgbe/ql_dbg.h stable/9/sys/dev/qlxgbe/ql_def.h stable/9/sys/dev/qlxgbe/ql_glbl.h stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_hw.h stable/9/sys/dev/qlxgbe/ql_inline.h stable/9/sys/dev/qlxgbe/ql_ioctl.c stable/9/sys/dev/qlxgbe/ql_ioctl.h 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/dev/qlxgbe/ql_os.h stable/9/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_dbg.h == --- stable/9/sys/dev/qlxgbe/ql_dbg.hTue Mar 6 23:17:56 2018 (r330556) +++ stable/9/sys/dev/qlxgbe/ql_dbg.hTue Mar 6 23:28:12 2018 (r330557) @@ -42,17 +42,21 @@ extern void ql_dump_buf16(qla_host_t *ha, const char * extern void ql_dump_buf32(qla_host_t *ha, const char *str, void *dbuf, uint32_t len32); -#define INJCT_RX_RXB_INVAL 0x1 -#define INJCT_RX_MP_NULL 0x2 -#define INJCT_LRO_RXB_INVAL0x3 -#define INJCT_LRO_MP_NULL 0x4 -#define INJCT_NUM_HNDLE_INVALID0x5 -#define INJCT_RDWR_INDREG_FAILURE 0x6 -#define INJCT_RDWR_OFFCHIPMEM_FAILURE 0x7 -#define INJCT_MBX_CMD_FAILURE 0x8 -#define INJCT_HEARTBEAT_FAILURE0x9 -#define INJCT_TEMPERATURE_FAILURE 0xA -#define INJCT_M_GETCL_M_GETJCL_FAILURE 0xB +#define INJCT_RX_RXB_INVAL 0x1 +#define INJCT_RX_MP_NULL 0x2 +#define INJCT_LRO_RXB_INVAL0x3 +#define INJCT_LRO_MP_NULL 0x4 +#define INJCT_NUM_HNDLE_INVALID0x5 +#define INJCT_RDWR_INDREG_FAILURE 0x6 +#define INJCT_RDWR_OFFCHIPMEM_FAILURE 0x7 +#define INJCT_MBX_CMD_FAILURE 0x8 +#define INJCT_HEARTBEAT_FAILURE0x9 +#define INJCT_TEMPERATURE_FAILURE 0xA +#define INJCT_M_GETCL_M_GETJCL_FAILURE 0xB +#define INJCT_INV_CONT_OPCODE 0xC +#define INJCT_SGL_RCV_INV_DESC_COUNT 0xD +#define INJCT_SGL_LRO_INV_DESC_COUNT 0xE +#define INJCT_PEER_PORT_FAILURE_ERR_RECOVERY 0xF #ifdef QL_DBG Modified: stable/9/sys/dev/qlxgbe/ql_def.h == --- stable/9/sys/dev/qlxgbe/ql_def.hTue Mar 6 23:17:56 2018 (r330556) +++ stable/9/sys/dev/qlxgbe/ql_def.hTue Mar 6 23:28:12 2018 (r330557) @@ -144,12 +144,12 @@ struct qla_host { volatile uint32_t qla_watchdog_paused; volatile uint32_t qla_initiate_recovery; volatile uint32_t qla_detach_active; + volatile uint32_t offline; device_tpci_dev; - uint16_twatchdog_ticks; + volatile uint16_t watchdog_ticks; uint8_t pci_func; - uint8_t resvd; /* ioctl related */ struct cdev *ioctl_dev; @@ -182,6 +182,7 @@ struct qla_host { /* hardware access lock */ + struct mtx sp_log_lock; struct mtx hw_lock; volatile uint32_t hw_lock_held; uint64_thw_lock_failed; @@ -239,6 +240,9 @@ struct qla_host { volatile const char *qla_unlock; uint32_tdbg_level; uint32_tenable_minidump; + uint32_tenable_driverstate_dump; + uint32_tenable_error_recovery; + uint32_tms_delay_after_init; uint8_t fw_ver_str[32]; @@ -272,5 +276,7 @@ typedef struct qla_host qla_host_t; #define QL_MAC_CMP(mac1, mac2)\
svn commit: r332054 - stable/9/sys/dev/qlxgbe
Author: davidcs Date: Thu Apr 5 00:03:38 2018 New Revision: 332054 URL: https://svnweb.freebsd.org/changeset/base/332054 Log: MFC r331739 1. Add additional debug prints. 2. Break transmit when IFF_DRV_RUNNING is OFF. 3. set desc_count=0 for default case in switch in ql_rcv_isr() Modified: stable/9/sys/dev/qlxgbe/ql_dbg.h stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_ioctl.c stable/9/sys/dev/qlxgbe/ql_isr.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_dbg.h == --- stable/9/sys/dev/qlxgbe/ql_dbg.hWed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_dbg.hThu Apr 5 00:03:38 2018 (r332054) @@ -57,6 +57,7 @@ extern void ql_dump_buf32(qla_host_t *ha, const char * #define INJCT_SGL_RCV_INV_DESC_COUNT 0xD #define INJCT_SGL_LRO_INV_DESC_COUNT 0xE #define INJCT_PEER_PORT_FAILURE_ERR_RECOVERY 0xF +#define INJCT_TXBUF_MBUF_NON_NULL 0x00010 #ifdef QL_DBG Modified: stable/9/sys/dev/qlxgbe/ql_hw.c == --- stable/9/sys/dev/qlxgbe/ql_hw.c Wed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Thu Apr 5 00:03:38 2018 (r332054) @@ -1088,7 +1088,11 @@ ql_hw_add_sysctls(qla_host_t *ha) "\t\t\t 8: mbx: mailbox command failure\n" "\t\t\t 9: heartbeat failure\n" "\t\t\t A: temperature failure\n" - "\t\t\t 11: m_getcl or m_getjcl failure\n" ); + "\t\t\t 11: m_getcl or m_getjcl failure\n" + "\t\t\t 13: Invalid Descriptor Count in SGL Receive\n" + "\t\t\t 14: Invalid Descriptor Count in LRO Receive\n" + "\t\t\t 15: peer port error recovery failure\n" + "\t\t\t 16: tx_buf[next_prod_index].mbuf != NULL\n" ); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -2904,7 +2908,7 @@ ql_del_hw_if_exit: void qla_confirm_9kb_enable(qla_host_t *ha) { - uint32_t supports_9kb = 0; +// uint32_t supports_9kb = 0; ha->hw.mbx_intr_mask_offset = READ_REG32(ha, Q8_MBOX_INT_MASK_MSIX); @@ -2912,10 +2916,12 @@ qla_confirm_9kb_enable(qla_host_t *ha) WRITE_REG32(ha, Q8_MBOX_INT_ENABLE, BIT_2); WRITE_REG32(ha, ha->hw.mbx_intr_mask_offset, 0x0); +#if 0 qla_get_nic_partition(ha, _9kb, NULL); if (!supports_9kb) - ha->hw.enable_9kb = 0; +#endif + ha->hw.enable_9kb = 0; return; } @@ -3587,6 +3593,13 @@ qla_hw_all_mcast(qla_host_t *ha, uint32_t add_mcast) bcopy(ha->hw.mcast[i].addr, mcast, ETHER_ADDR_LEN); mcast = mcast + ETHER_ADDR_LEN; count++; + + device_printf(ha->pci_dev, + "%s: %x:%x:%x:%x:%x:%x \n", + __func__, ha->hw.mcast[i].addr[0], + ha->hw.mcast[i].addr[1], ha->hw.mcast[i].addr[2], + ha->hw.mcast[i].addr[3], ha->hw.mcast[i].addr[4], + ha->hw.mcast[i].addr[5]); if (count == Q8_MAX_MAC_ADDRS) { if (qla_config_mac_addr(ha, ha->hw.mac_addr_arr, @@ -3823,6 +3836,18 @@ ql_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx) } hw_tx_cntxt->txr_free += comp_count; + + if (hw_tx_cntxt->txr_free > NUM_TX_DESCRIPTORS) + device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d txr_free = %d" + "txr_next = %d txr_comp = %d\n", __func__, __LINE__, + txr_idx, hw_tx_cntxt->txr_free, + hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp); + + QL_ASSERT(ha, (hw_tx_cntxt->txr_free <= NUM_TX_DESCRIPTORS), \ + ("%s [%d]: txr_idx = %d txr_free = %d txr_next = %d txr_comp = %d\n",\ + __func__, __LINE__, txr_idx, hw_tx_cntxt->txr_free, \ + hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp)); + return; } @@ -3959,7 +3984,9 @@ qla_init_nic_func(qla_host_t *ha) if (err) { device_printf(dev, "%s: failed [0x%08x]\n", __func__, err); -} +} else { +device_printf(dev, "%s: successful\n", __func__); + } return 0; } Modified: stable/9/sys/dev/qlxgbe/ql_ioctl.c == --- stable/9/sys/dev/qlxgbe/ql_ioctl.c Wed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_ioctl.c
svn commit: r339885 - stable/9/sys/dev/bxe
Author: davidcs Date: Mon Oct 29 21:36:10 2018 New Revision: 339885 URL: https://svnweb.freebsd.org/changeset/base/339885 Log: MFC r338734 Fixed isses: State check before enqueuing transmit task in bxe_link_attn() routine. State check before invoking bxe_nic_unload in bxe_shutdown(). Submitted by:vaishali.kulka...@cavium.com Modified: stable/9/sys/dev/bxe/bxe.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Mon Oct 29 21:31:23 2018(r339884) +++ stable/9/sys/dev/bxe/bxe.c Mon Oct 29 21:36:10 2018(r339885) @@ -7081,13 +7081,13 @@ bxe_link_attn(struct bxe_softc *sc) if (sc->state == BXE_STATE_OPEN) { bxe_stats_handle(sc, STATS_EVENT_LINK_UP); + /* Restart tx when the link comes back. */ + FOR_EACH_ETH_QUEUE(sc, i) { + fp = >fp[i]; + taskqueue_enqueue(fp->tq, >tx_task); + } } - /* Restart tx when the link comes back. */ -FOR_EACH_ETH_QUEUE(sc, i) { -fp = >fp[i]; -taskqueue_enqueue(fp->tq, >tx_task); - } } if (sc->link_vars.link_up && sc->link_vars.line_speed) { @@ -16284,9 +16284,11 @@ bxe_shutdown(device_t dev) /* stop the periodic callout */ bxe_periodic_stop(sc); -BXE_CORE_LOCK(sc); -bxe_nic_unload(sc, UNLOAD_NORMAL, FALSE); -BXE_CORE_UNLOCK(sc); +if (sc->state != BXE_STATE_CLOSED) { + BXE_CORE_LOCK(sc); + bxe_nic_unload(sc, UNLOAD_NORMAL, FALSE); + BXE_CORE_UNLOCK(sc); +} return (0); } ___ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"
svn commit: r339887 - stable/9/sys/dev/bxe
Author: davidcs Date: Mon Oct 29 21:46:12 2018 New Revision: 339887 URL: https://svnweb.freebsd.org/changeset/base/339887 Log: MFC r339366 Add support for Error Recovery Submitted by:vaishali.kulka...@cavium.com Modified: stable/9/sys/dev/bxe/bxe.c stable/9/sys/dev/bxe/bxe.h stable/9/sys/dev/bxe/bxe_stats.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/bxe/bxe.c == --- stable/9/sys/dev/bxe/bxe.c Mon Oct 29 21:46:05 2018(r339886) +++ stable/9/sys/dev/bxe/bxe.c Mon Oct 29 21:46:12 2018(r339887) @@ -188,6 +188,7 @@ static int bxe_attach(device_t); static int bxe_detach(device_t); static int bxe_shutdown(device_t); + /* * FreeBSD KLD module/device interface event handler method. */ @@ -700,6 +701,9 @@ static voidbxe_interrupt_detach(struct bxe_softc * static voidbxe_set_rx_mode(struct bxe_softc *sc); static int bxe_init_locked(struct bxe_softc *sc); static int bxe_stop_locked(struct bxe_softc *sc); +static voidbxe_sp_err_timeout_task(void *arg, int pending); +void bxe_parity_recover(struct bxe_softc *sc); +void bxe_handle_error(struct bxe_softc *sc); static __noinline int bxe_nic_load(struct bxe_softc *sc, int load_mode); static __noinline int bxe_nic_unload(struct bxe_softc *sc, @@ -3488,16 +3492,12 @@ bxe_watchdog(struct bxe_softc*sc, } BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index); -if(sc->trigger_grcdump) { - /* taking grcdump */ - bxe_grc_dump(sc); -} BXE_FP_TX_UNLOCK(fp); +BXE_SET_ERROR_BIT(sc, BXE_ERR_TXQ_STUCK); +taskqueue_enqueue_timeout(taskqueue_thread, +>sp_err_timeout_task, hz/10); -atomic_store_rel_long(>chip_tq_flags, CHIP_TQ_REINIT); -taskqueue_enqueue(sc->chip_tq, >chip_tq_task); - return (-1); } @@ -4252,6 +4252,7 @@ bxe_nic_unload(struct bxe_softc *sc, struct bxe_fastpath *fp; fp = >fp[i]; + fp->watchdog_timer = 0; BXE_FP_TX_LOCK(fp); BXE_FP_TX_UNLOCK(fp); } @@ -4267,20 +4268,22 @@ bxe_nic_unload(struct bxe_softc *sc, if (IS_PF(sc) && sc->recovery_state != BXE_RECOVERY_DONE && (sc->state == BXE_STATE_CLOSED || sc->state == BXE_STATE_ERROR)) { -/* - * We can get here if the driver has been unloaded - * during parity error recovery and is either waiting for a - * leader to complete or for other functions to unload and - * then ifconfig down has been issued. In this case we want to - * unload and let other functions to complete a recovery - * process. - */ -sc->recovery_state = BXE_RECOVERY_DONE; -sc->is_leader = 0; -bxe_release_leader_lock(sc); -mb(); -BLOGD(sc, DBG_LOAD, "Releasing a leadership...\n"); + if(CHIP_PORT_MODE(sc) == CHIP_4_PORT_MODE) { +/* + * We can get here if the driver has been unloaded + * during parity error recovery and is either waiting for a + * leader to complete or for other functions to unload and + * then ifconfig down has been issued. In this case we want to + * unload and let other functions to complete a recovery + * process. + */ +sc->recovery_state = BXE_RECOVERY_DONE; +sc->is_leader = 0; +bxe_release_leader_lock(sc); +mb(); +BLOGD(sc, DBG_LOAD, "Releasing a leadership...\n"); + } BLOGE(sc, "Can't unload in closed or error state recover_state 0x%x" " state = 0x%x\n", sc->recovery_state, sc->state); return (-1); @@ -7575,6 +7578,10 @@ bxe_parity_attn(struct bxe_softc *sc, if (print) BLOGI(sc, "\n"); + if( *global == TRUE ) { +BXE_SET_ERROR_BIT(sc, BXE_ERR_GLOBAL); +} + return (TRUE); } @@ -7589,6 +7596,9 @@ bxe_chk_parity_attn(struct bxe_softc *sc, struct attn_route attn = { {0} }; int port = SC_PORT(sc); +if(sc->state != BXE_STATE_OPEN) +return FALSE; + attn.sig[0] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_1_FUNC_0 + port*4); attn.sig[1] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_2_FUNC_0 + port*4); attn.sig[2] = REG_RD(sc, MISC_REG_AEU_AFTER_INVERT_3_FUNC_0 + port*4); @@ -7615,10 +7625,12 @@ bxe_attn_int_deasserted4(struct bxe_softc *sc, uint32_t attn) { uint32_t val; +boolean_t err_flg = FALSE; if (attn & AEU_INPUTS_ATTN_BITS_PGLUE_HW_INTERRUPT) { val = REG_RD(sc, PGLUE_B_REG_PGLUE_B_INT_STS_CLR); BLOGE(sc, "PGLUE hw attention 0x%08x\n", val); +err_flg = TRUE; if (val & PGLUE_B_PGLUE_B_INT_STS_REG_ADDRESS_ERROR)