]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
iflib: Make if_shared_ctx_t a pointer to const
authorMark Johnston <markj@FreeBSD.org>
Mon, 8 Mar 2021 17:39:06 +0000 (12:39 -0500)
committerKevin Bowling <kbowling@FreeBSD.org>
Sun, 3 Oct 2021 01:55:49 +0000 (18:55 -0700)
commit3a13449e4daa28fd7be43c91017212818006ed5c
tree7e5d4aee780f11d8b368ac3f7f9af9447104ee59
parent9c0707ed9ff150718fe8e0215c4c9fe8f4bc7f4a
iflib: Make if_shared_ctx_t a pointer to const

This structure is shared among multiple instances of a driver, so we
should ensure that it doesn't somehow get treated as if there's a
separate instance per interface.  This is especially important for
software-only drivers like wg.

DEVICE_REGISTER() still returns a void * and so the per-driver sctx
structures are not yet defined with the const qualifier.

Reviewed by: gallatin, erj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29102

(cherry picked from commit ffe3def903a5f239c319e5fe12450659658974a5)
sys/dev/bnxt/if_bnxt.c
sys/dev/e1000/if_em.c
sys/dev/e1000/igb_txrx.c
sys/dev/ixgbe/if_ix.c
sys/dev/ixgbe/if_ixv.c
sys/dev/ixgbe/ix_txrx.c
sys/dev/ixl/if_iavf.c
sys/dev/ixl/if_ixl.c
sys/net/iflib.h