Commit graph

42730 commits

Author SHA1 Message Date
Jeremiah Lott
86efff5491 ixv: Check cap return before MSI-X enable write
In the QEMU workaround code in if_ixv.c, the ixv driver calls
pci_find_cap(dev, PCIY_MSIX, &rid). It is not checking the return code
from that function and the function appears to always be failing. This
then causes the driver to use the rid variable uninitialized, which
will mean setting a bit at an arbitrary offset in pci config space. For
now, this seems to have no adverse impact, but it could easily cause
very subtle problems.

PR:		207037
Sponsored by:	BBOX.io

(cherry picked from commit b87b3696c973ef0a9df70143cd89f6b488531e93)
2024-10-29 18:01:04 -07:00
Konstantin Belousov
3aedf015d1 if_ixv: fix build without NETMAP
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit b0993e3bcaec60701f3ae56df255433eb4bcd091)
2024-10-28 22:03:00 -07:00
Kevin Bowling
9679df8eea ixv: Dynamically size the receive packet size
If MTU of the if_ixv VF driver is configured between 1501 and 2030, and
if a peer box have bigger MTU and sends a packet bigger than MTU into
this guest, kernel could crash.

Dynamically calculate the receive packet size on rx_mbuf_sz as ix(4)
does.

PR:		268092
Reported by:	Kumara Babu <nkumarababu@gmail.com>
Sponsored by:	BBOX.io

(cherry picked from commit cdbe3de5383706da0f6d3c29f1ec2dcfed366bf1)
2024-10-28 17:29:03 -07:00
Andrew Gallatin
ee373c1234 acpi_ged: Handle events directly
Handle ged interrupts directly from the interrupt handler,
while the interrupt source is masked, so as to conform
with the acpi spec, and avoid spurious interrupts and
lockups on boot.

When an acpi ged interrupt is encountered, the spec requires
the os (as stated in 5.6.4: General Purpose Event Handling)
to leave the interrupt source masked until it runs the
EOI handler.  This is not a good fit for our method of
queuing the work (including the EOI ack of the interrupt),
via the AcpiOsExecute() taskqueue mechanism.

Note this fixes a bug where an arm64 server could lock up if
it encountered a ged interrupt at boot.  The lockup was
due to running on a single core (due to arm64 not using
EARLY_AP_STARTUP), and due to that core encountering a
new interrupt each time the interrupt handler unmasked
the interrupt source, and having the EOI queued on a taskqueue
which never got a chance to run. This is also possible
on any platform when using just a single processor.
The symptom of this is a lockup at boot, with:
"AcpiOsExecute: failed to enqueue task, consider
increasing the debug.acpi.max_tasks tunable" scrolling
on console.

Similarly, spurious interrupts would occur when running
with multiple cores, because it was likely that the
interrupt would fire again immediately, before the
ged task could be run, and before an EOI could be sent
to lower the interrupt line.  I would typically see
3-5 copies of every ged event due to this issue.

This adds a tunable, debug.acpi.ged_defer, which can be
set to 1 to restore the old behavior.  This was done
because acpi is a complex system, and it may be
theoretically possible something the ged handler does
may sleep (though I cannot easily find anthing by inspection).

MFC after: 1 month
Reviewed by: andrew, jhb, imp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D42158

(cherry picked from commit be91b4797e2c8f3440f6fe3aac7e246886f9ebca)
2024-10-28 19:02:24 -04:00
Mark Johnston
9f984fc683 netmap: Make memory pools NUMA-aware
Each netmap adapter associated with a physical adapter is attached to a
netmap memory pool.  contigmalloc() is used to allocate physically
contiguous memory for the pool, but ideally we would ensure that all
such memory is allocated from the NUMA domain local to the adapter.

Augment netmap's memory pools with a NUMA domain ID, similar to how
IOMMU groups are handled in the Linux port.  That is, when attaching to
a physical adapter, ensure that the associated memory pools are local to
the adapter's associated memory domain, creating new pools as needed.

Some types of ifnets do not have any defined NUMA affinity; in this case
the domain ID in question is the sentinel value -1.

