Module Name: src Committed By: msaitoh Date: Thu Aug 13 10:03:38 UTC 2015
Modified Files: src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_api.c ixgbe_api.h ixgbe_type.h ixv.c Log Message: Reduce diff against FreeBSD r280181. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/ixgbe/ixgbe.c cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/ixgbe/ixgbe_api.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ixgbe_api.h cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/ixgbe/ixgbe_type.h cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/ixgbe/ixv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ixgbe/ixgbe.c diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.34 src/sys/dev/pci/ixgbe/ixgbe.c:1.35 --- src/sys/dev/pci/ixgbe/ixgbe.c:1.34 Thu Aug 13 04:56:43 2015 +++ src/sys/dev/pci/ixgbe/ixgbe.c Thu Aug 13 10:03:37 2015 @@ -59,7 +59,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ /*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 279805 2015-03-09 10:29:15Z araujo $*/ -/*$NetBSD: ixgbe.c,v 1.34 2015/08/13 04:56:43 msaitoh Exp $*/ +/*$NetBSD: ixgbe.c,v 1.35 2015/08/13 10:03:37 msaitoh Exp $*/ #include "opt_inet.h" #include "opt_inet6.h" @@ -136,15 +136,15 @@ static int ixgbe_detach(device_t, i #if 0 static int ixgbe_shutdown(device_t); #endif -#if IXGBE_LEGACY_TX +#ifdef IXGBE_LEGACY_TX static void ixgbe_start(struct ifnet *); static void ixgbe_start_locked(struct tx_ring *, struct ifnet *); -#else +#else /* ! IXGBE_LEGACY_TX */ static int ixgbe_mq_start(struct ifnet *, struct mbuf *); static int ixgbe_mq_start_locked(struct ifnet *, struct tx_ring *); static void ixgbe_qflush(struct ifnet *); -static void ixgbe_deferred_mq_start(void *); -#endif +static void ixgbe_deferred_mq_start(void *, int); +#endif /* IXGBE_LEGACY_TX */ static int ixgbe_ioctl(struct ifnet *, u_long, void *); static void ixgbe_ifstop(struct ifnet *, int); static int ixgbe_init(struct ifnet *); @@ -338,7 +338,7 @@ SYSCTL_INT("hw.ixgbe.rxd", &ixgbe_rxd); ** of unsupported SFP+ modules, note that ** doing so you are on your own :) */ -static int allow_unsupported_sfp = true; +static int allow_unsupported_sfp = false; SYSCTL_INT("hw.ix.unsupported_sfp", &allow_unsupported_sfp); /* @@ -608,8 +608,7 @@ ixgbe_attach(device_t parent, device_t d */ adapter->sfp_probe = TRUE; error = 0; - } else if ((error == IXGBE_ERR_SFP_NOT_SUPPORTED) - && (hw->allow_unsupported_sfp == false)) { + } else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) { aprint_error_dev(dev,"Unsupported SFP+ module detected!\n"); error = EIO; goto err_late; @@ -1094,7 +1093,7 @@ ixgbe_mq_start_locked(struct ifnet *ifp, * Called from a taskqueue to drain queued transmit packets. */ static void -ixgbe_deferred_mq_start(void *arg) +ixgbe_deferred_mq_start(void *arg, int pending) { struct tx_ring *txr = arg; struct adapter *adapter = txr->adapter; @@ -1341,7 +1340,7 @@ ixgbe_init_locked(struct adapter *adapte /* Enable Fan Failure Interrupt */ gpie |= IXGBE_SDP1_GPIEN; - /* Add for Thermal detection */ + /* Add for Module detection */ if (hw->mac.type == ixgbe_mac_82599EB) gpie |= IXGBE_SDP2_GPIEN; @@ -1633,11 +1632,12 @@ ixgbe_legacy_irq(void *arg) struct ix_queue *que = arg; struct adapter *adapter = que->adapter; struct ixgbe_hw *hw = &adapter->hw; - struct ifnet *ifp = adapter->ifp; + struct ifnet *ifp = adapter->ifp; struct tx_ring *txr = adapter->tx_rings; bool more = false; u32 reg_eicr; + reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICR); adapter->stats.legint.ev_count++; @@ -2669,6 +2669,7 @@ ixgbe_allocate_msix(struct adapter *adap que->msix = vector; adapter->que_mask |= (u64)(1 << que->msix); #ifdef RSS + /* * The queue ID is used as the RSS layer bucket ID. * We look up the queue ID -> RSS CPU ID and select * that. @@ -2677,7 +2678,7 @@ ixgbe_allocate_msix(struct adapter *adap #else /* * Bind the msix vector, and thus the - * ring to the corresponding cpu. + * rings to the corresponding cpu. * * This just happens to match the default RSS round-robin * bucket -> queue -> CPU allocation. @@ -4112,6 +4113,7 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, mp = rxbuf->buf; mp->m_pkthdr.len = mp->m_len = rxr->mbuf_sz; + /* If we're dealing with an mbuf that was copied rather * than replaced, there's no need to go through busdma. */ @@ -4823,6 +4825,7 @@ ixgbe_rx_discard(struct rx_ring *rxr, in rbuf = &rxr->rx_buffers[i]; + /* ** With advanced descriptors the writeback ** clobbers the buffer addrs, so its easier @@ -4830,16 +4833,17 @@ ixgbe_rx_discard(struct rx_ring *rxr, in ** the normal refresh path to get new buffers ** and mapping. */ + if (rbuf->buf != NULL) {/* Partial chain ? */ rbuf->fmp->m_flags |= M_PKTHDR; m_freem(rbuf->fmp); rbuf->fmp = NULL; rbuf->buf = NULL; /* rbuf->buf is part of fmp's chain */ } else if (rbuf->buf) { - m_free(rbuf->buf); - rbuf->buf = NULL; + m_free(rbuf->buf); + rbuf->buf = NULL; } - + rbuf->flags = 0; return; @@ -4973,7 +4977,6 @@ ixgbe_rxeof(struct ix_queue *que) ** that determines what we are */ sendmp = rbuf->fmp; - if (sendmp != NULL) { /* secondary frag */ rbuf->buf = rbuf->fmp = NULL; mp->m_flags &= ~M_PKTHDR; @@ -5007,6 +5010,7 @@ ixgbe_rxeof(struct ix_queue *que) sendmp->m_pkthdr.len = mp->m_len; } ++processed; + /* Pass the head pointer on */ if (eop == 0) { nbuf->fmp = sendmp; @@ -5234,6 +5238,7 @@ ixgbe_setup_vlan_hw_support(struct adapt struct rx_ring *rxr; u32 ctrl; + /* ** We get here thru init_locked, meaning ** a soft reset, this has already cleared @@ -5258,7 +5263,6 @@ ixgbe_setup_vlan_hw_support(struct adapt if ((ec->ec_capenable & ETHERCAP_VLAN_HWFILTER) == 0) return; - /* ** A soft reset zero's out the VFTA, so ** we need to repopulate it now. @@ -6390,7 +6394,7 @@ ixgbe_set_advertise(SYSCTLFN_ARGS) else if (adapter->advertise == 3) speed = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_10GB_FULL; - else {/* bogus value */ + else { /* bogus value */ adapter->advertise = last; return (EINVAL); } Index: src/sys/dev/pci/ixgbe/ixgbe_api.c diff -u src/sys/dev/pci/ixgbe/ixgbe_api.c:1.8 src/sys/dev/pci/ixgbe/ixgbe_api.c:1.9 --- src/sys/dev/pci/ixgbe/ixgbe_api.c:1.8 Wed Aug 5 04:08:44 2015 +++ src/sys/dev/pci/ixgbe/ixgbe_api.c Thu Aug 13 10:03:38 2015 @@ -31,7 +31,7 @@ ******************************************************************************/ /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 251964 2013-06-18 21:28:19Z jfv $*/ -/*$NetBSD: ixgbe_api.c,v 1.8 2015/08/05 04:08:44 msaitoh Exp $*/ +/*$NetBSD: ixgbe_api.c,v 1.9 2015/08/13 10:03:38 msaitoh Exp $*/ #include "ixgbe_api.h" #include "ixgbe_common.h" @@ -163,7 +163,7 @@ s32 ixgbe_set_mac_type(struct ixgbe_hw * "Unsupported device id: %x", hw->device_id); break; - } + } DEBUGOUT2("ixgbe_set_mac_type found mac: %d, returns: %d\n", hw->mac.type, ret_val); Index: src/sys/dev/pci/ixgbe/ixgbe_api.h diff -u src/sys/dev/pci/ixgbe/ixgbe_api.h:1.5 src/sys/dev/pci/ixgbe/ixgbe_api.h:1.6 --- src/sys/dev/pci/ixgbe/ixgbe_api.h:1.5 Wed Aug 5 04:08:44 2015 +++ src/sys/dev/pci/ixgbe/ixgbe_api.h Thu Aug 13 10:03:38 2015 @@ -31,7 +31,7 @@ ******************************************************************************/ /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.h 251964 2013-06-18 21:28:19Z jfv $*/ -/*$NetBSD: ixgbe_api.h,v 1.5 2015/08/05 04:08:44 msaitoh Exp $*/ +/*$NetBSD: ixgbe_api.h,v 1.6 2015/08/13 10:03:38 msaitoh Exp $*/ #ifndef _IXGBE_API_H_ #define _IXGBE_API_H_ @@ -39,6 +39,7 @@ #include "ixgbe_type.h" void ixgbe_dcb_get_rtrup2tc(struct ixgbe_hw *hw, u8 *map); + s32 ixgbe_init_shared_code(struct ixgbe_hw *hw); extern s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw); Index: src/sys/dev/pci/ixgbe/ixgbe_type.h diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.12 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.13 --- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.12 Thu Aug 13 04:56:43 2015 +++ src/sys/dev/pci/ixgbe/ixgbe_type.h Thu Aug 13 10:03:38 2015 @@ -31,7 +31,7 @@ ******************************************************************************/ /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_type.h 251964 2013-06-18 21:28:19Z jfv $*/ -/*$NetBSD: ixgbe_type.h,v 1.12 2015/08/13 04:56:43 msaitoh Exp $*/ +/*$NetBSD: ixgbe_type.h,v 1.13 2015/08/13 10:03:38 msaitoh Exp $*/ #ifndef _IXGBE_TYPE_H_ #define _IXGBE_TYPE_H_ @@ -136,7 +136,6 @@ #define IXGBE_DEV_ID_X540_VF_HV 0x1530 #define IXGBE_DEV_ID_X540_BYPASS 0x155C - /* General Registers */ #define IXGBE_CTRL 0x00000 #define IXGBE_STATUS 0x00008 @@ -343,7 +342,6 @@ #define IXGBE_RSSRK(_i) (0x05C80 + ((_i) * 4)) /* 10 of these (0-9) */ - /* Flow Director registers */ #define IXGBE_FDIRCTRL 0x0EE00 #define IXGBE_FDIRHKEY 0x0EE68 @@ -645,7 +643,6 @@ #define IXGBE_RTTBCNRD 0x0498C - /* FCoE DMA Context Registers */ #define IXGBE_FCPTRL 0x02410 /* FC User Desc. PTR Low */ #define IXGBE_FCPTRH 0x02414 /* FC USer Desc. PTR High */ @@ -1818,7 +1815,7 @@ enum { #define IXGBE_GSSR_MAC_CSR_SM 0x0008 #define IXGBE_GSSR_FLASH_SM 0x0010 #define IXGBE_GSSR_SW_MNG_SM 0x0400 - + /* FW Status register bitmask */ #define IXGBE_FWSTS_FWRI 0x00000200 /* Firmware Reset Indication */ @@ -2482,7 +2479,7 @@ struct ixgbe_hic_drv_info { /* Transmit Descriptor - Legacy */ struct ixgbe_legacy_tx_desc { - u64 buffer_addr; /* Address of the descriptor's data buffer */ + u64 buffer_addr; /* Address of the descriptor's data buffer */ union { __le32 data; struct { @@ -2661,7 +2658,7 @@ typedef u32 ixgbe_physical_layer; /* BitTimes (BT) conversion */ #define IXGBE_BT2KB(BT) ((BT + (8 * 1024 - 1)) / (8 * 1024)) #define IXGBE_B2BT(BT) (BT * 8) - + /* Calculate Delay to respond to PFC */ #define IXGBE_PFC_D 672 @@ -3315,6 +3312,7 @@ struct ixgbe_hw { #define IXGBE_ERR_OUT_OF_MEM -34 #define IXGBE_ERR_FEATURE_NOT_SUPPORTED -36 #define IXGBE_ERR_EEPROM_PROTECTED_REGION -37 + #define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF #endif /* _IXGBE_TYPE_H_ */ Index: src/sys/dev/pci/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.11 src/sys/dev/pci/ixgbe/ixv.c:1.12 --- src/sys/dev/pci/ixgbe/ixv.c:1.11 Thu Aug 13 04:56:43 2015 +++ src/sys/dev/pci/ixgbe/ixv.c Thu Aug 13 10:03:38 2015 @@ -31,7 +31,7 @@ ******************************************************************************/ /*$FreeBSD: head/sys/dev/ixgbe/ixv.c 275358 2014-12-01 11:45:24Z hselasky $*/ -/*$NetBSD: ixv.c,v 1.11 2015/08/13 04:56:43 msaitoh Exp $*/ +/*$NetBSD: ixv.c,v 1.12 2015/08/13 10:03:38 msaitoh Exp $*/ #include "opt_inet.h" #include "opt_inet6.h" @@ -461,7 +461,7 @@ ixv_attach(device_t parent, device_t dev ixv_init_stats(adapter); /* Register for VLAN events */ -#if 0 /* XXX msaitoh delete after write? */ +#if 0 /* XXX delete after write? */ adapter->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, ixv_register_vlan, adapter, EVENTHANDLER_PRI_FIRST); adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, @@ -690,10 +690,10 @@ ixv_mq_start_locked(struct ifnet *ifp, s ixv_txeof(txr); enqueued = 0; - if (m == NULL) { + if (m != NULL) { err = drbr_dequeue(ifp, txr->br, m); if (err) { - return (err); + return (err); } } /* Process the queue */ @@ -1872,6 +1872,7 @@ ixv_free_pci_resources(struct adapter * adapter->osdep.ihs[i]); } + /* Clean the Legacy or Link interrupt last */ if (adapter->mbxvec) /* we are doing MSIX */ rid = adapter->mbxvec + 1; @@ -2468,7 +2469,7 @@ ixv_free_transmit_buffers(struct tx_ring /********************************************************************* * - * Advanced Context Descriptor setup for VLAN or L4 CSUM + * Advanced Context Descriptor setup for VLAN or CSUM * **********************************************************************/ @@ -3662,6 +3663,7 @@ ixv_rx_checksum(u32 staterr, struct mbuf u8 errors = (u8) (staterr >> 24); #if 0 bool sctp = FALSE; + if ((ptype & IXGBE_RXDADV_PKTTYPE_ETQF) == 0 && (ptype & IXGBE_RXDADV_PKTTYPE_SCTP) != 0) sctp = TRUE;