Commit graph

24 commits

Author SHA1 Message Date
Marius Strobl f221d35be7 igb(4): Remove disconnected SYSCTL
The global hw.igb.rx_process_limit knob never was adhered to by the
in-tree version of this driver but similar functionality is available
via the device-specific dev.igb.N.iflib.rx_budget.

While at it, remove the - besides initialization of tx_process_limit -
unused {r,t}x_process_limit members.
2024-01-09 23:15:44 +01:00
Kevin Bowling 725e4008ef iflib: invert default restart on VLAN changes
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
2023-08-24 13:48:19 -07:00
Marius Strobl 51e235148a iflib drivers: Constify PCI ID LUTs
Since d49e83eac3, 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.
2023-08-17 20:34:23 +02:00
Warner Losh 685dc743dc sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:36 -06:00
Warner Losh 95ee2897e9 sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:11 -06:00
Kevin Bowling 0eb8cd1de2 igc: sync srrctl buffer sizing with e1000
Approved by:	grehan
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31493
2023-08-10 07:43:16 -07:00
Peter Grehan 43ed91e00b igc: Increase default per-queue interrupt rate to 20000.
The default per-queue packet rate of 8000 will cause packet loss when
forwarding at 2.5G with a single stream, as is common when using e.g.
iperf3 to test a platform.

Bump this to 20000 (the "low latency" value in the Linux driver) which
avoids packet loss for this type of test.

Future work will use adaptive interrupt rate in a similar fashion
to the ixgbe driver.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Reviewed by:	erj, kp
MFC after:	3 weeks
Differential Revision: https://reviews.freebsd.org/D40904
2023-07-11 13:29:37 +10:00
Justin Hibbits ec22a3a259 DrvAPI: Trivial mechanical conversions for various drivers
Mechanically convert the following drivers, with trivial changes:
* ipw(4)
* igc(4)
* enetc(4)
* malo(4)
* nfe(4)
* bxe(4)
* awg(4)
* otus(4)
* rtwn(4)
* bnxt(4)
* ath(4)

Sponsored by:	Juniper Networks, Inc.
2022-12-21 15:36:59 -05:00
Kevin Bowling 2eaef8ec4a igc: Fix up hw vlan ops
Adapt 2796f7cab1 to igc(4)

* Don't reset the entire adapter for vlan changes, fix up the problems
* Remove the VFTA, this hardware doesn't seem to implement it

Approved by:	grehan
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31979
2022-10-10 16:10:53 -07:00
Mah Yock Gen 29d7f1ff57 igc: remove unnecessary PHY ID checks
I225 devices have only one PHY vendor. There is unnecessary to check
_I_PHY_ID during the link establishment and auto-negotiation process,
the checking also caused devices like i225-IT failed. This patch is to
remove the mentioned unnecessary checking.

Cc: stable@dpdk.org

Signed-off-by: Mah Yock Gen <yock.gen.mah@intel.com>
Signed-off-by: Taripin Samuel <samuel.taripin@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Approved by:	grehan
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36923
2022-10-10 01:50:46 -07:00
Hubert Mazur 55760984d5 igc: Don't start in promiscious mode by default
The igc driver always sets the promiscious mode during initialization,
ignoring what is set in ifp.
Fix this by checking the interface flags and setting mode appropriately.

Reviewed by:	grehan
Obtained from:	Semihalf
Sponsored by:	Stormshield
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D36591
2022-09-19 09:18:19 +02:00
Kornel Dulęba 3b8d04f845 igc: Change default duplex setting
During media selection through ifconfig one might not specify
the duplex setting through the mediaopt flag.
In that case the igc driver would default to full-duplex.
The problem with this approach is that e1000(em/igb) driver
defaults to half-duplex.
Because of that if one connects both NICs and sets media to
e.g. 100baseTX on both of them no link will be found.
Fix that by matching igc behaviour with what e1000 does.

Reviewed by: grehan
Approved by: mw(mentor)
Obtained from: Semihalf
Sponsored by: Stormshield
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35673
2022-07-01 08:12:08 +02:00
Kevin Bowling 9b88ecd674 igc: Increase rx_buffer_size local variable to 32b
Apply 6987c47569 to igc. This is not
expected to have any benefit on current parts with current observed PBA
sizes but will avoid surprises if they are increased in future chips.