Add a sysctl, dev.netmap.port_numa_affinity, which can be used to enable
the new behaviour.  Keep it disabled by now to avoid surprises in case
netmap applications are relying on zero-copy optimizations to forward
packets between ports belonging to different NUMA domains.

Reviewed by:	vmaffione
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D46666

(cherry picked from commit 1bae9dc584272dd75dc4e04cb5d73be0e9fb562a)
2024-10-28 16:39:50 +00:00
Christos Margiolis
6bfac3b2a3 sound: Retire channel refcount
No longer used.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D47269

(cherry picked from commit 9a6cf27583ffc13bb0a7c5be0704ba0d2f3b834d)
2024-10-27 17:32:30 +01:00
Christos Margiolis
bf3a355a87 sound: Remove redundant refcount checks in vchan_setnew()
When adding a new vchan, we are looking for a parent channel which
either already has vchans (i.e CHN_F_HAS_VCHAN), or does not, but is
also not being used (i.e !CHN_F_BUSY). Since CHN_F_BUSY essentially
tells us if the channel is currently being used or not, there is no need
to check if the channel's refcount is 0 as well.

When removing a vchan, we first check if we have only 1 vchan allocated
that is also being used (so we cannot remove it at the moment), and then
we check if the vchan is not busy and remove it. Again, checking
CHN_F_BUSY is enough.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D47268

