From owner-svn-src-head@freebsd.org Thu Apr 26 22:04:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D915FB96DA; Thu, 26 Apr 2018 22:04:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C89E673844; Thu, 26 Apr 2018 22:04:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF9171DE90; Thu, 26 Apr 2018 22:04:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QM4LJ1039567; Thu, 26 Apr 2018 22:04:21 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QM4LJN039562; Thu, 26 Apr 2018 22:04:21 GMT (envelope-from np@FreeBSD.org) Message-Id: <201804262204.w3QM4LJN039562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 26 Apr 2018 22:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333043 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 333043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 22:04:22 -0000 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 *);