svn commit: r333043 - in head/sys/dev/cxgbe: . tom

Navdeep Parhar np at FreeBSD.org
Thu Apr 26 22:04:22 UTC 2018


Author: np
Date: Thu Apr 26 22:04:21 2018
New Revision: 333043
URL: https://svnweb.freebsd.org/changeset/base/333043

Log:
  cxgbe(4): Move release_tid to the base NIC driver for future consumers.
  
  Sponsored by:	Chelsio Communications.

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/tom/t4_tom.c
  head/sys/dev/cxgbe/tom/t4_tom.h

Modified: head/sys/dev/cxgbe/adapter.h
==============================================================================
--- head/sys/dev/cxgbe/adapter.h	Thu Apr 26 21:44:00 2018	(r333042)
+++ head/sys/dev/cxgbe/adapter.h	Thu Apr 26 22:04:21 2018	(r333043)
@@ -1169,6 +1169,7 @@ void free_atid_tab(struct tid_info *);
 int alloc_atid(struct adapter *, void *);
 void *lookup_atid(struct adapter *, int);
 void free_atid(struct adapter *, int);
+void release_tid(struct adapter *, int, struct sge_wrq *);
 
 #ifdef DEV_NETMAP
 /* t4_netmap.c */

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Thu Apr 26 21:44:00 2018	(r333042)
+++ head/sys/dev/cxgbe/t4_main.c	Thu Apr 26 22:04:21 2018	(r333043)
@@ -2535,6 +2535,31 @@ free_atid(struct adapter *sc, int atid)
 	mtx_unlock(&t->atid_lock);
 }
 
+static void
+queue_tid_release(struct adapter *sc, int tid)
+{
+
+	CXGBE_UNIMPLEMENTED("deferred tid release");
+}
+
+void
+release_tid(struct adapter *sc, int tid, struct sge_wrq *ctrlq)
+{
+	struct wrqe *wr;
+	struct cpl_tid_release *req;
+
+	wr = alloc_wrqe(sizeof(*req), ctrlq);
+	if (wr == NULL) {
+		queue_tid_release(sc, tid);	/* defer */
+		return;
+	}
+	req = wrtod(wr);
+
+	INIT_TP_WR_MIT_CPL(req, CPL_TID_RELEASE, tid);
+
+	t4_wrq_tx(sc, wr);
+}
+
 static int
 t4_range_cmp(const void *a, const void *b)
 {

Modified: head/sys/dev/cxgbe/tom/t4_tom.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_tom.c	Thu Apr 26 21:44:00 2018	(r333042)
+++ head/sys/dev/cxgbe/tom/t4_tom.c	Thu Apr 26 22:04:21 2018	(r333043)
@@ -96,7 +96,6 @@ static struct uld_info tom_uld_info = {
 	.deactivate = t4_tom_deactivate,
 };
 
-static void queue_tid_release(struct adapter *, int);
 static void release_offload_resources(struct toepcb *);
 static int alloc_tid_tabs(struct tid_info *);
 static void free_tid_tabs(struct tid_info *);
@@ -539,31 +538,6 @@ remove_tid(struct adapter *sc, int tid, int ntids)
 
 	t->tid_tab[tid] = NULL;
 	atomic_subtract_int(&t->tids_in_use, ntids);
-}
-
-void
-release_tid(struct adapter *sc, int tid, struct sge_wrq *ctrlq)
-{
-	struct wrqe *wr;
-	struct cpl_tid_release *req;
-
-	wr = alloc_wrqe(sizeof(*req), ctrlq);
-	if (wr == NULL) {
-		queue_tid_release(sc, tid);	/* defer */
-		return;
-	}
-	req = wrtod(wr);
-
-	INIT_TP_WR_MIT_CPL(req, CPL_TID_RELEASE, tid);
-
-	t4_wrq_tx(sc, wr);
-}
-
-static void
-queue_tid_release(struct adapter *sc, int tid)
-{
-
-	CXGBE_UNIMPLEMENTED("deferred tid release");
 }
 
 /*

Modified: head/sys/dev/cxgbe/tom/t4_tom.h
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_tom.h	Thu Apr 26 21:44:00 2018	(r333042)
+++ head/sys/dev/cxgbe/tom/t4_tom.h	Thu Apr 26 22:04:21 2018	(r333043)
@@ -333,7 +333,6 @@ void insert_tid(struct adapter *, int, void *, int);
 void *lookup_tid(struct adapter *, int);
 void update_tid(struct adapter *, int, void *);
 void remove_tid(struct adapter *, int, int);
-void release_tid(struct adapter *, int, struct sge_wrq *);
 int find_best_mtu_idx(struct adapter *, struct in_conninfo *,
     struct offload_settings *);
 u_long select_rcv_wnd(struct socket *);


More information about the svn-src-all mailing list