(cherry picked from commit 43c0b593c2c3b2c07009c031a0e7e8190a45b31a)
2024-10-27 17:32:30 +01:00
Christos Margiolis
f3449b1a21 sound: Untangle dsp_cdevs[] and dsp_unit2name() confusion
Before de8c0d15a64fa ("sound: Get rid of snd_clone and use
DEVFS_CDEVPRIV(9)"), sound(4) would create one device for each allocated
channel. The device names would be chosen from dsp_cdevs[], and created
with dsp_unit2name(). Additionally, dsp_cdevs[] was also used to match
these devices names, as well as OSSv4 aliases in dsp_clone().

Since sound(4) does not create separate devices for each channel
anymore, the meaning and use dsp_cdevs[] has changed. Part of it no
longer corresponds to devices at all, but instead is used to create
channel names, and another part is used to match only OSSv4 aliases in
dsp_clone().

To address this confusion, separate dsp_cdevs[] into a dsp_aliases[]
array, and move dsp_unit2name() to pcm/channel.c and rename it to
chn_mkname().

While here, get rid of the SND_DEV_DSPHW_* channel types, and simply use
the existing PCMDIR_* constants as the channel types. There is no need
to duplicate the same meaning twice.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D47199

(cherry picked from commit 802c78f5194e4524faa30ea57adbf00f28fc72c6)
(cherry picked from commit b1bb6934bb8774dd96be76d88e6824e49b613549)
2024-10-27 17:32:23 +01:00
Christos Margiolis
26524f063f sound: Change PCMDIR_* numbering
Needed by a follow-up patch, so that channels can be sorted properly.
This change does not affect the behavior of any subsystem.

While here, change to an enum.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D47198

(cherry picked from commit a4111e9dc7225618fa8d2af64d866cf0b0aebd56)
2024-10-27 17:32:17 +01:00
Christos Margiolis
32a2994b44 sound: Use DSP_REGISTERED in dsp_clone()
DSP_REGISTERED calls PCM_REGISTERED, and already contains all the checks
we are doing.

No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D47196

(cherry picked from commit bb5e3ac1a7b71480a50fc0c813c916a3d058336c)
2024-10-27 17:32:16 +01:00
Christos Margiolis
ace5484e48 sound: Call DSP_REGISTERED before PCM_DETACHING
DSP_REGISTERED first checks if the softc is not null, through
PCM_REGISTERED, which in turn calls PCM_ALIVE, whereas PCM_DETACHING
accesses the softc flags directly.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D47195

(cherry picked from commit 9693241188aa6882166b091d9006f9d0affeda7e)
2024-10-27 17:32:16 +01:00
Dimitry Andric
7905f6f1c7 Fix enum warning in ath_hal's ar9002
This fixes a clang 19 warning:

    sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c:57:32: error: comparison of different enumeration types ('HAL_BOOL' and 'HAL_ANT_SETTING') [-Werror,-Wenum-compare]
       57 |             (AH5212(ah)->ah_diversity != HAL_ANT_VARIABLE)) {
          |              ~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~

The `ah_diversity` field of `struct ath_hal_5212` is of type `HAL_BOOL`,
not the enum type `HAL_ANT_SETTING`. In other code, `ah_diversity` is
set to `AH_TRUE` whenever the related field `ah_antControl` is set to
`HAL_ANT_VARIABLE`.

It is not entirely clear to me what the intended statement is here: the
test as it is written now compares the enum value 0 to `ah_diversity`,
so in effect it enables the following block whenever `ah_diversity` is
`AH_TRUE`. Write it like that, to avoid the compiler warning.

MFC after:	3 days

(cherry picked from commit 36d486cc2ecdb9c290dba65bd5668b7e50d0d822)
2024-10-27 11:53:01 +01:00
Kevin Bowling
02bddce58c e1000: Move I219 LM19/V19 to ADL
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.

Sponsored by:	BBOX.io

(cherry picked from commit 77b70ad751dfe3b115112252a5b96f504fcc2e0a)
2024-10-26 19:27:10 -07:00
John Baldwin
e42a182bb7 cxgbe: Add a 'show t4 memdump' DDB command
Reviewed by:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D45187

(cherry picked from commit 1edf61f395d98a5abb7d6f38e5e64722b4ddf351)
2024-10-21 11:49:27 -07:00
Navdeep Parhar
42d8f6b759 cxgbe(4): Use correct synchronization when marking the adapter offline.
adapter->flags are guarded by a synch_op, as noted in the comment in
adapter.h where the flags are defined.

Fixes:	5241b210a4e cxgbe(4): Basic infrastructure for ULDs to participate in adapter reset.
Sponsored by:	Chelsio Communications

(cherry picked from commit 52e5a66eac22d24e29f204c5b65232378e71f4cf)
2024-10-21 10:15:33 -07:00
Navdeep Parhar
0eea8754ae cxgbe(4): Allow t4_tom to be unloaded safely.
* Disable IFCAP_TOE automatically on all ifnets on all adapters during
  unload.  This is user-friendly and avoids panics due to stale ifnet
  state after t4_tom is unloaded.
* Do not allow unload if tids are in use by the TOE on any adapter.

Reported by:	Bimal Abraham @ Chelsio
Sponsored by:	Chelsio Communications

(cherry picked from commit 9ba8670a8b175de79ea087688f51595b4f2db862)
2024-10-21 10:15:11 -07:00
Navdeep Parhar
48473a98a9 cxgbe/t4_tom: Remove duplicate unlock in t4_tom_deactivate.
Fixes:	c1c524852f62 cxgbe/t4_tom: Implement uld_stop and uld_restart for ULD_TOM.
Sponsored by:	Chelsio Communications

(cherry picked from commit cc110bbec6d23d8cff47733704c71de641d0c8e8)
2024-10-21 10:14:56 -07:00
Navdeep Parhar
b9f7a09c49 cxgbe(4): Clobber all tracer state on stop and redo only traceq on restart.
Tracers have to be recreated after a restart but that's okay given that
they are used for debugging only.

Sponsored by:	Chelsio Communications

(cherry picked from commit ee3da604dd016439850dae77366796313e60f0e0)
2024-10-21 10:14:39 -07:00
Navdeep Parhar
b56fe21c6d cxgbe/t4_tom: Do not set unresolved entries to STALE in t4_l2t_update.
An L2 entry in the driver's hash was marked STALE unconditionally if it
changed in the kernel when its driver refcount is 0.  Fix the driver to
do this for VALID entries only.

Sponsored by:	Chelsio Communications

(cherry picked from commit 3883300afe0bff5c5658274c4d8cfe773d08343e)
2024-10-21 10:14:23 -07:00
Navdeep Parhar
2c9c295f5e cxgbe/t4_tom: completely avoid L2T entries during stop/suspend.
1. Mark the L2T entry valid only if t4_write_l2e succeeds, which won't
   happen if the adapter is stopped.  This prevents L2T entries from
   sometimes getting (re)promoted to VALID on Tx activity during stop.
2. Discard a work request immediately instead of enqueueing it to the
   arp queue if the adapter is stopped.

Fixes:	c1c524852f62 cxgbe/t4_tom: Implement uld_stop and uld_restart for ULD_TOM.
Sponsored by:	Chelsio Communications

(cherry picked from commit 07f47e8850d0639d474026b203013072aeb32c81)
2024-10-21 10:14:04 -07:00
Navdeep Parhar
261c616077 cxgbe(4): Make sure that the tracing filters are usable after restart.
The destination queue for tracing filters is destroyed during stop or
suspend and the software state needs to reflect this.  A new destination
queue will be setup when the adapter resumes operation.

Sponsored by:	Chelsio Communications

(cherry picked from commit d82cb5c608ae9aaced4cb459ca511e62c64dbf74)
2024-10-21 10:13:47 -07:00
Navdeep Parhar
610ff48406 cxgbe/t4_tom: Demote STALE L2 table entries to RESOLVING in uld_stop.
The STALE state means the L2T entry is valid in hardware but needs to be
refreshed (ARP/NDP) in software.  But stop/suspend wipes the hardware
L2T and STALE entries need to be updated just like VALID entries to match
actual hardware state.

Fixes:	c1c524852f62 cxgbe/t4_tom: Implement uld_stop and uld_restart for ULD_TOM.
Sponsored by:	Chelsio Communications

(cherry picked from commit 171e57967b3e53f0fb48116df5003ce17163295c)
2024-10-21 10:09:52 -07:00
Navdeep Parhar
b5c0843322 cxgbe/t4_tom: Add synq entry to the list before calling send_synack.
This fixes a panic where the peer's ack to the synack arrives on a
different queue and do_pass_establish tries to remove the synqe from
synqe_list before it has been added by do_pass_accept_req.

Reported by:	Sony Arpita Das @ Chelsio
Fixes:	283333c0e329 cxgbe/t4_tom: Track all synq entries in a per-adapter list.
Sponsored by:	Chelsio Communications

(cherry picked from commit 674cbf38f6d0a0b307e52c4265da9f077606b035)
2024-10-21 10:09:37 -07:00
Navdeep Parhar
3301201fc9 cxgbe(4): Always report link-down on an abrupt stop.
This fixes a regression in 5241b210a4e1 where the driver stopped
reporting link down after a fatal error unless t4_reset_on_fatal_err was
also set.

Fixes:	5241b210a4e1 cxgbe(4): Basic infrastructure for ULDs to participate in adapter reset.
Sponsored by:	Chelsio Communications

(cherry picked from commit 7aeec281b8b2620d7d88c9abdfadd7e20a485b9c)
2024-10-21 10:09:14 -07:00
Navdeep Parhar
c7550138e5 cxgbe/iw_cxgbe: Fail early in some callbacks when the RNIC is stopped.
Stop allocating new resources when the RNIC is stopped but continue to
allow previously allocated resources to be freed.  Note that t4_tom's
uld_stop tears down all TOE connections, including those being used for
iWARP, and that triggers the cleanup of iWARP resources.

Fail post_send/post_recv early too to avoid the SQ doorbell.

Sponsored by:	Chelsio Communications

(cherry picked from commit 9fdb683d92b36cbd20bbd8d61f0c1138f8348dd4)
2024-10-21 10:08:56 -07:00
Navdeep Parhar
0366d0bd50 cxgbe/iw_cxgbe: c4iw_connect should return a negative errno.
Avoid a pointless assignment while here.

Sponsored by:	Chelsio Communications

(cherry picked from commit 3b4dcc0feb41120017381681d612d3cc21beb1d7)
2024-10-21 10:08:27 -07:00
Navdeep Parhar
11dc811bb8 cxgbe/iw_cxgbe: Tidy up a couple of CTRs in c4iw_create_listen.
backlog is an int and not a string.  While here, fix an adjacent CTR
that was spread over two lines even though it fits in one.

Sponsored by:	Chelsio Communications

(cherry picked from commit 3f250bb6f05b57890215398767bbb8aa00c888f3)
2024-10-21 10:08:09 -07:00
Navdeep Parhar
cd2ae69629 cxgbe/iw_cxgbe: Replace the fatal error flag with a stopped flag.
Now that suspend/resume is supported by the base driver, a fatal error
isn't the only reason that the RNIC can stop abruptly.  Also, this state
is no longer permanent as it's possible to resume operations after a
stop.  Rename the flag and associated routines to match the new state of
affairs.

Sponsored by:	Chelsio Communications

(cherry picked from commit 8254a276ad893ae2a1b35fcbbad255f06e29b8c6)
2024-10-21 10:07:49 -07:00
Navdeep Parhar
a7b24758d0 cxgbe(4): Export the core suspend/resume functionality to other modules.
Sponsored by:	Chelsio Communications

(cherry picked from commit 1e584ca30e3a97eedf37368e7ad75c31f08be039)
2024-10-21 10:07:20 -07:00
Navdeep Parhar
ccd65f200c cxgbe(4): reset routine for general use.
Add a reset_adapter wrapper that picks the most suitable reset routine
internally.  Use it in the fatal error handler as well as the sysctl
based reset.

Sponsored by:	Chelsio Communications

(cherry picked from commit d668a0b0abe4b079ac2a0d9cd0d7b71bd4a043c6)
2024-10-21 10:06:40 -07:00
Navdeep Parhar
888858a7bf cxgbe(4): Stop work request queues in a reliable manner.
Clear the EQ_HW_ALLOCATED flag with the wrq lock held and discard all
work requests, pending or new, when it's not set.

Sponsored by:	Chelsio Communications

(cherry picked from commit 0a9d1da6e6cede5e9c0ff63240d724049ad72b5b)
2024-10-21 10:06:19 -07:00
Navdeep Parhar
4016225138 cxgbe/iw_cxgbe: Fix typo in assertion.
eanbled -> enabled

(cherry picked from commit b5332809c633e7e37715f7823a8a8ee9799910a4)
2024-10-21 10:05:56 -07:00
Navdeep Parhar
3b600c38d8 cxgbe/t4_tom: bugfixes in stop/restart.
1. Remove toepcb from the toep_list on active open failure.
2. Purge the wr_list for an L2T entry on an adpater stop.

Fixes:	c1c524852f62 cxgbe/t4_tom: Implement uld_stop and uld_restart for ULD_TOM.
Sponsored by:	Chelsio Communications

(cherry picked from commit fef0e39f64a1db796ded8777dbee71fc287f6107)
2024-10-21 10:05:39 -07:00
Navdeep Parhar
788088340c cxgbe/iw_cxgbe: Add a placeholder uld_restart.
Sponsored by:	Chelsio Communications

(cherry picked from commit f1c4ed150334ae2844810a58b7384cb0e3abe664)
2024-10-21 10:03:34 -07:00
Navdeep Parhar
b836830270 cxgbe/t4_tom: Implement uld_stop and uld_restart for ULD_TOM.
This allows the adapter to be suspended or reset even when stateful TOE is
active, in some limited configurations.

The LLD has already stopped the adapter hardware and all its queues by the time
these ULD routines get called.  The general approach in t4_tom is to purge the
lookup tables immediately so that they are ready for operation by the time the
adapter resumes, and park all the resources left hanging by the stopped hardware
into separate "stranded" queues that can be dealt with at leisure.

Outstanding active opens, live connections, and synq entries (for connections in
the middle of the 3-way handshake) are all treated as if the hardware had
reported an abrupt error for the tid.  The servers/listeners are a bit different
in that no error is reported.  They're just noted as non-functional when the
hardware stops and are recreated by the driver during restart.

Sponsored by:	Chelsio Communications

(cherry picked from commit c1c524852f625cf5f420653f7850d1fe3ff6b4ca)
2024-10-21 10:03:14 -07:00
Navdeep Parhar
fcda529bf0 cxgbe/t4_tom: Track all synq entries in a per-adapter list.
Live tid entries in tid_tab are either full fledged connections or synq
entries.  toep_list tracks the connections already and this change adds
a synqe_list to track the synq entries.  These two lists can be used to
enumerate and iterate over all live tids.

Sponsored by:	Chelsio Communications

(cherry picked from commit 283333c0e329fd7aceff16fa3bf2b9892744d883)
2024-10-21 10:02:37 -07:00
Navdeep Parhar
da45eba6d1 cxgbe(4): Stop and restart the L2T allocator with the LLD.
L2T entries are used by both filters and TOE and the L2T is shared
between the base driver (LLD) and the TOM ULD.  Add a flag to indicate
that the L2T is stopped, which means:
* t4_alloc_l2e and t4_l2t_alloc_switching will not allocate new entries.
* t4_tom will ignore all ARP/NDP updates from the kernel.
* Previously allocated L2T entries can still be freed.

Sponsored by:   Chelsio Communications

(cherry picked from commit cd93fdee5c8bbdb00d10f8a1fa43f30f151a1ef7)
2024-10-21 10:02:17 -07:00
Navdeep Parhar
fb313ad44d cxgbe(4): Stop and restart the atid allocator with the LLD.
atids are used by both filters and TOE and the atid table is in the base
driver (LLD).  New atids cannot be allocated when the allocator is
stopped but existing ones can still be freed.  It is expected that the
owners of outstanding atids will release them in their own stop
processing, before the adapter is restarted.

Sponsored by:	Chelsio Communications

(cherry picked from commit fd3aca5b41968421f243b760ac5733f39f25cc56)
2024-10-21 10:01:50 -07:00
Navdeep Parhar
41e9881bf7 cxgbe(4): Basic infrastructure for ULDs to participate in adapter reset.
The suspend/resume/reset implementation in the base driver (LLD)
currently works when only stateless features are in use.  This commit
adds basic infrastructure for stateful upper layer drivers (ULDs) to
participate in suspend/resume/reset.

* Add a uld_restart to indicate that the adapter has been restarted
  after a stop and the ULD should resume operations.
* Move the existing functionality in t4_suspend/t4_resume to stop_lld and
  restart_lld.  Use these and the new uld restart routines everywhere the
  adapter has to be stopped abruptly and restarted, namely:
  1. PCIE bus suspend/resume/reset methods invoked by the kernel.
  2. Manual internal-reset using driver sysctl.
  3. Automatic internal-reset on a fatal error.
* Implement an alternate internal-reset for use in VMs and for testing.

Typical reset sequence is:
stop_adapter(sc);
stop_lld(sc);
stop_all_uld(sc);
set_adapter_hwstatus(sc, false);

/* hw reset takes place here. */

restart_adapter(sc);
restart_lld(sc);
  set_adapter_hwstatus(sc, true);
restart_all_uld(sc);

Sponsored by:	Chelsio Communications

(cherry picked from commit 5241b210a4e1029f3005faf82cd74965645c401b)
2024-10-21 10:01:06 -07:00
Navdeep Parhar
4f1b1077fb cxgbe(4): Changes to ULD list management.
* Convert t4_uld_list to an array.  There will be at most 3 items in the
  list and it's simpler to track them in an array with a fixed slot for
  each ULD.
* There is no need to refcount ULDs so stop doing that.
* Add uld_ prefix to all members of uld_info.
* Rename async_event to uld_stop to match its actual purpose.  Call it
  for all ULDs and not just ULD_IWARP.

Reviewed by:	jhb
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D46029

(cherry picked from commit cf5e6370f15cffabbbf508083ba7d48ec8abfa79)
2024-10-21 10:00:26 -07:00
Navdeep Parhar
85a5adf4ed cxgbe(4): Make no assumptions about the start and size of the L2T table.
Do not assume that the table starts at index 0 and is typically 4K in
size.  The only thing the driver needs to verify is that its use of
F_SYNC_WR doesn't collide with the L2T hwidx range.

Reviewed by:	jhb
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D46028

(cherry picked from commit cfcfd3c7bf5b60da42b13ac5d8085c762613c302)
2024-10-21 09:46:30 -07:00
Navdeep Parhar
e867a25031 cxgbe/t4_tom: Free up hardware resources when the final CPL is received.
Final CPL means the tid is done in the hardware and other resources
associated with it can be freed right away.  There is no need to wait
for the kernel to detach the toepcb.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D45991

(cherry picked from commit 27479403a764cf3b97194887a1f819c1e35357aa)
2024-10-21 09:46:30 -07:00
Navdeep Parhar
c18966b3dc cxgbe/t4_tom: Detach the toep from the tcpcb when entering TIME_WAIT.
The kernel used to call tod_pcb_detach when entering TIME_WAIT but that
seems to have changed, likely with the TIME_WAIT overhaul in the kernel
some time ago.  Catch up by having the driver perform the detach.

The hardware does not handle TIME_WAIT so it's important to detach and
let the kernel arm the 2MSL timer to deal with it.

Reported by:	Sony Arpita Das @ Chelsio
Reviewed by:	jhb
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D45990

(cherry picked from commit bbc326241d91ab2cee2ec2c5c0aa8a906480132f)
2024-10-21 09:46:29 -07:00
Navdeep Parhar
032bd06d98 cxgbe(4): Tidy up t4_l2t.h
Align the comment for if_t with the rest and remove the declaration of
t4_l2t_set_switching, which was removed in 061bbaf7e7.

No functional change.

Sponsored by:	Chelsio Communications

(cherry picked from commit b3bbc6cc79a3b76d342b2a8fd68e5266eb50ff11)
2024-10-21 09:46:29 -07:00
Kevin Bowling
4608b5f80d igc: txrx function prototype cleanup
Drop variable names of function prototypes since the file is mixed in
listing them or not and they fall out of sync.

Sponsored by:	BBOX.io

(cherry picked from commit 7763b194d8de6fe8034f754064449a7510ca16b9)
2024-10-21 08:10:57 -07:00
Kevin Bowling
10ad90dfd1 e1000: txrx function prototype cleanup
Drop variable names of function prototypes since the file is mixed in
listing them or not and they fall out of sync.

Sponsored by:	BBOX.io

(cherry picked from commit 9dc452b983f042aa9d2a2562517d44c1928ff42a)
2024-10-21 08:10:43 -07:00
Kevin Bowling
cd310c0135 igc: Function prototype cleanup
Drop variable names of function prototypes since the file is mixed in
listing them or not and they fall out of sync.

Sponsored by:	BBOX.io

(cherry picked from commit 1b0e41ddffbf0ac84c88019df84dfd50ce9f7788)
2024-10-21 08:10:28 -07:00
Kevin Bowling
e624987fe4 igc: Rename 'struct adapter' to 'struct igc_softc'
Rename the 'struct adapter' to 'struct igc_softc' to avoid type
ambiguity in things like kgdb and make sharing code with e1000 and
ixgbe easier.

Sponsored by:	BBOX.io

(cherry picked from commit 542f5d56317e94676cf19cb9d66207bf9a6b6758)
2024-10-21 08:10:09 -07:00
Kevin Bowling
1dae98bc4b igc: Add sysctls for some missing MAC stats
Sponsored by:	BBOX.io

(cherry picked from commit 09526a771afc411e641a3d04c905824fe8afc627)
2024-10-21 08:09:51 -07:00
Kevin Bowling
4c1441bba1 igc: Add sysctl for DMA Coalesce
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

Sponsored by:	BBOX.io

(cherry picked from commit 68b1f5dc59368ce5175e3300bf95476ea5a560bc)
2024-10-21 08:09:35 -07:00