git: 90c74b2b6004 - main - cxgbei: Enter network epoch and set vnet around t4_push_pdus().

John Baldwin jhb at FreeBSD.org
Mon Mar 22 17:05:25 UTC 2021


The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=90c74b2b6004bc50f89378ac689fd179aa2d2ad6

commit 90c74b2b6004bc50f89378ac689fd179aa2d2ad6
Author:     John Baldwin <jhb at FreeBSD.org>
AuthorDate: 2021-03-22 16:59:16 +0000
Commit:     John Baldwin <jhb at FreeBSD.org>
CommitDate: 2021-03-22 17:05:02 +0000

    cxgbei: Enter network epoch and set vnet around t4_push_pdus().
    
    Reviewed by:    np
    MFC after:      2 weeks
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D29302
---
 sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
index 72626e60b58e..6292dfc8dc75 100644
--- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
+++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
@@ -369,6 +369,7 @@ icl_cxgbei_conn_pdu_get_data(struct icl_conn *ic, struct icl_pdu *ip,
 void
 icl_cxgbei_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip)
 {
+	struct epoch_tracker et;
 	struct icl_cxgbei_conn *icc = ic_to_icc(ic);
 	struct icl_cxgbei_pdu *icp = ip_to_icp(ip);
 	struct socket *so = ic->ic_socket;
@@ -397,6 +398,8 @@ icl_cxgbei_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip)
 	 * already.
 	 */
 	inp = sotoinpcb(so);
+	CURVNET_SET(toep->vnet);
+	NET_EPOCH_ENTER(et);
 	INP_WLOCK(inp);
 	if (__predict_false(inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT)) ||
 	    __predict_false((toep->flags & TPF_ATTACHED) == 0))
@@ -406,6 +409,8 @@ icl_cxgbei_conn_pdu_queue(struct icl_conn *ic, struct icl_pdu *ip)
 		t4_push_pdus(icc->sc, toep, 0);
 	}
 	INP_WUNLOCK(inp);
+	NET_EPOCH_EXIT(et);
+	CURVNET_RESTORE();
 }
 
 static struct icl_conn *


More information about the dev-commits-src-all mailing list