History log of /freebsd-11-stable/sys/net/iflib.c
Revision Date Author Comments
# 361063 14-May-2020 erj

Partially MFC r354344: iflib: properly release memory allocated for DMA

This also removes the unused function iflib_deregister(); accidentally
introduced in a previous MFC.

Sponsored by: Intel Corporation


# 361061 14-May-2020 erj

MFC r356310: iflib: Prevent watchdog from resetting idle queues

Sponsored by: Intel Corporation


# 361058 14-May-2020 erj

MFC r354207: iflib: cleanup memory leaks on driver detach

Sponsored by: Intel Corporation


# 361057 14-May-2020 erj

Partially MFC r353967: iflib: call ether_ifdetach and netmap_detach before stop

This MFCs most of the patch except for the parts where the new
iflib_unregister_vlan_handlers() function is called in the pseudo device
register/deregister functions since those functions don't exist in FreeBSD
11.

This re-ordering can fix a potential panic.

Sponsored by: Intel Corporation


# 361055 14-May-2020 erj

MFC r360398: iflib: Stop interface before (un)registering VLAN

This is now misleadingly named for stable/11; this was meant to fix an
issue in an out-of-tree iavf(4) driver that uses iflib.

This commit actually introduces a new driver-dependent function that
iflib-using drivers can implement in order to tell iflib whether an
interface restart is needed for certain events. For this commit, this
function is only used for VLAN register/unregister events.

Sponsored by: Intel Corporation


# 358272 24-Feb-2020 hselasky

MFC r357799:
Make sure the so-called end of receive interrupts don't starve in iflib.

When the receive ring cannot be filled with mbufs, due to lack of memory,
no more interrupts may be generated to fill the receive ring later on.
Make sure to have a watchdog, to try refilling the receive ring from time
to time, hopefully when more mbufs are available.

Differential Revision: https://reviews.freebsd.org/D23315
Reviewed by: gallatin@
Sponsored by: Mellanox Technologies


# 352091 09-Sep-2019 erj

iflib: initialize the STATE_LOCK in iflib_register

From Jake:
r347197 contained an MFC for r332389, adding the STATE_LOCK to the iflib
core driver. Unfortunately, the commit accidentally missed adding the
STATE_LOCK_INIT.

Without this, if you build a STABLE-11 kernel with INVARIANTS enabled,
any mtx_lock of the state lock will result in a panic:

panic: mtx_lock() of spin mutex (null) @ /usr/src/sys/net/iflib.c:5522

It actually ends up looking like a panic due to taking a spin mutex when
we could be interrupted. However, the real cause is because the lock
class was never initialized.

Initialize the STATE_LOCK properly during iflib_register to fix this.

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: erj@
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D21540


# 347373 08-May-2019 erj

iflib: Add missing return statement that was left out from r347197


# 347213 06-May-2019 erj

MFC r345312: iflib: mark isc_driver_version as constant

(Additional comment by erj: This also adds a new sysctl_add_oid macro,
SYSCTL_ADD_CONST_STRING, for displaying const strings. This commit also
includes an edit to the sysctl.9 man page for it.)

Sponsored by: Intel Corporation


# 347212 06-May-2019 erj

MFC r345303, 345658, and partially MFC r345305

These are:
r345303: prevent possible infinite loop in iflib_encap
r345305: expose the Rx mbuf buffer size to drivers
r345658: return ENETDOWN when the network device is down

r345305 is only partially MFC'd with no mergeinfo because it includes
changes to iflib-using drivers, and none of the drivers it changes use
iflib in stable/11. This commit just makes the function it adds available
for use with iflib-using kernel modules.

Sponsored by: Intel Corporation


# 347210 06-May-2019 erj

MFC r344817: Remove references to CONTIGMALLOC_WORKS in iflib and em

Sponsored by: Intel Corporation


# 347208 06-May-2019 erj

MFC r340435: Prevent POLA violation with TSO/CSUM offload

Sponsored by: Intel Corporation


# 347197 06-May-2019 erj

MFC r332389, r3342331, r334343, and partially r339338

This commit backports some new features from iflib in 12 back to stable/11:

r332389 - Split out flag manipulation from general context manipulation in iflib
r334231 - Add IFLIB_ADMIN_ALWAYS_RUN flag
r334343 - hold context lock across detach
r339338 - (Other updates to iflib that were included in this revision)

This commit doesn't include mergeinfo for r339338 since this only includes part
of it. I'm reminded of advice given to keep MFC-ability in mind when committing
large changes in the future.

Reviewed by: marius@ (change content)
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D19949


# 344472 22-Feb-2019 shurd

MFC r333131:

Fix iflib_encap() EFBIG handling bugs

1) Don't give up if m_collapse() fails. Rather than giving up, try
m_defrag() immediately.

2) Fix a leak where, if the NIC driver rejected the defrag'ed chain
as having too many segments, we would fail to free the chain.

Reviewed by: Matthew Macy <mmacy@mattmacy.io> (this version of patch)
Submitted by: Matthew Macy <mmacy@mattmacy.io> (early version of leak fix)


# 343099 16-Jan-2019 shurd

MFC r342855:

Use iflib_if_init_locked() during resume instead of iflib_init_locked().

iflib_init_locked() assumes that iflib_stop() has been called, however,
it is not called for suspend. iflib_if_init_locked() calls stop then init,
so fixes the problem.

This was causing errors after a resume from suspend.

PR: 224059
Reported by: zeising
Sponsored by: Limelight Networks


# 341477 04-Dec-2018 vmaffione

