Changeset View
Standalone View
head/sys/dev/e1000/if_em.c
Show First 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | static pci_vendor_info_t em_vendor_info_array[] = | ||||
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM2, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM2, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_LBG_I219_LM3, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_LBG_I219_LM3, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM4, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM4, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V4, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V4, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM5, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM5, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V5, "Intel(R) PRO/1000 Network Connection"), | PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V5, "Intel(R) PRO/1000 Network Connection"), | ||||
PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_LM6, "Intel(R) PRO/1000 Network Connection"), | |||||
PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_V6, "Intel(R) PRO/1000 Network Connection"), | |||||
PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_LM7, "Intel(R) PRO/1000 Network Connection"), | |||||
PVID(0x8086, E1000_DEV_ID_PCH_CNP_I219_V7, "Intel(R) PRO/1000 Network Connection"), | |||||
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM8, "Intel(R) PRO/1000 Network Connection"), | |||||
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V8, "Intel(R) PRO/1000 Network Connection"), | |||||
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM9, "Intel(R) PRO/1000 Network Connection"), | |||||
PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V9, "Intel(R) PRO/1000 Network Connection"), | |||||
/* required last entry */ | /* required last entry */ | ||||
PVID_END | PVID_END | ||||
}; | }; | ||||
static pci_vendor_info_t igb_vendor_info_array[] = | static pci_vendor_info_t igb_vendor_info_array[] = | ||||
{ | { | ||||
/* Intel(R) PRO/1000 Network Connection - igb */ | /* Intel(R) PRO/1000 Network Connection - igb */ | ||||
PVID(0x8086, E1000_DEV_ID_82575EB_COPPER, "Intel(R) PRO/1000 PCI-Express Network Driver"), | PVID(0x8086, E1000_DEV_ID_82575EB_COPPER, "Intel(R) PRO/1000 PCI-Express Network Driver"), | ||||
▲ Show 20 Lines • Show All 680 Lines • ▼ Show 20 Lines | adapter->osdep.flash_bus_space_handle = | ||||
rman_get_bushandle(adapter->flash); | rman_get_bushandle(adapter->flash); | ||||
} | } | ||||
/* | /* | ||||
** In the new SPT device flash is not a | ** In the new SPT device flash is not a | ||||
** separate BAR, rather it is also in BAR0, | ** separate BAR, rather it is also in BAR0, | ||||
** so use the same tag and an offset handle for the | ** so use the same tag and an offset handle for the | ||||
** FLASH read/write macros in the shared code. | ** FLASH read/write macros in the shared code. | ||||
*/ | */ | ||||
else if (hw->mac.type == e1000_pch_spt) { | else if (hw->mac.type >= e1000_pch_spt) { | ||||
adapter->osdep.flash_bus_space_tag = | adapter->osdep.flash_bus_space_tag = | ||||
adapter->osdep.mem_bus_space_tag; | adapter->osdep.mem_bus_space_tag; | ||||
adapter->osdep.flash_bus_space_handle = | adapter->osdep.flash_bus_space_handle = | ||||
adapter->osdep.mem_bus_space_handle | adapter->osdep.mem_bus_space_handle | ||||
+ E1000_FLASH_BASE_ADDR; | + E1000_FLASH_BASE_ADDR; | ||||
} | } | ||||
/* Do Shared Code initialization */ | /* Do Shared Code initialization */ | ||||
▲ Show 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | em_if_mtu_set(if_ctx_t ctx, uint32_t mtu) | ||||
switch (adapter->hw.mac.type) { | switch (adapter->hw.mac.type) { | ||||
case e1000_82571: | case e1000_82571: | ||||
case e1000_82572: | case e1000_82572: | ||||
case e1000_ich9lan: | case e1000_ich9lan: | ||||
case e1000_ich10lan: | case e1000_ich10lan: | ||||
case e1000_pch2lan: | case e1000_pch2lan: | ||||
case e1000_pch_lpt: | case e1000_pch_lpt: | ||||
case e1000_pch_spt: | case e1000_pch_spt: | ||||
case e1000_pch_cnp: | |||||
case e1000_82574: | case e1000_82574: | ||||
case e1000_82583: | case e1000_82583: | ||||
case e1000_80003es2lan: | case e1000_80003es2lan: | ||||
/* 9K Jumbo Frame size */ | /* 9K Jumbo Frame size */ | ||||
max_frame_size = 9234; | max_frame_size = 9234; | ||||
break; | break; | ||||
case e1000_pchlan: | case e1000_pchlan: | ||||
max_frame_size = 4096; | max_frame_size = 4096; | ||||
▲ Show 20 Lines • Show All 1,268 Lines • ▼ Show 20 Lines | if (adapter->hw.mac.max_frame_size > 4096) | ||||
pba = E1000_PBA_14K; | pba = E1000_PBA_14K; | ||||
else | else | ||||
pba = E1000_PBA_10K; | pba = E1000_PBA_10K; | ||||
break; | break; | ||||
case e1000_pchlan: | case e1000_pchlan: | ||||
case e1000_pch2lan: | case e1000_pch2lan: | ||||
case e1000_pch_lpt: | case e1000_pch_lpt: | ||||
case e1000_pch_spt: | case e1000_pch_spt: | ||||
case e1000_pch_cnp: | |||||
pba = E1000_PBA_26K; | pba = E1000_PBA_26K; | ||||
break; | break; | ||||
case e1000_82575: | case e1000_82575: | ||||
pba = E1000_PBA_32K; | pba = E1000_PBA_32K; | ||||
break; | break; | ||||
case e1000_82576: | case e1000_82576: | ||||
case e1000_vfadapt: | case e1000_vfadapt: | ||||
pba = E1000_READ_REG(hw, E1000_RXPBS); | pba = E1000_READ_REG(hw, E1000_RXPBS); | ||||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | if (if_getmtu(ifp) > ETHERMTU) { | ||||
hw->fc.high_water = 0x5000; | hw->fc.high_water = 0x5000; | ||||
hw->fc.low_water = 0x3000; | hw->fc.low_water = 0x3000; | ||||
} | } | ||||
hw->fc.refresh_time = 0x1000; | hw->fc.refresh_time = 0x1000; | ||||
break; | break; | ||||
case e1000_pch2lan: | case e1000_pch2lan: | ||||
case e1000_pch_lpt: | case e1000_pch_lpt: | ||||
case e1000_pch_spt: | case e1000_pch_spt: | ||||
case e1000_pch_cnp: | |||||
hw->fc.high_water = 0x5C20; | hw->fc.high_water = 0x5C20; | ||||
hw->fc.low_water = 0x5048; | hw->fc.low_water = 0x5048; | ||||
hw->fc.pause_time = 0x0650; | hw->fc.pause_time = 0x0650; | ||||
hw->fc.refresh_time = 0x0400; | hw->fc.refresh_time = 0x0400; | ||||
/* Jumbos need adjusted PBA */ | /* Jumbos need adjusted PBA */ | ||||
if (if_getmtu(ifp) > ETHERMTU) | if (if_getmtu(ifp) > ETHERMTU) | ||||
E1000_WRITE_REG(hw, E1000_PBA, 12); | E1000_WRITE_REG(hw, E1000_PBA, 12); | ||||
else | else | ||||
▲ Show 20 Lines • Show All 514 Lines • ▼ Show 20 Lines | tctl |= (E1000_TCTL_PSP | E1000_TCTL_RTLC | E1000_TCTL_EN | | ||||
(E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT)); | (E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT)); | ||||
if (adapter->hw.mac.type >= e1000_82571) | if (adapter->hw.mac.type >= e1000_82571) | ||||
tctl |= E1000_TCTL_MULR; | tctl |= E1000_TCTL_MULR; | ||||
/* This write will effectively turn on the transmit unit. */ | /* This write will effectively turn on the transmit unit. */ | ||||
E1000_WRITE_REG(&adapter->hw, E1000_TCTL, tctl); | E1000_WRITE_REG(&adapter->hw, E1000_TCTL, tctl); | ||||
/* SPT and KBL errata workarounds */ | |||||
if (hw->mac.type == e1000_pch_spt) { | if (hw->mac.type == e1000_pch_spt) { | ||||
u32 reg; | u32 reg; | ||||
reg = E1000_READ_REG(hw, E1000_IOSFPC); | reg = E1000_READ_REG(hw, E1000_IOSFPC); | ||||
reg |= E1000_RCTL_RDMTS_HEX; | reg |= E1000_RCTL_RDMTS_HEX; | ||||
E1000_WRITE_REG(hw, E1000_IOSFPC, reg); | E1000_WRITE_REG(hw, E1000_IOSFPC, reg); | ||||
/* i218-i219 Specification Update 1.5.4.4 */ | |||||
reg = E1000_READ_REG(hw, E1000_TARC(0)); | reg = E1000_READ_REG(hw, E1000_TARC(0)); | ||||
reg |= E1000_TARC0_CB_MULTIQ_3_REQ; | reg &= E1000_TARC0_CB_MULTIQ_3_REQ; | ||||
reg |= E1000_TARC0_CB_MULTIQ_2_REQ; | |||||
erj: The line above already sets this bit, along with another. In fact, the line above clears… | |||||
kbowlingAuthorUnsubmitted Not Done Inline Actions@erj this was taken from the Linux team's shared code https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/net/ethernet/intel/e1000e?id=c0f4b163a03e73055dd734eaca64b9580e72e7fb I'm not sure whether they intended or not to toggle all the bits but it made it past a bunch of people :/ The root cause for the fix seems to be attempting to slow down DMA https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/net/ethernet/intel/e1000e?id=b10effb92e272051dd1ec0d7be56bf9ca85ab927 kbowling: @erj this was taken from the Linux team's shared code https://git.kernel. | |||||
erjUnsubmitted Not Done Inline ActionsThe linked patch includes the proper "~" before the constant in the block of code in netdev.c, so I think that was just missed here. And my confusion in the second part was due to a typo in the comment -- this fix is for 1.5.4.5, not 1.5.4.4. Modifying TARC0 (it looks like it's a register for enabling/disabling hardware workarounds) wouldn't be unexpected for something like that issue. erj: The linked patch includes the proper "~" before the constant in the block of code in netdev.c… | |||||
erjUnsubmitted Not Done Inline ActionsAnd to nitpick a little bit -- netdev.c isn't shared code; that's Linux-specific. It appears the client team is committing important fixes directly to the Linux code without notifying us. :( erj: And to nitpick a little bit -- netdev.c isn't shared code; that's Linux-specific.
It appears… | |||||
kbowlingAuthorUnsubmitted Not Done Inline Actions@erj ok, I can't directly commit but I suggest you or @sbruno either backing out this errata part of my patch or just fixing it, these were both typos and my fault. @cramerj_intel.com can you settle up with the client team to figure out better communication with the shared teams? kbowling: @erj ok, I can't directly commit but I suggest you or @sbruno either backing out this errata… | |||||
E1000_WRITE_REG(hw, E1000_TARC(0), reg); | E1000_WRITE_REG(hw, E1000_TARC(0), reg); | ||||
} | } | ||||
} | } | ||||
/********************************************************************* | /********************************************************************* | ||||
* | * | ||||
* Enable receive unit. | * Enable receive unit. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 1,474 Lines • Show Last 20 Lines |
The line above already sets this bit, along with another. In fact, the line above clears everything but bit 28 and 29, and possibly those two as well.
Anyway, how does this fix the errata in 1.5.4.4? The description doesn't mention doing anything to the TARC0 register.