Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/dev/pci/ixgbe Pull up following revision(s) (requeste...
details: https://anonhg.NetBSD.org/src/rev/8e8d50d1e4e6
branches: netbsd-8
changeset: 434176:8e8d50d1e4e6
user: snj <snj%NetBSD.org@localhost>
date: Sat Aug 05 03:49:35 2017 +0000
description:
Pull up following revision(s) (requested by msaitoh in ticket #175):
sys/dev/pci/ixgbe/ix_txrx.c: 1.25-1.27
sys/dev/pci/ixgbe/ixgbe.c: 1.91-1.95
sys/dev/pci/ixgbe/ixgbe_type.h: 1.23-1.25
sys/dev/pci/ixgbe/ixgbe_api.c: 1.16
sync ixg(4) up to ixgbe.c rev. 1.95:
- Increase total number of RX buffers on multiqueue.
- Fix the partial chain check in ixgbe_rx_discard(). This bug was
added in ixgbe.c rev. 1.33.
- Fix a double free in ixgbe_rxeof().
- Print verbose output in ixgbe_update_link_status() correctly on 5Gbps
and 2.5Gbps (NBASE-T) for X550T[12] and newer.
- Change hw.ixgN.ts to hw.ixgN.thermal_test. Same as FreeBSD.
- Fix a bug that ifconfig ixgN media 1000baseT and 10Gbase-T advertised
additional unwanted speeds.
- Print PHY ID.
- Remove unused variable.
diffstat:
sys/dev/pci/ixgbe/ix_txrx.c | 42 +++++++++++++---------------------
sys/dev/pci/ixgbe/ixgbe.c | 51 ++++++++++++++++++++++++++++++++++++-----
sys/dev/pci/ixgbe/ixgbe_api.c | 6 +++-
sys/dev/pci/ixgbe/ixgbe_type.h | 23 +++++++++++++++++-
4 files changed, 85 insertions(+), 37 deletions(-)
diffs (truncated from 307 to 300 lines):
diff -r f6956b1fc8b2 -r 8e8d50d1e4e6 sys/dev/pci/ixgbe/ix_txrx.c
--- a/sys/dev/pci/ixgbe/ix_txrx.c Tue Aug 01 23:41:13 2017 +0000
+++ b/sys/dev/pci/ixgbe/ix_txrx.c Sat Aug 05 03:49:35 2017 +0000
@@ -59,7 +59,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 301538 2016-06-07 04:51:50Z sephe $*/
-/*$NetBSD: ix_txrx.c,v 1.24 2017/05/18 08:25:37 msaitoh Exp $*/
+/*$NetBSD: ix_txrx.c,v 1.24.2.1 2017/08/05 03:49:35 snj Exp $*/
#include "opt_inet.h"
#include "opt_inet6.h"
@@ -1446,21 +1446,10 @@
static void
ixgbe_free_receive_ring(struct rx_ring *rxr)
-{
- struct ixgbe_rx_buf *rxbuf;
+{
for (int i = 0; i < rxr->num_desc; i++) {
- rxbuf = &rxr->rx_buffers[i];
- if (rxbuf->buf != NULL) {
- bus_dmamap_sync(rxr->ptag->dt_dmat, rxbuf->pmap,
- 0, rxbuf->buf->m_pkthdr.len,
- BUS_DMASYNC_POSTREAD);
- ixgbe_dmamap_unload(rxr->ptag, rxbuf->pmap);
- rxbuf->buf->m_flags |= M_PKTHDR;
- m_freem(rxbuf->buf);
- rxbuf->buf = NULL;
- rxbuf->flags = 0;
- }
+ ixgbe_rx_discard(rxr, i);
}
}
@@ -1510,7 +1499,8 @@
* or size of jumbo mbufs may have changed.
*/
ixgbe_jcl_reinit(&adapter->jcl_head, rxr->ptag->dt_dmat,
- 2 * adapter->num_rx_desc, adapter->rx_mbuf_sz);
+ (2 * adapter->num_rx_desc) * adapter->num_queues,
+ adapter->rx_mbuf_sz);
IXGBE_RX_LOCK(rxr);
@@ -1631,7 +1621,9 @@
*/
for (int i = 0; i < j; ++i) {
rxr = &adapter->rx_rings[i];
+ IXGBE_RX_LOCK(rxr);
ixgbe_free_receive_ring(rxr);
+ IXGBE_RX_UNLOCK(rxr);
}
return (ENOBUFS);
@@ -1685,15 +1677,7 @@
if (rxr->rx_buffers != NULL) {
for (int i = 0; i < adapter->num_rx_desc; i++) {
rxbuf = &rxr->rx_buffers[i];
- if (rxbuf->buf != NULL) {
- bus_dmamap_sync(rxr->ptag->dt_dmat,
- rxbuf->pmap, 0, rxbuf->buf->m_pkthdr.len,
- BUS_DMASYNC_POSTREAD);
- ixgbe_dmamap_unload(rxr->ptag, rxbuf->pmap);
- rxbuf->buf->m_flags |= M_PKTHDR;
- m_freem(rxbuf->buf);
- }
- rxbuf->buf = NULL;
+ ixgbe_rx_discard(rxr, i);
if (rxbuf->pmap != NULL) {
ixgbe_dmamap_destroy(rxr->ptag, rxbuf->pmap);
rxbuf->pmap = NULL;
@@ -1770,12 +1754,15 @@
** and mapping.
*/
- if (rbuf->buf != NULL) {/* Partial chain ? */
- rbuf->fmp->m_flags |= M_PKTHDR;
+ if (rbuf->fmp != NULL) {/* Partial chain ? */
+ bus_dmamap_sync(rxr->ptag->dt_dmat, rbuf->pmap, 0,
+ rbuf->buf->m_pkthdr.len, BUS_DMASYNC_POSTREAD);
m_freem(rbuf->fmp);
rbuf->fmp = NULL;
rbuf->buf = NULL; /* rbuf->buf is part of fmp's chain */
} else if (rbuf->buf) {
+ bus_dmamap_sync(rxr->ptag->dt_dmat, rbuf->pmap, 0,
+ rbuf->buf->m_pkthdr.len, BUS_DMASYNC_POSTREAD);
m_free(rbuf->buf);
rbuf->buf = NULL;
}
@@ -1869,6 +1856,9 @@
goto next_desc;
}
+ bus_dmamap_sync(rxr->ptag->dt_dmat, rbuf->pmap, 0,
+ rbuf->buf->m_pkthdr.len, BUS_DMASYNC_POSTREAD);
+
/*
** On 82599 which supports a hardware
** LRO (called HW RSC), packets need
diff -r f6956b1fc8b2 -r 8e8d50d1e4e6 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Tue Aug 01 23:41:13 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Sat Aug 05 03:49:35 2017 +0000
@@ -59,7 +59,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.88.2.1 2017/07/04 14:57:19 martin Exp $*/
+/*$NetBSD: ixgbe.c,v 1.88.2.2 2017/08/05 03:49:35 snj Exp $*/
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -71,6 +71,8 @@
#include "vlan.h"
#include <sys/cprng.h>
+#include <dev/mii/mii.h>
+#include <dev/mii/miivar.h>
/*********************************************************************
* Driver version
@@ -722,6 +724,26 @@
break;
}
+ if (hw->phy.id != 0) {
+ uint16_t id1, id2;
+ int oui, model, rev;
+ const char *descr;
+
+ id1 = hw->phy.id >> 16;
+ id2 = hw->phy.id & 0xffff;
+ oui = MII_OUI(id1, id2);
+ model = MII_MODEL(id2);
+ rev = MII_REV(id2);
+ if ((descr = mii_get_descr(oui, model)) != NULL)
+ aprint_normal_dev(dev,
+ "PHY: %s (OUI 0x%06x, model 0x%04x), rev. %d\n",
+ descr, oui, model, rev);
+ else
+ aprint_normal_dev(dev,
+ "PHY OUI 0x%06x, model 0x%04x, rev. %d\n",
+ oui, model, rev);
+ }
+
/* hw.ix defaults init */
ixgbe_set_advertise(adapter, ixgbe_advertise_speed);
ixgbe_set_flowcntl(adapter, ixgbe_flow_control);
@@ -2131,6 +2153,9 @@
struct ifmedia *ifm = &adapter->media;
struct ixgbe_hw *hw = &adapter->hw;
ixgbe_link_speed speed = 0;
+ ixgbe_link_speed link_caps = 0;
+ bool negotiate = false;
+ s32 err = IXGBE_NOT_IMPLEMENTED;
INIT_DEBUGOUT("ixgbe_media_change: begin");
@@ -2147,10 +2172,19 @@
*/
switch (IFM_SUBTYPE(ifm->ifm_media)) {
case IFM_AUTO:
+ err = hw->mac.ops.get_link_capabilities(hw, &link_caps,
+ &negotiate);
+ if (err != IXGBE_SUCCESS) {
+ device_printf(adapter->dev, "Unable to determine "
+ "supported advertise speeds\n");
+ return (ENODEV);
+ }
+ speed |= link_caps;
+ break;
case IFM_10G_T:
- speed |= IXGBE_LINK_SPEED_100_FULL;
case IFM_10G_LRM:
case IFM_10G_LR:
+ case IFM_10G_TWINAX:
#ifndef IFM_ETH_XTYPE
case IFM_10G_SR: /* KR, too */
case IFM_10G_CX4: /* KX4 */
@@ -2158,12 +2192,9 @@
case IFM_10G_KR:
case IFM_10G_KX4:
#endif
- speed |= IXGBE_LINK_SPEED_1GB_FULL;
- case IFM_10G_TWINAX:
speed |= IXGBE_LINK_SPEED_10GB_FULL;
break;
case IFM_1000_T:
- speed |= IXGBE_LINK_SPEED_100_FULL;
case IFM_1000_LX:
case IFM_1000_SX:
case IFM_1000_KX:
@@ -2434,6 +2465,12 @@
case IXGBE_LINK_SPEED_10GB_FULL:
bpsmsg = "10 Gbps";
break;
+ case IXGBE_LINK_SPEED_5GB_FULL:
+ bpsmsg = "5 Gbps";
+ break;
+ case IXGBE_LINK_SPEED_2_5GB_FULL:
+ bpsmsg = "2.5 Gbps";
+ break;
case IXGBE_LINK_SPEED_1GB_FULL:
bpsmsg = "1 Gbps";
break;
@@ -4684,7 +4721,7 @@
if (sysctl_createv(log, 0, &rnode, &cnode,
CTLFLAG_READWRITE, CTLTYPE_INT,
- "ts", SYSCTL_DESCR("Thermal Test"),
+ "thermal_test", SYSCTL_DESCR("Thermal Test"),
ixgbe_sysctl_thermal_test, 0, (void *)adapter, 0, CTL_CREATE, CTL_EOL) != 0)
aprint_error_dev(dev, "could not create sysctl\n");
@@ -5468,8 +5505,8 @@
{
struct sysctlnode node = *rnode;
struct adapter *adapter = (struct adapter *)node.sysctl_data;
- int error, fire = 0;
struct ixgbe_hw *hw;
+ int error, fire = 0;
hw = &adapter->hw;
diff -r f6956b1fc8b2 -r 8e8d50d1e4e6 sys/dev/pci/ixgbe/ixgbe_api.c
--- a/sys/dev/pci/ixgbe/ixgbe_api.c Tue Aug 01 23:41:13 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_api.c Sat Aug 05 03:49:35 2017 +0000
@@ -31,13 +31,15 @@
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 299200 2016-05-06 22:54:56Z pfg $*/
-/*$NetBSD: ixgbe_api.c,v 1.15 2016/12/05 08:50:29 msaitoh Exp $*/
+/*$NetBSD: ixgbe_api.c,v 1.15.8.1 2017/08/05 03:49:35 snj Exp $*/
#include "ixgbe_api.h"
#include "ixgbe_common.h"
+#define IXGBE_EMPTY_PARAM
+
static const u32 ixgbe_mvals_base[IXGBE_MVALS_IDX_LIMIT] = {
- IXGBE_MVALS_INIT()
+ IXGBE_MVALS_INIT(IXGBE_EMPTY_PARAM)
};
static const u32 ixgbe_mvals_X540[IXGBE_MVALS_IDX_LIMIT] = {
diff -r f6956b1fc8b2 -r 8e8d50d1e4e6 sys/dev/pci/ixgbe/ixgbe_type.h
--- a/sys/dev/pci/ixgbe/ixgbe_type.h Tue Aug 01 23:41:13 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_type.h Sat Aug 05 03:49:35 2017 +0000
@@ -31,7 +31,7 @@
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_type.h 299200 2016-05-06 22:54:56Z pfg $*/
-/*$NetBSD: ixgbe_type.h,v 1.22 2017/06/02 08:16:52 msaitoh Exp $*/
+/*$NetBSD: ixgbe_type.h,v 1.22.2.1 2017/08/05 03:49:35 snj Exp $*/
#ifndef _IXGBE_TYPE_H_
#define _IXGBE_TYPE_H_
@@ -510,6 +510,7 @@
/* Tx DCA Control register : 128 of these (0-127) */
#define IXGBE_DCA_TXCTRL_82599(_i) (0x0600C + ((_i) * 0x40))
#define IXGBE_TIPG 0x0CB00
+#define IXGBE_TIPG_IPGT_MASK 0x000000FF
#define IXGBE_TXPBSIZE(_i) (0x0CC00 + ((_i) * 4)) /* 8 of these */
#define IXGBE_MNGTXMAP 0x0CD10
#define IXGBE_TIPG_FIBER_DEFAULT 3
@@ -1052,6 +1053,24 @@
#define IXGBE_GSCN_2 0x11028
#define IXGBE_GSCN_3 0x1102C
#define IXGBE_FACTPS 0x10150
+
+/* X550 */
+#define IXGBE_PCI_ICAUSE 0x11520
+#define IXGBE_PCI_IENA 0x11528
+#define IXGBE_PCI_VMINDEX 0x11530
+#define IXGBE_PCI_VMPEND 0x11538
+#define IXGBE_PCI_DREVID 0x11540
+#define IXGBE_PCI_BYTCTH 0x11544
+#define IXGBE_PCI_BYTCTL 0x11548
+#define IXGBE_PCI_LATCT 0x11720 /* Denverton */
+#define IXGBE_PCI_LCBDATA 0x11734
+#define IXGBE_PCI_PKTCT 0x11740 /* Denverton */
+#define IXGBE_PCI_LCBADD 0x11788
+#define IXGBE_GSCL_1_X550 0x11800
+#define IXGBE_GSCL_2_X550 0x11804
+#define IXGBE_PCI_GSCL(_i) (0x011810 + ((_i) * 4))
+#define IXGBE_PCI_GSCN(_i) (0x011820 + ((_i) * 4))
+
#define IXGBE_FACTPS_X540 IXGBE_FACTPS
#define IXGBE_FACTPS_X550 IXGBE_FACTPS
#define IXGBE_FACTPS_X550EM_x IXGBE_FACTPS
@@ -1741,6 +1760,7 @@
/* PAP bit masks*/
#define IXGBE_PAP_TXPAUSECNT_MASK 0x0000FFFF /* Pause counter mask */
+#define IXGBE_PAP_PACE_MASK 0x000F0000 /* Pace bit mask */
/* RMCS Bit Masks */
#define IXGBE_RMCS_RRM 0x00000002 /* Rx Recycle Mode enable */
@@ -3835,7 +3855,6 @@
Home |
Main Index |
Thread Index |
Old Index