aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/e1000/if_em.c
Commit message (Collapse)AuthorAgeFilesLines
* e1000: Fix some issues in em_newitr()Mark Johnston2025-05-271-18/+22
| | | | | | | | | | | | - Load packet and byte counters exactly once, as they can be concurrently mutated. - Rename bytes_packets to bytes_per_packet, which seems clearer. - Use local variables that have the same types as the counter values, rather than truncating unsigned long to u32. Reviewed by: kbowling MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50416
* e1000: Initialize helper variables in em_newitr()Mark Johnston2025-05-271-0/+1
| | | | | | | | | | | | Due to races with the threaded transmit and receive paths, it's possible to have r/tx_bytes != 0 && r/tx_packets == 0, in which case the maximum byte count could be left uninitialized. Initialize them to zero to handle this case. PR: 286819 Reviewed by: kbowling MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50416
* dev: Use recently added improvements to PME# support to simplify driversJohn Baldwin2025-03-271-7/+3
| | | | | | | | | | Depend on the PCI bus driver clearing PME# after resume to remove the need for clearing PME# from DEVICE_RESUME methods. Use pci_has_pm and pci_enable_pme. Reviewed by: Krzysztof Galazka <krzysztof.galazka@intel.com> Differential Revision: https://reviews.freebsd.org/D49251
* e1000: Remove old itr sysctl handlerKevin Bowling2024-11-291-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implementation had various bugs. bde@ reported that the unit conversion/scaling is wrong, and it also does not handle 82574L or igb(4) devices correctly. With the new AIM code, it is expected most users will not need to manually tune this. If you do need static control: hw.em.enable_aim=0 for all interfaces at boot or dev.em.X.enable_aim=0 for individual interfaces at runtime and they will track the hw.em.max_interrupt_rate tunable. That codepath has been bugfixed for all supported chipsets. You may view the current rate with dev.em.X.queue_rx_0.interrupt_rate which has been bugfixed for all supported chipsets. If you need to set different rates per interface for some reason let me know and I will rethink how to add this back. Otherwise you can leave AIM on for general purpose interfaces and disable it at runtime on special purpose low or high latency interfaces that would track hw.em.max_interrupt_rate if you have a mix of concerns. PR: 235031 Reported by: Bruce Evans <bde@FreeBSD.org> MFC after: 3 days Relnotes: yes Sponsored by: BBOX.io
* e1000: Style txrxKevin Bowling2024-11-241-1/+2
| | | | | | | Fix up indentation and reflow long lines. MFC after: 3 days Sponsored by: BBOX.io
* e1000: Style pass on if_emKevin Bowling2024-11-241-433/+626
| | | | | | | Fix up some indentation and reflow long lines MFC after: 3 days Sponsored by: BBOX.io
* e1000: Try auto-negotiation for fixed 100 or 10 configurationKevin Bowling2024-11-241-6/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a retread of https://reviews.freebsd.org/D34449 which I think will fix the issue for the remote side not supporting autoneg. We now attempt an autoneg, and if that fails fall back to the current code that forces the link speed/duplex. The original intent of this patch is to inform the remote switch of duplex settings when we (the client) are specifying a fixed 10 or 100 speed. Otherwise it may get the duplex setting wrong. The tricky case is when the remote (switch) side is fixing its speed AND duplex while disabling autoneg and we (client) need to do the same, which still seems to be common enough at some ISPs. Original commit message follows: Currently if an e1000 interface is set to a fixed media configuration, for gigabit, it will participate in auto-negotiation as required by IEEE 802.3-2018 Clause 37. However, if set to fixed media configuration for 100 or 10, it does NOT participate in auto-negotiation. By my reading of Clauses 28 and 37, while auto-negotiation is optional for 100 and 10, it is not prohibited and is, in fact, "highly recommended". This patch enables auto-negotiation for fixed 100 and 10 media configuration, in a similar manner to that already performed for 1000. I.e., the patch enables advertising of just the manually configured settings with the goal of allowing the remote end to match the manually configured settings if it has them available. To be clear, this patch does NOT allow an em(4) interface that has been manually configured with specific media settings to respond to auto-negotiation by then configuring different parameters to those that were manually configured. The intent of this patch is to fully comply with the requirements of Clause 37, but for 100 and 10. The need for this has arisen on an em(4) link where the other end is under a different administrative control and is set to full auto-negotiation. Due to the cable length GigE is not working well. It is desired to set the em(4) end to "media 100baseTX mediatype full-duplex" which does work when both ends are configured that way. Currently, because em(4) does not participate in autoneg for this setting, the remote defaults to half-duplex - i.e., there's a duplex mismatch and things don't work. With this patch, em(4) would inform the remote that it has only 100baseTX full, the remote would match that and it will work. Tested by: Natalino Picone <natalino.picone@nozominetworks.com> Tested by: Franco Fichtner <franco@opnsense.org> Tested by: J.R. Oldroyd <fbsd@opal.com> (previous version) Sponsored by: Nozomi Networks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D47336
* e1000: sysctl for TCP flag handling during TSOMichael Tuexen2024-11-211-0/+56
| | | | | | | | | | | | | | Add tso_tcp_flags_mask_first_segment, tso_tcp_flags_mask_middle_segment, and tso_tcp_flags_mask_last_segment sysctl-variables to control the handling of TCP flags during TSO. This allows to change the masks appropriate for classical ECN and to configure appropriate masks for accurate ECN. Reviewed by: rrs MFC after: 3 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D44259
* e1000: Move I219 LM19/V19 to ADLKevin Bowling2024-10-241-2/+2
| | | | | | | | | | | This roughly corresponds to Linux 9d9e5347b035412daa844f884b94a05bac94f864 For FreeBSD this is currently not expected to cause any difference in behavior because we do not have the MTP force smbus changes for modern standby. MFC after: 3 days Sponsored by: BBOX.io
* e1000: Re-add AIMKevin Bowling2024-10-111-5/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We originally left this out because iflib modulates interrupts and accomplishes some level of batching versus the custom queues in the older driver. Upon more detailed study of the Linux driver which has a newer implementation, it finally became clear to me this is actually a holdoff timer and not an interrupt limit as it is conventionally (statically) programmed and displayed as an interrupt rate. The data sheets also make this somewhat clear. Thus, AIM accomplishes two beneficial things for a wide variety of workloads[1]: 1. At low throughput/packet rates, it will significantly lower latency (by counter-intuitively "increasing" the interrupt rate.. better thought of as decreasing the holdoff timer because you will modulate down before coming anywhere near these interrupt rates). 2. At bulk data rates, it is tuned to achieve a lower interrupt rate (by increasing the holdoff timer) than the current static 8000/s. This decreases processing overhead and yields more headroom for other work such as packet filters or userland. For a single NIC this might be worth a few sys% on common CPUs, but may be meaningful when multiplied such as if_lagg, if_bridge and forwarding setups. The AIM algorithm was re-introduced from the older igb or out of tree driver, and then modernized with permission to use Intel code from other drivers. I have retroactively added it to lem(4) and em(4) where the same concept applies, albeit to a single ITR register. [1]: http://iommu.com/datasheets/ethernet/controllers-nics/intel/e1000/gbe-controllers-interrupt-moderation-appl-note.pdf Tested by: cc (https://wiki.freebsd.org/chengcui/testD46768) MFC after: 1 week Relnotes: yes Sponsored by: Rubicon Communications, LLC ("Netgate") Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D46768
* e1000: Clean up ITR/EITR in preparation for AIMKevin Bowling2024-09-271-12/+8
| | | | | | | | | | | | Provide macros to derive the various needed values and make it a bit more clear the differences between em and igb. The igb default EITR was not landing at the right offset. Respect the 'max_interrupt_rate' tunable. MFC after: 1 week Sponsored by: BBOX.io
* e1000: Clean up legacy absolute and packet timersKevin Bowling2024-09-271-57/+59
| | | | | | | | | | | The absolute and packet timers only apply to lem and em with some only applying to the later. This cleans up the sysctl tree to only show these where applicable and stops writing to unexpected registers for igb. MFC after: 1 week Sponsored by: BBOX.io
* e1000: Add sysctl for igb(4) DMA CoalesceKevin Bowling2024-09-241-0/+56
| | | | | | | | | | | | | | This feature can increase efficiency at the expense of latency It does not work well with the default interrupt delay, but expose the otherwise unconnected code in the driver in case people want to experiment. See https://www.intel.com/content/dam/support/us/en/documents/network/adapter/pro100/sb/466827_intel_r__dma_coalescing_white_paper_v003.pdf MFC after: 1 week Sponsored by: Blue Box Systems
* e1000: Handle igb EEE sysctlKevin Bowling2024-09-241-3/+12
| | | | | MFC after: 1 week Sponsored by: Blue Box Systems
* e1000: Add sysctls for some missing MAC statsKevin Bowling2024-09-241-0/+19
| | | | | MFC after: 1 week Sponsored by: Blue Box Systems
* e1000: drop NEEDGIANT from em_sysctl_debug_info useKevin Bowling2024-09-221-1/+1
| | | | | | | The write is only used to toggle the debug print function and this is otherwise stateless. MFC after: 1 week
* e1000: drop NEEDGIANT on em_sysctl_reg_handler usesKevin Bowling2024-09-221-6/+6
| | | | | | These are simple singular diagnostic register reads MFC after: 1 week
* e1000: remove NEEDGIANT from a couple sysctlsKevin Bowling2024-09-221-2/+2
| | | | | | These are internally locked already MFC after: 1 week
* e1000: Update igb driver version to 2.5.28-fbsdKevin Bowling2024-09-211-1/+1
| | | | | | | Bump to the current out of tree driver version since we only have some gratuitous changes. MFC after: 1 week
* e1000(4): Remove disconnected SYSCTLMarius Strobl2024-01-091-11/+0
| | | | | | | | The global hw.em.rx_process_limit knob has been replaced by the device- specific dev.IF.N.iflib.rx_budget along with the conversion to iflib(4). While at it, remove the - besides initialization of tx_process_limit - unused {r,t}x_process_limit members.
* iflib: invert default restart on VLAN changesKevin Bowling2023-08-241-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In rS360398, a new iflib device method was added to opt out of VLAN events needing an interface reset. I am switching the default to not requiring a restart for: * VLAN events * unknown events After fixing various bugs, I do not think this would be a common need of hardware and it is undesirable from the user's perspective causing link flaps and much slower VLAN configuration. Currently, there are no other restart events besides VLAN events, and setting the ifdi_needs_restart default to false will alleviate the need to churn every driver if an odd event is added in the future for specific hardware. markj points out this could cause churn in the other direction; I will solve that problem with an event registration system as he mentions in the review should we need it in the future. These drivers will opt into restart and need further inspection or work: * ixv (needs code audit, 61a8231 fixed principal issue; re-init probably not necessary) * axgbe (needs code audit; re-init probably not necessary) * iavf - (needs code audit; interaction with Malicious Driver Detection mentioned in rS360398) * mgb - no VLAN functions are currently implemented. Left a comment. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D41558
* iflib drivers: Constify PCI ID LUTsMarius Strobl2023-08-171-4/+4
| | | | | | | | Since d49e83eac3baf16a22b1c5d42e8438b68b17e6f9, iflib(9) is ready for this change. While at it, make isc_driver_version strings (static) const where not apparently un-const on purpose, too. This reduces the size of the amd64 GENERIC by about 10 KiB.
* sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-161-1/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* e1000: disable TSO on lem(4) and em(4)Kevin Bowling2023-08-151-0/+6
| | | | | | | | | Disable TSO on lem(4) and em(4) until a ring stall can be debugged. I am not able to reproduce the issue on lem(4) but disabling there in abundance of caution in case the issue is not specific to em(4). Reported by: grog
* e1000: Enable TSO on 82574Kevin Bowling2023-08-091-3/+0
| | | | | | | | Further testing indicates something wrong with particular reciever, enabling TSO 82574 for wider testing. Tested by: karels MFC after: 3 months
* e1000: Enable TSO for lem(4) and em(4)Kevin Bowling2023-08-031-29/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most em(4) devices now enjoy TSO and TSO6, matching NetBSD and Linux defaults. A prior commit automasks TSO on 10/100 Ethernet due to errata and other bugs for IPv6 were fixed recently allowing this. Mike Karels identified a performance anomaly on Intel 82574L devices. These are multiqueue enabled on FreeBSD since the conversion to iflib. I am investigating whether this can be fixed, in the mean time MSI-X with checksum offloads remain default. i219 SPT devices have an errata that downclocks the DMA engine, which results in TSO not being able to acheive line rate. Therefore, it is disabled on: * Intel(R) I219-LM and I219-V SPT * Intel(R) I219-LM and I219-V SPT-H (2) * Intel(R) I219-LM and I219-V LBG (3) * Intel(R) I219-LM and I219-V SPT (4) * Intel(R) I219-LM and I219-V SPT (5) Many lem(4) devices enjoy TSO, exceptions being 82542, 82543, 82547. TSO6 may be possible for some chipsets but I am still working through my testing matrix and that is hidden behind hw.em.unsupported_tso. If you encounter issues, you may disable TSO with for example: ifconfig em0 -tso -tso6. I ask to be informed of any deviations from normal operation requiring this. Thanks to cc@ for access to emulab.net. On a sample I219 system it saves about 16% CPU on IPv4 and 19% on IPv6. iperf3 -Vc reported numbers: total% user% system% IPv4 TSO 21.3 7 14.4 21.4 6 15.4 21.5 6 15.5 IPv4 no TSO 36.8 5.4 31.4 38.5 5.1 33.5 38.2 5.7 32.6 IPv4 no TSO no TXCSUM 45.1 5.8 39.3 46 6.3 39.7 46.2 5.9 40.4 IPv6 TSO6 21.7 5.4 16.3 21.6 5.1 16.5 21.9 5.6 16.3 IPv6 no TSO6 41.2 5.2 36 41 5.1 36 40.8 5.2 35.7 IPv6 no TSO6 no TXCSUM6 49 5.9 43.1 48.8 4.9 43.9 49 5.6 43.4 Tested by: cc (lem(4)), karels (82574L) MFC after: 3 months Relnotes: yes Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D41170
* e1000: Automask TSO on lem(4)/em(4) 10/100 EthernetKevin Bowling2023-08-031-2/+48
| | | | | | | | | | | | This feature masks TSO capability when a link comes up at 10 or 100mbit due to errata on the chips. This behavior matches previous versions of FreeBSD as well as NetBSD and Linux. A tunable, hw.em.unsupported_tso may be set if the admin desires to disabling automasking and configure TSO settings manually. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41170
* e1000: Fix lem(4)/em(4) TSO6Kevin Bowling2023-07-311-5/+4
| | | | | | | | | | | * Fix TSO6 by specializing IP checksum insertion and following Intel SDM values for IPv6. * Remove unnecessary 82544 IP-bit handling * Remove TSO6 from lem(4) capabilitities Reviewed by: erj (earlier version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41170
* e1000: HWCSUM excemption fixesKevin Bowling2023-07-291-2/+3
| | | | | | | | | | | Also disable IPV6 checksum offload. Spell hw->mac.type < e1000_82543 as e1000_82542. Confusingly, chips like 82540 and 82541 come later and do not have these issues. There is no functional change here, as the enum was defined in such a way it worked correctly. But this reads literally. MFC after: 1 week
* e1000: Corrections for lem(4)/em(4) txcsum offloadKevin Bowling2023-07-271-7/+4
| | | | | | | | | Explicitly set ipcss/ipcse/ipcso for IPv6 per intel SDM as indicated in inline comments. Fix and consolidate 82543/82547 hwcsum exemption. While here rearrange and expand some commentary.
* e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixesKevin Bowling2023-07-221-19/+38
| | | | | | | | | | | | | | | | * em(4) obey administrative ifcaps for using hwcsum offload * em(4) obey administrative ifcaps for hw vlan receive tagging * em(4) add additional TSO6 ifcap, but disabled by default as is TSO4 * lem(4) obey administrative ifcaps for using hwcsum offload * lem(4) add support for hw vlan receive tagging * lem(4) Add ifcaps for TSO offload experimentation, but disabled by default due to errata and possibly missing txrx code. * lem(4) disable HWCSUM ifcaps by default on 82547 due to errata around full duplex links. It may still be administratively enabled. Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30072
* Revert "e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes"Kevin Bowling2023-07-221-32/+16
| | | | | | | | Seems to cause a panic when booting under VitrualBox. Reported by: yasu This reverts commit 95f7b36e8fac45092b9a4eea5e32732e979989f0.
* e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixesKevin Bowling2023-07-211-16/+32
| | | | | | | | | | | | | | | | * em(4) obey administrative ifcaps for using hwcsum offload * em(4) obey administrative ifcaps for hw vlan receive tagging * em(4) add additional TSO6 ifcap, but disabled by default as is TSO4 * lem(4) obey administrative ifcaps for using hwcsum offload * lem(4) add support for hw vlan receive tagging * lem(4) Add ifcaps for TSO offload experimentation, but disabled by default due to errata and possibly missing txrx code. * lem(4) disable HWCSUM ifcaps by default on 82547 due to errata around full duplex links. It may still be administratively enabled. Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30072
* e1000: fix VLAN 0Kristof Provost2023-05-111-1/+3
| | | | | | | | | | | | | | | | VLAN 0 essentially means "Treat as untagged, but with priority bits", and is used by some ISPs. On igb/em interfaces we did not receive packets with VLAN tag 0 unless vlanhwfilter was disabled. This can be fixed by explicitly listing VLAN 0 in the hardware VLAN filter (VFTA). Do this from em_setup_vlan_hw_support(), where we already (re-)write the VFTA. Reviewed by: kbowling Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D40046
* e1000: Add support for future client platformsKevin Bowling2023-02-091-0/+11
| | | | | MFC after: 2 weeks Sponsored by: BBOX.io
* e1000: Remove redundant disable_ulp for ich8lanKevin Bowling2023-02-091-3/+0
| | | | | | | | | | This call only makes sense for ich8lan, and the shared code does it in e1000_setup_init_funcs() above this deletion. Obtained from: DPDK MFC after: 2 weeks Sponsored by: BBOX.io Pull Request: https://github.com/freebsd/freebsd-src/pull/539
* e1000: bump driver versionKevin Bowling2023-02-081-2/+3
| | | | | | | | | | Incrementing these to avoid confusion in users; we are on par with these out of tree versions. Reviewed by: erj MFC after: 2 weeks Sponsored by: BBOX.io Pull Request: https://github.com/freebsd/freebsd-src/pull/540
* e1000: fix I219 hang on resetKevin Bowling2023-02-081-2/+117
| | | | | | | | | | | Clear the rings before reset to avoid a HW hang. Inspired by em-7.7.8 and DPDK (1fc9701238edcf0541289b9ae15565b6d9d7ab30) Reviewed by: erj MFC after: 2 weeks Sponsored by: BBOX.io Pull Request: https://github.com/freebsd/freebsd-src/pull/540
* em(4): Add IDs for new Intel(R) I219 devicesPiotr Kubaj2023-02-061-0/+8
| | | | | | | | | | | | | | | | These include I219 (20) through I219 (23), which ends at Raptor Lake. This also corrects a discrepancy where the (16) devices should be mac type "e1000_pch_tgp" and not "e1000_pch_adp". Signed-off-by: Eric Joyner <erj@FreeBSD.org> PR: 269224 Reviewed by: erj@ MFC after: 1 day Relnotes: yes Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D38376
* Convert iflib(4) and iflib-based drivers to the DrvAPIJustin Hibbits2022-12-211-11/+11
| | | | | | | | | | | | | | Summary: Convert iflib(4) and the following drivers: * axgbe * em * ice * ixl * vmxnet Sponsored by: Juniper Networks, Inc. Reviewed by: kbowling, #iflib Differential Revision: https://reviews.freebsd.org/D37768
* sys: Nuke double-semicolonsElliott Mitchell2022-11-021-1/+1
| | | | | | | | | A distinct number of double-semicolons have ended up in FreeBSD. Take a pass at getting rid of many of these harmless typos. Reviewed by: emaste, rrs Pull Request: https://github.com/freebsd/freebsd-src/pull/609 Differential Revision: https://reviews.freebsd.org/D31716
* Revert "e1000: Try auto-negotiation for fixed 100 or 10 configuration"Kevin Bowling2022-10-121-12/+8
| | | | | | | | This reverts commit 9ab4dfce8feda8cf3545be0c3c7569095b1fcd24. OPNsense users have reported a regression with fixed configs. The e1000 api is not ready for this change.
* e1000: Increase rx_buffer_size to 32bKevin Bowling2022-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the size of the local rx_buffer_size variable to account for larger buffer sizes possible on 82580, i350 chips. From i350 datasheet, 6.2.10 Initialization Control 4 (LAN Base Address + Offset 0x13): When 4 ports are enabled maximum buffer size is 36 KB. When 2 ports are enabled maximum buffer size is 72 KB. When only a single port is enabled maximum buffer size is 144 KB. and 8.3: The overall available internal buffer size in the I350 for all ports is 144 KB for receive buffers and 80 KB for transmit Buffers. Disabled ports memory can be shared between active ports and sharing can be asymmetric. The default buffer size for each port is loaded from the EEPROM on initialization. From the reporter: But for I350 when only 2 ports are used PBA size can be set as 72KB (see datasheet RXPbsize or e1000_rxpbs_adjust_82580 function in e1000_82575.c). In this case calculating the rx_buffer_size overflows as 0x0048 << 10 = 73728 or 0x12000 pushed into u16. It is then set as 0x2000 or 8192. PR: 263896 Reported by: hannula@gmail.com Tested by: hannula@gmail.com Approved by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D35167
* em/igb: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-061-4/+2
|
* e1000: Try auto-negotiation for fixed 100 or 10 configurationJ.R. Oldroyd2022-04-131-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if an e1000 interface is set to a fixed media configuration, for gigabit, it will participate in auto-negotiation as required by IEEE 802.3-2018 Clause 37. However, if set to fixed media configuration for 100 or 10, it does NOT participate in auto-negotiation. By my reading of Clauses 28 and 37, while auto-negotiation is optional for 100 and 10, it is not prohibited and is, in fact, "highly recommended". This patch enables auto-negotiation for fixed 100 and 10 media configuration, in a similar manner to that already performed for 1000. I.e., the patch enables advertising of just the manually configured settings with the goal of allowing the remote end to match the manually configured settings if it has them available. To be clear, this patch does NOT allow an em(4) interface that has been manually configured with specific media settings to respond to auto-negotiation by then configuring different parameters to those that were manually configured. The intent of this patch is to fully comply with the requirements of Clause 37, but for 100 and 10. The need for this has arisen on an em(4) link where the other end is under a different administrative control and is set to full auto-negotiation. Due to the cable length GigE is not working well. It is desired to set the em(4) end to "media 100baseTX mediatype full-duplex" which does work when both ends are configured that way. Currently, because em(4) does not participate in autoneg for this setting, the remote defaults to half-duplex - i.e., there's a duplex mismatch and things don't work. With this patch, em(4) would inform the remote that it has only 100baseTX full, the remote would match that and it will work. Approved by: erj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D34449
* e1000: Update mc filter before RCTL flagsKevin Bowling2022-04-131-3/+3
| | | | | | | Update mc filter array before changing RCTL flags as in 5a3eb6207a35 Approved by: grehan MFC after: 2 weeks
* e1000: fix interface capabilities managementVincenzo Maffione2021-12-081-19/+23
| | | | | | | | | | | | | | | | | The e1000 drivers (em, lem, igb) are currently looking at the iflib copies of the capabilities bitvectors (scctx->isc_capabilities and scctx->isc_capenable) rather than the ifnet ones (ifp->if_capabilities and ifp->if_capenable). However, the latter are the ones that are actually updated by ifconfig and that should be used by the drivers during interface operation. The former are set by the driver on interface attach (for iflib internal use) and should not be used anymore by the driver. This patch fixes the e1000 driver to use the correct bitvectors. PR: 260068 Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D33154
* e1000: print EEPROM/NVM/OROM versionsKevin Bowling2021-10-061-30/+155
| | | | | | | | | This is useful for diagnosing problems. In particular, the errata sheets identify the EEPROM version for many fixes. Reviewed by: gallatin MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32333
* e1000: Lock nvm print sysctlKevin Bowling2021-10-061-1/+8
| | | | | | | | | Otherwise results in KASSERT with debug kernels because we rely on the iflib CTX lock to implement the software serialization to the NVM model Reviewed by: gallatin MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32333
* e1000: Function prototype cleanupKevin Bowling2021-10-061-49/+49
| | | | | | | | | | | Drop arguments of function prototypes since the file is mixed between listing arg names and not. No functional changes Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D32329