Approved by:	grehan
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D35217
2022-05-16 20:15:34 -07:00
Kevin Bowling 48a1a6be19 igc: Fix typo in PCI ID define usage
Reported by:	jenkins
Fixes:	bf0aa72f1f igc: Update PCI IDs
MFC after:	3 days
2022-05-15 16:17:49 -07:00
Kevin Bowling bf0aa72f1f igc: Update PCI IDs
I226-K PCI ID got clarified by intel. Add a new I226 ID while here.

Approved by:	grehan
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D35218
2022-05-15 15:09:58 -07:00
John Baldwin 05a86e7c3c igc: Remove unused devclass argument to DRIVER_MODULE. 2022-05-06 15:39:30 -07:00
Scott Long 6f3c0d2764 Default to always accepting the PHY that's present. Linux did
something similar a while back, and there are devices in the wild
that otherwise won't attach.  This patch is temporary until the
PHY code is further cleared up.

Obtained from: grehan
2022-02-26 18:29:08 -07:00
Kevin Bowling b4a58b3d58 igc: Remove redundant IFCAP_VLAN_HWTAGGING check
Match igb(4) as in f7926a6d0c. From Vincenzo, this check is redundant
to setup providing us an IGC_RXD_STAT_VP bit and would make for an
unexpected condition if IFCAP_VLAN_HWTAGGING were not set but the tag
was stripped, which would be passed up the stack breaking isolation.

PR:		260068
Approved by:	vmaffione
MFC after:	1 month
2021-12-29 09:37:34 -07:00
Vincenzo Maffione f7926a6d0c net: iflib: fix vlan processing in the drivers
The logic that sets iri_vtag and M_VLANTAG does not handle the
case where the 802.11q VLAN tag is 0. Fix this issue across
the iflib drivers. While there, also improve and align the
VLAN tag check extraction, by moving it outside the RX descriptor
loop, eliminating a local variable and additional checks.

PR:             260068
Reviewed by:    kbowling, gallatin
Reported by:	erj
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D33156
2021-12-28 11:11:41 +00:00
betterentley f7c32ed617 Fix 'take effect' spelling in menus and comments.
Signed-off-by: John Bentley <johnbentley.public@gmail.com>
Pull Request: https://github.com/freebsd/freebsd-src/pull/559
2021-11-18 23:22:12 -07:00
Peter Grehan 561cd74b17 igc: Use hardware routine for PHY reset
Summary:
The previously used software reset routine wasn't sufficient
to reset the PHY if the	bootloader hadn't left the device in
an initialized state. This was seen with the onboard igc port
on an 11th-gen Intel NUC.

The software reset isn't used in the Linux driver so all related
code has been removed.

Tested on: Netgate 6100 onboard ports, a discrete PCIe I225-LM card,
and an 11th-gen Intel NUC.

Reported by:	woodsb02
Tested by:	woodsb02 (NUC)
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Reviewed by:	kbowling
Differential Revision: https://reviews.freebsd.org/D32772
2021-11-08 23:33:10 +10:00
Peter Grehan 5a3eb6207a igc: correctly update RCTL when changing multicast filters.
Fix clearing of bits in RCTL for the non-bpf/non-allmulti case.
Update RCTL after modifying the multicast filter registers as per
the Linux driver.

This fixes LACP on igc interfaces, where incoming LACP multicasti
control packets were being dropped.

Reviewed by:	kbowling
Obtained from:	Rubicon Communications, LLC ("Netgate")
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D32574
2021-10-22 21:16:12 +10:00
Kevin Bowling d02e436353 igc: sync igc_txrx with igb(4)
Reviewed by:	grehan
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D31227
2021-07-31 08:00:16 -07:00
Peter Grehan 517904de5c igc(4): Introduce new driver for the Intel I225 Ethernet controller.
This controller supports 2.5G/1G/100MB/10MB speeds, and allows
tx/rx checksum offload, TSO, LRO, and multi-queue operation.

The driver was derived from code contributed by Intel, and modified
by Netgate to fit into the iflib framework.

Thanks to Mike Karels for testing and feedback on the driver.

Reviewed by:	bcr (manpages), kbowling, scottl, erj
MFC after:	1 month
Relnotes:	yes
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30668
2021-07-12 14:57:18 +10:00