]> 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)
committerMark Johnston <markj@FreeBSD.org>
Mon, 22 Mar 2021 15:42:18 +0000 (11:42 -0400)
commit46f44865e3c9bbfa4097a37fa8d33aa2e5adc729
treedc973ce35e5438e62c944caa2bdb6acabe13b45b
parent3aa6cc000f7472079a5174944e70f3bd412e6c37
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
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