Deleted Added
sdiff udiff text old ( 237263 ) new ( 239344 )
full compact
1/*-
2 * Copyright (c) 2012 Chelsio Communications, Inc.
3 * All rights reserved.
4 * Written by: Navdeep Parhar <np@FreeBSD.org>
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/dev/cxgbe/tom/t4_tom.c 237263 2012-06-19 07:34:13Z np $");
30
31#include "opt_inet.h"
32
33#include <sys/param.h>
34#include <sys/types.h>
35#include <sys/systm.h>
36#include <sys/kernel.h>
37#include <sys/ktr.h>

--- 12 unchanged lines hidden (view full) ---

50
51#ifdef TCP_OFFLOAD
52#include "common/common.h"
53#include "common/t4_msg.h"
54#include "common/t4_regs.h"
55#include "tom/t4_tom_l2t.h"
56#include "tom/t4_tom.h"
57
58/* Module ops */
59static int t4_tom_mod_load(void);
60static int t4_tom_mod_unload(void);
61static int t4_tom_modevent(module_t, int, void *);
62
63/* ULD ops and helpers */
64static int t4_tom_activate(struct adapter *);
65static int t4_tom_deactivate(struct adapter *);

--- 96 unchanged lines hidden (view full) ---

162 /* Update socket */
163 sb = &so->so_snd;
164 SOCKBUF_LOCK(sb);
165 sb->sb_flags |= SB_NOCOALESCE;
166 SOCKBUF_UNLOCK(sb);
167 sb = &so->so_rcv;
168 SOCKBUF_LOCK(sb);
169 sb->sb_flags |= SB_NOCOALESCE;
170 SOCKBUF_UNLOCK(sb);
171
172 /* Update TCP PCB */
173 tp->tod = &td->tod;
174 tp->t_toe = toep;
175 tp->t_flags |= TF_TOE;
176
177 /* Install an extra hold on inp */

--- 52 unchanged lines hidden (view full) ---

230 KASSERT(toepcb_flag(toep, TPF_CPL_PENDING) == 0,
231 ("%s: %p has CPL pending.", __func__, toep));
232 KASSERT(toepcb_flag(toep, TPF_ATTACHED) == 0,
233 ("%s: %p is still attached.", __func__, toep));
234
235 CTR4(KTR_CXGBE, "%s: toep %p (tid %d, l2te %p)",
236 __func__, toep, tid, toep->l2te);
237
238 if (toep->l2te)
239 t4_l2t_release(toep->l2te);
240
241 if (tid >= 0) {
242 remove_tid(sc, tid);
243 release_tid(sc, tid, toep->ctrlq);
244 }
245

--- 317 unchanged lines hidden (view full) ---

563free_tom_data(struct adapter *sc, struct tom_data *td)
564{
565 KASSERT(TAILQ_EMPTY(&td->toep_list),
566 ("%s: TOE PCB list is not empty.", __func__));
567 KASSERT(td->lctx_count == 0,
568 ("%s: lctx hash table is not empty.", __func__));
569
570 t4_uninit_l2t_cpl_handlers(sc);
571
572 if (td->listen_mask != 0)
573 hashdestroy(td->listen_hash, M_CXGBE, td->listen_mask);
574
575 if (mtx_initialized(&td->lctx_hash_lock))
576 mtx_destroy(&td->lctx_hash_lock);
577 if (mtx_initialized(&td->toep_list_lock))
578 mtx_destroy(&td->toep_list_lock);

--- 29 unchanged lines hidden (view full) ---

608 td->listen_hash = hashinit_flags(LISTEN_HASH_SIZE, M_CXGBE,
609 &td->listen_mask, HASH_NOWAIT);
610
611 /* TID tables */
612 rc = alloc_tid_tabs(&sc->tids);
613 if (rc != 0)
614 goto done;
615
616 /* CPL handlers */
617 t4_init_connect_cpl_handlers(sc);
618 t4_init_l2t_cpl_handlers(sc);
619 t4_init_listen_cpl_handlers(sc);
620 t4_init_cpl_io_handlers(sc);
621
622 /* toedev ops */
623 tod = &td->tod;

--- 59 unchanged lines hidden (view full) ---

683
684 return (rc);
685}
686
687static int
688t4_tom_mod_load(void)
689{
690 int rc;
691
692 rc = t4_register_uld(&tom_uld_info);
693 if (rc != 0)
694 t4_tom_mod_unload();
695
696 return (rc);
697}
698
699static void

--- 56 unchanged lines hidden ---