MFC r339639

netmap: align codebase to the current upstream (sha 8374e1a7e6941)

Changelist:
- Move large parts of VALE code to a new file and header netmap_bdg.[ch].
This is useful to reuse the code within upcoming projects.
- Improvements and bug fixes to pipes and monitors.
- Introduce nm_os_onattach(), nm_os_onenter() and nm_os_onexit() to
handle differences between FreeBSD and Linux.
- Introduce some new helper functions to handle more host rings and fake
rings (netmap_all_rings(), netmap_real_rings(), ...)
- Added new sysctl to enable/disable hw checksum in emulated netmap mode.
- nm_inject: add support for NS_MOREFRAG

Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D17364


# 338873 21-Sep-2018 erj

Revert MFC of r334231 in r338871.

It did not apply cleanly and was causing build errors.


# 338871 21-Sep-2018 erj

MFC r334231, r334779, r335322, and r338208 to stable/11 from head

These include:
r334231: iflib: Add new shared flag: IFLIB_ADMIN_ALWAYS_RUN
r334779: iflib: Record TCP checksum info in iflib when TCP checksum is requested
r335322: iflib: Style fixes
r338208: if_media: Add new 2.5G/5G/25G/40G/50G/100G/200G/400G media types

Sponsored by: Intel Corporation


# 333503 11-May-2018 shurd

MFC r333329, r333366, r333373

r333329: Fix off-by-one error requesting tx interrupt
r333366: Cleanup queues when iflib_device_register fails
r333373: Log iflib_tx_structures_setup failure in function

Approved by: re (gjb@)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15354


# 333341 07-May-2018 shurd

MFC r333253-r333254

Fixes invalid free()s when iflib_queues_alloc() fails, and remove unused
brscp variable.

Approved by: re (gjb@)


# 333340 07-May-2018 shurd

Direct commit to stable/11 to fix botched r333338

netmap nm_intr is not part of stable/11

Approved by: re (marius@)
Sponsored by: Limelight Networks


# 333338 07-May-2018 shurd

Merge iflib changes to 11-STABLE

MFC r300147, r300153, r300154, r300215, r301563, r301567,
r302372, r307560, r307562, r307563, r307568, r308792, r311039,
r311837, r312755, r312903, r312905, r312924, r313248, r315217,
r315245, r315288, r316278, r316281, r316502, r316596, r317756,
r319917, r319921, r319984, r319989, r320059, r320609, r320611,
r321253, r321629, r321630, r322337, r322338, r322823, r323077,
r323825, r323876, r323879, r323887, r323941, r323942, r323943,
r323944, r323954, r324038, r324318, r324937, r325166, r325167,
r325168, r325201, r325241, r325245, r325487, r325494, r325901,
r326033, r326369, r326370, r326432, r326577, r326578, r326702,
r326706, r326775, r327013, r327017, r327052, r327072, r327098,
r327242, r327244, r327247, r329651, r329742, r330289, r330715,
r330721, r332419, r332422, r332729

Reviewed by: sbruno
Approved by: re (delphij@)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D15142


# 332288 08-Apr-2018 brooks

MFC r331797:

Use an accessor function to access ifr_data.

This fixes 32-bit compat (no ioctl command defintions are required
as struct ifreq is the same size).

Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14900


# 331673 28-Mar-2018 markj

MFC r331538:
Clamp IFLIB_RX_COPY_THRESH to MHLEN in iflib_rxd_pkt_get().


# 328328 24-Jan-2018 hselasky

MFC r314502:
Make gtaskqueue compatible with drm-next such that they can be used with the
linuxkpi tasklets.

Submitted by: mmacy@nextbsd.org
Reported by: hselasky (hps)


# 321662 28-Jul-2017 dim

MFC r321306:

Fix printf format warning in iflib.c

Clang 5.0.0 got better warnings about printf format strings using %zd,
and this leads to the following -Werror warning on e.g. arm:

sys/net/iflib.c:1517:8: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat]
sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize);
^~~~~~~~~~~~~~~~~~~~
sys/net/iflib.c:1517:41: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'bus_size_t' (aka 'unsigned long') [-Werror,-Wformat]
sctx->isc_tx_maxsize, nsegments, sctx->isc_tx_maxsegsize);
^~~~~~~~~~~~~~~~~~~~~~~

Fix this by casting bus_size_t arguments to uintmax_t, and using %ju
instead.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D11679


# 318237 12-May-2017 bz

MFC r318015:

Adjust a comment.


# 315221 14-Mar-2017 pfg

MFC r313982, r314068:
sys: Replace zero with NULL for pointers.

Found with: devel/coccinelle


# 306770 06-Oct-2016 jhb

MFC 303754: Add __printflike() to bus_describe_intr() to enable -Wformat checks.

Fix a few places that were passing a raw string as the format to use
a "%s" format string instead.


# 304704 23-Aug-2016 shurd

MFC r304021: Update iflib to support more NIC designs

- Move group task queue into kern/subr_gtaskqueue.c
- Change intr_enable to return an int so it can be detected if it's not
implemented
- Allow different TX/RX queues per set to be different sizes
- Don't split up TX mbufs before transmit
- Allow a completion queue for TX as well as RX
- Pass the RX budget to isc_rxd_available() to allow an earlier return
and avoid multiple calls

Approved by: sbruno


# 302665 12-Jul-2016 bdrewery

MFC r302439:

iflib: Fix typo in 'iflib_rx_miss_bufs' sysctl name

Approved by: re (gjb)