svn commit: r343598 - in head/sys: dev/qlnx/qlnxe dev/qlnx/qlnxr modules/qlnx modules/qlnx/qlnxe modules/qlnx/qlnxr
Author: davidcs Date: Thu Jan 31 00:09:38 2019 New Revision: 343598 URL: https://svnweb.freebsd.org/changeset/base/343598 Log: Add RDMA (iWARP and RoCEv1) support David Somayajulu (davidcs): Overall RDMA Driver infrastructure and iWARP Anand Khoje (akh...@marvell.com): RoCEv1 verbs implementation MFC after:5 days Added: head/sys/dev/qlnx/qlnxe/ecore_iwarp.c (contents, props changed) head/sys/dev/qlnx/qlnxe/ecore_ll2.c (contents, props changed) head/sys/dev/qlnx/qlnxe/ecore_ooo.c (contents, props changed) head/sys/dev/qlnx/qlnxe/ecore_rdma.c (contents, props changed) head/sys/dev/qlnx/qlnxe/ecore_roce.c (contents, props changed) head/sys/dev/qlnx/qlnxe/qlnx_rdma.c (contents, props changed) head/sys/dev/qlnx/qlnxe/qlnx_rdma.h (contents, props changed) head/sys/dev/qlnx/qlnxr/ head/sys/dev/qlnx/qlnxr/qlnxr_cm.c (contents, props changed) head/sys/dev/qlnx/qlnxr/qlnxr_cm.h (contents, props changed) head/sys/dev/qlnx/qlnxr/qlnxr_def.h (contents, props changed) head/sys/dev/qlnx/qlnxr/qlnxr_os.c (contents, props changed) head/sys/dev/qlnx/qlnxr/qlnxr_roce.h (contents, props changed) head/sys/dev/qlnx/qlnxr/qlnxr_user.h (contents, props changed) head/sys/dev/qlnx/qlnxr/qlnxr_verbs.c (contents, props changed) head/sys/dev/qlnx/qlnxr/qlnxr_verbs.h (contents, props changed) head/sys/modules/qlnx/qlnxr/ head/sys/modules/qlnx/qlnxr/Makefile (contents, props changed) Modified: head/sys/modules/qlnx/Makefile head/sys/modules/qlnx/qlnxe/Makefile Added: head/sys/dev/qlnx/qlnxe/ecore_iwarp.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/qlnx/qlnxe/ecore_iwarp.c Thu Jan 31 00:09:38 2019 (r343598) @@ -0,0 +1,3970 @@ +/* + * Copyright (c) 2018-2019 Cavium, Inc. + * 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 : ecore_iwarp.c + */ +#include +__FBSDID("$FreeBSD$"); + +#include "bcm_osal.h" +#include "ecore.h" +#include "ecore_status.h" +#include "ecore_sp_commands.h" +#include "ecore_cxt.h" +#include "ecore_rdma.h" +#include "reg_addr.h" +#include "ecore_hw.h" +#include "ecore_hsi_iwarp.h" +#include "ecore_ll2.h" +#include "ecore_ooo.h" +#ifndef LINUX_REMOVE +#include "ecore_tcp_ip.h" +#endif + +#ifdef _NTDDK_ +#pragma warning(push) +#pragma warning(disable : 28123) +#pragma warning(disable : 28167) +#endif + +/* Default values used for MPA Rev 1 */ +#define ECORE_IWARP_ORD_DEFAULT 32 +#define ECORE_IWARP_IRD_DEFAULT 32 + +#define ECORE_IWARP_MAX_FW_MSS 4120 + +struct mpa_v2_hdr { + __be16 ird; + __be16 ord; +}; + +#define MPA_V2_PEER2PEER_MODEL 0x8000 +#define MPA_V2_SEND_RTR0x4000 /* on ird */ +#define MPA_V2_READ_RTR0x4000 /* on ord */ +#define MPA_V2_WRITE_RTR 0x8000 +#define MPA_V2_IRD_ORD_MASK0x3FFF + +#define MPA_REV2(_mpa_rev) (_mpa_rev == MPA_NEGOTIATION_TYPE_ENHANCED) + +#define ECORE_IWARP_INVALID_TCP_CID 0x +/* How many times fin will be sent before FW aborts and send RST */ +#define ECORE_IWARP_MAX_FIN_RT_DEFAULT 2 +#define ECORE_IWARP_RCV_WND_SIZE_MIN (0x) +/* INTERNAL: These numbers are derived from BRB buffer sizes to obtain optimal performance */ +#define ECORE_IWARP_RCV_WND_SIZE_BB_DEF_2_PORTS (200*1024) +#define ECORE_IWARP_RCV_WND_SIZE_BB_DEF_4_PORTS (100*1024) +#define ECORE_IWARP_RCV_WND_SIZE_AH_DEF_2_PORTS (150*1024) +#define ECORE_IWARP_RCV_WND_SIZE_AH_DEF_4_PORTS (90*1024) +#define ECORE_IWARP_MAX_WND_SCALE(14) +/* Timestamp header is the length of the timestamp option (10): + * kind:8 bit, length
svn commit: r339366 - head/sys/dev/bxe
Author: davidcs Date: Mon Oct 15 18:39:33 2018 New Revision: 339366 URL: https://svnweb.freebsd.org/changeset/base/339366 Log: Add support for Error Recovery Submitted by:vaishali.kulka...@cavium.com Approved by:re(kib) MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Mon Oct 15 18:28:34 2018(r339365) +++ head/sys/dev/bxe/bxe.c Mon Oct 15 18:39:33 2018(r339366) @@ -202,6 +202,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. */ @@ -705,6 +706,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, @@ -3486,16 +3490,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, +&sc->sp_err_timeout_task, hz/10); -atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); -taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); - return (-1); } @@ -4250,6 +4250,7 @@ bxe_nic_unload(struct bxe_softc *sc, struct bxe_fastpath *fp; fp = &sc->fp[i]; + fp->watchdog_timer = 0; BXE_FP_TX_LOCK(fp); BXE_FP_TX_UNLOCK(fp); } @@ -4265,20 +4266,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); @@ -7570,6 +7573,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); } @@ -7584,6 +7591,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); @@ -7610,10 +7620,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) BLOGE(sc, "PGLUE_B_PGLUE_B_INT_STS_REG_ADDRESS_ERROR\n");
svn commit: r338734 - head/sys/dev/bxe
Author: davidcs Date: Mon Sep 17 20:15:18 2018 New Revision: 338734 URL: https://svnweb.freebsd.org/changeset/base/338734 Log: 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 Approved by:re(gjb) Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Mon Sep 17 19:38:43 2018(r338733) +++ head/sys/dev/bxe/bxe.c Mon Sep 17 20:15:18 2018(r338734) @@ -7076,13 +7076,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 = &sc->fp[i]; + taskqueue_enqueue(fp->tq, &fp->tx_task); + } } - /* Restart tx when the link comes back. */ -FOR_EACH_ETH_QUEUE(sc, i) { -fp = &sc->fp[i]; -taskqueue_enqueue(fp->tq, &fp->tx_task); - } } if (sc->link_vars.link_up && sc->link_vars.line_speed) { @@ -16279,9 +16279,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-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r336695 - in head/sys: dev/qlnx/qlnxe modules/qlnx modules/qlnx/qlnxe modules/qlnx/qlnxev
Author: davidcs Date: Wed Jul 25 02:36:55 2018 New Revision: 336695 URL: https://svnweb.freebsd.org/changeset/base/336695 Log: Remove support for QLNX_RCV_IN_TASKQ - i.e., Rx only in TaskQ. Added support for LLDP passthru Upgrade ECORE to version 8.33.5.0 Upgrade STORMFW to version 8.33.7.0 Added support for SRIOV MFC after:5 days Added: head/sys/dev/qlnx/qlnxe/ecore_iwarp.h (contents, props changed) head/sys/dev/qlnx/qlnxe/ecore_mng_tlv.c (contents, props changed) head/sys/dev/qlnx/qlnxe/ecore_rdma.h (contents, props changed) head/sys/dev/qlnx/qlnxe/ecore_rdma_api.h (contents, props changed) head/sys/dev/qlnx/qlnxe/ecore_sriov.c (contents, props changed) head/sys/dev/qlnx/qlnxe/ecore_tcp_ip.h (contents, props changed) head/sys/dev/qlnx/qlnxe/ecore_vf.c (contents, props changed) head/sys/modules/qlnx/qlnxev/ head/sys/modules/qlnx/qlnxev/Makefile (contents, props changed) Modified: head/sys/dev/qlnx/qlnxe/bcm_osal.h head/sys/dev/qlnx/qlnxe/common_hsi.h head/sys/dev/qlnx/qlnxe/ecore.h head/sys/dev/qlnx/qlnxe/ecore_chain.h head/sys/dev/qlnx/qlnxe/ecore_cxt.c head/sys/dev/qlnx/qlnxe/ecore_cxt.h head/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c head/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.h head/sys/dev/qlnx/qlnxe/ecore_dbg_values.h head/sys/dev/qlnx/qlnxe/ecore_dcbx.c head/sys/dev/qlnx/qlnxe/ecore_dcbx.h head/sys/dev/qlnx/qlnxe/ecore_dcbx_api.h head/sys/dev/qlnx/qlnxe/ecore_dev.c head/sys/dev/qlnx/qlnxe/ecore_dev_api.h head/sys/dev/qlnx/qlnxe/ecore_fcoe.h head/sys/dev/qlnx/qlnxe/ecore_fcoe_api.h head/sys/dev/qlnx/qlnxe/ecore_hsi_common.h head/sys/dev/qlnx/qlnxe/ecore_hsi_debug_tools.h head/sys/dev/qlnx/qlnxe/ecore_hsi_eth.h head/sys/dev/qlnx/qlnxe/ecore_hsi_fcoe.h head/sys/dev/qlnx/qlnxe/ecore_hsi_init_func.h head/sys/dev/qlnx/qlnxe/ecore_hsi_init_tool.h head/sys/dev/qlnx/qlnxe/ecore_hsi_iscsi.h head/sys/dev/qlnx/qlnxe/ecore_hsi_iwarp.h head/sys/dev/qlnx/qlnxe/ecore_hsi_rdma.h head/sys/dev/qlnx/qlnxe/ecore_hsi_roce.h head/sys/dev/qlnx/qlnxe/ecore_hw.c head/sys/dev/qlnx/qlnxe/ecore_hw.h head/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.c head/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.h head/sys/dev/qlnx/qlnxe/ecore_init_ops.c head/sys/dev/qlnx/qlnxe/ecore_init_values.h head/sys/dev/qlnx/qlnxe/ecore_int.c head/sys/dev/qlnx/qlnxe/ecore_int.h head/sys/dev/qlnx/qlnxe/ecore_int_api.h head/sys/dev/qlnx/qlnxe/ecore_iov_api.h head/sys/dev/qlnx/qlnxe/ecore_iro.h head/sys/dev/qlnx/qlnxe/ecore_iro_values.h head/sys/dev/qlnx/qlnxe/ecore_iscsi.h head/sys/dev/qlnx/qlnxe/ecore_iscsi_api.h head/sys/dev/qlnx/qlnxe/ecore_l2.c head/sys/dev/qlnx/qlnxe/ecore_l2.h head/sys/dev/qlnx/qlnxe/ecore_l2_api.h head/sys/dev/qlnx/qlnxe/ecore_ll2.h head/sys/dev/qlnx/qlnxe/ecore_ll2_api.h head/sys/dev/qlnx/qlnxe/ecore_mcp.c head/sys/dev/qlnx/qlnxe/ecore_mcp.h head/sys/dev/qlnx/qlnxe/ecore_mcp_api.h head/sys/dev/qlnx/qlnxe/ecore_ooo.h head/sys/dev/qlnx/qlnxe/ecore_proto_if.h head/sys/dev/qlnx/qlnxe/ecore_roce.h head/sys/dev/qlnx/qlnxe/ecore_roce_api.h head/sys/dev/qlnx/qlnxe/ecore_rt_defs.h head/sys/dev/qlnx/qlnxe/ecore_sp_commands.c head/sys/dev/qlnx/qlnxe/ecore_sp_commands.h head/sys/dev/qlnx/qlnxe/ecore_spq.c head/sys/dev/qlnx/qlnxe/ecore_spq.h head/sys/dev/qlnx/qlnxe/ecore_sriov.h head/sys/dev/qlnx/qlnxe/ecore_utils.h head/sys/dev/qlnx/qlnxe/ecore_vf.h head/sys/dev/qlnx/qlnxe/ecore_vf_api.h head/sys/dev/qlnx/qlnxe/ecore_vfpf_if.h head/sys/dev/qlnx/qlnxe/eth_common.h head/sys/dev/qlnx/qlnxe/fcoe_common.h head/sys/dev/qlnx/qlnxe/iscsi_common.h head/sys/dev/qlnx/qlnxe/mcp_private.h head/sys/dev/qlnx/qlnxe/mcp_public.h head/sys/dev/qlnx/qlnxe/nvm_cfg.h head/sys/dev/qlnx/qlnxe/nvm_map.h head/sys/dev/qlnx/qlnxe/qlnx_def.h head/sys/dev/qlnx/qlnxe/qlnx_ioctl.c head/sys/dev/qlnx/qlnxe/qlnx_ioctl.h head/sys/dev/qlnx/qlnxe/qlnx_os.c head/sys/dev/qlnx/qlnxe/qlnx_os.h head/sys/dev/qlnx/qlnxe/qlnx_ver.h head/sys/dev/qlnx/qlnxe/rdma_common.h head/sys/dev/qlnx/qlnxe/reg_addr.h head/sys/dev/qlnx/qlnxe/roce_common.h head/sys/dev/qlnx/qlnxe/spad_layout.h head/sys/dev/qlnx/qlnxe/storage_common.h head/sys/dev/qlnx/qlnxe/tcp_common.h head/sys/modules/qlnx/Makefile head/sys/modules/qlnx/qlnxe/Makefile Modified: head/sys/dev/qlnx/qlnxe/bcm_osal.h == --- head/sys/dev/qlnx/qlnxe/bcm_osal.h Wed Jul 25 01:04:50 2018 (r336694) +++ head/sys/dev/qlnx/qlnxe/bcm_osal.h Wed Jul 25 02:36:55 2018 (r336695) @@ -34,7 +34,7 @@ #include "ecore_status.h" #include -#if __FreeBSD_version >= 120 +#if __FreeBSD_version >= 1200032 #include #else #if __FreeBSD_version >= 1100090 @@ -62,6 +62,7 @@ extern void qlnx_pci_write_config_word(void *ecore_dev extern void qlnx_pci_write_config_dword(void *ecore_dev, uint32_t pci_reg, uint32_t reg_value); extern int ql
svn commit: r336680 - head/share/man/man4
Author: davidcs Date: Tue Jul 24 18:39:46 2018 New Revision: 336680 URL: https://svnweb.freebsd.org/changeset/base/336680 Log: Update man page with support for 41000 Series adapters MFC after:5 days Modified: head/share/man/man4/qlnxe.4 Modified: head/share/man/man4/qlnxe.4 == --- head/share/man/man4/qlnxe.4 Tue Jul 24 18:33:26 2018(r336679) +++ head/share/man/man4/qlnxe.4 Tue Jul 24 18:39:46 2018(r336680) @@ -63,6 +63,8 @@ chipsets: .Bl -bullet -compact .It QLogic 45000 series +.It +QLogic 41000 series .El .Sh SUPPORT For support questions please contact your Cavium approved reseller or ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r336438 - head/sys/dev/bxe
Author: davidcs Date: Tue Jul 17 23:56:13 2018 New Revision: 336438 URL: https://svnweb.freebsd.org/changeset/base/336438 Log: 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 MFC after:5 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Tue Jul 17 23:23:54 2018(r336437) +++ head/sys/dev/bxe/bxe.c Tue Jul 17 23:56:13 2018(r336438) @@ -4396,6 +4396,8 @@ bxe_nic_unload(struct bxe_softc *sc, BLOGD(sc, DBG_LOAD, "Ended NIC unload\n"); +bxe_link_report(sc); + return (0); } @@ -4441,30 +4443,39 @@ bxe_ifmedia_status(struct ifnet *ifp, struct ifmediare { struct bxe_softc *sc = if_getsoftc(ifp); +/* 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 ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) { +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 @@ -7038,7 +7049,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(&sc->link_params, &sc->link_vars); if (sc->link_vars.link_up) { @@ -9127,11 +9138,16 @@ bxe_interrupt_detach(struct bxe_softc *sc) while (taskqueue_cancel_timeout(fp->tq, &fp->tx_timeout_task, NULL)) taskqueue_drain_timeout(fp->tq, &fp->tx_timeout_task); -taskqueue_free(fp->tq); -fp->tq = NULL; } -} +for (i = 0; i < sc->num_queues; i++) { +fp = &sc->fp[i]; +if (fp->tq != NULL) { +taskqueue_free(fp->tq); +fp->tq = NULL; +} +} +} if (sc->sp_tq) { taskqueue_drain(sc->sp_tq, &sc->sp_tq_task); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r333004 - head/sys/dev/bxe
Author: davidcs Date: Wed Apr 25 18:06:22 2018 New Revision: 333004 URL: https://svnweb.freebsd.org/changeset/base/333004 Log: 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 MFC after:5 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Wed Apr 25 17:51:17 2018(r333003) +++ head/sys/dev/bxe/bxe.c Wed Apr 25 18:06:22 2018(r333004) @@ -29,7 +29,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" @@ -11993,85 +11993,107 @@ bxe_initial_phy_init(struct bxe_softc *sc, } /* must be called under IF_ADDR_LOCK */ - static int -bxe_set_mc_list(struct bxe_softc *sc) +bxe_init_mcast_macs_list(struct bxe_softc *sc, + struct ecore_mcast_ramrod_params *p) { -struct ecore_mcast_ramrod_params rparam = { NULL }; -int rc = 0; -int mc_count = 0; -int mcnt, i; -struct ecore_mcast_list_elem *mc_mac, *mc_mac_start; -unsigned char *mta; if_t ifp = sc->ifp; +int mc_count = 0; +struct ifmultiaddr *ifma; +struct ecore_mcast_list_elem *mc_mac; -mc_count = if_multiaddr_count(ifp, -1);/* XXX they don't have a limit */ -if (!mc_count) -return (0); +TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { +if (ifma->ifma_addr->sa_family != AF_LINK) { +continue; +} -mta = malloc(sizeof(unsigned char) * ETHER_ADDR_LEN * -mc_count, M_DEVBUF, M_NOWAIT); +mc_count++; +} -if(mta == NULL) { -BLOGE(sc, "Failed to allocate temp mcast list\n"); -return (-1); +ECORE_LIST_INIT(&p->mcast_list); +p->mcast_list_len = 0; + +if (!mc_count) { +return (0); } -bzero(mta, (sizeof(unsigned char) * ETHER_ADDR_LEN * mc_count)); - -mc_mac = mallocarray(mc_count, sizeof(*mc_mac), M_DEVBUF, -(M_NOWAIT | M_ZERO)); -mc_mac_start = mc_mac; +mc_mac = malloc(sizeof(*mc_mac) * mc_count, M_DEVBUF, +(M_NOWAIT | M_ZERO)); if (!mc_mac) { -free(mta, M_DEVBUF); BLOGE(sc, "Failed to allocate temp mcast list\n"); return (-1); } bzero(mc_mac, (sizeof(*mc_mac) * mc_count)); -/* mta and mcnt not expected to be different */ -if_multiaddr_array(ifp, mta, &mcnt, mc_count); +TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { +if (ifma->ifma_addr->sa_family != AF_LINK) { +continue; +} +mc_mac->mac = (uint8_t *)LLADDR((struct sockaddr_dl *)ifma->ifma_addr); +ECORE_LIST_PUSH_TAIL(&mc_mac->link, &p->mcast_list); -rparam.mcast_obj = &sc->mcast_obj; -ECORE_LIST_INIT(&rparam.mcast_list); +BLOGD(sc, DBG_LOAD, + "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_count); + mc_mac++; +} -for(i=0; i< mcnt; i++) { +p->mcast_list_len = mc_count; -mc_mac->mac = (uint8_t *)(mta + (i * ETHER_ADDR_LEN)); -ECORE_LIST_PUSH_TAIL(&mc_mac->link, &rparam.mcast_list); +return (0); +} -BLOGD(sc, DBG_LOAD, - "Setting MCAST %02X:%02X:%02X:%02X:%02X:%02X\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]); +static void +bxe_free_mcast_macs_list(struct ecore_mcast_ramrod_params *p) +{ +struct ecore_mcast_list_elem *mc_mac = +ECORE_LIST_FIRST_ENTRY(&p->mcast_list, + struct ecore_mcast_list_elem, + link); -mc_mac++; +if (mc_mac) { +/* only a single free as all mc_macs are in the same heap array */ +free(mc_mac, M_DEVBUF); } -rparam.mcast_list_len = mc_count; +} +static int +bxe_set_mc_list(struct bxe_softc *sc) +{ +struct ecore_mcast_ramrod_params rparam = { NULL }; +int rc = 0; +rparam.mcast_obj = &sc->mcast_obj; + BXE_MCAST_LOCK(sc); /* first, clear all configured multicast MACs */ rc = ecore_config_mcast(sc, &rparam, 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); - free(mc_mac_start, M_DEVBUF); -free(mta, M_DEVBUF); return (rc); } +/* configure a new MACs list */ +rc = bxe_init_mcast_macs_list(sc, &rparam); +if (rc) { +BLOGE(sc, "
svn commit: r333003 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Apr 25 17:51:17 2018 New Revision: 333003 URL: https://svnweb.freebsd.org/changeset/base/333003 Log: Upgraded FW Related Files to version 5.4.67 MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_boot.c head/sys/dev/qlxgbe/ql_fw.c head/sys/dev/qlxgbe/ql_minidump.c head/sys/dev/qlxgbe/ql_reset.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_boot.c == --- head/sys/dev/qlxgbe/ql_boot.c Wed Apr 25 16:43:45 2018 (r333002) +++ head/sys/dev/qlxgbe/ql_boot.c Wed Apr 25 17:51:17 2018 (r333003) @@ -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: head/sys/dev/qlxgbe/ql_fw.c == --- head/sys/dev/qlxgbe/ql_fw.c Wed Apr 25 16:43:45 2018(r333002) +++ head/sys/dev/qlxgbe/ql_fw.c Wed Apr 25 17:51:17 2018(r333003) @@ -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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@
svn commit: r331739 - head/sys/dev/qlxgbe
Author: davidcs Date: Thu Mar 29 17:36:34 2018 New Revision: 331739 URL: https://svnweb.freebsd.org/changeset/base/331739 Log: 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() MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_dbg.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_ioctl.c head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_dbg.h == --- head/sys/dev/qlxgbe/ql_dbg.hThu Mar 29 17:19:59 2018 (r331738) +++ head/sys/dev/qlxgbe/ql_dbg.hThu Mar 29 17:36:34 2018 (r331739) @@ -59,6 +59,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: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Thu Mar 29 17:19:59 2018(r331738) +++ head/sys/dev/qlxgbe/ql_hw.c Thu Mar 29 17:36:34 2018(r331739) @@ -1090,7 +1090,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)), @@ -2906,7 +2910,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); @@ -2914,10 +2918,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, &supports_9kb, NULL); if (!supports_9kb) - ha->hw.enable_9kb = 0; +#endif + ha->hw.enable_9kb = 0; return; } @@ -3589,6 +3595,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, @@ -3825,6 +3838,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; } @@ -3961,7 +3986,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: head/sys/dev/qlxgbe/ql_ioctl.c == --- head/sys/dev/qlxgbe/ql_ioctl.c Thu Mar 29 17:19:59 2018 (r331738) +++ head/sys/dev/qlxgbe/ql_ioctl.c Thu Mar 29 17:36:34 2018 (r331739) @@ -269,7 +269,8 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data,
svn commit: r329855 - head/sys/dev/qlxgbe
Author: davidcs Date: Fri Feb 23 03:36:24 2018 New Revision: 329855 URL: https://svnweb.freebsd.org/changeset/base/329855 Log: 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: head/sys/dev/qlxgbe/ql_dbg.h head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_glbl.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_inline.h head/sys/dev/qlxgbe/ql_ioctl.c head/sys/dev/qlxgbe/ql_ioctl.h head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_misc.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_os.h head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_dbg.h == --- head/sys/dev/qlxgbe/ql_dbg.hFri Feb 23 03:18:24 2018 (r329854) +++ head/sys/dev/qlxgbe/ql_dbg.hFri Feb 23 03:36:24 2018 (r329855) @@ -44,17 +44,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: head/sys/dev/qlxgbe/ql_def.h == --- head/sys/dev/qlxgbe/ql_def.hFri Feb 23 03:18:24 2018 (r329854) +++ head/sys/dev/qlxgbe/ql_def.hFri Feb 23 03:36:24 2018 (r329855) @@ -146,12 +146,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; @@ -184,6 +184,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; @@ -241,6 +242,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]; @@ -274,5 +278,7 @@ typedef struct qla_host qla_host_t; #define QL_MAC_CMP(mac1, mac2)\ *(uint32_t *) mac1) == (*(uint32_t *) mac2) && \ (*(uint16_t *)(mac1 + 4)) == (*(uint16_t *)(mac2 + 4 ? 0 : 1) + +#define QL_INITIATE_RECOVERY(ha) qla_set_error_recove
svn commit: r324538 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Oct 11 20:22:01 2017 New Revision: 324538 URL: https://svnweb.freebsd.org/changeset/base/324538 Log: Added support driver state capture/retrieval MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_glbl.h head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_ioctl.c head/sys/dev/qlxgbe/ql_ioctl.h head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_def.h == --- head/sys/dev/qlxgbe/ql_def.hWed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_def.hWed Oct 11 20:22:01 2017 (r324538) @@ -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; Modified: head/sys/dev/qlxgbe/ql_glbl.h == --- head/sys/dev/qlxgbe/ql_glbl.h Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_glbl.h Wed Oct 11 20:22:01 2017 (r324538) @@ -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: head/sys/dev/qlxgbe/ql_hw.h == --- head/sys/dev/qlxgbe/ql_hw.h Wed Oct 11 20:04:30 2017(r324537) +++ head/sys/dev/qlxgbe/ql_hw.h Wed Oct 11 20:22:01 2017(r324538) @@ -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: head/sys/dev/qlxgbe/ql_ioctl.c == --- head/sys/dev/qlxgbe/ql_ioctl.c Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_ioctl.c Wed Oct 11 20:22:01 2017 (r324538) @@ -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 += QL_ALIGN(size, 64); + + size = ha->hw.num_rds_rings * (sizeof (qla_drvr_state_rx_t)); + drvr_state_size += QL_ALIGN(size, 64); + + size = ha->hw.num_sds_rings * (sizeof (qla_drvr_state_sds_t)); + drvr_state_size += QL_ALIGN(size, 64); + + size = sizeof(q80_tx_cmd_t) * NUM_TX_DESCRIPTORS * ha->hw.num_tx_rings; + drvr_state_size += QL_ALIGN(size, 64); + + size = sizeof(q80_recv_desc_t) * NUM_RX_DESCRIPTORS * ha->hw.num_rds_rings; + drvr_state_size += QL_ALIGN(size, 64); +
svn commit: r324535 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Oct 11 18:25:05 2017 New Revision: 324535 URL: https://svnweb.freebsd.org/changeset/base/324535 Log: 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. MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Wed Oct 11 15:13:40 2017(r324534) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Oct 11 18:25:05 2017(r324535) @@ -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 = &hw->tx_cntxt[txr_idx].tx_ring_base[tx_idx]; if (!(mp->m_pkthdr.csum_flags & CSUM_TSO)) { Modified: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Wed Oct 11 15:13:40 2017(r324534) +++ head/sys/dev/qlxgbe/ql_os.c Wed Oct 11 18:25:05 2017(r324535) @@ -1232,6 +1232,17 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__)); 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, &nsegs, ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r324504 - head/sys/dev/qlxgbe
Author: davidcs Date: Tue Oct 10 20:45:45 2017 New Revision: 324504 URL: https://svnweb.freebsd.org/changeset/base/324504 Log: Revert Commit r324290 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: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Tue Oct 10 20:08:30 2017(r324503) +++ head/sys/dev/qlxgbe/ql_hw.c Tue Oct 10 20:45:45 2017(r324504) @@ -2374,16 +2374,6 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, in } } - for (i = 0; i < num_tx_cmds; i++) { - if (NULL != ha->tx_ring[txr_idx].tx_buf[(tx_idx+i)].m_head) { - QL_ASSERT(ha, 0, \ - ("%s: txr_idx = %d tx_idx = %d mbuf = %p\n",\ - __func__, txr_idx, (tx_idx+i),\ - ha->tx_ring[txr_idx].tx_buf[(tx_idx+i)].m_head)); - return (EINVAL); - } - } - tx_cmd = &hw->tx_cntxt[txr_idx].tx_ring_base[tx_idx]; if (!(mp->m_pkthdr.csum_flags & CSUM_TSO)) { Modified: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Tue Oct 10 20:08:30 2017(r324503) +++ head/sys/dev/qlxgbe/ql_os.c Tue Oct 10 20:45:45 2017(r324504) @@ -1232,17 +1232,6 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__)); 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: txr_idx = %d tx_idx = %d mbuf = %p\n",\ - __func__, 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, &nsegs, ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r324290 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Oct 4 23:03:09 2017 New Revision: 324290 URL: https://svnweb.freebsd.org/changeset/base/324290 Log: 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: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Wed Oct 4 22:55:30 2017(r324289) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Oct 4 23:03:09 2017(r324290) @@ -2374,6 +2374,16 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, in } } + for (i = 0; i < num_tx_cmds; i++) { + if (NULL != ha->tx_ring[txr_idx].tx_buf[(tx_idx+i)].m_head) { + QL_ASSERT(ha, 0, \ + ("%s: txr_idx = %d tx_idx = %d mbuf = %p\n",\ + __func__, txr_idx, (tx_idx+i),\ + ha->tx_ring[txr_idx].tx_buf[(tx_idx+i)].m_head)); + return (EINVAL); + } + } + tx_cmd = &hw->tx_cntxt[txr_idx].tx_ring_base[tx_idx]; if (!(mp->m_pkthdr.csum_flags & CSUM_TSO)) { Modified: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Wed Oct 4 22:55:30 2017(r324289) +++ head/sys/dev/qlxgbe/ql_os.c Wed Oct 4 23:03:09 2017(r324290) @@ -1232,6 +1232,17 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__)); 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: txr_idx = %d tx_idx = %d mbuf = %p\n",\ + __func__, 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, &nsegs, ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r324065 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Sep 27 17:46:11 2017 New Revision: 324065 URL: https://svnweb.freebsd.org/changeset/base/324065 Log: Tx Ring Shadow Consumer Index Register needs to be cleared prior to passing it's physical address to the FW during Tx Create Context. MFC after:3 days Modified: head/sys/dev/qlxgbe/ql_hw.c Modified: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Wed Sep 27 16:12:13 2017(r324064) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Sep 27 17:46:11 2017(r324065) @@ -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-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r324026 - head/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 26 20:53:25 2017 New Revision: 324026 URL: https://svnweb.freebsd.org/changeset/base/324026 Log: Fix delete all multicast addresses Submitted by:anand.kh...@cavium.com MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_glbl.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_glbl.h == --- head/sys/dev/qlxgbe/ql_glbl.h Tue Sep 26 20:26:48 2017 (r324025) +++ head/sys/dev/qlxgbe/ql_glbl.h Tue Sep 26 20:53:25 2017 (r324026) @@ -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: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Tue Sep 26 20:26:48 2017(r324025) +++ head/sys/dev/qlxgbe/ql_hw.c Tue Sep 26 20:53:25 2017(r324026) @@ -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: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Tue Sep 26 20:26:48 2017(r324025) +++ head/sys/dev/qlxgbe/ql_os.c Tue Sep 26 20:53:25 2017(r324026) @@ -975,7 +975,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-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r323824 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Sep 20 20:07:45 2017 New Revision: 323824 URL: https://svnweb.freebsd.org/changeset/base/323824 Log: 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 MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Wed Sep 20 18:31:36 2017(r323823) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Sep 20 20:07:45 2017(r323824) @@ -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: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Wed Sep 20 18:31:36 2017(r323823) +++ head/sys/dev/qlxgbe/ql_os.c Wed Sep 20 20:07:45 2017(r323824) @@ -1287,6 +1287,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); @@ -1372,7 +1373,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 @@ -1415,6 +1417,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); } } @@ -1677,16 +1684,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-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r323782 - head/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 19 23:26:27 2017 New Revision: 323782 URL: https://svnweb.freebsd.org/changeset/base/323782 Log: Add sysctl "enable_minidump" to turn on/off automatic minidump retrieval MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_def.h == --- head/sys/dev/qlxgbe/ql_def.hTue Sep 19 22:17:30 2017 (r323781) +++ head/sys/dev/qlxgbe/ql_def.hTue Sep 19 23:26:27 2017 (r323782) @@ -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: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Tue Sep 19 22:17:30 2017(r323781) +++ head/sys/dev/qlxgbe/ql_os.c Tue Sep 19 23:26:27 2017(r323782) @@ -185,6 +185,13 @@ qla_add_sysctls(qla_host_t *ha) OID_AUTO, "debug", CTLFLAG_RW, &ha->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, + &ha->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)), @@ -2025,7 +2032,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-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r323781 - head/sys/dev/qlxgbe
Author: davidcs Date: Tue Sep 19 22:17:30 2017 New Revision: 323781 URL: https://svnweb.freebsd.org/changeset/base/323781 Log: Update minidump template for version 5.4.66 MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_minidump.c Modified: head/sys/dev/qlxgbe/ql_minidump.c == --- head/sys/dev/qlxgbe/ql_minidump.c Tue Sep 19 21:31:36 2017 (r323780) +++ head/sys/dev/qlxgbe/ql_minidump.c Tue Sep 19 22:17:30 2017 (r323781) @@ -41,7 +41,7 @@ unsigned int ql83xx_minidump_version_sub = 66; unsigned char ql83xx_minidump[] = { 0x63, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xaa, 0x05, 0x00, 0x00, 0x04, 0x00, 0x02, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x1d, 0x95, 0x7b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x36, 0x87, 0x40, 0x59, 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, 0x08, 0x31, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -49,7 +49,7 @@ unsigned char ql83xx_minidump[] = { 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, 0x11, 0x01, 0x00, 0xdc, 0xfb, 0x07, 0x00, - 0x00, 0x8a, 0x2b, 0x00, 0x80, 0x73, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x8a, 0x2b, 0x00, 0x40, 0x6f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x4a, 0x3b, 0x00, 0x00, 0x10, 0x03, 0x08, 0x00, 0x08, 0x31, 0x77, 0x04, 0x08, 0x31, 0x77, 0x08, 0x08, 0x31, 0x77, 0x0c, 0x08, 0x31, 0x77, 0x10, 0x08, 0x31, 0x77, 0x1c, 0x08, 0x31, 0x77, @@ -61,8 +61,8 @@ unsigned char ql83xx_minidump[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc9, 0x02, 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, 0x01, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, - 0xe0, 0x91, 0x00, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x11, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xbf, 0x00, 0x00, 0x00, + 0x00, 0x93, 0x00, 0x00, 0x00, 0x22, 0x02, 0x00, 0x00, 0x11, 0x01, 0x00, 0x62, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x30, 0x77, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, @@ -2935,10 +2935,26 @@ unsigned char ql83xx_minidump[] = { 0x08, 0xd6, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x18, 0x02, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x20, 0xe8, 0x01, 0x06, 0x00, 0x00, 0x02, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x11, 0x06, 0x00, 0x80, 0x02, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xe0, 0x17, 0x00, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x14, 0x06, 0xe0, 0x17, 0x00, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0x00, 0x00, + 0x08, 0xdc, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, + 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x55, 0x06, 0xe0, 0x1f, 0x00, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x04, 0xc8, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xd5, 0x00, 0x00, 0x80, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0xd5, 0x00, 0x00, 0x80, 0x02, 0x00, 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x04, 0xca, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2946,7 +2962,7 @@ unsigned char ql83xx_minidump[] = { 0x48, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x14, 0x00, 0x04, 0xc9, 0x00, 0x00, 0x00, 0x50, 0x1a, 0x01, 0x06, 0xc1, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00
svn commit: r322852 - head/sys/dev/qlnx/qlnxe
Author: davidcs Date: Thu Aug 24 19:09:42 2017 New Revision: 322852 URL: https://svnweb.freebsd.org/changeset/base/322852 Log: Fix qlnx_tso_check() so that every window of (ETH_TX_LSO_WINDOW_BDS_NUM - nbds_in_hdr) has atleast ETH_TX_LSO_WINDOW_MIN_LEN bytes MFC after:5 days Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c == --- head/sys/dev/qlnx/qlnxe/qlnx_os.c Thu Aug 24 18:51:55 2017 (r322851) +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c Thu Aug 24 19:09:42 2017 (r322852) @@ -2921,25 +2921,35 @@ qlnx_tso_check(struct qlnx_fastpath *fp, bus_dma_segme { int i; uint32_tsum, nbds_in_hdr = 1; - bus_dma_segment_t *t_segs = segs; + uint32_twindow; +bus_dma_segment_t *s_seg; - /* count the number of segments spanned by TCP header */ + /* If the header spans mulitple segments, skip those segments */ + if (nsegs < ETH_TX_LSO_WINDOW_BDS_NUM) + return (0); + i = 0; - while ((i < nsegs) && (offset > t_segs->ds_len)) { - nbds_in_hdr++; - offset = offset - t_segs->ds_len; - t_segs++; + + while ((i < nsegs) && (offset >= segs->ds_len)) { + offset = offset - segs->ds_len; + segs++; i++; + nbds_in_hdr++; } - while (nsegs >= QLNX_MAX_SEGMENTS_NON_TSO) { + window = ETH_TX_LSO_WINDOW_BDS_NUM - nbds_in_hdr; + nsegs = nsegs - i; + + while (nsegs >= window) { + sum = 0; + s_seg = segs; - for (i = 0; i < (ETH_TX_LSO_WINDOW_BDS_NUM - nbds_in_hdr); i++){ - sum += segs->ds_len; - segs++; + for (i = 0; i < window; i++){ + sum += s_seg->ds_len; + s_seg++; } if (sum < ETH_TX_LSO_WINDOW_MIN_LEN) { @@ -2947,7 +2957,8 @@ qlnx_tso_check(struct qlnx_fastpath *fp, bus_dma_segme return (-1); } - nsegs -= QLNX_MAX_SEGMENTS_NON_TSO; + nsegs = nsegs - 1; + segs++; } return (0); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r322771 - in head/sys: dev/qlxgbe modules/qlxgbe
Author: davidcs Date: Mon Aug 21 20:27:45 2017 New Revision: 322771 URL: https://svnweb.freebsd.org/changeset/base/322771 Log: 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 MFC after:5 days Modified: head/sys/dev/qlxgbe/README.txt head/sys/dev/qlxgbe/ql_boot.c head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_fw.c head/sys/dev/qlxgbe/ql_glbl.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_inline.h head/sys/dev/qlxgbe/ql_ioctl.c head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_minidump.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_os.h head/sys/dev/qlxgbe/ql_reset.c head/sys/dev/qlxgbe/ql_ver.h head/sys/modules/qlxgbe/Makefile Modified: head/sys/dev/qlxgbe/README.txt == --- head/sys/dev/qlxgbe/README.txt Mon Aug 21 20:23:05 2017 (r322770) +++ head/sys/dev/qlxgbe/README.txt Mon Aug 21 20:27:45 2017 (r322771) @@ -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: head/sys/dev/qlxgbe/ql_boot.c == --- head/sys/dev/qlxgbe/ql_boot.c Mon Aug 21 20:23:05 2017 (r322770) +++ head/sys/dev/qlxgbe/ql_boot.c Mon Aug 21 20:27:45 2017 (r322771) @@ -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: head/sys/dev/qlxgbe/ql_def.h == --- head/sys/dev/qlxgbe/ql_def.hMon Aug 21 20:23:05 2017 (r322770) +++ head/sys/dev/qlxgbe/ql_def.hMon Aug 21 20:27:45 2017 (r322771) @@ -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 { @@ -123,25 +124,26 @@ typedef struct _qla_tx_fp { } qla_tx_fp_t; /* - * Adapter structure contains the hardware independent information of the + * Adapter structure contains the hardware independant information of the * pci function. */ 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: r322408 - in head/sys: dev/qlnx/qlnxe modules/qlnx/qlnxe
Author: davidcs Date: Fri Aug 11 17:43:25 2017 New Revision: 322408 URL: https://svnweb.freebsd.org/changeset/base/322408 Log: Performance enhancements to reduce CPU utililization for large number of TCP connections (order of tens of thousands), with predominantly Transmits. Choice to perform receive operations either in IThread or Taskqueue Thread. Submitted by:vaishali.kulka...@cavium.com MFC after:5 days Modified: head/sys/dev/qlnx/qlnxe/qlnx_def.h head/sys/dev/qlnx/qlnxe/qlnx_os.c head/sys/dev/qlnx/qlnxe/qlnx_ver.h head/sys/modules/qlnx/qlnxe/Makefile Modified: head/sys/dev/qlnx/qlnxe/qlnx_def.h == --- head/sys/dev/qlnx/qlnxe/qlnx_def.h Fri Aug 11 17:05:31 2017 (r322407) +++ head/sys/dev/qlnx/qlnxe/qlnx_def.h Fri Aug 11 17:43:25 2017 (r322408) @@ -50,9 +50,10 @@ struct qlnx_ivec { typedef struct qlnx_ivec qlnx_ivec_t; -//#define QLNX_MAX_RSS 30 -#define QLNX_MAX_RSS 16 -#define QLNX_MAX_TC1 +//#define QLNX_MAX_RSS 30 +#define QLNX_MAX_RSS 36 +#define QLNX_DEFAULT_RSS 16 +#define QLNX_MAX_TC1 enum QLNX_STATE { QLNX_STATE_CLOSED, @@ -201,6 +202,17 @@ struct qlnx_fastpath { uint64_ttx_pkts_freed; uint64_ttx_pkts_transmitted; uint64_ttx_pkts_completed; + uint64_ttx_tso_pkts; + uint64_ttx_non_tso_pkts; + +#ifdef QLNX_TRACE_PERF_DATA + uint64_ttx_pkts_trans_ctx; + uint64_ttx_pkts_compl_ctx; + uint64_ttx_pkts_trans_fp; + uint64_ttx_pkts_compl_fp; + uint64_ttx_pkts_compl_intr; +#endif + uint64_ttx_lso_wnd_min_len; uint64_ttx_defrag; uint64_ttx_nsegs_gt_elem_left; @@ -209,6 +221,13 @@ struct qlnx_fastpath { uint32_ttx_tso_max_pkt_len; uint32_ttx_tso_min_pkt_len; uint64_ttx_pkts[QLNX_FP_MAX_SEGS]; + +#ifdef QLNX_TRACE_PERF_DATA + uint64_ttx_pkts_hist[QLNX_FP_MAX_SEGS]; + uint64_ttx_comInt[QLNX_FP_MAX_SEGS]; + uint64_ttx_pkts_q[QLNX_FP_MAX_SEGS]; +#endif + uint64_terr_tx_nsegs_gt_elem_left; uint64_terr_tx_dmamap_create; uint64_terr_tx_defrag_dmamap_load; @@ -301,8 +320,13 @@ typedef struct qlnx_link_output qlnx_link_output_t; #define QLNX_MFW_VERSION_LENGTH 32 #define QLNX_STORMFW_VERSION_LENGTH 32 -#define QLNX_TX_ELEM_RESERVE 2 +#define QLNX_TX_ELEM_RESERVE 2 +#define QLNX_TX_ELEM_THRESH128 +#define QLNX_TX_ELEM_MAX_THRESH512 +#define QLNX_TX_ELEM_MIN_THRESH32 +#define QLNX_TX_COMPL_THRESH 32 + #define QLNX_TPA_MAX_AGG_BUFFERS (20) #define QLNX_MAX_NUM_MULTICAST_ADDRS ECORE_MAX_MC_ADDRS @@ -454,6 +478,7 @@ struct qlnx_host { qlnx_storm_stats_t storm_stats[QLNX_STORM_STATS_TOTAL]; uint32_tstorm_stats_index; uint32_tstorm_stats_enable; + uint32_tstorm_stats_gather; uint32_tpersonality; }; @@ -470,8 +495,11 @@ typedef struct qlnx_host qlnx_host_t; #define QLNX_MAX_MTU 9000 #define QLNX_MAX_SEGMENTS_NON_TSO (ETH_TX_MAX_BDS_PER_NON_LSO_PACKET - 1) -#define QLNX_MAX_TSO_FRAME_SIZE((64 * 1024 - 1) + 22) +//#define QLNX_MAX_TSO_FRAME_SIZE ((64 * 1024 - 1) + 22) +#define QLNX_MAX_TSO_FRAME_SIZE65536 +#define QLNX_MAX_TX_MBUF_SIZE 65536/* bytes - bd_len = 16bits */ + #define QL_MAC_CMP(mac1, mac2)\ *(uint32_t *) mac1) == (*(uint32_t *) mac2) && \ (*(uint16_t *)(mac1 + 4)) == (*(uint16_t *)(mac2 + 4 ? 0 : 1) @@ -702,6 +730,18 @@ extern void qlnx_fill_link(struct ecore_hwfn *hwfn, #define CQE_HAS_VLAN(flags) \ ((flags) & (PARSING_AND_ERR_FLAGS_TAG8021QEXIST_MASK \ << PARSING_AND_ERR_FLAGS_TAG8021QEXIST_SHIFT)) + +#if defined(__i386__) || defined(__amd64__) + +static __inline +void prefetch(void *x) +{ +__asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x)); +} + +#else +#define prefetch(x) +#endif #endif /* #ifndef _QLNX_DEF_H_ */ Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c == --- head/sys/dev/qlnx/qlnxe/qlnx_os.c Fri Aug 11 17:05:31 2017 (r322407) +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c Fri Aug 11 17:43:25 2017 (r322408) @@ -94,6 +94,8 @@ static int qlnx_get_ifq_snd_maxlen(qlnx_host_t *ha); static uint32_t qlnx_get_optics(qlnx_host_t *ha, struct qlnx_link_output *if_link
svn commit: r322331 - in head/sys: dev/qlnx/qlnxe modules/qlnx/qlnxe
Author: davidcs Date: Wed Aug 9 22:18:49 2017 New Revision: 322331 URL: https://svnweb.freebsd.org/changeset/base/322331 Log: Provide compile to choose receive processing in either Ithread or Taskqueue Thread. Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c head/sys/dev/qlnx/qlnxe/qlnx_ver.h head/sys/modules/qlnx/qlnxe/Makefile Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c == --- head/sys/dev/qlnx/qlnxe/qlnx_os.c Wed Aug 9 21:44:55 2017 (r322330) +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c Wed Aug 9 22:18:49 2017 (r322331) @@ -397,10 +397,14 @@ qlnx_fp_taskqueue(void *context, int pending) struct ifnet *ifp; struct mbuf*mp; intret = -1; + struct thread *cthread; + +#ifdef QLNX_RCV_IN_TASKQ int lro_enable; int rx_int = 0, total_rx_count = 0; - struct thread *cthread; +#endif /* #ifdef QLNX_RCV_IN_TASKQ */ + fp = context; if (fp == NULL) @@ -419,55 +423,60 @@ qlnx_fp_taskqueue(void *context, int pending) ifp = ha->ifp; - lro_enable = ha->ifp->if_capenable & IFCAP_LRO; +#ifdef QLNX_RCV_IN_TASKQ + { + lro_enable = ifp->if_capenable & IFCAP_LRO; - rx_int = qlnx_rx_int(ha, fp, ha->rx_pkt_threshold, lro_enable); + rx_int = qlnx_rx_int(ha, fp, ha->rx_pkt_threshold, lro_enable); - if (rx_int) { - fp->rx_pkts += rx_int; - total_rx_count += rx_int; - } + if (rx_int) { + fp->rx_pkts += rx_int; + total_rx_count += rx_int; + } #ifdef QLNX_SOFT_LRO - { - struct lro_ctrl *lro; + { + struct lro_ctrl *lro; + + lro = &fp->rxq->lro; - lro = &fp->rxq->lro; + if (lro_enable && total_rx_count) { - if (lro_enable && total_rx_count) { - #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) - if (ha->dbg_trace_lro_cnt) { - if (lro->lro_mbuf_count & ~1023) - fp->lro_cnt_1024++; - else if (lro->lro_mbuf_count & ~511) - fp->lro_cnt_512++; - else if (lro->lro_mbuf_count & ~255) - fp->lro_cnt_256++; - else if (lro->lro_mbuf_count & ~127) - fp->lro_cnt_128++; - else if (lro->lro_mbuf_count & ~63) - fp->lro_cnt_64++; - } - tcp_lro_flush_all(lro); + if (ha->dbg_trace_lro_cnt) { + if (lro->lro_mbuf_count & ~1023) + fp->lro_cnt_1024++; + else if (lro->lro_mbuf_count & ~511) + fp->lro_cnt_512++; + else if (lro->lro_mbuf_count & ~255) + fp->lro_cnt_256++; + else if (lro->lro_mbuf_count & ~127) + fp->lro_cnt_128++; + else if (lro->lro_mbuf_count & ~63) + fp->lro_cnt_64++; + } + tcp_lro_flush_all(lro); #else - struct lro_entry *queued; + struct lro_entry *queued; - while ((!SLIST_EMPTY(&lro->lro_active))) { - queued = SLIST_FIRST(&lro->lro_active); - SLIST_REMOVE_HEAD(&lro->lro_active, next); - tcp_lro_flush(lro, queued); - } + while ((!SLIST_EMPTY(&lro->lro_active))) { + queued = SLIST_FIRST(&lro->lro_active); + SLIST_REMOVE_HEAD(&lro->lro_active, next); + tcp_lro_flush(lro, queued); + } #endif /* #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) */ + } } - } #endif /* #ifdef QLNX_SOFT_LRO */ - ecore_sb_update_sb_idx(fp->sb_info); - rmb(); + ecore_sb_update_sb_idx(fp->sb_info); + rmb(); + } +#endif /* #ifdef QLNX_RCV_IN_TASKQ */ + mtx_lock(&fp->tx_mtx); if (((ifp->i
svn commit: r321233 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Jul 19 19:08:37 2017 New Revision: 321233 URL: https://svnweb.freebsd.org/changeset/base/321233 Log: 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 MFC after:3 days Modified: head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_def.h == --- head/sys/dev/qlxgbe/ql_def.hWed Jul 19 19:06:19 2017 (r321232) +++ head/sys/dev/qlxgbe/ql_def.hWed Jul 19 19:08:37 2017 (r321233) @@ -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: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Wed Jul 19 19:06:19 2017(r321232) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Jul 19 19:08:37 2017(r321233) @@ -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: head/sys/dev/qlxgbe/ql_hw.h == --- head/sys/dev/qlxgbe/ql_hw.h Wed Jul 19 19:06:19 2017(r321232) +++ head/sys/dev/qlxgbe/ql_hw.h Wed Jul 19 19:08:37 2017(r321233) @@ -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: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Wed Jul 19 19:06:19 2017(r321232) +++ head/sys/dev/qlxgbe/ql_os.c Wed Jul 19 19:08:37 2017(r321233) @@ -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(&ha->tx_callout, QLA_WATCHDOG_CALLOUT_TICKS, qla_watchdog, ha); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r320705 - head/sys/dev/qlxgbe
Author: davidcs Date: Thu Jul 6 05:16:06 2017 New Revision: 320705 URL: https://svnweb.freebsd.org/changeset/base/320705 Log: Release mtx hw_lock before calling pause() in qla_stop() and qla_error_recovery() MFC after: 5 days Modified: head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Thu Jul 6 04:56:23 2017(r320704) +++ head/sys/dev/qlxgbe/ql_os.c Thu Jul 6 05:16:06 2017(r320705) @@ -1519,8 +1519,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; @@ -1915,7 +1918,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-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r320694 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Jul 5 19:25:09 2017 New Revision: 320694 URL: https://svnweb.freebsd.org/changeset/base/320694 Log: Allow MTU changes without ifconfig down/up MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Wed Jul 5 19:24:53 2017(r320693) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Jul 5 19:25:09 2017(r320694) @@ -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: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Wed Jul 5 19:24:53 2017(r320693) +++ head/sys/dev/qlxgbe/ql_os.c Wed Jul 5 19:25:09 2017(r320694) @@ -980,8 +980,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) @@ -1014,11 +1013,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-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r320175 - head/sys/dev/qlxgbe
Author: davidcs Date: Tue Jun 20 21:17:05 2017 New Revision: 320175 URL: https://svnweb.freebsd.org/changeset/base/320175 Log: Add pkts_cnt_oversized to stats. Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h Modified: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Tue Jun 20 20:52:06 2017(r320174) +++ head/sys/dev/qlxgbe/ql_hw.c Tue Jun 20 21:17:05 2017(r320175) @@ -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: head/sys/dev/qlxgbe/ql_hw.h == --- head/sys/dev/qlxgbe/ql_hw.h Tue Jun 20 20:52:06 2017(r320174) +++ head/sys/dev/qlxgbe/ql_hw.h Tue Jun 20 21:17:05 2017(r320175) @@ -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-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r319964 - head/sys/dev/qlnx/qlnxe
Author: davidcs Date: Thu Jun 15 02:45:43 2017 New Revision: 319964 URL: https://svnweb.freebsd.org/changeset/base/319964 Log: Upgrade STORMFW to 8.30.0.0 and ecore version to 8.30.0.0 Add support for pci deviceID 0x8070 for QLE41xxx product line which supports 10GbE/25GbE/40GbE MFC after:5 days Modified: head/sys/dev/qlnx/qlnxe/bcm_osal.h head/sys/dev/qlnx/qlnxe/common_hsi.h head/sys/dev/qlnx/qlnxe/ecore.h head/sys/dev/qlnx/qlnxe/ecore_chain.h head/sys/dev/qlnx/qlnxe/ecore_cxt.c head/sys/dev/qlnx/qlnxe/ecore_cxt.h head/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c head/sys/dev/qlnx/qlnxe/ecore_dbg_fw_funcs.h head/sys/dev/qlnx/qlnxe/ecore_dbg_values.h head/sys/dev/qlnx/qlnxe/ecore_dcbx.c head/sys/dev/qlnx/qlnxe/ecore_dcbx.h head/sys/dev/qlnx/qlnxe/ecore_dev.c head/sys/dev/qlnx/qlnxe/ecore_dev_api.h head/sys/dev/qlnx/qlnxe/ecore_fcoe_api.h head/sys/dev/qlnx/qlnxe/ecore_gtt_reg_addr.h head/sys/dev/qlnx/qlnxe/ecore_hsi_common.h head/sys/dev/qlnx/qlnxe/ecore_hsi_debug_tools.h head/sys/dev/qlnx/qlnxe/ecore_hsi_eth.h head/sys/dev/qlnx/qlnxe/ecore_hsi_fcoe.h head/sys/dev/qlnx/qlnxe/ecore_hsi_iscsi.h head/sys/dev/qlnx/qlnxe/ecore_hsi_iwarp.h head/sys/dev/qlnx/qlnxe/ecore_hsi_rdma.h head/sys/dev/qlnx/qlnxe/ecore_hsi_roce.h head/sys/dev/qlnx/qlnxe/ecore_hw.c head/sys/dev/qlnx/qlnxe/ecore_hw.h head/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.c head/sys/dev/qlnx/qlnxe/ecore_init_fw_funcs.h head/sys/dev/qlnx/qlnxe/ecore_init_ops.c head/sys/dev/qlnx/qlnxe/ecore_init_ops.h head/sys/dev/qlnx/qlnxe/ecore_init_values.h head/sys/dev/qlnx/qlnxe/ecore_int.c head/sys/dev/qlnx/qlnxe/ecore_int.h head/sys/dev/qlnx/qlnxe/ecore_int_api.h head/sys/dev/qlnx/qlnxe/ecore_iov_api.h head/sys/dev/qlnx/qlnxe/ecore_iro.h head/sys/dev/qlnx/qlnxe/ecore_iro_values.h head/sys/dev/qlnx/qlnxe/ecore_iscsi.h head/sys/dev/qlnx/qlnxe/ecore_iscsi_api.h head/sys/dev/qlnx/qlnxe/ecore_l2.c head/sys/dev/qlnx/qlnxe/ecore_l2.h head/sys/dev/qlnx/qlnxe/ecore_l2_api.h head/sys/dev/qlnx/qlnxe/ecore_ll2.h head/sys/dev/qlnx/qlnxe/ecore_ll2_api.h head/sys/dev/qlnx/qlnxe/ecore_mcp.c head/sys/dev/qlnx/qlnxe/ecore_mcp.h head/sys/dev/qlnx/qlnxe/ecore_mcp_api.h head/sys/dev/qlnx/qlnxe/ecore_ooo.h head/sys/dev/qlnx/qlnxe/ecore_proto_if.h head/sys/dev/qlnx/qlnxe/ecore_roce.h head/sys/dev/qlnx/qlnxe/ecore_roce_api.h head/sys/dev/qlnx/qlnxe/ecore_rt_defs.h head/sys/dev/qlnx/qlnxe/ecore_sp_api.h head/sys/dev/qlnx/qlnxe/ecore_sp_commands.c head/sys/dev/qlnx/qlnxe/ecore_sp_commands.h head/sys/dev/qlnx/qlnxe/ecore_spq.c head/sys/dev/qlnx/qlnxe/ecore_sriov.h head/sys/dev/qlnx/qlnxe/ecore_vf.h head/sys/dev/qlnx/qlnxe/ecore_vf_api.h head/sys/dev/qlnx/qlnxe/ecore_vfpf_if.h head/sys/dev/qlnx/qlnxe/eth_common.h head/sys/dev/qlnx/qlnxe/fcoe_common.h head/sys/dev/qlnx/qlnxe/iscsi_common.h head/sys/dev/qlnx/qlnxe/mcp_private.h head/sys/dev/qlnx/qlnxe/mcp_public.h head/sys/dev/qlnx/qlnxe/mfw_hsi.h head/sys/dev/qlnx/qlnxe/nvm_cfg.h head/sys/dev/qlnx/qlnxe/nvm_map.h head/sys/dev/qlnx/qlnxe/pcics_reg_driver.h head/sys/dev/qlnx/qlnxe/qlnx_def.h head/sys/dev/qlnx/qlnxe/qlnx_os.c head/sys/dev/qlnx/qlnxe/qlnx_ver.h head/sys/dev/qlnx/qlnxe/rdma_common.h head/sys/dev/qlnx/qlnxe/reg_addr.h head/sys/dev/qlnx/qlnxe/spad_layout.h head/sys/dev/qlnx/qlnxe/storage_common.h head/sys/dev/qlnx/qlnxe/tcp_common.h Modified: head/sys/dev/qlnx/qlnxe/bcm_osal.h == --- head/sys/dev/qlnx/qlnxe/bcm_osal.h Thu Jun 15 02:39:33 2017 (r319963) +++ head/sys/dev/qlnx/qlnxe/bcm_osal.h Thu Jun 15 02:45:43 2017 (r319964) @@ -34,12 +34,17 @@ #include "ecore_status.h" #include -#if __FreeBSD_version >= 1100090 +#if __FreeBSD_version >= 120 #include #else +#if __FreeBSD_version >= 1100090 +#include +#else #include #endif +#endif +#define OSAL_NUM_CPUS()mp_ncpus /* * prototypes of freebsd specific functions required by ecore */ @@ -60,6 +65,7 @@ extern int qlnx_pci_find_capability(void *ecore_dev, i extern uint32_t qlnx_direct_reg_rd32(void *p_hwfn, uint32_t *reg_addr); extern void qlnx_direct_reg_wr32(void *p_hwfn, void *reg_addr, uint32_t value); +extern void qlnx_direct_reg_wr64(void *p_hwfn, void *reg_addr, uint64_t value); extern uint32_t qlnx_reg_rd32(void *p_hwfn, uint32_t reg_addr); extern void qlnx_reg_wr32(void *p_hwfn, uint32_t reg_addr, uint32_t value); @@ -129,6 +135,8 @@ rounddown_pow_of_two(unsigned long x) #endif /* #ifndef QLNX_RDMA */ +#define OSAL_UNUSED + #define OSAL_CPU_TO_BE64(val) htobe64(val) #define OSAL_BE64_TO_CPU(val) be64toh(val) @@ -199,6 +207,8 @@ typedef struct osal_list_t #define REG_WR(hwfn, addr, val) qlnx_reg_wr32(hwfn, addr, val) #define REG_WR16(hwfn, addr, val) qlnx_reg_wr16(hwfn, addr, val) #define DIRECT_REG_WR(p_hwfn, addr, value) qlnx_direct_reg_wr32(p_hwfn, addr, value) +#define DIRECT_
svn commit: r318676 - head/sys/dev/qlnx/qlnxe
Author: davidcs Date: Mon May 22 19:57:28 2017 New Revision: 318676 URL: https://svnweb.freebsd.org/changeset/base/318676 Log: Check for IPV6 TCP/UDP CSUM offload in pkt header during transmits. Submitted by:shminderjit.si...@cavium.com Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c == --- head/sys/dev/qlnx/qlnxe/qlnx_os.c Mon May 22 19:57:20 2017 (r318675) +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c Mon May 22 19:57:28 2017 (r318676) @@ -2946,7 +2946,8 @@ qlnx_send(qlnx_host_t *ha, struct qlnx_f (1 << ETH_TX_1ST_BD_FLAGS_IP_CSUM_SHIFT); } - if (m_head->m_pkthdr.csum_flags & (CSUM_UDP | CSUM_TCP)) { + if (m_head->m_pkthdr.csum_flags & + (CSUM_UDP | CSUM_TCP | CSUM_TCP_IPV6 | CSUM_UDP_IPV6)) { first_bd->data.bd_flags.bitfields |= (1 << ETH_TX_1ST_BD_FLAGS_L4_CSUM_SHIFT); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r318383 - head/sys/dev/qlnx/qlnxe
Author: davidcs Date: Tue May 16 21:46:30 2017 New Revision: 318383 URL: https://svnweb.freebsd.org/changeset/base/318383 Log: QL_DPRINT macro modfied to handle multiple args; print line#. Submitted by:shminderjit.si...@cavium.com MFC after:3 days Modified: head/sys/dev/qlnx/qlnxe/qlnx_def.h head/sys/dev/qlnx/qlnxe/qlnx_ioctl.c head/sys/dev/qlnx/qlnxe/qlnx_os.c Modified: head/sys/dev/qlnx/qlnxe/qlnx_def.h == --- head/sys/dev/qlnx/qlnxe/qlnx_def.h Tue May 16 21:34:40 2017 (r318382) +++ head/sys/dev/qlnx/qlnxe/qlnx_def.h Tue May 16 21:46:30 2017 (r318383) @@ -483,35 +483,141 @@ typedef struct qlnx_host qlnx_host_t; #ifdef QLNX_DEBUG -#define QL_DPRINT1(ha, x) if (ha->dbg_level & 0x0001) device_printf x -#define QL_DPRINT2(ha, x) if (ha->dbg_level & 0x0002) device_printf x -#define QL_DPRINT3(ha, x) if (ha->dbg_level & 0x0004) device_printf x -#define QL_DPRINT4(ha, x) if (ha->dbg_level & 0x0008) device_printf x -#define QL_DPRINT5(ha, x) if (ha->dbg_level & 0x0010) device_printf x -#define QL_DPRINT6(ha, x) if (ha->dbg_level & 0x0020) device_printf x -#define QL_DPRINT7(ha, x) if (ha->dbg_level & 0x0040) device_printf x -#define QL_DPRINT8(ha, x) if (ha->dbg_level & 0x0080) device_printf x -#define QL_DPRINT9(ha, x) if (ha->dbg_level & 0x0100) device_printf x -#define QL_DPRINT11(ha, x) if (ha->dbg_level & 0x0400) device_printf x -#define QL_DPRINT12(ha, x) if (ha->dbg_level & 0x0800) device_printf x -#define QL_DPRINT13(ha, x) if (ha->dbg_level & 0x1000) device_printf x -#define QL_DPRINT14(ha, x) if (ha->dbg_level & 0x2000) device_printf x +#define QL_DPRINT1(ha, x, ...) \ + do {\ + if ((ha)->dbg_level & 0x0001) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x,\ + __func__, __LINE__, \ + ## __VA_ARGS__);\ + } \ + } while (0) + +#define QL_DPRINT2(ha, x, ...) \ + do {\ + if ((ha)->dbg_level & 0x0002) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x,\ + __func__, __LINE__, \ + ## __VA_ARGS__);\ + } \ + } while (0) + +#define QL_DPRINT3(ha, x, ...) \ + do {\ + if ((ha)->dbg_level & 0x0004) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x,\ + __func__, __LINE__, \ + ## __VA_ARGS__);\ + } \ + } while (0) + +#define QL_DPRINT4(ha, x, ...) \ + do {\ + if ((ha)->dbg_level & 0x0008) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x,\ + __func__, __LINE__, \ + ## __VA_ARGS__);\ + } \ + } while (0) + +#define QL_DPRINT5(ha, x, ...) \ + do {\ + if ((ha)->dbg_level & 0x0010) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x,\ + __func__, __LINE__, \ + ## __VA_ARGS__);\ + } \ + } while (0) + +#define QL_DPRINT6(ha, x, ...) \ + do {\ + if ((ha)->dbg_level & 0x0020) { \ + device_printf ((ha)->pci_dev, \ + "[%s:%d]" x,\ + __func__, __LINE__, \ + ## __VA_ARGS__);\ + }
svn commit: r318382 - in head/sys: dev/qlnx/qlnxe modules/qlnx/qlnxe
Author: davidcs Date: Tue May 16 21:34:40 2017 New Revision: 318382 URL: https://svnweb.freebsd.org/changeset/base/318382 Log: 1. Move Rx Processing to fp_taskqueue(). With this CPU utilization for processing interrupts drops to around 1% for 100G and under 1% for other speeds. 2. Use sysctls for TRACE_LRO_CNT and TRACE_TSO_PKT_LEN 3. remove unused mtx tx_lock 4. bind taskqueue kernel thread to the appropriate cpu core 5. when tx_ring is full, stop further transmits till at least 1/16th of the Tx Ring is empty. In our case 1K entries. Also if there are rx_pkts to process, put the taskqueue thread to sleep for 100ms, before enabling interrupts. 6. Use rx_pkt_threshold of 128. MFC after:3 days Modified: head/sys/dev/qlnx/qlnxe/qlnx_def.h head/sys/dev/qlnx/qlnxe/qlnx_os.c head/sys/dev/qlnx/qlnxe/qlnx_os.h head/sys/modules/qlnx/qlnxe/Makefile Modified: head/sys/dev/qlnx/qlnxe/qlnx_def.h == --- head/sys/dev/qlnx/qlnxe/qlnx_def.h Tue May 16 19:54:47 2017 (r318381) +++ head/sys/dev/qlnx/qlnxe/qlnx_def.h Tue May 16 21:34:40 2017 (r318382) @@ -191,6 +191,7 @@ struct qlnx_fastpath { struct mtx tx_mtx; chartx_mtx_name[32]; struct buf_ring *tx_br; + uint32_ttx_ring_full; struct task fp_task; struct taskqueue*fp_taskqueue; @@ -364,6 +365,8 @@ struct qlnx_host { /* debug */ uint32_tdbg_level; + uint32_tdbg_trace_lro_cnt; + uint32_tdbg_trace_tso_pkt_len; uint32_tdp_level; uint32_tdp_module; @@ -386,7 +389,6 @@ struct qlnx_host { /* tx related */ struct callout tx_callout; - struct mtx tx_lock; uint32_ttxr_idx; /* rx related */ Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c == --- head/sys/dev/qlnx/qlnxe/qlnx_os.c Tue May 16 19:54:47 2017 (r318381) +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c Tue May 16 21:34:40 2017 (r318382) @@ -382,16 +382,77 @@ qlnx_fp_taskqueue(void *context, int pen struct ifnet *ifp; struct mbuf*mp; intret; + int lro_enable, tc; + int rx_int = 0, total_rx_count = 0; + struct thread *cthread; fp = context; if (fp == NULL) return; + cthread = curthread; + + thread_lock(cthread); + + if (!sched_is_bound(cthread)) + sched_bind(cthread, fp->rss_id); + + thread_unlock(cthread); + ha = (qlnx_host_t *)fp->edev; ifp = ha->ifp; + lro_enable = ha->ifp->if_capenable & IFCAP_LRO; + + rx_int = qlnx_rx_int(ha, fp, ha->rx_pkt_threshold, lro_enable); + + if (rx_int) { + fp->rx_pkts += rx_int; + total_rx_count += rx_int; + } + +#ifdef QLNX_SOFT_LRO + { + struct lro_ctrl *lro; + + lro = &fp->rxq->lro; + + if (lro_enable && total_rx_count) { + +#if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) + + if (ha->dbg_trace_lro_cnt) { + if (lro->lro_mbuf_count & ~1023) + fp->lro_cnt_1024++; + else if (lro->lro_mbuf_count & ~511) + fp->lro_cnt_512++; + else if (lro->lro_mbuf_count & ~255) + fp->lro_cnt_256++; + else if (lro->lro_mbuf_count & ~127) + fp->lro_cnt_128++; + else if (lro->lro_mbuf_count & ~63) + fp->lro_cnt_64++; + } + tcp_lro_flush_all(lro); + +#else + struct lro_entry *queued; + + while ((!SLIST_EMPTY(&lro->lro_active))) { + queued = SLIST_FIRST(&lro->lro_active); + SLIST_REMOVE_HEAD(&lro->lro_active, next); + tcp_lro_flush(lro, queued); + } +#endif /* #if (__FreeBSD_version >= 1100101) || (defined QLNX_QSORT_LRO) */ + } + } +#endif /* #ifdef QLNX_SOFT_LRO */ + + ecore_sb_update_sb_idx(fp->sb_info); + rmb(); + mtx_lock(&fp->tx_mtx); if (((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != @@ -401,13 +462,19 @@ qlnx_fp_taskqueue(void *context, int pen goto qlnx_fp_taskqueue_exit; } -(void)q
svn commit: r318126 - head/sys/dev/qlnx/qlnxe
Author: davidcs Date: Wed May 10 01:01:20 2017 New Revision: 318126 URL: https://svnweb.freebsd.org/changeset/base/318126 Log: llh_func_filter needs to be configured for 100G MFC after:3 days Modified: head/sys/dev/qlnx/qlnxe/ecore_dev.c Modified: head/sys/dev/qlnx/qlnxe/ecore_dev.c == --- head/sys/dev/qlnx/qlnxe/ecore_dev.c Wed May 10 00:42:28 2017 (r318125) +++ head/sys/dev/qlnx/qlnxe/ecore_dev.c Wed May 10 01:01:20 2017 (r318126) @@ -1986,6 +1986,15 @@ static enum _ecore_status_t ecore_hw_ini } } #endif + /* Add an LLH filter with the primary MAC address. */ + if (p_hwfn->p_dev->num_hwfns > 1 && IS_LEAD_HWFN(p_hwfn)) { + rc = ecore_llh_add_mac_filter(p_hwfn, p_ptt, + p_hwfn->hw_info.hw_mac_addr); + if (rc != ECORE_SUCCESS) + DP_NOTICE(p_hwfn, false, + "Failed to add an LLH filter with the primary MAC\n"); + } + if (b_hw_start) { /* enable interrupts */ rc = ecore_int_igu_enable(p_hwfn, p_ptt, int_mode); @@ -2473,6 +2482,11 @@ enum _ecore_status_t ecore_hw_stop(struc rc2 = ECORE_UNKNOWN_ERROR; } } + + /* remove the LLH filter with the primary MAC addres */ + if (p_hwfn->p_dev->num_hwfns > 1 && IS_LEAD_HWFN(p_hwfn)) + ecore_llh_remove_mac_filter(p_hwfn, p_ptt, + p_hwfn->hw_info.hw_mac_addr); } /* hwfn loop */ if (IS_PF(p_dev)) { @@ -4569,7 +4583,7 @@ enum _ecore_status_t ecore_llh_add_mac_f } DP_VERBOSE(p_hwfn, ECORE_MSG_HW, - "MAC: %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx is added at %d\n", + "MAC: %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx is added at LLH entry %d\n", p_filter[0], p_filter[1], p_filter[2], p_filter[3], p_filter[4], p_filter[5], entry_num); @@ -4651,7 +4665,7 @@ void ecore_llh_remove_mac_filter(struct } DP_VERBOSE(p_hwfn, ECORE_MSG_HW, - "MAC: %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx was removed from %d\n", + "MAC: %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx was removed from LLH entry %d\n", p_filter[0], p_filter[1], p_filter[2], p_filter[3], p_filter[4], p_filter[5], entry_num); } @@ -4760,37 +4774,37 @@ ecore_llh_add_protocol_filter(struct eco switch (type) { case ECORE_LLH_FILTER_ETHERTYPE: DP_VERBOSE(p_hwfn, ECORE_MSG_HW, - "ETH type %x is added at %d\n", + "ETH type %x is added at LLH entry %d\n", source_port_or_eth_type, entry_num); break; case ECORE_LLH_FILTER_TCP_SRC_PORT: DP_VERBOSE(p_hwfn, ECORE_MSG_HW, - "TCP src port %x is added at %d\n", + "TCP src port %x is added at LLH entry %d\n", source_port_or_eth_type, entry_num); break; case ECORE_LLH_FILTER_UDP_SRC_PORT: DP_VERBOSE(p_hwfn, ECORE_MSG_HW, - "UDP src port %x is added at %d\n", + "UDP src port %x is added at LLH entry %d\n", source_port_or_eth_type, entry_num); break; case ECORE_LLH_FILTER_TCP_DEST_PORT: DP_VERBOSE(p_hwfn, ECORE_MSG_HW, - "TCP dst port %x is added at %d\n", + "TCP dst port %x is added at LLH entry %d\n", dest_port, entry_num); break; case ECORE_LLH_FILTER_UDP_DEST_PORT: DP_VERBOSE(p_hwfn, ECORE_MSG_HW, - "UDP dst port %x is added at %d\n", + "UDP dst port %x is added at LLH entry %d\n", dest_port, entry_num); break; case ECORE_LLH_FILTER_TCP_SRC_AND_DEST_PORT: DP_VERBOSE(p_hwfn, ECORE_MSG_HW, - "TCP src/dst ports %x/%x are added at %d\n", + "TCP src/dst ports %x/%x are added at LLH entry %d\n", source_port_or_eth_type, dest_port, entry_num); break; case ECORE_LLH_FILTER_UDP_SRC_AND_DEST_PORT: DP_VERBOSE(p_hwfn, ECORE_MSG_HW, - "UDP src/dst ports %x/%x are added at %d\n", + "UDP src/dst ports %x/%x are added at LLH entry %d\n", source_port_or_eth_type, dest_port, entry_num); break; } @@ -4917,7 +4931,7 @@ ecore_llh
svn commit: r317996 - head/sys/dev/qlxgbe
Author: davidcs Date: Tue May 9 01:01:41 2017 New Revision: 317996 URL: https://svnweb.freebsd.org/changeset/base/317996 Log: 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() MFC after:3 days Modified: head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_isr.c == --- head/sys/dev/qlxgbe/ql_isr.cTue May 9 00:51:10 2017 (r317995) +++ head/sys/dev/qlxgbe/ql_isr.cTue May 9 01:01:41 2017 (r317996) @@ -987,7 +987,8 @@ ql_isr(void *arg) fp = &ha->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->fp_task); return; Modified: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Tue May 9 00:51:10 2017(r317995) +++ head/sys/dev/qlxgbe/ql_os.c Tue May 9 01:01:41 2017(r317996) @@ -925,7 +925,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); @@ -1031,20 +1033,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: @@ -1529,9 +1527,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); @@ -1922,8 +1920,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++) { @@ -1943,6 +1939,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-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r317180 - head/sys/dev/qlxgbe
Author: davidcs Date: Thu Apr 20 03:41:42 2017 New Revision: 317180 URL: https://svnweb.freebsd.org/changeset/base/317180 Log: Cleanup QLA_LOCK/QLA_UNLOCK macros remove unused QLA_TX_LOCK/QLA_TX_UNLOCK macros format qla_error_recovery() MFC after:3 days Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_ioctl.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_os.h Modified: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Thu Apr 20 03:36:09 2017(r317179) +++ head/sys/dev/qlxgbe/ql_hw.c Thu Apr 20 03:41:42 2017(r317180) @@ -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: head/sys/dev/qlxgbe/ql_ioctl.c == --- head/sys/dev/qlxgbe/ql_ioctl.c Thu Apr 20 03:36:09 2017 (r317179) +++ head/sys/dev/qlxgbe/ql_ioctl.c Thu Apr 20 03:41:42 2017 (r317180) @@ -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: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Thu Apr 20 03:36:09 2017(r317179) +++ head/sys/dev/qlxgbe/ql_os.c Thu Apr 20 03:41:42 2017(r317180) @@ -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); @@ -890,9 +890,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__)); } @@ -924,13 +924,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); } @@ -953,9 +949,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", @@ -975,10 +971,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); @@ -990,7 +988,7 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, ha->std_replenish = QL_STD_REPLENISH_THRES; - Q
svn commit: r316747 - head/sys/dev/qlnx/qlnxe
Author: davidcs Date: Thu Apr 13 01:17:49 2017 New Revision: 316747 URL: https://svnweb.freebsd.org/changeset/base/316747 Log: Fix rss_ind_table entry for num_funcs > 1 MFC after:3 days Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c == --- head/sys/dev/qlnx/qlnxe/qlnx_os.c Thu Apr 13 00:07:39 2017 (r316746) +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c Thu Apr 13 01:17:49 2017 (r316747) @@ -5840,7 +5840,7 @@ qlnx_update_vport(struct ecore_dev *cdev ha->num_rss; fp = &ha->fp_array[fp_index]; - rss->rss_ind_table[i] = fp->rxq->handle; + rss->rss_ind_table[j] = fp->rxq->handle; } for (j = 0; j < ECORE_RSS_IND_TABLE_SIZE;) { ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r316720 - head/sys/dev/qlnx/qlnxe
Author: davidcs Date: Wed Apr 12 00:52:09 2017 New Revision: 316720 URL: https://svnweb.freebsd.org/changeset/base/316720 Log: Fix defects reported by Coverity 1. Deadcode in ecore_init_cache_line_size(), qlnx_ioctl() and qlnx_clean_filters() 2. ARRAY_VS_SINGLETON issue in qlnx_remove_all_mcast_mac() and qlnx_update_rx_prod() MFC after:5 days Modified: head/sys/dev/qlnx/qlnxe/bcm_osal.h head/sys/dev/qlnx/qlnxe/qlnx_os.c Modified: head/sys/dev/qlnx/qlnxe/bcm_osal.h == --- head/sys/dev/qlnx/qlnxe/bcm_osal.h Tue Apr 11 22:47:02 2017 (r316719) +++ head/sys/dev/qlnx/qlnxe/bcm_osal.h Wed Apr 12 00:52:09 2017 (r316720) @@ -144,7 +144,14 @@ rounddown_pow_of_two(unsigned long x) #define OSAL_CPU_TO_LE16(val) htole16(val) #define OSAL_LE16_TO_CPU(val) le16toh(val) -#define OSAL_CACHE_LINE_SIZE CACHE_LINE_SIZE +static __inline uint32_t +qlnx_get_cache_line_size(void) +{ + return (CACHE_LINE_SIZE); +} + +#define OSAL_CACHE_LINE_SIZE qlnx_get_cache_line_size() + #define OSAL_BE32 uint32_t #define dma_addr_t bus_addr_t #define osal_size_t size_t Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c == --- head/sys/dev/qlnx/qlnxe/qlnx_os.c Tue Apr 11 22:47:02 2017 (r316719) +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c Wed Apr 12 00:52:09 2017 (r316720) @@ -2167,9 +2167,6 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd } QLNX_UNLOCK(ha); - - if (ret) - ret = EINVAL; } break; @@ -5910,25 +5907,26 @@ qlnx_update_rx_prod(struct ecore_hwfn *p uint16_t bd_prod; uint16_t cqe_prod; -struct eth_rx_prod_datarx_prods = {0}; + union { + struct eth_rx_prod_data rx_prod_data; + uint32_tdata32; + } rx_prods; bd_prod = ecore_chain_get_prod_idx(&rxq->rx_bd_ring); cqe_prod = ecore_chain_get_prod_idx(&rxq->rx_comp_ring); /* Update producers */ -rx_prods.bd_prod = htole16(bd_prod); -rx_prods.cqe_prod = htole16(cqe_prod); +rx_prods.rx_prod_data.bd_prod = htole16(bd_prod); +rx_prods.rx_prod_data.cqe_prod = htole16(cqe_prod); /* Make sure that the BD and SGE data is updated before updating the * producers since FW might read the BD/SGE right after the producer * is updated. */ wmb(); - //bus_barrier(ha->pci_reg, 0, 0, BUS_SPACE_BARRIER_READ); - //bus_barrier(ha->pci_dbells, 0, 0, BUS_SPACE_BARRIER_READ); internal_ram_wr(p_hwfn, rxq->hw_rxq_prod_addr, - sizeof(rx_prods), (u32 *)&rx_prods); + sizeof(rx_prods), &rx_prods.data32); /* mmiowb is needed to synchronize doorbell writes from more than one * processor. It guarantees that the write arrives to the device before @@ -6342,9 +6340,8 @@ qlnx_remove_all_mcast_mac(qlnx_host_t *h ha->mcast[i].addr[2] || ha->mcast[i].addr[3] || ha->mcast[i].addr[4] || ha->mcast[i].addr[5]) { - memcpy(&mcast->mac[0], &ha->mcast[i].addr[0], ETH_ALEN); + memcpy(&mcast->mac[i], &ha->mcast[i].addr[0], ETH_ALEN); mcast->num_mc_addrs++; - mcast++; } } mcast = &ha->ecore_mcast; @@ -6363,7 +6360,7 @@ qlnx_clean_filters(qlnx_host_t *ha) intrc = 0; /* Remove all unicast macs */ - qlnx_remove_all_ucast_mac(ha); + rc = qlnx_remove_all_ucast_mac(ha); if (rc) return rc; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r316485 - in head: share/man/man4 sys/conf sys/dev/qlnx sys/dev/qlnx/qlnxe sys/modules sys/modules/qlnx sys/modules/qlnx/qlnxe
.conf 5 : +.Bd -literal -offset indent +if_qlnxe_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, Receive Side scaling, HW and Soft LRO. +For further hardware information, see +.Pa http://www.qlogic.com/ . +.Sh HARDWARE +The +.Nm +driver supports 25/40/100 Gigabit Ethernet & CNA Adapter based on the following +chipsets: +.Pp +.Bl -bullet -compact +.It +QLogic 45000 series +.El +.Sh SUPPORT +For support questions please contact your Cavium approved reseller or +Cavium Technical Support at +.Pa http://support.qlogic.com , +or by E-mail at +.Aq Mt 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 12.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An David C Somayajulu +at Cavium Inc. Modified: head/sys/conf/files.amd64 == --- head/sys/conf/files.amd64 Tue Apr 4 05:56:42 2017(r316484) +++ head/sys/conf/files.amd64 Tue Apr 4 06:16:59 2017(r316485) @@ -364,6 +364,20 @@ dev/qlxgbe/ql_isr.coptionalqlxgbe pci dev/qlxgbe/ql_misc.c optionalqlxgbe pci dev/qlxgbe/ql_os.c optionalqlxgbe pci dev/qlxgbe/ql_reset.c optionalqlxgbe pci +dev/qlnx/qlnxe/ecore_cxt.c optionalqlnxe pci +dev/qlnx/qlnxe/ecore_dbg_fw_funcs.c optional qlnxe pci +dev/qlnx/qlnxe/ecore_dcbx.coptionalqlnxe pci +dev/qlnx/qlnxe/ecore_dev.c optionalqlnxe pci +dev/qlnx/qlnxe/ecore_hw.c optionalqlnxe pci +dev/qlnx/qlnxe/ecore_init_fw_funcs.c optional qlnxe pci +dev/qlnx/qlnxe/ecore_init_ops.coptionalqlnxe pci +dev/qlnx/qlnxe/ecore_int.c optionalqlnxe pci +dev/qlnx/qlnxe/ecore_l2.c optionalqlnxe pci +dev/qlnx/qlnxe/ecore_mcp.c optionalqlnxe pci +dev/qlnx/qlnxe/ecore_sp_commands.c optionalqlnxe pci +dev/qlnx/qlnxe/ecore_spq.c optionalqlnxe pci +dev/qlnx/qlnxe/qlnx_ioctl.coptionalqlnxe pci +dev/qlnx/qlnxe/qlnx_os.c optionalqlnxe pci dev/sfxge/common/ef10_ev.c optionalsfxge pci dev/sfxge/common/ef10_filter.c optionalsfxge pci dev/sfxge/common/ef10_intr.c optionalsfxge pci Added: head/sys/dev/qlnx/qlnxe/bcm_osal.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/qlnx/qlnxe/bcm_osal.h Tue Apr 4 06:16:59 2017 (r316485) @@ -0,0 +1,527 @@ +/* + * Copyright (c) 2017-2018 Cavium, Inc. + * 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. + * + * $FreeBSD$ + */ + +#ifndef __BCM_OSAL_ECORE_PACKAGE +#define __BCM_OSAL_ECORE_PACKAGE + +#include "qlnx_os.h" +#include "ecore_status.h" +#include + +#if __FreeBSD_version >= 1100090 +#include +#else +#include +#endif + +/* + * prototypes of freebsd specific functions required by ecore + */ +extern uint32_t qlnx_pci_bus_get_bar_size(void *ecore_dev, uint8_t bar_id); +extern uint32_t qlnx_pci_read_config_byte(void *ecore_dev, uint32_t pci_reg, +uint8_t *reg_value); +extern uint32_t qlnx_pci_read_config_word(void *ecore_dev, uint32_t pci_reg, +uint16_t *reg_value); +extern uint32_t qlnx_pci_read_config_dword(void *ecore_dev, uint32_t pci_reg, +
svn commit: r316310 - head/share/man/man4
Author: davidcs Date: Thu Mar 30 23:49:57 2017 New Revision: 316310 URL: https://svnweb.freebsd.org/changeset/base/316310 Log: 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). MFC after:5 days Modified: head/share/man/man4/qlxgbe.4 Modified: head/share/man/man4/qlxgbe.4 == --- head/share/man/man4/qlxgbe.4Thu Mar 30 22:43:32 2017 (r316309) +++ head/share/man/man4/qlxgbe.4Thu Mar 30 23:49:57 2017 (r316310) @@ -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-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r316309 - head/sys/dev/qlxgbe
Author: davidcs Date: Thu Mar 30 22:43:32 2017 New Revision: 316309 URL: https://svnweb.freebsd.org/changeset/base/316309 Log: Add support for optional Soft LRO MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Thu Mar 30 22:26:15 2017(r316308) +++ head/sys/dev/qlxgbe/ql_hw.c Thu Mar 30 22:43:32 2017(r316309) @@ -440,6 +440,17 @@ ql_hw_add_sysctls(qla_host_t *ha) OID_AUTO, "enable_9kb", CTLFLAG_RW, &ha->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, &ha->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 = &ha->hw; +struct lro_ctrl *lro; + +for (i = 0; i < hw->num_sds_rings; i++) { +lro = &hw->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 = &ha->hw; +struct lro_ctrl *lro; + + for (i = 0; i < hw->num_sds_rings; i++) { + lro = &hw->sds[i].lro; + +#if (__FreeBSD_version >= 1100101) + tcp_lro_flush_all(lro); +#else +struct lro_entry *queued; + + while ((!SLIST_EMPTY(&lro->lro_active))) { + queued = SLIST_FIRST(&lro->lro_active); + SLIST_REMOVE_HEAD(&lro->lro_active, next); + tcp_lro_flush(lro, queued); + } +#endif /* #if (__FreeBSD_version >= 1100101) */ + } + + return; +} + +static void +qla_free_soft_lro(qla_host_t *ha) +{ +int i; +qla_hw_t *hw = &ha->hw; +struct lro_ctrl *lro; + +for (i = 0; i < hw->num_sds_rings; i++) { + lro = &hw->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 (-1); + } + } if (qla_init_nic_func(ha))
svn commit: r316183 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Mar 29 23:00:07 2017 New Revision: 316183 URL: https://svnweb.freebsd.org/changeset/base/316183 Log: Upgrade firmware and other related files to version 5.4.64 Modified: head/sys/dev/qlxgbe/ql_boot.c head/sys/dev/qlxgbe/ql_fw.c head/sys/dev/qlxgbe/ql_minidump.c head/sys/dev/qlxgbe/ql_reset.c Modified: head/sys/dev/qlxgbe/ql_boot.c == --- head/sys/dev/qlxgbe/ql_boot.c Wed Mar 29 22:33:56 2017 (r316182) +++ head/sys/dev/qlxgbe/ql_boot.c Wed Mar 29 23:00:07 2017 (r316183) @@ -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: head/sys/dev/qlxgbe/ql_fw.c == --- head/sys/dev/qlxgbe/ql_fw.c Wed Mar 29 22:33:56 2017(r316182) +++ head/sys/dev/qlxgbe/ql_fw.c Wed Mar 29 23:00:07 2017(r316183) @@ -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, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -69,118 +69,118 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
svn commit: r314365 - head/sys/dev/bxe
Author: davidcs Date: Mon Feb 27 23:38:51 2017 New Revision: 314365 URL: https://svnweb.freebsd.org/changeset/base/314365 Log: 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 MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_elink.c head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/bxe_stats.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Mon Feb 27 22:53:25 2017(r314364) +++ head/sys/dev/bxe/bxe.c Mon Feb 27 23:38:51 2017(r314365) @@ -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" @@ -496,12 +496,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"} + }; @@ -616,12 +623,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"} + }; @@ -692,6 +706,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); @@ -5231,12 +5246,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; +} } } } @@ -5636,6 +5663,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); @@ -5757,6 +5789,11 @@ bxe_tx_mq_start(struct ifnet *
svn commit: r314062 - head/sys/dev/qlxgbe
Author: davidcs Date: Tue Feb 21 23:32:27 2017 New Revision: 314062 URL: https://svnweb.freebsd.org/changeset/base/314062 Log: add bus_dmamap_unload in ql_free_dmabuf() MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Tue Feb 21 21:48:45 2017(r314061) +++ head/sys/dev/qlxgbe/ql_os.c Tue Feb 21 23:32:27 2017(r314062) @@ -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-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r312728 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Jan 25 00:23:38 2017 New Revision: 312728 URL: https://svnweb.freebsd.org/changeset/base/312728 Log: Added support for if_transmit and if_qflush Removed if_start updated version to 3.10.33 MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_glbl.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_os.h head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_def.h == --- head/sys/dev/qlxgbe/ql_def.hTue Jan 24 23:41:20 2017 (r312727) +++ head/sys/dev/qlxgbe/ql_def.hWed Jan 25 00:23:38 2017 (r312728) @@ -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 independent 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: head/sys/dev/qlxgbe/ql_glbl.h == --- head/sys/dev/qlxgbe/ql_glbl.h Tue Jan 24 23:41:20 2017 (r312727) +++ head/sys/dev/qlxgbe/ql_glbl.h Wed Jan 25 00:23:38 2017 (r312728) @@ -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: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Tue Jan 24 23:41:20 2017(r312727) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Jan 25 00:23:38 2017(r312728) @@ -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]); - rcntxt->sds[i].intr_src_bit = qla_host_to_le16((i)); - } else { - rcntxt->sds[i].intr_id = - qla_host_to_le16(
svn commit: r307578 - head/sys/dev/bxe
Author: davidcs Date: Tue Oct 18 21:33:57 2016 New Revision: 307578 URL: https://svnweb.freebsd.org/changeset/base/307578 Log: 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. MFC after: 5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Tue Oct 18 21:17:31 2016(r307577) +++ head/sys/dev/bxe/bxe.c Tue Oct 18 21:33:57 2016(r307578) @@ -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" @@ -489,7 +489,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 { @@ -602,7 +609,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) @@ -5599,7 +5613,7 @@ bxe_tx_start(if_t 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, @@ -5621,11 +5635,16 @@ bxe_tx_mq_start_locked(struct bxe_softc return (EINVAL); } -if (!sc->link_vars.link_up || -(if_getdrvflags(ifp) & -(IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { -if (m != NULL) -rc = drbr_enqueue(ifp, tx_br, m); +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; } @@ -5635,24 +5654,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_drv(ifp, tx_br); -} else if (drbr_needs_enqueue_drv(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_drv(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++; @@ -5668,11 +5685,11 @@ bxe_tx_mq_start_locked(struct bxe_softc if (next != NULL) { /* mark the TX queue as full and save the frame */ if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0
svn commit: r306790 - head/sys/dev/qlxgbe
Author: davidcs Date: Thu Oct 6 21:39:04 2016 New Revision: 306790 URL: https://svnweb.freebsd.org/changeset/base/306790 Log: Add support for adding up to 64 Multicast addresses with a single mailbox command MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Thu Oct 6 21:32:03 2016(r306789) +++ head/sys/dev/qlxgbe/ql_hw.c Thu Oct 6 21:39:04 2016(r306790) @@ -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 @@ qla_init_xmt_cntxt(qla_host_t *ha) } static int -qla_hw_add_all_mcast(qla_host_t *ha) +qla_hw_all_mcast(qla_host_t *ha, uint32_t add_m
svn commit: r306522 - head/sys/dev/qlxgbe
Author: davidcs Date: Fri Sep 30 19:21:02 2016 New Revision: 306522 URL: https://svnweb.freebsd.org/changeset/base/306522 Log: Upgrade Firmware/Bootloader/ResetSeq/Minidump to revision 5.4.62 MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_boot.c head/sys/dev/qlxgbe/ql_fw.c head/sys/dev/qlxgbe/ql_minidump.c head/sys/dev/qlxgbe/ql_reset.c Modified: head/sys/dev/qlxgbe/ql_boot.c == --- head/sys/dev/qlxgbe/ql_boot.c Fri Sep 30 18:58:50 2016 (r306521) +++ head/sys/dev/qlxgbe/ql_boot.c Fri Sep 30 19:21:02 2016 (r306522) @@ -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, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x
svn commit: r306515 - head/sys/dev/bxe
Author: davidcs Date: Fri Sep 30 18:08:16 2016 New Revision: 306515 URL: https://svnweb.freebsd.org/changeset/base/306515 Log: Revert commit r306284 - Fixes for issues under high workloads Will fix and recommit patch Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Fri Sep 30 17:49:04 2016(r306514) +++ head/sys/dev/bxe/bxe.c Fri Sep 30 18:08:16 2016(r306515) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.89" +#define BXE_DRIVER_VERSION "1.78.81" #include "bxe.h" #include "ecore_sp.h" @@ -489,16 +489,7 @@ 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"}, -{ STATS_OFFSET32(bxe_tx_mq_start_lock_failures), -4, STATS_FLAGS_FUNC, "bxe_tx_mq_start_lock_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_queue_full_return"} }; static const struct { @@ -611,15 +602,7 @@ 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"}, -{ Q_STATS_OFFSET32(bxe_tx_mq_start_lock_failures), -4, "bxe_tx_mq_start_lock_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_queue_full_return"} }; #define BXE_NUM_ETH_STATS ARRAY_SIZE(bxe_eth_stats_arr) @@ -5638,18 +5621,11 @@ bxe_tx_mq_start_locked(struct bxe_softc return (EINVAL); } -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 || (if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { -fp->eth_q_stats.tx_request_link_down_failures++; +if (m != NULL) +rc = drbr_enqueue(ifp, tx_br, m); goto bxe_tx_mq_start_locked_exit; } @@ -5659,22 +5635,24 @@ bxe_tx_mq_start_locked(struct bxe_softc fp->eth_q_stats.tx_max_drbr_queue_depth = depth; } -/* keep adding entries while there are frames to send */ -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; -} +if (m == NULL) { +/* no new work, check for pending frames */ +next = drbr_dequeue_drv(ifp, tx_br); +} else if (drbr_needs_enqueue_drv(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_drv(ifp, tx_br); +} else { +/* new work only and nothing pending */ +next = m; +} + +/* keep adding entries while there are frames to send */ +while (next != NULL) { /* the mbuf now belongs to us */ fp->eth_q_stats.mbuf_alloc_tx++; @@ -5689,12 +5667,12 @@ bxe_tx_mq_start_locked(struct bxe_softc fp->eth_q_stats.tx_encap_failures++; if (next != NULL) { /* mark the TX queue as full and save the frame */ -ifp->if_drv_flags |= IFF_DRV_OACTIVE; -drbr_putback(ifp, tx_br, next); +if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); +/* XXX this may reorder the frame */ +rc = drbr_enqueue(ifp, tx_br, next); fp->eth_q_stats.mbuf_a
svn commit: r306284 - head/sys/dev/bxe
Author: davidcs Date: Fri Sep 23 23:18:54 2016 New Revision: 306284 URL: https://svnweb.freebsd.org/changeset/base/306284 Log: Fixes for issues under high workloads MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Fri Sep 23 23:11:58 2016(r306283) +++ head/sys/dev/bxe/bxe.c Fri Sep 23 23:18:54 2016(r306284) @@ -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" @@ -489,7 +489,16 @@ 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(bxe_tx_mq_start_lock_failures), +4, STATS_FLAGS_FUNC, "bxe_tx_mq_start_lock_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"} + }; static const struct { @@ -602,7 +611,15 @@ 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(bxe_tx_mq_start_lock_failures), +4, "bxe_tx_mq_start_lock_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"} }; #define BXE_NUM_ETH_STATS ARRAY_SIZE(bxe_eth_stats_arr) @@ -5621,11 +5638,18 @@ bxe_tx_mq_start_locked(struct bxe_softc return (EINVAL); } +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 || (if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { -if (m != NULL) -rc = drbr_enqueue(ifp, tx_br, m); +fp->eth_q_stats.tx_request_link_down_failures++; goto bxe_tx_mq_start_locked_exit; } @@ -5635,24 +5659,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_drv(ifp, tx_br); -} else if (drbr_needs_enqueue_drv(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_drv(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++; @@ -5667,12 +5689,12 @@ bxe_tx_mq_start_locked(struct bxe_softc fp->eth_q_stats.tx_encap_failures++; if (next != NULL) { /* mark the TX queue as full and save the frame */ -if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); -/* XXX this may reorder the frame */ -rc = drbr_enqueue(ifp, tx_br, next); +ifp->if_drv_flags |= IFF_DRV_OACTIVE; +drbr_putback(ifp, tx_br, next); fp->eth_q_stats.mbuf_alloc_tx--; fp->eth_q_stats.tx_frames_deferred++; -} +
svn commit: r304249 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Aug 17 02:40:17 2016 New Revision: 304249 URL: https://svnweb.freebsd.org/changeset/base/304249 Log: Add support for set/get cam search mode MFC after: 5 days Modified: head/sys/dev/qlxgbe/ql_dbg.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_dbg.h == --- head/sys/dev/qlxgbe/ql_dbg.hWed Aug 17 01:57:58 2016 (r304248) +++ head/sys/dev/qlxgbe/ql_dbg.hWed Aug 17 02:40:17 2016 (r304249) @@ -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: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Wed Aug 17 01:57:58 2016(r304248) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Aug 17 02:40:17 2016(r304249) @@ -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, &ret, 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, &ret, 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; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), @@ -407,7 +479,8 @@ ql_hw_add_sysctls(qla_host_t *ha) "\t\t\t 7: ocm: offchip memory rd_wr failure\n"
svn commit: r304248 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Aug 17 01:57:58 2016 New Revision: 304248 URL: https://svnweb.freebsd.org/changeset/base/304248 Log: Add ql_minidump.h MFC after:5 days Added: head/sys/dev/qlxgbe/ql_minidump.h (contents, props changed) Added: head/sys/dev/qlxgbe/ql_minidump.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/qlxgbe/ql_minidump.h Wed Aug 17 01:57:58 2016 (r304248) @@ -0,0 +1,470 @@ +/* + * Copyright (c) 2013-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_minidump.h + * + * $FreeBSD$ + */ +#ifndef _QL_MINIDUMP_H_ +#define _QL_MINIDUMP_H_ + +#define QL_DBG_STATE_ARRAY_LEN 16 +#define QL_DBG_CAP_SIZE_ARRAY_LEN 8 +#define QL_NO_OF_OCM_WINDOWS16 + + +typedef struct ql_mdump_tmplt_hdr { +uint32_t entry_type ; +uint32_t first_entry_offset ; +uint32_t size_of_template ; +uint32_t recommended_capture_mask; + +uint32_t num_of_entries ; +uint32_t version ; +uint32_t driver_timestamp ; +uint32_t checksum ; + +uint32_t driver_capture_mask ; +uint32_t driver_info_word2 ; +uint32_t driver_info_word3 ; +uint32_t driver_info_word4 ; + +uint32_t saved_state_array[QL_DBG_STATE_ARRAY_LEN] ; +uint32_t capture_size_array[QL_DBG_CAP_SIZE_ARRAY_LEN] ; + +uint32_t ocm_window_array[QL_NO_OF_OCM_WINDOWS] ; +} ql_minidump_template_hdr_t ; + +/* + * MIU AGENT ADDRESSES. + */ + +#define MD_TA_CTL_ENABLE0x2 +#define MD_TA_CTL_START 0x1 +#define MD_TA_CTL_BUSY 0x8 +#define MD_TA_CTL_CHECK 1000 + +#define MD_MIU_TEST_AGT_CTRL0x4190 +#define MD_MIU_TEST_AGT_ADDR_LO 0x4194 +#define MD_MIU_TEST_AGT_ADDR_HI 0x4198 + +#define MD_MIU_TEST_AGT_RDDATA_0_31 0x41A8 +#define MD_MIU_TEST_AGT_RDDATA_32_630x41AC +#define MD_MIU_TEST_AGT_RDDATA_64_950x41B8 +#define MD_MIU_TEST_AGT_RDDATA_96_127 0x41BC + +#define MD_MIU_TEST_AGT_WRDATA_0_31 0x41A0 +#define MD_MIU_TEST_AGT_WRDATA_32_630x41A4 +#define MD_MIU_TEST_AGT_WRDATA_64_950x41B0 +#define MD_MIU_TEST_AGT_WRDATA_96_127 0x41B4 + +/* + * ROM Read Address + */ + +#define MD_DIRECT_ROM_WINDOW0x42110030 +#define MD_DIRECT_ROM_READ_BASE 0x4215 + +/* + * Entry Type Defines + */ + +#define RDNOP 0 +#define RDCRB 1 +#defineRDMUX 2 +#define QUEUE 3 +#define BOARD 4 +#define RDOCM 6 +#define L1DAT 11 +#define L1INS 12 +#define L2DTG 21 +#define L2ITG 22 +#define L2DAT 23 +#define L2INS 24 +#define POLLRD 35 +#define RDMUX2 36 +#define POLLRDMWR 37 +#define RDROM 71 +#define RDMEM 72 +#define CNTRL 98 +#define TLHDR 99 +#define RDEND 255 + +/* + * Index of State Table. The Template header maintains + * an array of 8 (0..7) words that is used to store some + * "State Information" from the board. + */ + +#define QL_PCIE_FUNC_INDX 0 +#define QL_CLK_STATE_INDX 1 +#define QL_SRE_STATE_INDX 2 +#define QL_OCM0_ADDR_INDX 3 + +#define QL_REVID_STATE_INDX 4
svn commit: r304247 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Aug 17 01:56:37 2016 New Revision: 304247 URL: https://svnweb.freebsd.org/changeset/base/304247 Log: Upgrade fw, bootloader and minidump template to version 5.4.58 Add minidump retrieval code MFC after: 5 days Modified: head/sys/dev/qlxgbe/ql_boot.c head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_fw.c head/sys/dev/qlxgbe/ql_glbl.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_ioctl.c head/sys/dev/qlxgbe/ql_ioctl.h head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_minidump.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_reset.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_boot.c == --- head/sys/dev/qlxgbe/ql_boot.c Wed Aug 17 01:24:34 2016 (r304246) +++ head/sys/dev/qlxgbe/ql_boot.c Wed Aug 17 01:56:37 2016 (r304247) @@ -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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1589,7 +1589,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x14, 0x7c, 0x
svn commit: r298591 - in head/sys: dev/bxe modules/bxe
Author: davidcs Date: Mon Apr 25 18:55:01 2016 New Revision: 298591 URL: https://svnweb.freebsd.org/changeset/base/298591 Log: 1. Removed -Wno-shift-negative-value from Makefile 2. Fixed warning its absence caused in bxe_elink.c MFC after:5 days Modified: head/sys/dev/bxe/bxe_elink.c head/sys/modules/bxe/Makefile Modified: head/sys/dev/bxe/bxe_elink.c == --- head/sys/dev/bxe/bxe_elink.cMon Apr 25 18:44:11 2016 (r298590) +++ head/sys/dev/bxe/bxe_elink.cMon Apr 25 18:55:01 2016 (r298591) @@ -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: head/sys/modules/bxe/Makefile == --- head/sys/modules/bxe/Makefile Mon Apr 25 18:44:11 2016 (r298590) +++ head/sys/modules/bxe/Makefile Mon Apr 25 18:55:01 2016 (r298591) @@ -17,6 +17,5 @@ SRCS += bxe.c \ 57712_init_values.c CFLAGS += -I${BXE} -CFLAGS += -Wno-shift-negative-value .include ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r298496 - head/sys/dev/bxe
Author: davidcs Date: Sat Apr 23 01:22:12 2016 New Revision: 298496 URL: https://svnweb.freebsd.org/changeset/base/298496 Log: Remove Unused/Dead Code MFC after:5 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Sat Apr 23 01:22:04 2016(r298495) +++ head/sys/dev/bxe/bxe.c Sat Apr 23 01:22:12 2016(r298496) @@ -4429,115 +4429,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, &nvdata_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, &nvdata_base, sizeof(struct bxe_nvram_data)); -} else { -nvdata = &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 *)&sc->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) @@ -4578,8 +4469,6 @@ bxe_ioctl(if_t ifp, { struct bxe_softc *sc = if_getsoftc(ifp); struct ifreq *ifr = (struct ifreq *)data; -struct bxe_nvram_data *nvdata; -uint32_t priv_op; int mask = 0; int reinit = 0; int error = 0; @@ -4768,36 +4657,6 @@ bxe_ioctl(if_t ifp, error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command); break; -case SIOCGPRIVATE_0: -copyin(ifr->ifr_data, &priv_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", - nvdata->offset, nvdata->len); -error = bxe_ioctl_nvram(sc, priv_op, ifr); -break; - -
svn commit: r298294 - head/sys/dev/bxe
Author: davidcs Date: Tue Apr 19 20:28:30 2016 New Revision: 298294 URL: https://svnweb.freebsd.org/changeset/base/298294 Log: 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: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Tue Apr 19 20:19:21 2016(r298293) +++ head/sys/dev/bxe/bxe.c Tue Apr 19 20:28:30 2016(r298294) @@ -672,7 +672,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); @@ -3449,6 +3448,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); @@ -15637,30 +15640,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, &result, 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; @@ -15811,14 +15790,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, &sc->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, &sc->grcdump_done, 0, + CTLFLAG_RD, &sc->grcdump_done, 0, "set by driver when grcdump is done"); sc->rx_budget = bxe_rx_budget; @@ -18650,7 +18631,7 @@ bxe_get_preset_regs(struct bxe_softc *sc return 0; } -static int +int bxe_grc_dump(struct bxe_softc *sc) { int rval = 0; @@ -18658,12 +18639,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; @@ -18695,7 +18717,7 @@ bxe_grc_dump(struct bxe_softc *sc) (preset_idx == 11)) continue; -rval = bxe_get_preset_regs(sc, sc->grc_dump, preset_idx); +rval = bxe_get_preset_regs(sc, (uint32_t *)buf, prese
svn commit: r297922 - head/sys/dev/bxe
Author: davidcs Date: Wed Apr 13 13:14:18 2016 New Revision: 297922 URL: https://svnweb.freebsd.org/changeset/base/297922 Log: reversed commits r297916 r297909 r297898 due to i386 build failures. MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Wed Apr 13 12:32:58 2016(r297921) +++ head/sys/dev/bxe/bxe.c Wed Apr 13 13:14:18 2016(r297922) @@ -672,6 +672,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); static int bxe_alloc_buf_rings(struct bxe_softc *sc); static void bxe_free_buf_rings(struct bxe_softc *sc); @@ -3448,10 +3449,6 @@ 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); @@ -15640,6 +15637,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, &result, 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; @@ -15790,16 +15811,14 @@ bxe_add_sysctls(struct bxe_softc *sc) "debug logging mode"); #endif /* #if __FreeBSD_version >= 90 */ -sc->trigger_grcdump = 0; -SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump", - CTLFLAG_RW, &sc->trigger_grcdump, 0, - "trigger grcdump should be invoked" - " before collecting grcdump"); +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_started = 0; sc->grcdump_done = 0; SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "grcdump_done", - CTLFLAG_RD, &sc->grcdump_done, 0, + CTLFLAG_RW, &sc->grcdump_done, 0, "set by driver when grcdump is done"); sc->rx_budget = bxe_rx_budget; @@ -18631,7 +18650,7 @@ bxe_get_preset_regs(struct bxe_softc *sc return 0; } -int +static int bxe_grc_dump(struct bxe_softc *sc) { int rval = 0; @@ -18639,53 +18658,12 @@ 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 || sc->grcdump_started) +if (sc->grcdump_done) 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; @@ -18717,7 +18695,7 @@ bxe_grc_dump(struct bxe_softc *sc) (preset_idx == 11)) continue; -rval = bxe_get_preset_regs(sc, (uint32_t *)buf, preset_idx); +rval = bxe_get_preset_regs(sc, sc->grc_dump, preset_idx); if (rval) break; @@ -18727,81 +18705,9 @@ bxe_grc_dump(struct bxe_softc *sc) buf += size; } -bxe_pretend_func(sc, 0); -ecore_clear_blocks_parity(sc); -ecore_enable_blocks_parity(sc); - -bxe_pretend_func(sc, 1); ecore_clear_blocks_parity(sc);
svn commit: r297916 - head/sys/dev/bxe
Author: davidcs Date: Wed Apr 13 11:24:24 2016 New Revision: 297916 URL: https://svnweb.freebsd.org/changeset/base/297916 Log: Fix compilation error on i386 Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Wed Apr 13 10:35:17 2016(r297915) +++ head/sys/dev/bxe/bxe.c Wed Apr 13 11:24:24 2016(r297916) @@ -18752,12 +18752,12 @@ bxe_grc_dump(struct bxe_softc *sc) (uintmax_t)sc->fw_stats_req_mapping, (uintmax_t)sc->fw_stats_data_mapping, sc->fw_stats_req, (sc->fw_stats_req_size + sc->fw_stats_data_size)); -BLOGI(sc, "def_status_block paddr %p vaddr %p size 0x%lx\n", +BLOGI(sc, "def_status_block paddr %p vaddr %p size 0x%zx\n", (void *)sc->def_sb_dma.paddr, sc->def_sb, sizeof(struct host_sp_status_block)); BLOGI(sc, "event_queue paddr %#jx vaddr %p size 0x%x\n", (uintmax_t)sc->eq_dma.paddr, sc->eq_dma.vaddr, BCM_PAGE_SIZE); -BLOGI(sc, "slow path paddr %#jx vaddr %p size 0x%lx\n", +BLOGI(sc, "slow path paddr %#jx vaddr %p size 0x%zx\n", (uintmax_t)sc->sp_dma.paddr, sc->sp_dma.vaddr, sizeof(struct bxe_slowpath)); BLOGI(sc, "slow path queue paddr %#jx vaddr %p size 0x%x\n", @@ -18767,7 +18767,7 @@ bxe_grc_dump(struct bxe_softc *sc) FW_BUF_SIZE); for (i = 0; i < sc->num_queues; i++) { fp = &sc->fp[i]; -BLOGI(sc, "FP status block fp %d paddr %#jx vaddr %p size 0x%lx\n", i, +BLOGI(sc, "FP status block fp %d paddr %#jx vaddr %p size 0x%zx\n", i, (uintmax_t)fp->sb_dma.paddr, fp->sb_dma.vaddr, sizeof(union bxe_host_hc_status_block)); BLOGI(sc, "TX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, @@ -18776,7 +18776,7 @@ bxe_grc_dump(struct bxe_softc *sc) BLOGI(sc, "RX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, (uintmax_t)fp->rx_dma.paddr, fp->rx_dma.vaddr, (BCM_PAGE_SIZE * RX_BD_NUM_PAGES)); -BLOGI(sc, "RX RCQ CHAIN fp %d paddr %#jx vaddr %p size 0x%lx\n", i, +BLOGI(sc, "RX RCQ CHAIN fp %d paddr %#jx vaddr %p size 0x%zx\n", i, (uintmax_t)fp->rcq_dma.paddr, fp->rcq_dma.vaddr, (BCM_PAGE_SIZE * RCQ_NUM_PAGES)); BLOGI(sc, "RX SGE CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r297909 - head/sys/dev/bxe
Author: davidcs Date: Wed Apr 13 04:13:36 2016 New Revision: 297909 URL: https://svnweb.freebsd.org/changeset/base/297909 Log: Fix build failure on i386. Need to typecast a bunch of variables to (uintmax_t) MFC after:5 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Wed Apr 13 03:45:39 2016(r297908) +++ head/sys/dev/bxe/bxe.c Wed Apr 13 04:13:36 2016(r297909) @@ -18743,7 +18743,8 @@ bxe_grc_dump(struct bxe_softc *sc) for (i = 0, allocated = 0; allocated < context_size; i++) { BLOGI(sc, "cdu_context i %d paddr %#jx vaddr %p size 0x%zx\n", i, -sc->context[i].vcxt_dma.paddr, sc->context[i].vcxt_dma.vaddr, +(uintmax_t)sc->context[i].vcxt_dma.paddr, +sc->context[i].vcxt_dma.vaddr, sc->context[i].size); allocated += sc->context[i].size; } @@ -18755,36 +18756,38 @@ bxe_grc_dump(struct bxe_softc *sc) (void *)sc->def_sb_dma.paddr, sc->def_sb, sizeof(struct host_sp_status_block)); BLOGI(sc, "event_queue paddr %#jx vaddr %p size 0x%x\n", -sc->eq_dma.paddr, sc->eq_dma.vaddr, BCM_PAGE_SIZE); +(uintmax_t)sc->eq_dma.paddr, sc->eq_dma.vaddr, BCM_PAGE_SIZE); BLOGI(sc, "slow path paddr %#jx vaddr %p size 0x%lx\n", -sc->sp_dma.paddr, sc->sp_dma.vaddr, sizeof(struct bxe_slowpath)); +(uintmax_t)sc->sp_dma.paddr, sc->sp_dma.vaddr, +sizeof(struct bxe_slowpath)); BLOGI(sc, "slow path queue paddr %#jx vaddr %p size 0x%x\n", -sc->spq_dma.paddr, sc->spq_dma.vaddr, BCM_PAGE_SIZE); +(uintmax_t)sc->spq_dma.paddr, sc->spq_dma.vaddr, BCM_PAGE_SIZE); BLOGI(sc, "fw_buf paddr %#jx vaddr %p size 0x%x\n", -sc->gz_buf_dma.paddr, sc->gz_buf_dma.vaddr, FW_BUF_SIZE); +(uintmax_t)sc->gz_buf_dma.paddr, sc->gz_buf_dma.vaddr, +FW_BUF_SIZE); for (i = 0; i < sc->num_queues; i++) { fp = &sc->fp[i]; BLOGI(sc, "FP status block fp %d paddr %#jx vaddr %p size 0x%lx\n", i, -fp->sb_dma.paddr, fp->sb_dma.vaddr, +(uintmax_t)fp->sb_dma.paddr, fp->sb_dma.vaddr, sizeof(union bxe_host_hc_status_block)); BLOGI(sc, "TX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, -fp->tx_dma.paddr, fp->tx_dma.vaddr, +(uintmax_t)fp->tx_dma.paddr, fp->tx_dma.vaddr, (BCM_PAGE_SIZE * TX_BD_NUM_PAGES)); BLOGI(sc, "RX BD CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, -fp->rx_dma.paddr, fp->rx_dma.vaddr, +(uintmax_t)fp->rx_dma.paddr, fp->rx_dma.vaddr, (BCM_PAGE_SIZE * RX_BD_NUM_PAGES)); BLOGI(sc, "RX RCQ CHAIN fp %d paddr %#jx vaddr %p size 0x%lx\n", i, -fp->rcq_dma.paddr, fp->rcq_dma.vaddr, +(uintmax_t)fp->rcq_dma.paddr, fp->rcq_dma.vaddr, (BCM_PAGE_SIZE * RCQ_NUM_PAGES)); BLOGI(sc, "RX SGE CHAIN fp %d paddr %#jx vaddr %p size 0x%x\n", i, -fp->rx_sge_dma.paddr, fp->rx_sge_dma.vaddr, +(uintmax_t)fp->rx_sge_dma.paddr, fp->rx_sge_dma.vaddr, (BCM_PAGE_SIZE * RX_SGE_NUM_PAGES)); } ilt_cli = &ilt->clients[1]; for (i = ilt_cli->start; i <= ilt_cli->end; i++) { BLOGI(sc, "ECORE_ILT paddr %#jx vaddr %p size 0x%x\n", -((struct bxe_dma *)((&ilt->lines[i])->page))->paddr, +(uintmax_t)(((struct bxe_dma *)((&ilt->lines[i])->page))->paddr), ((struct bxe_dma *)((&ilt->lines[i])->page))->vaddr, BCM_PAGE_SIZE); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r297898 - head/sys/dev/bxe
Author: davidcs Date: Wed Apr 13 00:53:04 2016 New Revision: 297898 URL: https://svnweb.freebsd.org/changeset/base/297898 Log: 1. modify fwdump (a.k.a 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 Approved by:davi...@freebsd.org MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Wed Apr 13 00:30:42 2016(r297897) +++ head/sys/dev/bxe/bxe.c Wed Apr 13 00:53:04 2016(r297898) @@ -672,7 +672,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); @@ -3449,6 +3448,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); @@ -15637,30 +15640,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, &result, 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; @@ -15811,14 +15790,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, &sc->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, &sc->grcdump_done, 0, + CTLFLAG_RD, &sc->grcdump_done, 0, "set by driver when grcdump is done"); sc->rx_budget = bxe_rx_budget; @@ -18650,7 +18631,7 @@ bxe_get_preset_regs(struct bxe_softc *sc return 0; } -static int +int bxe_grc_dump(struct bxe_softc *sc) { int rval = 0; @@ -18658,12 +18639,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; @@ -18695,7 +18717,7 @@ bxe_grc_dump(struct bxe_softc *sc) (preset_idx == 11)) continue; -rval = bxe_get_preset_regs(sc, sc->grc_dump, preset_idx); +rval = bxe_get_p
svn commit: r297884 - head/sys/dev/bxe
Author: davidcs Date: Tue Apr 12 22:31:48 2016 New Revision: 297884 URL: https://svnweb.freebsd.org/changeset/base/297884 Log: Add support for Flash Update Submitted by:nrapendra.si...@qlogic.com;vaishali.kulka...@qlogic.com;davi...@freebsd.org Approved by:davi...@freebsd.org MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_ioctl.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Tue Apr 12 22:11:29 2016(r297883) +++ head/sys/dev/bxe/bxe.c Tue Apr 12 22:31:48 2016(r297884) @@ -13653,49 +13653,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) \ @@ -18714,6 +18725,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(&bxe_cdevsw, sc->ifp->if_dunit, UID_ROOT, @@ -18725,6 +18744,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); } @@ -18740,12 +18761,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 ((if_getdrvflags(sc->ifp) & 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, + eeprom->eeprom_data_len); +break; + +case BXE_EEPROM_CMD_GET_EEPROM: + +rval = bxe_
svn commit: r297873 - head/sys/dev/bxe
Author: davidcs Date: Tue Apr 12 21:00:38 2016 New Revision: 297873 URL: https://svnweb.freebsd.org/changeset/base/297873 Log: 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 Approved by:davi...@freebsd.org MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe_stats.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Tue Apr 12 20:59:25 2016(r297872) +++ head/sys/dev/bxe/bxe.c Tue Apr 12 21:00:38 2016(r297873) @@ -487,7 +487,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 { @@ -598,7 +600,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) @@ -4619,7 +4623,7 @@ bxe_ioctl(if_t ifp, if (if_getdrvflags(ifp) & 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 { @@ -5723,11 +5727,6 @@ bxe_tx_start(if_t ifp) return; } -if (if_getdrvflags(ifp) & 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; @@ -5735,6 +5734,11 @@ bxe_tx_start(if_t ifp) fp = &sc->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); @@ -9936,21 +9940,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. @@ -12269,6 +12258,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)) { @@ -12291,6 +12282,48 @@ bxe_periodic_callout_func(void *xsc) return; } +#if __FreeBSD_version >= 80 + +FOR_EACH_QUEUE(sc, i) { +fp = &sc->fp[i]; + +if (BXE_FP_TX_TRYLOCK(fp)) { +if_t ifp = sc->ifp; +/* + * 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 = &sc->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. */ FOR_EACH_QUEUE(sc, i) { if (bxe_watchdog(sc, &sc->fp[i]) != 0) { @@ -16137,6 +16170,7 @@ bxe_detach(device_t dev)
svn commit: r297155 - head/sys/dev/bxe
Author: davidcs Date: Mon Mar 21 18:48:20 2016 New Revision: 297155 URL: https://svnweb.freebsd.org/changeset/base/297155 Log: Modifications to achieve a common source base from FreeBSD7.x thru 10.x MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Mon Mar 21 18:02:26 2016(r297154) +++ head/sys/dev/bxe/bxe.c Mon Mar 21 18:48:20 2016(r297155) @@ -3063,7 +3063,7 @@ bxe_tpa_stop(struct bxe_softc * #if __FreeBSD_version >= 80 /* specify what RSS queue was used for this flow */ m->m_pkthdr.flowid = fp->index; -M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); +BXE_SET_FLOWID(m); #endif if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); @@ -3352,7 +3352,7 @@ bxe_rxeof(struct bxe_softc*sc, #if __FreeBSD_version >= 80 /* specify what RSS queue was used for this flow */ m->m_pkthdr.flowid = fp->index; -M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); +BXE_SET_FLOWID(m); #endif next_rx: @@ -4829,6 +4829,8 @@ bxe_dump_mbuf(struct bxe_softc *sc, } while (m) { + +#if __FreeBSD_version >= 100 BLOGD(sc, DBG_MBUF, "%02d: mbuf=%p m_len=%d m_flags=0x%b m_data=%p\n", i, m, m->m_len, m->m_flags, M_FLAG_BITS, m->m_data); @@ -4839,6 +4841,26 @@ bxe_dump_mbuf(struct bxe_softc *sc, i, m->m_pkthdr.len, m->m_flags, M_FLAG_BITS, (int)m->m_pkthdr.csum_flags, CSUM_BITS); } +#else +BLOGD(sc, DBG_MBUF, + "%02d: mbuf=%p m_len=%d m_flags=0x%b m_data=%p\n", + i, m, m->m_len, m->m_flags, + "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY", m->m_data); + +if (m->m_flags & M_PKTHDR) { + BLOGD(sc, DBG_MBUF, + "%02d: - m_pkthdr: tot_len=%d flags=0x%b csum_flags=%b\n", + i, m->m_pkthdr.len, m->m_flags, + "\20\12M_BCAST\13M_MCAST\14M_FRAG" + "\15M_FIRSTFRAG\16M_LASTFRAG\21M_VLANTAG" + "\22M_PROMISC\23M_NOFREE", + (int)m->m_pkthdr.csum_flags, + "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP\4CSUM_IP_FRAGS" + "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED" + "\12CSUM_IP_VALID\13CSUM_DATA_VALID" + "\14CSUM_PSEUDO_HDR"); +} +#endif /* #if __FreeBSD_version >= 100 */ if (m->m_flags & M_EXT) { switch (m->m_ext.ext_type) { @@ -5222,7 +5244,9 @@ bxe_tx_encap(struct bxe_fastpath *fp, st sc = fp->sc; +#if __FreeBSD_version >= 80 M_ASSERTPKTHDR(*m_head); +#endif /* #if __FreeBSD_version >= 80 */ m0 = *m_head; rc = defragged = nbds = ovlan = vlan_off = total_pkt_size = 0; @@ -5741,7 +5765,7 @@ bxe_tx_mq_start_locked(struct bxe_softc if (!sc->link_vars.link_up || (if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { -rc = drbr_enqueue_drv(ifp, tx_br, m); +rc = drbr_enqueue(ifp, tx_br, m); goto bxe_tx_mq_start_locked_exit; } @@ -5756,7 +5780,7 @@ bxe_tx_mq_start_locked(struct bxe_softc next = drbr_dequeue_drv(ifp, tx_br); } else if (drbr_needs_enqueue_drv(ifp, tx_br)) { /* have both new and pending work, maintain packet order */ -rc = drbr_enqueue_drv(ifp, tx_br, m); +rc = drbr_enqueue(ifp, tx_br, m); if (rc != 0) { fp->eth_q_stats.tx_soft_errors++; goto bxe_tx_mq_start_locked_exit; @@ -5785,7 +5809,7 @@ bxe_tx_mq_start_locked(struct bxe_softc /* mark the TX queue as full and save the frame */ if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); /* XXX this may reorder the frame */ -rc = drbr_enqueue_drv(ifp, tx_br, next); +rc = drbr_enqueue(ifp, tx_br, next); fp->eth_q_stats.mbuf_alloc_tx--; fp->eth_q_stats.tx_frames_deferred++; } @@ -5837,7 +5861,8 @@ bxe_tx_mq_start(struct ifnet *ifp, fp_index = 0; /* default is the first queue */ /* check if flowid is set */ -if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) + +if (BXE_VALID_FLOWID(m)) fp_index = (m->m_pkthdr.flowid % sc->num_queues); fp = &sc->fp[fp_index]; @@ -5846,7 +5871,7 @@ bxe_tx_mq_start(struct ifnet *ifp, rc = bxe_tx_mq_start_locked(sc, ifp, fp, m); BXE_FP_TX_UNLOCK(fp); } else -rc = drbr_enqueue_drv(ifp, fp->tx_br, m); +rc = drbr_enqueue(ifp, fp->tx_br, m); return (rc); } @@ -15677,18 +15702,11 @@ bxe_add_sysctls(struct bxe_softc *sc) CTLFLAG_RD, BXE_DRIVER_VERSION, 0, "version"); -SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bc_versio
svn commit: r296579 - head/sys/dev/bxe
Author: davidcs Date: Wed Mar 9 21:12:26 2016 New Revision: 296579 URL: https://svnweb.freebsd.org/changeset/base/296579 Log: Fix code so that buf_ring allocation for Tx Queues and their mutexes is done during during bxe_attach() and freed during bxe_detach() MFC after: 5 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Wed Mar 9 21:05:21 2016(r296578) +++ head/sys/dev/bxe/bxe.c Wed Mar 9 21:12:26 2016(r296579) @@ -669,6 +669,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 @@ -4193,9 +4195,20 @@ bxe_nic_unload(struct bxe_softc *sc, { uint8_t global = FALSE; uint32_t val; +int i; BXE_CORE_LOCK_ASSERT(sc); +if_setdrvflagbits(sc->ifp, 0, IFF_DRV_RUNNING); + +for (i = 0; i < sc->num_queues; i++) { +struct bxe_fastpath *fp; + +fp = &sc->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 */ @@ -5726,7 +5739,7 @@ bxe_tx_mq_start_locked(struct bxe_softc } if (!sc->link_vars.link_up || -(ifp->if_drv_flags & +(if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { rc = drbr_enqueue_drv(ifp, tx_br, m); goto bxe_tx_mq_start_locked_exit; @@ -6239,8 +6252,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 @@ -6270,14 +6281,6 @@ bxe_free_fp_buffers(struct bxe_softc *sc } /* XXX verify all mbufs were reclaimed */ - -if (mtx_initialized(&fp->tx_mtx)) { -mtx_destroy(&fp->tx_mtx); -} - -if (mtx_initialized(&fp->rx_mtx)) { -mtx_destroy(&fp->rx_mtx); -} } } @@ -6499,15 +6502,6 @@ bxe_alloc_fp_buffers(struct bxe_softc *s for (i = 0; i < sc->num_queues; i++) { fp = &sc->fp[i]; -#if __FreeBSD_version >= 80 -fp->tx_br = buf_ring_alloc(BXE_BR_SIZE, M_DEVBUF, - M_NOWAIT, &fp->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; @@ -9615,14 +9609,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(&fp->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(&fp->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)); @@ -15788,6 +15774,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 = &sc->fp[i]; + +fp->tx_br = buf_ring_alloc(BXE_BR_SIZE, M_DEVBUF, + M_NOWAIT, &fp->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 = &sc->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 = &sc->fp[i]; + +snprintf(fp->tx_mtx_name, sizeof(fp->tx_mtx_name), +"bxe%d_fp%d_tx_lock", sc->unit, i); +mtx_init(&fp->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(&fp->rx_mtx, fp->rx_mtx_name, NULL, MTX_DEF); +} +} + +static void +bxe_destroy_fp_mutexs(struct bxe_softc *sc) +{ +int i; +struct bxe_fa
svn commit: r296071 - in head/sys: dev/bxe modules/bxe
Author: davidcs Date: Thu Feb 25 22:44:00 2016 New Revision: 296071 URL: https://svnweb.freebsd.org/changeset/base/296071 Log: Upgrade the firmware carried in driver and loaded during hardware initialization (a.k.a STORM firmware) to version 7.13.1 (latest version) Modified: head/sys/dev/bxe/57710_init_values.c head/sys/dev/bxe/57710_int_offsets.h head/sys/dev/bxe/57711_init_values.c head/sys/dev/bxe/57711_int_offsets.h head/sys/dev/bxe/57712_init_values.c head/sys/dev/bxe/57712_int_offsets.h head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_elink.c head/sys/dev/bxe/bxe_elink.h head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/ecore_fw_defs.h head/sys/dev/bxe/ecore_hsi.h head/sys/dev/bxe/ecore_init.h head/sys/dev/bxe/ecore_init_ops.h head/sys/dev/bxe/ecore_mfw_req.h head/sys/dev/bxe/ecore_reg.h head/sys/dev/bxe/ecore_sp.c head/sys/dev/bxe/ecore_sp.h head/sys/modules/bxe/Makefile Modified: head/sys/dev/bxe/57710_init_values.c == --- head/sys/dev/bxe/57710_init_values.cThu Feb 25 22:13:43 2016 (r296070) +++ head/sys/dev/bxe/57710_init_values.cThu Feb 25 22:44:00 2016 (r296071) @@ -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}, - {OP_SW, 0x224b18, 0x404c8}, + {OP_SW, 0x224b18, 0x404ca}, {OP_ZR, 0x224b28, 0xc}, - {OP_SW, 0x224b58, 0x404cc}, + {OP_SW, 0x224b58, 0x404ce}, {OP_ZR, 0x224b68, 0xc}, - {OP_SW, 0x224b98, 0x404d0}, + {OP_SW, 0x224b98, 0x404d2
svn commit: r295830 - head/sys/dev/bxe
Author: davidcs Date: Fri Feb 19 22:46:52 2016 New Revision: 295830 URL: https://svnweb.freebsd.org/changeset/base/295830 Log: Remove dead code. Code Cleanup. Improve clarity in debug messages MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/ecore_init.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Fri Feb 19 22:45:09 2016(r295829) +++ head/sys/dev/bxe/bxe.c Fri Feb 19 22:46:52 2016(r295830) @@ -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), @@ -458,12 +406,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), @@ -516,12 +458,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), @@ -633,12 +569,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), 4, "tx_chain_lost_mbuf"}, { Q_STATS_OFFSET32(tx_frames_deferred), @@ -906,12 +836,6 @@ bxe_dma_map_addr(void *arg, bus_dma_s
svn commit: r295823 - head/sys/dev/bxe
Author: davidcs Date: Fri Feb 19 21:32:49 2016 New Revision: 295823 URL: https://svnweb.freebsd.org/changeset/base/295823 Log: 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. MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Fri Feb 19 18:05:02 2016(r295822) +++ head/sys/dev/bxe/bxe.c Fri Feb 19 21:32:49 2016(r295823) @@ -738,6 +738,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 @@ -7934,6 +7935,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); @@ -16148,6 +16159,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, &result, 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; @@ -16279,11 +16314,15 @@ bxe_add_sysctls(struct bxe_softc *sc) CTLFLAG_RW, &sc->debug, "debug logging mode"); -sc->trigger_grcdump = 0; -SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump", -CTLFLAG_RW, &sc->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, &sc->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", @@ -18901,26 +18940,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; @@ -19147,18 +19166,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; @@ -19179,7 +19201,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 (preset_idx = 1; preset_idx <= DUMP_MAX_PRESETS; preset_idx++) { @@ -19196,13 +19217,6 @@ bxe_grc_dump(struct bxe_
svn commit: r294854 - head/sys/dev/qlxgbe
Author: davidcs Date: Tue Jan 26 22:32:58 2016 New Revision: 294854 URL: https://svnweb.freebsd.org/changeset/base/294854 Log: Upgrade FW to 5.4.56 Update driver version to 3.10.26 Modified: head/sys/dev/qlxgbe/ql_fw.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_fw.c == --- head/sys/dev/qlxgbe/ql_fw.c Tue Jan 26 22:14:55 2016(r294853) +++ head/sys/dev/qlxgbe/ql_fw.c Tue Jan 26 22:32:58 2016(r294854) @@ -35,31 +35,31 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_firmware_version_major = 5; unsigned int ql83xx_firmware_version_minor = 4; -unsigned int ql83xx_firmware_version_sub = 55; +unsigned int ql83xx_firmware_version_sub = 56; unsigned char ql83xx_firmware[] = { - 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xa4, 0x44, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xdf, 0xab, 0xb2, 0x6d, 0x14, 0xbc, 0xac, 0x79, + 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x44, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x65, 0x29, 0xa5, 0xc3, 0x36, 0x3d, 0x7d, 0x98, 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, 0x0f, 0xea, 0x03, 0x00, + 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xea, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x2c, 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, 0xef, 0xf3, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x45, 0x8f, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf3, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf7, 0x8e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x9b, 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, 0x34, 0x83, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xe7, 0x82, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 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, @@ -69,117 +69,117 @@ unsigned char ql83xx_firmware[] = { 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, + 0x00, 0x00, 0x00, 0x00, 0x5e, 0x8d, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x40, 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, - 0x29, 0xa3, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x04, 0x00, 0x00, + 0xdc, 0xa2, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 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, 0xf9, 0xa7, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0xa7, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
svn commit: r292639 - head/sys/dev/bxe
Author: davidcs Date: Wed Dec 23 03:19:12 2015 New Revision: 292639 URL: https://svnweb.freebsd.org/changeset/base/292639 Log: Add support for firmware dump (a.k.a grcdump) MFC after:5 days Added: head/sys/dev/bxe/bxe_dump.h (contents, props changed) head/sys/dev/bxe/bxe_ioctl.h (contents, props changed) Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/ecore_init.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Wed Dec 23 01:31:32 2015(r292638) +++ head/sys/dev/bxe/bxe.c Wed Dec 23 03:19:12 2015(r292639) @@ -736,6 +736,8 @@ static __noinline int bxe_nic_unload(str static void bxe_handle_sp_tq(void *context, int pending); static void bxe_handle_fp_tq(void *context, int pending); +static int bxe_add_cdev(struct bxe_softc *sc); +static void bxe_del_cdev(struct bxe_softc *sc); /* calculate crc32 on a buffer (NOTE: crc32_length MUST be aligned to 8) */ uint32_t @@ -4503,7 +4505,7 @@ bxe_nic_unload(struct bxe_softc *sc, sc->rx_mode = BXE_RX_MODE_NONE; /* XXX set rx mode ??? */ -if (IS_PF(sc)) { +if (IS_PF(sc) && !sc->grcdump_done) { /* set ALWAYS_ALIVE bit in shmem */ sc->fw_drv_pulse_wr_seq |= DRV_PULSE_ALWAYS_ALIVE; @@ -4523,7 +4525,8 @@ bxe_nic_unload(struct bxe_softc *sc, ; /* bxe_vfpf_close_vf(sc); */ } else if (unload_mode != UNLOAD_RECOVERY) { /* if this is a normal/close unload need to clean up chip */ -bxe_chip_cleanup(sc, unload_mode, keep_link); +if (!sc->grcdump_done) +bxe_chip_cleanup(sc, unload_mode, keep_link); } else { /* Send the UNLOAD_REQUEST to the MCP */ bxe_send_unload_req(sc, unload_mode); @@ -16276,6 +16279,12 @@ bxe_add_sysctls(struct bxe_softc *sc) CTLFLAG_RW, &sc->debug, "debug logging mode"); +sc->trigger_grcdump = 0; +SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump", +CTLFLAG_RW, &sc->trigger_grcdump, 0, +"set by driver when a grcdump is needed"); + + sc->rx_budget = bxe_rx_budget; SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "rx_budget", CTLFLAG_RW, &sc->rx_budget, 0, @@ -16404,8 +16413,20 @@ bxe_attach(device_t dev) return (ENXIO); } +if (bxe_add_cdev(sc) != 0) { +if (sc->ifp != NULL) { +ether_ifdetach(sc->ifp); +} +ifmedia_removeall(&sc->ifmedia); +bxe_release_mutexes(sc); +bxe_deallocate_bars(sc); +pci_disable_busmaster(dev); +return (ENXIO); +} + /* allocate device interrupts */ if (bxe_interrupt_alloc(sc) != 0) { +bxe_del_cdev(sc); if (sc->ifp != NULL) { ether_ifdetach(sc->ifp); } @@ -16419,6 +16440,7 @@ bxe_attach(device_t dev) /* allocate ilt */ if (bxe_alloc_ilt_mem(sc) != 0) { bxe_interrupt_free(sc); +bxe_del_cdev(sc); if (sc->ifp != NULL) { ether_ifdetach(sc->ifp); } @@ -16433,6 +16455,7 @@ bxe_attach(device_t dev) if (bxe_alloc_hsi_mem(sc) != 0) { bxe_free_ilt_mem(sc); bxe_interrupt_free(sc); +bxe_del_cdev(sc); if (sc->ifp != NULL) { ether_ifdetach(sc->ifp); } @@ -16504,6 +16527,8 @@ bxe_detach(device_t dev) return(EBUSY); } +bxe_del_cdev(sc); + /* stop the periodic callout */ bxe_periodic_stop(sc); @@ -18824,3 +18849,457 @@ ecore_storm_memset_struct(struct bxe_sof } } + +/* + * character device - ioctl interface definitions + */ + + +#include "bxe_dump.h" +#include "bxe_ioctl.h" +#include + +static int bxe_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, +struct thread *td); + +static struct cdevsw bxe_cdevsw = { +.d_version = D_VERSION, +.d_ioctl = bxe_eioctl, +.d_name = "bxecnic", +}; + +#define BXE_PATH(sc)(CHIP_IS_E1x(sc) ? 0 : (sc->pcie_func & 1)) + + +#define DUMP_ALL_PRESETS0x1FFF +#define DUMP_MAX_PRESETS13 +#define IS_E1_REG(chips)((chips & DUMP_CHIP_E1) == DUMP_CHIP_E1) +#define IS_E1H_REG(chips) ((chips & DUMP_CHIP_E1H) == DUMP_CHIP_E1H) +#define IS_E2_REG(chips)((chips & DUMP_CHIP_E2) == DUMP_CHIP_E2) +#define IS_E3A0_REG(chips) ((chips & DUMP_CHIP_E3A0) == DUMP_CHIP_E3A0) +#define IS_E3B0_REG(chips) ((chips & DUMP_CHIP_E3B0) == DUMP_CHIP_E3B0) + +#define IS_REG_IN_PRESET(presets, idx) \ +((presets & (1 << (idx-1))) == (1 << (idx-1))) + + +static int +bxe_get_preset_regs_len(struct bxe_softc *sc, uint32_t preset) +{ +if (CHIP_IS_E1(sc)) +return dump_num_registers[0][preset-1]; +else if (CHIP_IS_E1H(sc)) +return dump_num_registers[1][preset-1]; +else if (CHIP_IS_E2(sc)) +return dump_num_registers[2][preset-1]; +
svn commit: r292638 - head/sys/dev/bxe
Author: davidcs Date: Wed Dec 23 01:31:32 2015 New Revision: 292638 URL: https://svnweb.freebsd.org/changeset/base/292638 Log: 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() MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/bxe_stats.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Tue Dec 22 23:21:06 2015(r292637) +++ head/sys/dev/bxe/bxe.c Wed Dec 23 01:31:32 2015(r292638) @@ -472,6 +472,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), @@ -585,6 +589,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), @@ -3475,11 +3483,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 */ @@ -16122,12 +16133,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: head/sys/dev/bxe/bxe_stats.c == --- head/sys/dev/bxe/bxe_stats.cTue Dec 22 23:21:06 2015 (r292637) +++ head/sys/dev/bxe/bxe_stats.cWed Dec 23 01:31:32 2015 (r292638) @@ -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: head/sys/dev/bxe/bxe_stats.h == --- head/sys/dev/bxe/bxe_stats.hTue Dec 22 23:21:06 2015 (r292637) +++ head/sys/dev/bxe/bxe_stats.hWed Dec 23 01:31:32 2015 (r292638) @@ -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; uint32_t rx_jumbo_sge_pkts_old; uint32_t rx_soft_errors_old; uint32_t rx_hw_csum_errors_old; ___ svn-src-head
svn commit: r289635 - head/sys/dev/qlxgbe
Author: davidcs Date: Tue Oct 20 17:27:11 2015 New Revision: 289635 URL: https://svnweb.freebsd.org/changeset/base/289635 Log: ql_hw.c: fixed error code INJCT_HEARTBEAT_FAILURE ql_os.c: removed unnecessary debug printf ql_ver.h: updated version number MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Tue Oct 20 16:10:46 2015(r289634) +++ head/sys/dev/qlxgbe/ql_hw.c Tue Oct 20 17:27:11 2015(r289635) @@ -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: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Tue Oct 20 16:10:46 2015(r289634) +++ head/sys/dev/qlxgbe/ql_os.c Tue Oct 20 17:27:11 2015(r289635) @@ -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: head/sys/dev/qlxgbe/ql_ver.h == --- head/sys/dev/qlxgbe/ql_ver.hTue Oct 20 16:10:46 2015 (r289634) +++ head/sys/dev/qlxgbe/ql_ver.hTue Oct 20 17:27:11 2015 (r289635) @@ -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-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r289199 - head/sys/dev/bxe
Author: davidcs Date: Mon Oct 12 20:21:17 2015 New Revision: 289199 URL: https://svnweb.freebsd.org/changeset/base/289199 Log: Add support for reading device temperature MFC after:5 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Mon Oct 12 18:53:37 2015(r289198) +++ head/sys/dev/bxe/bxe.c Mon Oct 12 20:21:17 2015(r289199) @@ -16122,9 +16122,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-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r285973 - head/sys/dev/bxe
Author: davidcs Date: Tue Jul 28 19:15:44 2015 New Revision: 285973 URL: https://svnweb.freebsd.org/changeset/base/285973 Log: - Avoid lock contention in the if_transmit callback by using trylock and enqueueing the frames when it fails. This way there is some latency removed from the transmitting path. - If IFF_DRV_OACTIVE is set (and also if IFF_DRV_RUNNING is not) just enqueue the desired frames and return successful transmit. This way we avoid to return errors on transmit side and resulting in possible out-of-order frames. Please note that IFF_DRV_OACTIVE is set everytime we get the threshold ring hit, so this can be happening quite often. Submitted by: attilio@isilon.com MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Tue Jul 28 18:41:28 2015(r285972) +++ head/sys/dev/bxe/bxe.c Tue Jul 28 19:15:44 2015(r285973) @@ -5999,19 +5999,26 @@ bxe_tx_mq_start_locked(struct bxe_softc rc = tx_count = 0; +BXE_FP_TX_LOCK_ASSERT(fp); + if (!tx_br) { BLOGE(sc, "Multiqueue TX and no buf_ring!\n"); return (EINVAL); } +if (!sc->link_vars.link_up || +(ifp->if_drv_flags & +(IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { +rc = drbr_enqueue_drv(ifp, tx_br, m); +goto bxe_tx_mq_start_locked_exit; +} + /* fetch the depth of the driver queue */ depth = drbr_inuse_drv(ifp, tx_br); if (depth > fp->eth_q_stats.tx_max_drbr_queue_depth) { fp->eth_q_stats.tx_max_drbr_queue_depth = depth; } -BXE_FP_TX_LOCK_ASSERT(fp); - if (m == NULL) { /* no new work, check for pending frames */ next = drbr_dequeue_drv(ifp, tx_br); @@ -6103,26 +6110,11 @@ bxe_tx_mq_start(struct ifnet *ifp, fp = &sc->fp[fp_index]; -if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) { -BLOGW(sc, "Interface not running, ignoring transmit request\n"); -return (ENETDOWN); -} - -if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE) { -BLOGW(sc, "Interface TX queue is full, ignoring transmit request\n"); -return (EBUSY); -} - -if (!sc->link_vars.link_up) { -BLOGW(sc, "Interface link is down, ignoring transmit request\n"); -return (ENETDOWN); -} - -/* XXX change to TRYLOCK here and if failed then schedule taskqueue */ - -BXE_FP_TX_LOCK(fp); -rc = bxe_tx_mq_start_locked(sc, ifp, fp, m); -BXE_FP_TX_UNLOCK(fp); +if (BXE_FP_TX_TRYLOCK(fp)) { +rc = bxe_tx_mq_start_locked(sc, ifp, fp, m); +BXE_FP_TX_UNLOCK(fp); +} else +rc = drbr_enqueue_drv(ifp, fp->tx_br, m); return (rc); } Modified: head/sys/dev/bxe/bxe.h == --- head/sys/dev/bxe/bxe.h Tue Jul 28 18:41:28 2015(r285972) +++ head/sys/dev/bxe/bxe.h Tue Jul 28 19:15:44 2015(r285973) @@ -582,6 +582,7 @@ struct bxe_fastpath { #define BXE_FP_TX_LOCK(fp)mtx_lock(&fp->tx_mtx) #define BXE_FP_TX_UNLOCK(fp) mtx_unlock(&fp->tx_mtx) #define BXE_FP_TX_LOCK_ASSERT(fp) mtx_assert(&fp->tx_mtx, MA_OWNED) +#define BXE_FP_TX_TRYLOCK(fp) mtx_trylock(&fp->tx_mtx) #define BXE_FP_RX_LOCK(fp)mtx_lock(&fp->rx_mtx) #define BXE_FP_RX_UNLOCK(fp) mtx_unlock(&fp->rx_mtx) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r284741 - in head/sys: dev/qlxgbe modules/qlxgbe
Author: davidcs Date: Tue Jun 23 22:22:36 2015 New Revision: 284741 URL: https://svnweb.freebsd.org/changeset/base/284741 Log: 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: head/sys/dev/qlxgbe/ql_boot.c (contents, props changed) head/sys/dev/qlxgbe/ql_fw.c (contents, props changed) head/sys/dev/qlxgbe/ql_minidump.c (contents, props changed) Modified: head/sys/dev/qlxgbe/ql_dbg.c head/sys/dev/qlxgbe/ql_dbg.h head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_glbl.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_inline.h head/sys/dev/qlxgbe/ql_ioctl.c head/sys/dev/qlxgbe/ql_ioctl.h head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_misc.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_os.h head/sys/dev/qlxgbe/ql_reset.c head/sys/dev/qlxgbe/ql_tmplt.h head/sys/dev/qlxgbe/ql_ver.h head/sys/modules/qlxgbe/Makefile Added: head/sys/dev/qlxgbe/ql_boot.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/qlxgbe/ql_boot.c Tue Jun 23 22:22:36 2015 (r284741) @@ -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 +__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, 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, 0x2f, 0x00, 0x7c, 0x00, + 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0,
svn commit: r284739 - head/sys/dev/bxe
Author: davidcs Date: Tue Jun 23 20:09:52 2015 New Revision: 284739 URL: https://svnweb.freebsd.org/changeset/base/284739 Log: tx_mtx should be grabbed before calling buf_ring_dequeue_sc() Submitted by:attilio@isilon.com MFC after:5 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Tue Jun 23 20:01:12 2015(r284738) +++ head/sys/dev/bxe/bxe.c Tue Jun 23 20:09:52 2015(r284739) @@ -6547,10 +6547,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-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r284651 - head/sys/dev/bxe
Author: davidcs Date: Sat Jun 20 22:24:44 2015 New Revision: 284651 URL: https://svnweb.freebsd.org/changeset/base/284651 Log: Simplified implementation of bxe_set_mc_list() removed bxe_free_mcast_macs_list() and bxe_init_mcast_macs_list() fixed bug where copy of multicast list mta was deleted prior to passing the list to firmware MFC after:5 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Sat Jun 20 21:48:07 2015(r284650) +++ head/sys/dev/bxe/bxe.c Sat Jun 20 22:24:44 2015(r284651) @@ -12499,24 +12499,21 @@ bxe_initial_phy_init(struct bxe_softc *s } /* must be called under IF_ADDR_LOCK */ + static int -bxe_init_mcast_macs_list(struct bxe_softc *sc, - struct ecore_mcast_ramrod_params *p) +bxe_set_mc_list(struct bxe_softc *sc) { -if_t ifp = sc->ifp; +struct ecore_mcast_ramrod_params rparam = { NULL }; +int rc = 0; int mc_count = 0; int mcnt, i; -struct ecore_mcast_list_elem *mc_mac; +struct ecore_mcast_list_elem *mc_mac, *mc_mac_start; unsigned char *mta; +if_t ifp = sc->ifp; mc_count = if_multiaddr_count(ifp, -1);/* XXX they don't have a limit */ - /* should we enforce one? */ -ECORE_LIST_INIT(&p->mcast_list); -p->mcast_list_len = 0; - -if (!mc_count) { +if (!mc_count) return (0); -} mta = malloc(sizeof(unsigned char) * ETHER_ADDR_LEN * mc_count, M_DEVBUF, M_NOWAIT); @@ -12527,8 +12524,9 @@ bxe_init_mcast_macs_list(struct bxe_soft } bzero(mta, (sizeof(unsigned char) * ETHER_ADDR_LEN * mc_count)); -mc_mac = malloc(sizeof(*mc_mac) * mc_count, M_DEVBUF, -(M_NOWAIT | M_ZERO)); +mc_mac = malloc(sizeof(*mc_mac) * mc_count, M_DEVBUF, (M_NOWAIT | M_ZERO)); +mc_mac_start = mc_mac; + if (!mc_mac) { free(mta, M_DEVBUF); BLOGE(sc, "Failed to allocate temp mcast list\n"); @@ -12536,12 +12534,17 @@ bxe_init_mcast_macs_list(struct bxe_soft } bzero(mc_mac, (sizeof(*mc_mac) * mc_count)); -if_multiaddr_array(ifp, mta, &mcnt, mc_count); /* mta and mcnt not expected - to be different */ +/* mta and mcnt not expected to be different */ +if_multiaddr_array(ifp, mta, &mcnt, mc_count); + + +rparam.mcast_obj = &sc->mcast_obj; +ECORE_LIST_INIT(&rparam.mcast_list); + for(i=0; i< mcnt; i++) { - mc_mac->mac = (uint8_t *)(mta + (i * ETHER_ADDR_LEN)); -ECORE_LIST_PUSH_TAIL(&mc_mac->link, &p->mcast_list); +mc_mac->mac = (uint8_t *)(mta + (i * ETHER_ADDR_LEN)); +ECORE_LIST_PUSH_TAIL(&mc_mac->link, &rparam.mcast_list); BLOGD(sc, DBG_LOAD, "Setting MCAST %02X:%02X:%02X:%02X:%02X:%02X\n", @@ -12550,34 +12553,7 @@ bxe_init_mcast_macs_list(struct bxe_soft mc_mac++; } - -p->mcast_list_len = mc_count; -free(mta, M_DEVBUF); - -return (0); -} - -static void -bxe_free_mcast_macs_list(struct ecore_mcast_ramrod_params *p) -{ -struct ecore_mcast_list_elem *mc_mac = -ECORE_LIST_FIRST_ENTRY(&p->mcast_list, - struct ecore_mcast_list_elem, - link); - -if (mc_mac) { -/* only a single free as all mc_macs are in the same heap array */ -free(mc_mac, M_DEVBUF); -} -} - -static int -bxe_set_mc_list(struct bxe_softc *sc) -{ -struct ecore_mcast_ramrod_params rparam = { NULL }; -int rc = 0; - -rparam.mcast_obj = &sc->mcast_obj; +rparam.mcast_list_len = mc_count; BXE_MCAST_LOCK(sc); @@ -12586,14 +12562,8 @@ bxe_set_mc_list(struct bxe_softc *sc) if (rc < 0) { BLOGE(sc, "Failed to clear multicast configuration: %d\n", rc); BXE_MCAST_UNLOCK(sc); -return (rc); -} - -/* configure a new MACs list */ -rc = bxe_init_mcast_macs_list(sc, &rparam); -if (rc) { -BLOGE(sc, "Failed to create mcast MACs list (%d)\n", rc); -BXE_MCAST_UNLOCK(sc); + free(mc_mac_start, M_DEVBUF); +free(mta, M_DEVBUF); return (rc); } @@ -12603,10 +12573,11 @@ bxe_set_mc_list(struct bxe_softc *sc) BLOGE(sc, "Failed to set new mcast config (%d)\n", rc); } -bxe_free_mcast_macs_list(&rparam); - BXE_MCAST_UNLOCK(sc); +free(mc_mac_start, M_DEVBUF); +free(mta, M_DEVBUF); + return (rc); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r284470 - head/sys/dev/bxe
Author: davidcs Date: Tue Jun 16 21:11:32 2015 New Revision: 284470 URL: https://svnweb.freebsd.org/changeset/base/284470 Log: 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: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/ecore_sp.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Tue Jun 16 21:11:31 2015(r284469) +++ head/sys/dev/bxe/bxe.c Tue Jun 16 21:11:32 2015(r284470) @@ -12525,6 +12525,7 @@ bxe_init_mcast_macs_list(struct bxe_soft BLOGE(sc, "Failed to allocate temp mcast list\n"); return (-1); } +bzero(mta, (sizeof(unsigned char) * ETHER_ADDR_LEN * mc_count)); mc_mac = malloc(sizeof(*mc_mac) * mc_count, M_DEVBUF, (M_NOWAIT | M_ZERO)); @@ -12533,12 +12534,13 @@ 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)); if_multiaddr_array(ifp, mta, &mcnt, mc_count); /* mta and mcnt not expected to be different */ for(i=0; i< mcnt; i++) { -bcopy((mta + (i * ETHER_ADDR_LEN)), mc_mac->mac, ETHER_ADDR_LEN); + mc_mac->mac = (uint8_t *)(mta + (i * ETHER_ADDR_LEN)); ECORE_LIST_PUSH_TAIL(&mc_mac->link, &p->mcast_list); BLOGD(sc, DBG_LOAD, @@ -12583,6 +12585,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: head/sys/dev/bxe/ecore_sp.c == --- head/sys/dev/bxe/ecore_sp.c Tue Jun 16 21:11:31 2015(r284469) +++ head/sys/dev/bxe/ecore_sp.c Tue Jun 16 21:11:32 2015(r284470) @@ -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-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r284335 - head/sys/dev/bxe
Author: davidcs Date: Sat Jun 13 01:28:19 2015 New Revision: 284335 URL: https://svnweb.freebsd.org/changeset/base/284335 Log: 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 MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/ecore_reg.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Fri Jun 12 22:05:04 2015(r284334) +++ head/sys/dev/bxe/bxe.c Sat Jun 13 01:28:19 2015(r284335) @@ -726,7 +726,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); @@ -1174,7 +1173,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 @@ -4764,28 +4773,6 @@ bxe_handle_chip_tq(void *context, switch (work) { -case CHIP_TQ_START: -if ((if_getflags(sc->ifp) & IFF_UP) && -!(if_getdrvflags(sc->ifp) & 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 (!(if_getflags(sc->ifp) & IFF_UP) && -(if_getdrvflags(sc->ifp) & 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 (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) { @@ -4859,21 +4846,22 @@ bxe_ioctl(if_t 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 (if_getflags(ifp) & IFF_UP) { if (if_getdrvflags(ifp) & 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 (if_getdrvflags(ifp) & 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; @@ -4885,7 +4873,9 @@ bxe_ioctl(if_t ifp, /* check if the interface is up */ if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { /* set the receive mode flags */ + BXE_CORE_LOCK(sc); bxe_set_rx_mode(sc); + BXE_CORE_UNLOCK(sc); } break; @@ -5044,8 +5034,11 @@ bxe_ioctl(if_t ifp, if (reinit && (if_getdrvflags(sc->ifp) & 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); @@ -7487,8 +7480,7 @@ bxe_attn_int_asserted(struct bxe_softc * if (asserted & ATTN_HARD_WIRED_MASK) { if (asserted & ATTN_NIG_FOR_FUNC) { -BXE_PHY_LOCK(sc); - + bxe_acquire_phy_lock(sc); /* save nig interrupt mask */ nig_mask = REG_RD(sc, nig_int_mask_addr); @@ -7581
svn commit: r283274 - head/sys/dev/bxe
Author: davidcs Date: Fri May 22 01:44:07 2015 New Revision: 283274 URL: https://svnweb.freebsd.org/changeset/base/283274 Log: Add stat counters for Jumbo Frames using SGE ring. Also remove the checks for IFCAP_LRO in bxe_alloc_fp_buffers() and bxe_pf_rx_q_prep() since both TPA and Jumbo can use SGE ring. Submitted by:gary.zambr...@qlogic.com Approved by:davi...@freebsd.org MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/bxe_stats.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Thu May 21 23:14:18 2015(r283273) +++ head/sys/dev/bxe/bxe.c Fri May 22 01:44:07 2015(r283274) @@ -27,7 +27,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.78" +#define BXE_DRIVER_VERSION "1.78.79" #include "bxe.h" #include "ecore_sp.h" @@ -472,6 +472,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), @@ -583,6 +585,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), @@ -3466,6 +3470,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 */ @@ -6844,42 +6849,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 (if_getcapenable(sc->ifp) & 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; } } @@ -11763,28 +11766,26 @@ bxe_pf_rx_q_prep(struct bxe_softc uint16_t sge_sz = 0; uint16_t tpa_agg_size = 0; -if (if_getcapenable(sc->ifp) & 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 */
svn commit: r283269 - head/sys/dev/bxe
Author: davidcs Date: Thu May 21 20:47:19 2015 New Revision: 283269 URL: https://svnweb.freebsd.org/changeset/base/283269 Log: Limit the size of the posted receive buffers in Rx Rings to MJUMPAGESIZE. Previously for jumbo MTUs, the rx ring buffers were MTU + any required pad. Now when this size greater than MJUMPAGESIZE, the packet is spanned across multiple buffers and the mbufs are stiched together. Submitted by:gary.zambr...@qlogic.com Approved by:davi...@freebsd.org Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Thu May 21 20:43:02 2015(r283268) +++ head/sys/dev/bxe/bxe.c Thu May 21 20:47:19 2015(r283269) @@ -3100,7 +3100,7 @@ static inline void bxe_update_sge_prod(struct bxe_softc *sc, struct bxe_fastpath *fp, uint16_t sge_len, -struct eth_end_agg_rx_cqe *cqe) +union eth_sgl_or_raw_data *cqe) { uint16_t last_max, last_elem, first_elem; uint16_t delta = 0; @@ -3113,17 +3113,17 @@ bxe_update_sge_prod(struct bxe_softc /* first mark all used pages */ for (i = 0; i < sge_len; i++) { BIT_VEC64_CLEAR_BIT(fp->sge_mask, -RX_SGE(le16toh(cqe->sgl_or_raw_data.sgl[i]))); +RX_SGE(le16toh(cqe->sgl[i]))); } BLOGD(sc, DBG_LRO, "fp[%02d] fp_cqe->sgl[%d] = %d\n", fp->index, sge_len - 1, - le16toh(cqe->sgl_or_raw_data.sgl[sge_len - 1])); + le16toh(cqe->sgl[sge_len - 1])); /* assume that the last SGE index is the biggest */ bxe_update_last_max_sge(fp, -le16toh(cqe->sgl_or_raw_data.sgl[sge_len - 1])); +le16toh(cqe->sgl[sge_len - 1])); last_max = RX_SGE(fp->last_max_sge); last_elem = last_max >> BIT_VEC64_ELEM_SHIFT; @@ -3239,6 +3239,53 @@ bxe_tpa_stop_exit: } static uint8_t +bxe_service_rxsgl( + struct bxe_fastpath *fp, + uint16_t len, + uint16_t lenonbd, + struct mbuf *m, + struct eth_fast_path_rx_cqe *cqe_fp) +{ +struct mbuf *m_frag; +uint16_t frags, frag_len; +uint16_t sge_idx = 0; +uint16_t j; +uint8_t i, rc = 0; +uint32_t frag_size; + +/* adjust the mbuf */ +m->m_len = lenonbd; + +frag_size = len - lenonbd; +frags = SGE_PAGE_ALIGN(frag_size) >> SGE_PAGE_SHIFT; + +for (i = 0, j = 0; i < frags; i += PAGES_PER_SGE, j++) { +sge_idx = RX_SGE(le16toh(cqe_fp->sgl_or_raw_data.sgl[j])); + +m_frag = fp->rx_sge_mbuf_chain[sge_idx].m; +frag_len = min(frag_size, (uint32_t)(SGE_PAGE_SIZE)); +m_frag->m_len = frag_len; + + /* allocate a new mbuf for the SGE */ +rc = bxe_alloc_rx_sge_mbuf(fp, sge_idx); +if (rc) { +/* Leave all remaining SGEs in the ring! */ +return (rc); +} +fp->eth_q_stats.mbuf_alloc_sge--; + +/* concatenate the fragment to the head mbuf */ +m_cat(m, m_frag); + +frag_size -= frag_len; +} + +bxe_update_sge_prod(fp->sc, fp, frags, &cqe_fp->sgl_or_raw_data); + +return rc; +} + +static uint8_t bxe_rxeof(struct bxe_softc*sc, struct bxe_fastpath *fp) { @@ -3278,7 +3325,7 @@ bxe_rxeof(struct bxe_softc*sc, struct eth_fast_path_rx_cqe *cqe_fp; uint8_t cqe_fp_flags; enum eth_rx_cqe_type cqe_fp_type; -uint16_t len, pad; +uint16_t len, lenonbd, pad; struct mbuf *m = NULL; comp_ring_cons = RCQ(sw_cq_cons); @@ -3293,7 +3340,7 @@ bxe_rxeof(struct bxe_softc*sc, BLOGD(sc, DBG_RX, "fp[%02d] Rx hw_cq_cons=%d hw_sw_cons=%d " "BD prod=%d cons=%d CQE type=0x%x err=0x%x " - "status=0x%x rss_hash=0x%x vlan=0x%x len=%u\n", + "status=0x%x rss_hash=0x%x vlan=0x%x len=%u lenonbd=%u\n", fp->index, hw_cq_cons, sw_cq_cons, @@ -3304,7 +3351,8 @@ bxe_rxeof(struct bxe_softc*sc, cqe_fp->status_flags, le32toh(cqe_fp->rss_hash_result), le16toh(cqe_fp->vlan_tag), - le16toh(cqe_fp->pkt_len_or_gro_seg_len)); + le16toh(cqe_fp->pkt_len_or_gro_seg_len), + le16toh(cqe_fp->len_on_bd)); /* is this a slowpath msg? */ if (__predict_false(CQE_TYPE_SLOW(cqe_fp_type))) { @@ -3351,7 +3399,7 @@ bxe_rxeof(struct bxe_softc*sc, bxe_tpa_stop(sc, fp, tpa_info, queue, pages, &cqe->end_agg_cqe, comp_ring_cons); -bxe_update_sge_prod(sc, fp, pages, &cqe->end_agg_cqe); +bxe_update_sge_prod(sc, fp, pages, &cqe->end_agg_cqe.sgl_or_raw_data); g
svn commit: r281006 - head/sys/dev/bxe
Author: davidcs Date: Thu Apr 2 21:55:03 2015 New Revision: 281006 URL: https://svnweb.freebsd.org/changeset/base/281006 Log: When an mbuf allocation fails in the receive path, the mbuf containing the received packet is not sent to the host net work 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. MFC after: 5 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Thu Apr 2 21:35:36 2015(r281005) +++ head/sys/dev/bxe/bxe.c Thu Apr 2 21:55:03 2015(r281006) @@ -3246,7 +3246,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); @@ -3388,6 +3388,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++; @@ -3476,6 +3480,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-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271728 - head/sys/dev/bxe
Author: davidcs Date: Wed Sep 17 22:49:29 2014 New Revision: 271728 URL: http://svnweb.freebsd.org/changeset/base/271728 Log: For ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() check bxe_debug flag before printing error message. MFC after:5 days Modified: head/sys/dev/bxe/ecore_sp.h Modified: head/sys/dev/bxe/ecore_sp.h == --- head/sys/dev/bxe/ecore_sp.h Wed Sep 17 22:26:01 2014(r271727) +++ head/sys/dev/bxe/ecore_sp.h Wed Sep 17 22:49:29 2014(r271728) @@ -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-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271727 - head/sys/modules/bce
Author: davidcs Date: Wed Sep 17 22:26:01 2014 New Revision: 271727 URL: http://svnweb.freebsd.org/changeset/base/271727 Log: Remove clean option MFC after:5 days Modified: head/sys/modules/bce/Makefile Modified: head/sys/modules/bce/Makefile == --- head/sys/modules/bce/Makefile Wed Sep 17 22:24:51 2014 (r271726) +++ head/sys/modules/bce/Makefile Wed Sep 17 22:26:01 2014 (r271727) @@ -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 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r271726 - head/sys/modules/bxe
Author: davidcs Date: Wed Sep 17 22:24:51 2014 New Revision: 271726 URL: http://svnweb.freebsd.org/changeset/base/271726 Log: Remove clean option MFC after:5 days Modified: head/sys/modules/bxe/Makefile Modified: head/sys/modules/bxe/Makefile == --- head/sys/modules/bxe/Makefile Wed Sep 17 22:11:20 2014 (r271725) +++ head/sys/modules/bxe/Makefile Wed Sep 17 22:24:51 2014 (r271726) @@ -18,9 +18,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 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r268854 - head/sys/dev/bxe
Author: davidcs Date: Fri Jul 18 20:04:11 2014 New Revision: 268854 URL: http://svnweb.freebsd.org/changeset/base/268854 Log: 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. MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/ecore_reg.h head/sys/dev/bxe/ecore_sp.h Modified: head/sys/dev/bxe/bxe.c == --- head/sys/dev/bxe/bxe.c Fri Jul 18 18:11:24 2014(r268853) +++ head/sys/dev/bxe/bxe.c Fri Jul 18 20:04:11 2014(r268854) @@ -11471,6 +11471,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: head/sys/dev/bxe/bxe.h == --- head/sys/dev/bxe/bxe.h Fri Jul 18 18:11:24 2014(r268853) +++ head/sys/dev/bxe/bxe.h Fri Jul 18 20:04:11 2014(r268854) @@ -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: head/sys/dev/bxe/bxe_stats.c == --- head/sys/dev/bxe/bxe_stats.cFri Jul 18 18:11:24 2014 (r268853) +++ head/sys/dev/bxe/bxe_stats.cFri Jul 18 20:04:11 2014 (r268854) @@ -1302,7 +1302,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: head/sys/dev/bxe/ecore_reg.h == --- head/sys/dev/bxe/ecore_reg.hFri Jul 18 18:11:24 2014 (r268853) +++ head/sys/dev/bxe/ecore_reg.hFri Jul 18 20:04:11 2014 (r268854) @@ -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: head/sys/dev/bxe/ecore_sp.h == --- head/sys/dev/bxe/ecore_sp.h Fri Jul 18 18:11:24 2014(r268853) +++ head/sys/dev/bxe/ecore_sp.h Fri Jul 18 20:04:11 2014(r268854) @@ -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-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265703 - in head: share/man/man4 sys/dev/bce sys/dev/bxe sys/modules/bce
Author: davidcs Date: Thu May 8 19:40:37 2014 New Revision: 265703 URL: http://svnweb.freebsd.org/changeset/base/265703 Log: 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 MFC after:5 days Modified: head/share/man/man4/bce.4 head/share/man/man4/bxe.4 head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcefw.h head/sys/dev/bce/if_bcereg.h head/sys/dev/bxe/bxe.c head/sys/modules/bce/Makefile Modified: head/share/man/man4/bce.4 == --- head/share/man/man4/bce.4 Thu May 8 19:35:29 2014(r265702) +++ head/share/man/man4/bce.4 Thu May 8 19:40:37 2014(r265703) @@ -1,5 +1,4 @@ -.\" Copyright (c) 2006 Broadcom Corporation -.\" David Christensen . 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: head/share/man/man4/bxe.4 == --- head/share/man/man4/bxe.4 Thu May 8 19:35:29 2014(r265702) +++ head/share/man/man4/bxe.4 Thu May 8 19:40:37 2014(r265703) @@ -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 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 S
svn commit: r265411 - in head/sys: dev/bxe modules/bxe
Author: davidcs Date: Tue May 6 02:32:27 2014 New Revision: 265411 URL: http://svnweb.freebsd.org/changeset/base/265411 Log: Modify Copyright information to reflect Qlogic Corporation's purchase of Broadcom's NetXtreme business Submitted by:David C Somayajulu (davi...@freebsd.org) QLogic Corporation MFC after:5 days Modified: head/sys/dev/bxe/57710_init_values.c head/sys/dev/bxe/57710_int_offsets.h head/sys/dev/bxe/57711_init_values.c head/sys/dev/bxe/57711_int_offsets.h head/sys/dev/bxe/57712_init_values.c head/sys/dev/bxe/57712_int_offsets.h head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_dcb.h head/sys/dev/bxe/bxe_debug.c head/sys/dev/bxe/bxe_elink.c head/sys/dev/bxe/bxe_elink.h head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/bxe_stats.h head/sys/dev/bxe/ecore_fw_defs.h head/sys/dev/bxe/ecore_hsi.h head/sys/dev/bxe/ecore_init.h head/sys/dev/bxe/ecore_init_ops.h head/sys/dev/bxe/ecore_mfw_req.h head/sys/dev/bxe/ecore_reg.h head/sys/dev/bxe/ecore_sp.c head/sys/dev/bxe/ecore_sp.h head/sys/modules/bxe/Makefile Modified: head/sys/dev/bxe/57710_init_values.c == --- head/sys/dev/bxe/57710_init_values.cTue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/57710_init_values.cTue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * 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: head/sys/dev/bxe/57710_int_offsets.h == --- head/sys/dev/bxe/57710_int_offsets.hTue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/57710_int_offsets.hTue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * 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: head/sys/dev/bxe/57711_init_values.c == --- head/sys/dev/bxe/57711_init_values.cTue May 6 02:22:52 2014 (r265410) +++ head/sys/dev/bxe/57711_init_values.cTue May 6 02:32:27 2014 (r265411) @@ -1,9 +1,5 @@ /*- - * Copyright (c) 2007-2013 Broadcom Corporation. All rights reserved. - * - * Eric Davis - * David Christensen - * Gary Zambrano + * 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 Mo
svn commit: r261861 - head/sys/dev/qlxgb
Author: davidcs Date: Fri Feb 14 01:02:06 2014 New Revision: 261861 URL: http://svnweb.freebsd.org/changeset/base/261861 Log: check for defrag only when bus_dmamap_load_mbuf_sg() returns EFBIG. Comment in qla_hw_send is moot. Modified: head/sys/dev/qlxgb/qla_hw.c head/sys/dev/qlxgb/qla_os.c Modified: head/sys/dev/qlxgb/qla_hw.c == --- head/sys/dev/qlxgb/qla_hw.c Fri Feb 14 00:26:30 2014(r261860) +++ head/sys/dev/qlxgb/qla_hw.c Fri Feb 14 01:02:06 2014(r261861) @@ -998,7 +998,6 @@ qla_hw_send(qla_host_t *ha, bus_dma_segm if (hdr_len == 0) { if ((nsegs > Q8_TX_MAX_SEGMENTS) || (mp->m_pkthdr.len > ha->max_frame_size)){ - /* TBD: copy into private buffer and send it */ device_printf(dev, "%s: (nsegs[%d, %d, 0x%b] > Q8_TX_MAX_SEGMENTS)\n", __func__, nsegs, mp->m_pkthdr.len, Modified: head/sys/dev/qlxgb/qla_os.c == --- head/sys/dev/qlxgb/qla_os.c Fri Feb 14 00:26:30 2014(r261860) +++ head/sys/dev/qlxgb/qla_os.c Fri Feb 14 01:02:06 2014(r261861) @@ -1063,10 +1063,7 @@ qla_send(qla_host_t *ha, struct mbuf **m ret = bus_dmamap_load_mbuf_sg(ha->tx_tag, map, m_head, segs, &nsegs, BUS_DMA_NOWAIT); - if ((ret == EFBIG) || - ((nsegs > Q8_TX_MAX_SEGMENTS) && -(((m_head->m_pkthdr.csum_flags & CSUM_TSO) == 0) || - (m_head->m_pkthdr.len <= ha->max_frame_size { + if (ret == EFBIG) { struct mbuf *m; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258156 - head/sys/dev/qlxge
Author: davidcs Date: Fri Nov 15 01:44:58 2013 New Revision: 258156 URL: http://svnweb.freebsd.org/changeset/base/258156 Log: Validate the buffer and its length passed to QLA_MPI_DUMP. copyout dump only if qls_mpi_core_dump() is successful. (like to credit x90c for pointing the issue) Submitted by:David C Somayajulu Modified: head/sys/dev/qlxge/qls_ioctl.c Modified: head/sys/dev/qlxge/qls_ioctl.c == --- head/sys/dev/qlxge/qls_ioctl.c Fri Nov 15 01:26:24 2013 (r258155) +++ head/sys/dev/qlxge/qls_ioctl.c Fri Nov 15 01:44:58 2013 (r258156) @@ -100,13 +100,16 @@ qls_eioctl(struct cdev *dev, u_long cmd, if (mpi_dump->size == 0) { mpi_dump->size = sizeof (qls_mpi_coredump_t); } else { - if (mpi_dump->size < sizeof (qls_mpi_coredump_t)) + if ((mpi_dump->size != sizeof (qls_mpi_coredump_t)) || + (mpi_dump->dbuf == NULL)) rval = EINVAL; else { - qls_mpi_core_dump(ha); - rval = copyout( &ql_mpi_coredump, - mpi_dump->dbuf, - mpi_dump->size); + if (qls_mpi_core_dump(ha) == 0) { + rval = copyout(&ql_mpi_coredump, + mpi_dump->dbuf, + mpi_dump->size); + } else + rval = ENXIO; if (rval) { device_printf(ha->pci_dev, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r258155 - head/sys/dev/qlxgbe
Author: davidcs Date: Fri Nov 15 01:26:24 2013 New Revision: 258155 URL: http://svnweb.freebsd.org/changeset/base/258155 Log: ql_hw.[c,h]: set minimum thresholds on pkt size for lro path. ql_ioctl.c: validate the length and address of buffer passed to QL_RD_FW_DUMP Submitted by:David C Somayajulu Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_ioctl.c Modified: head/sys/dev/qlxgbe/ql_hw.c == --- head/sys/dev/qlxgbe/ql_hw.c Thu Nov 14 23:28:28 2013(r258154) +++ head/sys/dev/qlxgbe/ql_hw.c Fri Nov 15 01:26:24 2013(r258155) @@ -212,6 +212,12 @@ ql_hw_add_sysctls(qla_host_t *ha) "Number of Rcv Rings Entries to post before updating" " RDS Ring Producer Index"); + ha->hw.min_lro_pkt_size = 512; + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "min_lro_pkt_size", CTLFLAG_RD, &ha->hw.min_lro_pkt_size, + ha->hw.min_lro_pkt_size, "minimum packet size to trigger lro"); + ha->hw.mdump_active = 0; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -1069,6 +1075,11 @@ qla_config_fw_lro(qla_host_t *ha, uint16 fw_lro->cntxt_id = cntxt_id; + if (ha->hw.min_lro_pkt_size) { + fw_lro->flags |= Q8_MBX_FW_LRO_LOW_THRESHOLD; + fw_lro->low_threshold = ha->hw.min_lro_pkt_size; + } + if (qla_mbx_cmd(ha, (uint32_t *)fw_lro, (sizeof (q80_config_fw_lro_t) >> 2), ha->hw.mbox, (sizeof (q80_config_fw_lro_rsp_t) >> 2), 0)) { Modified: head/sys/dev/qlxgbe/ql_hw.h == --- head/sys/dev/qlxgbe/ql_hw.h Thu Nov 14 23:28:28 2013(r258154) +++ head/sys/dev/qlxgbe/ql_hw.h Fri Nov 15 01:26:24 2013(r258155) @@ -568,9 +568,13 @@ typedef struct _q80_config_fw_lro { #define Q8_MBX_FW_LRO_IPV6 0x2 #define Q8_MBX_FW_LRO_IPV4_WO_DST_IP_CHK 0x4 #define Q8_MBX_FW_LRO_IPV6_WO_DST_IP_CHK 0x8 +#define Q8_MBX_FW_LRO_LOW_THRESHOLD0x10 uint8_t rsrvd; uint16_tcntxt_id; + + uint16_tlow_threshold; + uint16_trsrvd0; } __packed q80_config_fw_lro_t; typedef struct _q80_config_fw_lro_rsp { @@ -1521,6 +1525,7 @@ typedef struct _qla_hw { uint32_thealth_count; uint32_tmax_tx_segs; + uint32_tmin_lro_pkt_size; /* Flash Descriptor Table */ qla_flash_desc_table_t fdt; Modified: head/sys/dev/qlxgbe/ql_ioctl.c == --- head/sys/dev/qlxgbe/ql_ioctl.c Thu Nov 14 23:28:28 2013 (r258154) +++ head/sys/dev/qlxgbe/ql_ioctl.c Fri Nov 15 01:26:24 2013 (r258155) @@ -223,6 +223,13 @@ ql_eioctl(struct cdev *dev, u_long cmd, } fw_dump = (qla_rd_fw_dump_t *)data; + + if ((fw_dump->md_template == NULL) || + (fw_dump->template_size != ha->hw.dma_buf.minidump.size)) { + rval = EINVAL; + break; + } + if ((rval = copyout(ha->hw.dma_buf.minidump.dma_b, fw_dump->md_template, fw_dump->template_size))) rval = ENXIO; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r255003 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Aug 28 20:07:00 2013 New Revision: 255003 URL: http://svnweb.freebsd.org/changeset/base/255003 Log: ql_minidump() should be performed only by port 0. Submitted by: David C Somayajulu Modified: head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Wed Aug 28 20:00:25 2013(r255002) +++ head/sys/dev/qlxgbe/ql_os.c Wed Aug 28 20:07:00 2013(r255003) @@ -1642,8 +1642,6 @@ qla_error_recovery(void *context, int pe QLA_UNLOCK(ha, __func__); - ql_minidump(ha); - if ((ha->pci_func & 0x1) == 0) { if (!ha->msg_from_peer) { @@ -1656,6 +1654,8 @@ qla_error_recovery(void *context, int pe ha->msg_from_peer = 0; + ql_minidump(ha); + (void) ql_init_hw(ha); qla_free_xmt_bufs(ha); qla_free_rcv_bufs(ha); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r254976 - head/sys/dev/qlxgbe
Author: davidcs Date: Tue Aug 27 21:29:21 2013 New Revision: 254976 URL: http://svnweb.freebsd.org/changeset/base/254976 Log: Fix bug in Flash access code Submitted by: David C Somayajulu Modified: head/sys/dev/qlxgbe/ql_misc.c Modified: head/sys/dev/qlxgbe/ql_misc.c == --- head/sys/dev/qlxgbe/ql_misc.c Tue Aug 27 21:28:12 2013 (r254975) +++ head/sys/dev/qlxgbe/ql_misc.c Tue Aug 27 21:29:21 2013 (r254976) @@ -321,7 +321,7 @@ qla_get_fdt(qla_host_t *ha) } while ((count < 1) && (data32 != 0x6)); - if (count == 0 && data32 != 0x6) { + if (data32 != 0x6) { qla_sem_unlock(ha, Q8_FLASH_UNLOCK); device_printf(ha->pci_dev, "%s: Poll Q8_FLASH_STATUS failed\n", @@ -401,7 +401,7 @@ qla_flash_write_enable(qla_host_t *ha, i } while ((count < 1) && (data32 != 0x6)); - if (count == 0 && data32 != 0x6) { + if (data32 != 0x6) { device_printf(ha->pci_dev, "%s: Poll Q8_FLASH_STATUS failed\n", __func__); @@ -432,7 +432,7 @@ qla_erase_flash_sector(qla_host_t *ha, u } while (((count++) < 1000) && (data32 != 0x6)); - if (count == 0 && data32 != 0x6) { + if (data32 != 0x6) { device_printf(ha->pci_dev, "%s: Poll Q8_FLASH_STATUS failed\n", __func__); @@ -479,7 +479,7 @@ qla_erase_flash_sector(qla_host_t *ha, u } while (((count++) < 1000) && (data32 != 0x6)); - if (count == 0 && data32 != 0x6) { + if (data32 != 0x6) { device_printf(ha->pci_dev, "%s: Poll Q8_FLASH_STATUS failed\n", __func__); @@ -575,7 +575,7 @@ qla_wr_flash32(qla_host_t *ha, uint32_t } while ((count < 1) && (data32 != 0x6)); - if (count == 0 && data32 != 0x6) { + if (data32 != 0x6) { device_printf(ha->pci_dev, "%s: Poll Q8_FLASH_STATUS failed\n", __func__); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r252580 - head/sys/dev/qlxgbe
Author: davidcs Date: Wed Jul 3 17:57:35 2013 New Revision: 252580 URL: http://svnweb.freebsd.org/changeset/base/252580 Log: Port 0 needs to wait for ACK only if it issued the RESET. Modified: head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_os.c == --- head/sys/dev/qlxgbe/ql_os.c Wed Jul 3 17:47:48 2013(r252579) +++ head/sys/dev/qlxgbe/ql_os.c Wed Jul 3 17:57:35 2013(r252580) @@ -1646,11 +1646,13 @@ qla_error_recovery(void *context, int pe if ((ha->pci_func & 0x1) == 0) { - if (!ha->msg_from_peer) + if (!ha->msg_from_peer) { qla_send_msg_to_peer(ha, QL_PEER_MSG_RESET); - while ((ha->msg_from_peer != QL_PEER_MSG_ACK) && msecs_100--) - qla_mdelay(__func__, 100); + while ((ha->msg_from_peer != QL_PEER_MSG_ACK) && + msecs_100--) + qla_mdelay(__func__, 100); + } ha->msg_from_peer = 0; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r252206 - in head: share/man/man4 sys/conf sys/dev/qlxge sys/modules sys/modules/qlxge
Author: davidcs Date: Tue Jun 25 17:50:22 2013 New Revision: 252206 URL: http://svnweb.freebsd.org/changeset/base/252206 Log: Add Qlogic 10Gb Ethernet Driver for Qlogic 8100 Series CNA Adapter Driver version (v2.0.0) Submitted by: David C Somayajulu (davi...@freebsd.org) QLogic Corporation Approved by: George Neville-Neil (g...@freebsd.org) Added: head/share/man/man4/qlxge.4 (contents, props changed) head/sys/dev/qlxge/ head/sys/dev/qlxge/README.txt (contents, props changed) head/sys/dev/qlxge/qls_dbg.c (contents, props changed) head/sys/dev/qlxge/qls_dbg.h (contents, props changed) head/sys/dev/qlxge/qls_def.h (contents, props changed) head/sys/dev/qlxge/qls_dump.c (contents, props changed) head/sys/dev/qlxge/qls_dump.h (contents, props changed) head/sys/dev/qlxge/qls_glbl.h (contents, props changed) head/sys/dev/qlxge/qls_hw.c (contents, props changed) head/sys/dev/qlxge/qls_hw.h (contents, props changed) head/sys/dev/qlxge/qls_inline.h (contents, props changed) head/sys/dev/qlxge/qls_ioctl.c (contents, props changed) head/sys/dev/qlxge/qls_ioctl.h (contents, props changed) head/sys/dev/qlxge/qls_isr.c (contents, props changed) head/sys/dev/qlxge/qls_os.c (contents, props changed) head/sys/dev/qlxge/qls_os.h (contents, props changed) head/sys/dev/qlxge/qls_ver.h (contents, props changed) head/sys/modules/qlxge/ head/sys/modules/qlxge/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files.amd64 head/sys/modules/Makefile Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileTue Jun 25 15:45:31 2013 (r252205) +++ head/share/man/man4/MakefileTue Jun 25 17:50:22 2013 (r252206) @@ -371,6 +371,7 @@ MAN=aac.4 \ pts.4 \ pty.4 \ puc.4 \ + ${_qlxge.4} \ ${_qlxgb.4} \ ${_qlxgbe.4} \ ral.4 \ @@ -793,10 +794,12 @@ _bhyve.4= bhyve.4 _if_ntb.4= if_ntb.4 _ntb.4=ntb.4 _ntb_hw.4= ntb_hw.4 +_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 Added: head/share/man/man4/qlxge.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/qlxge.4 Tue Jun 25 17:50:22 2013(r252206) @@ -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 HAR
svn commit: r251605 - head/sys/dev/qlxgbe
Author: davidcs Date: Mon Jun 10 17:12:22 2013 New Revision: 251605 URL: http://svnweb.freebsd.org/changeset/base/251605 Log: There is a one-to-one correspondence between the MSI-X vector # and the Status Descriptor Ring Index. Hence there is no need to check the Interrupt Source Register. Approved by: George Neville-Neil Modified: head/sys/dev/qlxgbe/ql_isr.c Modified: head/sys/dev/qlxgbe/ql_isr.c == --- head/sys/dev/qlxgbe/ql_isr.cMon Jun 10 15:22:27 2013 (r251604) +++ head/sys/dev/qlxgbe/ql_isr.cMon Jun 10 17:12:22 2013 (r251605) @@ -858,7 +858,6 @@ ql_isr(void *arg) int idx; qla_hw_t *hw; struct ifnet *ifp; - uint32_t data = 0; uint32_t ret = 0; ha = ivec->ha; @@ -871,12 +870,7 @@ ql_isr(void *arg) if (idx == 0) taskqueue_enqueue(ha->tx_tq, &ha->tx_task); - - - data = READ_REG32(ha, ha->hw.intr_src[idx]); - - if (data & 0x1 ) - ret = qla_rcv_isr(ha, idx, -1); + ret = qla_rcv_isr(ha, idx, -1); if (idx == 0) taskqueue_enqueue(ha->tx_tq, &ha->tx_task); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r251076 - head/sys/dev/qlxgbe
Author: davidcs Date: Tue May 28 22:00:37 2013 New Revision: 251076 URL: http://svnweb.freebsd.org/changeset/base/251076 Log: Avoid reading back certain registers following a write. This is an optimization. Submitted by: David C Somayajulu Approved by: George Neville Neil Modified: head/sys/dev/qlxgbe/ql_hw.h Modified: head/sys/dev/qlxgbe/ql_hw.h == --- head/sys/dev/qlxgbe/ql_hw.h Tue May 28 21:57:55 2013(r251075) +++ head/sys/dev/qlxgbe/ql_hw.h Tue May 28 22:00:37 2013(r251076) @@ -1533,16 +1533,16 @@ typedef struct _qla_hw { } qla_hw_t; #define QL_UPDATE_RDS_PRODUCER_INDEX(ha, prod_reg, val) \ - WRITE_REG32(ha, prod_reg, val); + bus_write_4((ha->pci_reg), prod_reg, val); #define QL_UPDATE_TX_PRODUCER_INDEX(ha, val, i) \ - WRITE_REG32(ha, ha->hw.tx_cntxt[i].tx_prod_reg, val) + WRITE_REG32(ha, ha->hw.tx_cntxt[i].tx_prod_reg, val) #define QL_UPDATE_SDS_CONSUMER_INDEX(ha, i, val) \ - WRITE_REG32(ha, ha->hw.sds[i].sds_consumer, val) - -#define QL_ENABLE_INTERRUPTS(ha, i) WRITE_REG32(ha, ha->hw.intr_src[i], 0); + bus_write_4((ha->pci_reg), (ha->hw.sds[i].sds_consumer), val); +#define QL_ENABLE_INTERRUPTS(ha, i) \ + bus_write_4((ha->pci_reg), (ha->hw.intr_src[i]), 0); #define QL_BUFFER_ALIGN16 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r250661 - in head: share/man/man4 sys/conf sys/dev/qlxgbe sys/modules sys/modules/qlxgbe
Author: davidcs Date: Wed May 15 17:03:09 2013 New Revision: 250661 URL: http://svnweb.freebsd.org/changeset/base/250661 Log: Add Qlogic 10Gigabit Ethernet & CNA Adapter Driver Version 3.10.10 for QLogic 8300 Series Adapters Submitted by: David C Somayajulu (davi...@freebsd.org) QLogic Corporation Approved by: George Neville-Neil (g...@freebsd.org) Added: head/share/man/man4/qlxgbe.4 (contents, props changed) head/sys/dev/qlxgbe/ head/sys/dev/qlxgbe/README.txt (contents, props changed) head/sys/dev/qlxgbe/ql_dbg.c (contents, props changed) head/sys/dev/qlxgbe/ql_dbg.h (contents, props changed) head/sys/dev/qlxgbe/ql_def.h (contents, props changed) head/sys/dev/qlxgbe/ql_glbl.h (contents, props changed) head/sys/dev/qlxgbe/ql_hw.c (contents, props changed) head/sys/dev/qlxgbe/ql_hw.h (contents, props changed) head/sys/dev/qlxgbe/ql_inline.h (contents, props changed) head/sys/dev/qlxgbe/ql_ioctl.c (contents, props changed) head/sys/dev/qlxgbe/ql_ioctl.h (contents, props changed) head/sys/dev/qlxgbe/ql_isr.c (contents, props changed) head/sys/dev/qlxgbe/ql_misc.c (contents, props changed) head/sys/dev/qlxgbe/ql_os.c (contents, props changed) head/sys/dev/qlxgbe/ql_os.h (contents, props changed) head/sys/dev/qlxgbe/ql_reset.c (contents, props changed) head/sys/dev/qlxgbe/ql_tmplt.h (contents, props changed) head/sys/dev/qlxgbe/ql_ver.h (contents, props changed) head/sys/modules/qlxgbe/ head/sys/modules/qlxgbe/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files.amd64 head/sys/modules/Makefile Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileWed May 15 14:35:02 2013 (r250660) +++ head/share/man/man4/MakefileWed May 15 17:03:09 2013 (r250661) @@ -371,6 +371,7 @@ MAN=aac.4 \ pty.4 \ puc.4 \ ${_qlxgb.4} \ + ${_qlxgbe.4} \ ral.4 \ random.4 \ rc.4 \ @@ -791,9 +792,11 @@ _if_ntb.4= if_ntb.4 _ntb.4=ntb.4 _ntb_hw.4= ntb_hw.4 _qlxgb.4= qlxgb.4 +_qlxgbe.4= qlxgbe.4 _sfxge.4= sfxge.4 MLINKS+=qlxgb.4 if_qlxgb.4 +MLINKS+=qlxgbe.4 if_qlxgbe.4 MLINKS+=sfxge.4 if_sfxge.4 .endif Added: head/share/man/man4/qlxgbe.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/qlxgbe.4Wed May 15 17:03:09 2013 (r250661) @@ -0,0 +1,91 @@ +.\"- +.\" Copyright (c) 2013 Qlogic Corportaion +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 1, 2013 +.Dt QLXGBE 4 +.Os +.Sh NAME +.Nm qlxgbe +.Nd "QLogic 10 Gigabit Ethernet & CNA Adapter Driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device qlxgbe" +.Ed +.Pp +To load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_qlxgbe_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver supports IPv4 checksum offload, +TCP and UDP checksum offload for both IPv4 and IPv6, +Large Segment Offload for both IPv4 and IPv6, +Jumbo frames, VLAN Tag, and +Receive Side scaling. +For further hardware information, see +.Pa http://www.qlogic.co
svn commit: r250375 - head/sys/dev/qlxgb
Author: davidcs Date: Wed May 8 18:25:46 2013 New Revision: 250375 URL: http://svnweb.freebsd.org/changeset/base/250375 Log: No need to set if_mtu since it automatically updated by ether_ifattach(). Use if_initbaudrate() to set baudrate. Add IFCAP_LINKSTATE to if_capabilities. Submitted by: David C Somayajulu Approved by: George Neville-Neil Modified: head/sys/dev/qlxgb/qla_os.c Modified: head/sys/dev/qlxgb/qla_os.c == --- head/sys/dev/qlxgb/qla_os.c Wed May 8 17:45:22 2013(r250374) +++ head/sys/dev/qlxgb/qla_os.c Wed May 8 18:25:46 2013(r250375) @@ -669,8 +669,7 @@ qla_init_ifnet(device_t dev, qla_host_t if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; - ifp->if_baudrate = (1 * 1000 * 1000 *1000); + if_initbaudrate(ifp, IF_Gbps(10)); ifp->if_init = qla_init; ifp->if_softc = ha; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; @@ -690,6 +689,7 @@ qla_init_ifnet(device_t dev, qla_host_t IFCAP_JUMBO_MTU; ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; + ifp->if_capabilities |= IFCAP_LINKSTATE; #if defined(__FreeBSD_version) && (__FreeBSD_version < 92) ifp->if_timer = 0; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r250340 - head/sys/dev/qlxgb
Author: davidcs Date: Tue May 7 22:58:42 2013 New Revision: 250340 URL: http://svnweb.freebsd.org/changeset/base/250340 Log: 1. Updated Copyright Information 2. Added Flash Read/Update Support 3. Fixed TSO Handling Submitted by: David C Somayajulu (davi...@freebsd.org) Reviewed by: George Neville-Neil (g...@freebsd.org) Approved by: George Neville-Neil (g...@freebsd.org) Modified: head/sys/dev/qlxgb/README.txt head/sys/dev/qlxgb/qla_dbg.c head/sys/dev/qlxgb/qla_dbg.h head/sys/dev/qlxgb/qla_def.h head/sys/dev/qlxgb/qla_glbl.h head/sys/dev/qlxgb/qla_hw.c head/sys/dev/qlxgb/qla_hw.h head/sys/dev/qlxgb/qla_inline.h head/sys/dev/qlxgb/qla_ioctl.c head/sys/dev/qlxgb/qla_ioctl.h head/sys/dev/qlxgb/qla_isr.c head/sys/dev/qlxgb/qla_misc.c head/sys/dev/qlxgb/qla_os.c head/sys/dev/qlxgb/qla_os.h head/sys/dev/qlxgb/qla_reg.h head/sys/dev/qlxgb/qla_ver.h Modified: head/sys/dev/qlxgb/README.txt == --- head/sys/dev/qlxgb/README.txt Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/README.txt Tue May 7 22:58:42 2013 (r250340) @@ -93,7 +93,7 @@ Technical Support at any phase of integr Technical Support can be reached by the following methods: Web:http://support.qlogic.com E-mail: supp...@qlogic.com -(c) Copyright 2011. All rights reserved worldwide. QLogic, the QLogic +(c) Copyright 2013. All rights reserved worldwide. QLogic, the QLogic logo, and the Powered by QLogic logo are registered trademarks of QLogic Corporation. All other brand and product names are trademarks or registered trademarks of their respective owners. Modified: head/sys/dev/qlxgb/qla_dbg.c == --- head/sys/dev/qlxgb/qla_dbg.cTue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_dbg.cTue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/qlxgb/qla_dbg.h == --- head/sys/dev/qlxgb/qla_dbg.hTue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_dbg.hTue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/qlxgb/qla_def.h == --- head/sys/dev/qlxgb/qla_def.hTue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_def.hTue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -194,6 +194,8 @@ struct qla_host { /* debug stuff */ volatile const char *qla_lock; volatile const char *qla_unlock; + + uint8_t fw_ver_str[32]; }; typedef struct qla_host qla_host_t; Modified: head/sys/dev/qlxgb/qla_glbl.h == --- head/sys/dev/qlxgb/qla_glbl.h Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_glbl.h Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,14 +56,6 @@ extern void qla_start(struct ifnet *ifp) extern int qla_get_mbuf(qla_host_t *ha, qla_rx_buf_t *rxb, struct mbuf *nmp, uint32_t jumbo); - -/* - * from qla_flash.c - */ -extern int qla_flash_rd32_words(qla_host_t *ha, uint32_t addr, - uint32_t *val, uint32_t num); -extern int qla_flash_rd32(qla_host_t *ha, uint32_t addr, uint32_t *val); - /* * from qla_hw.c */ @@ -97,6 +89,14 @@ extern int qla_init_hw(qla_host_t *ha); extern int qla_rdwr_indreg32(qla_host_t *ha, uint32_t addr, uint32_t *val, uint32_t rd); extern int qla_rd_flash32(qla_host_t *ha, uint32_t addr, uint32_t *data); +extern int qla_flash_rd32_words(qla_host_t *ha, uint32_t addr, + uint32_t *val, uint32_t num); +extern int qla_flash_rd32(qla_host_t *ha, uint32_t addr, uint32_t *val); +extern int qla_fw_update(qla_host_t *ha, void *fdata, uint32_t off, + uint32_t size); +extern int qla_erase_flash(qla_host_t *ha, uint32_t off, uint32_t size); +extern int