git: 1967e313795f - main - lagg(4): Add support for allocating TLS receive tags.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 07 Jun 2022 10:59:25 UTC
The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=1967e313795f40c8c5076af66a914132af71b85d commit 1967e313795f40c8c5076af66a914132af71b85d Author: Hans Petter Selasky <hselasky@FreeBSD.org> AuthorDate: 2022-05-25 10:38:30 +0000 Commit: Hans Petter Selasky <hselasky@FreeBSD.org> CommitDate: 2022-06-07 10:54:42 +0000 lagg(4): Add support for allocating TLS receive tags. The TLS receive tags are allocated directly from the receiving interface, because mbufs are flowing in the opposite direction and then route change checks are not useful, because they only work for outgoing traffic. Differential revision: https://reviews.freebsd.org/D32356 Sponsored by: NVIDIA Networking --- sys/net/if_lagg.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index e9e66e54e6ce..1d0ac50666e7 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -1836,6 +1836,7 @@ lagg_snd_tag_alloc(struct ifnet *ifp, struct lagg_snd_tag *lst; struct lagg_port *lp; struct ifnet *lp_ifp; + struct m_snd_tag *mst; int error; switch (params->hdr.type) { @@ -1851,6 +1852,10 @@ lagg_snd_tag_alloc(struct ifnet *ifp, case IF_SND_TAG_TYPE_TLS: sw = &lagg_snd_tag_tls_sw; break; + case IF_SND_TAG_TYPE_TLS_RX: + /* Return tag from port interface directly. */ + sw = NULL; + break; #ifdef RATELIMIT case IF_SND_TAG_TYPE_TLS_RATE_LIMIT: sw = &lagg_snd_tag_tls_rl_sw; @@ -1876,22 +1881,30 @@ lagg_snd_tag_alloc(struct ifnet *ifp, if_ref(lp_ifp); NET_EPOCH_EXIT(et); - lst = malloc(sizeof(*lst), M_LAGG, M_NOWAIT); - if (lst == NULL) { - if_rele(lp_ifp); - return (ENOMEM); - } + if (sw != NULL) { + lst = malloc(sizeof(*lst), M_LAGG, M_NOWAIT); + if (lst == NULL) { + if_rele(lp_ifp); + return (ENOMEM); + } + } else + lst = NULL; - error = m_snd_tag_alloc(lp_ifp, params, &lst->tag); + error = m_snd_tag_alloc(lp_ifp, params, &mst); if_rele(lp_ifp); if (error) { free(lst, M_LAGG); return (error); } - m_snd_tag_init(&lst->com, ifp, sw); + if (sw != NULL) { + m_snd_tag_init(&lst->com, ifp, sw); + lst->tag = mst; + + *ppmt = &lst->com; + } else + *ppmt = mst; - *ppmt = &lst->com; return (0); }