2012-06-19 07:34:13 +00:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 2012 Chelsio Communications, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
* Written by: Navdeep Parhar <np@FreeBSD.org>
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
__FBSDID("$FreeBSD$");
|
|
|
|
|
|
|
|
#include "opt_inet.h"
|
2013-01-15 00:24:01 +00:00
|
|
|
#include "opt_inet6.h"
|
2012-06-19 07:34:13 +00:00
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/kernel.h>
|
|
|
|
#include <sys/ktr.h>
|
2015-07-29 08:12:05 +00:00
|
|
|
#include <sys/lock.h>
|
2015-12-26 00:26:02 +00:00
|
|
|
#include <sys/limits.h>
|
2012-06-19 07:34:13 +00:00
|
|
|
#include <sys/module.h>
|
|
|
|
#include <sys/protosw.h>
|
|
|
|
#include <sys/domain.h>
|
2016-05-07 00:33:35 +00:00
|
|
|
#include <sys/refcount.h>
|
2015-07-29 08:12:05 +00:00
|
|
|
#include <sys/rmlock.h>
|
2012-06-19 07:34:13 +00:00
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <sys/socketvar.h>
|
2013-04-18 19:52:11 +00:00
|
|
|
#include <sys/taskqueue.h>
|
2013-01-15 07:07:29 +00:00
|
|
|
#include <net/if.h>
|
2013-10-28 07:29:16 +00:00
|
|
|
#include <net/if_var.h>
|
2012-06-19 07:34:13 +00:00
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <netinet/in_pcb.h>
|
2013-01-15 07:07:29 +00:00
|
|
|
#include <netinet/in_var.h>
|
2012-06-19 07:34:13 +00:00
|
|
|
#include <netinet/ip.h>
|
2013-01-15 00:24:01 +00:00
|
|
|
#include <netinet/ip6.h>
|
2013-01-15 07:07:29 +00:00
|
|
|
#include <netinet6/scope6_var.h>
|
2012-06-19 07:34:13 +00:00
|
|
|
#define TCPSTATES
|
|
|
|
#include <netinet/tcp_fsm.h>
|
2016-01-27 05:15:53 +00:00
|
|
|
#include <netinet/tcp_var.h>
|
2012-06-19 07:34:13 +00:00
|
|
|
#include <netinet/toecore.h>
|
|
|
|
|
|
|
|
#ifdef TCP_OFFLOAD
|
|
|
|
#include "common/common.h"
|
|
|
|
#include "common/t4_msg.h"
|
|
|
|
#include "common/t4_regs.h"
|
2013-07-04 17:55:52 +00:00
|
|
|
#include "common/t4_regs_values.h"
|
2013-07-04 19:44:30 +00:00
|
|
|
#include "common/t4_tcb.h"
|
2012-06-19 07:34:13 +00:00
|
|
|
#include "tom/t4_tom_l2t.h"
|
|
|
|
#include "tom/t4_tom.h"
|
|
|
|
|
2016-07-27 18:29:35 +00:00
|
|
|
static struct protosw toe_protosw;
|
|
|
|
static struct pr_usrreqs toe_usrreqs;
|
2012-08-17 00:49:29 +00:00
|
|
|
|
2016-07-27 18:29:35 +00:00
|
|
|
static struct protosw toe6_protosw;
|
|
|
|
static struct pr_usrreqs toe6_usrreqs;
|
2013-01-15 00:24:01 +00:00
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
/* Module ops */
|
|
|
|
static int t4_tom_mod_load(void);
|
|
|
|
static int t4_tom_mod_unload(void);
|
|
|
|
static int t4_tom_modevent(module_t, int, void *);
|
|
|
|
|
|
|
|
/* ULD ops and helpers */
|
|
|
|
static int t4_tom_activate(struct adapter *);
|
|
|
|
static int t4_tom_deactivate(struct adapter *);
|
|
|
|
|
|
|
|
static struct uld_info tom_uld_info = {
|
|
|
|
.uld_id = ULD_TOM,
|
|
|
|
.activate = t4_tom_activate,
|
|
|
|
.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 *);
|
2013-01-15 07:07:29 +00:00
|
|
|
static int add_lip(struct adapter *, struct in6_addr *);
|
|
|
|
static int delete_lip(struct adapter *, struct in6_addr *);
|
|
|
|
static struct clip_entry *search_lip(struct tom_data *, struct in6_addr *);
|
|
|
|
static void init_clip_table(struct adapter *, struct tom_data *);
|
2013-04-18 19:52:11 +00:00
|
|
|
static void update_clip(struct adapter *, void *);
|
|
|
|
static void t4_clip_task(void *, int);
|
|
|
|
static void update_clip_table(struct adapter *, struct tom_data *);
|
2013-01-15 07:07:29 +00:00
|
|
|
static void destroy_clip_table(struct adapter *, struct tom_data *);
|
2012-06-19 07:34:13 +00:00
|
|
|
static void free_tom_data(struct adapter *, struct tom_data *);
|
2014-10-07 21:26:22 +00:00
|
|
|
static void reclaim_wr_resources(void *, int);
|
2012-06-19 07:34:13 +00:00
|
|
|
|
2013-04-18 19:52:11 +00:00
|
|
|
static int in6_ifaddr_gen;
|
|
|
|
static eventhandler_tag ifaddr_evhandler;
|
|
|
|
static struct timeout_task clip_task;
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
struct toepcb *
|
2015-12-03 00:02:01 +00:00
|
|
|
alloc_toepcb(struct vi_info *vi, int txqid, int rxqid, int flags)
|
2012-06-19 07:34:13 +00:00
|
|
|
{
|
2015-12-03 00:02:01 +00:00
|
|
|
struct port_info *pi = vi->pi;
|
2012-06-19 07:34:13 +00:00
|
|
|
struct adapter *sc = pi->adapter;
|
|
|
|
struct toepcb *toep;
|
|
|
|
int tx_credits, txsd_total, len;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The firmware counts tx work request credits in units of 16 bytes
|
|
|
|
* each. Reserve room for an ABORT_REQ so the driver never has to worry
|
|
|
|
* about tx credits if it wants to abort a connection.
|
|
|
|
*/
|
|
|
|
tx_credits = sc->params.ofldq_wr_cred;
|
|
|
|
tx_credits -= howmany(sizeof(struct cpl_abort_req), 16);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Shortest possible tx work request is a fw_ofld_tx_data_wr + 1 byte
|
|
|
|
* immediate payload, and firmware counts tx work request credits in
|
|
|
|
* units of 16 byte. Calculate the maximum work requests possible.
|
|
|
|
*/
|
|
|
|
txsd_total = tx_credits /
|
2016-04-22 16:57:42 +00:00
|
|
|
howmany(sizeof(struct fw_ofld_tx_data_wr) + 1, 16);
|
2012-06-19 07:34:13 +00:00
|
|
|
|
|
|
|
if (txqid < 0)
|
2015-12-03 00:02:01 +00:00
|
|
|
txqid = (arc4random() % vi->nofldtxq) + vi->first_ofld_txq;
|
|
|
|
KASSERT(txqid >= vi->first_ofld_txq &&
|
|
|
|
txqid < vi->first_ofld_txq + vi->nofldtxq,
|
|
|
|
("%s: txqid %d for vi %p (first %d, n %d)", __func__, txqid, vi,
|
|
|
|
vi->first_ofld_txq, vi->nofldtxq));
|
2012-06-19 07:34:13 +00:00
|
|
|
|
|
|
|
if (rxqid < 0)
|
2015-12-03 00:02:01 +00:00
|
|
|
rxqid = (arc4random() % vi->nofldrxq) + vi->first_ofld_rxq;
|
|
|
|
KASSERT(rxqid >= vi->first_ofld_rxq &&
|
|
|
|
rxqid < vi->first_ofld_rxq + vi->nofldrxq,
|
|
|
|
("%s: rxqid %d for vi %p (first %d, n %d)", __func__, rxqid, vi,
|
|
|
|
vi->first_ofld_rxq, vi->nofldrxq));
|
2012-06-19 07:34:13 +00:00
|
|
|
|
|
|
|
len = offsetof(struct toepcb, txsd) +
|
|
|
|
txsd_total * sizeof(struct ofld_tx_sdesc);
|
|
|
|
|
|
|
|
toep = malloc(len, M_CXGBE, M_ZERO | flags);
|
|
|
|
if (toep == NULL)
|
|
|
|
return (NULL);
|
|
|
|
|
2016-05-07 00:33:35 +00:00
|
|
|
refcount_init(&toep->refcount, 1);
|
2012-06-19 07:34:13 +00:00
|
|
|
toep->td = sc->tom_softc;
|
2015-12-03 00:02:01 +00:00
|
|
|
toep->vi = vi;
|
2013-09-09 04:38:57 +00:00
|
|
|
toep->tx_total = tx_credits;
|
2012-06-19 07:34:13 +00:00
|
|
|
toep->tx_credits = tx_credits;
|
|
|
|
toep->ofld_txq = &sc->sge.ofld_txq[txqid];
|
|
|
|
toep->ofld_rxq = &sc->sge.ofld_rxq[rxqid];
|
|
|
|
toep->ctrlq = &sc->sge.ctrlq[pi->port_id];
|
2015-12-26 00:26:02 +00:00
|
|
|
mbufq_init(&toep->ulp_pduq, INT_MAX);
|
|
|
|
mbufq_init(&toep->ulp_pdu_reclaimq, INT_MAX);
|
2012-06-19 07:34:13 +00:00
|
|
|
toep->txsd_total = txsd_total;
|
|
|
|
toep->txsd_avail = txsd_total;
|
|
|
|
toep->txsd_pidx = 0;
|
|
|
|
toep->txsd_cidx = 0;
|
2016-07-27 18:29:35 +00:00
|
|
|
aiotx_init_toep(toep);
|
2016-05-07 00:33:35 +00:00
|
|
|
ddp_init_toep(toep);
|
2012-06-19 07:34:13 +00:00
|
|
|
|
|
|
|
return (toep);
|
|
|
|
}
|
|
|
|
|
2016-05-07 00:33:35 +00:00
|
|
|
struct toepcb *
|
|
|
|
hold_toepcb(struct toepcb *toep)
|
|
|
|
{
|
|
|
|
|
|
|
|
refcount_acquire(&toep->refcount);
|
|
|
|
return (toep);
|
|
|
|
}
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
void
|
|
|
|
free_toepcb(struct toepcb *toep)
|
|
|
|
{
|
|
|
|
|
2016-05-07 00:33:35 +00:00
|
|
|
if (refcount_release(&toep->refcount) == 0)
|
|
|
|
return;
|
|
|
|
|
2012-08-21 18:30:16 +00:00
|
|
|
KASSERT(!(toep->flags & TPF_ATTACHED),
|
2012-06-19 07:34:13 +00:00
|
|
|
("%s: attached to an inpcb", __func__));
|
2012-08-21 18:30:16 +00:00
|
|
|
KASSERT(!(toep->flags & TPF_CPL_PENDING),
|
2012-06-19 07:34:13 +00:00
|
|
|
("%s: CPL pending", __func__));
|
|
|
|
|
2016-05-07 00:33:35 +00:00
|
|
|
ddp_uninit_toep(toep);
|
2012-06-19 07:34:13 +00:00
|
|
|
free(toep, M_CXGBE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Set up the socket for TCP offload.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
offload_socket(struct socket *so, struct toepcb *toep)
|
|
|
|
{
|
|
|
|
struct tom_data *td = toep->td;
|
|
|
|
struct inpcb *inp = sotoinpcb(so);
|
|
|
|
struct tcpcb *tp = intotcpcb(inp);
|
|
|
|
struct sockbuf *sb;
|
|
|
|
|
|
|
|
INP_WLOCK_ASSERT(inp);
|
|
|
|
|
|
|
|
/* Update socket */
|
|
|
|
sb = &so->so_snd;
|
|
|
|
SOCKBUF_LOCK(sb);
|
|
|
|
sb->sb_flags |= SB_NOCOALESCE;
|
|
|
|
SOCKBUF_UNLOCK(sb);
|
|
|
|
sb = &so->so_rcv;
|
|
|
|
SOCKBUF_LOCK(sb);
|
|
|
|
sb->sb_flags |= SB_NOCOALESCE;
|
2016-07-27 18:29:35 +00:00
|
|
|
if (inp->inp_vflag & INP_IPV6)
|
|
|
|
so->so_proto = &toe6_protosw;
|
|
|
|
else
|
|
|
|
so->so_proto = &toe_protosw;
|
2012-06-19 07:34:13 +00:00
|
|
|
SOCKBUF_UNLOCK(sb);
|
|
|
|
|
|
|
|
/* Update TCP PCB */
|
|
|
|
tp->tod = &td->tod;
|
|
|
|
tp->t_toe = toep;
|
|
|
|
tp->t_flags |= TF_TOE;
|
|
|
|
|
|
|
|
/* Install an extra hold on inp */
|
|
|
|
toep->inp = inp;
|
2012-08-21 18:30:16 +00:00
|
|
|
toep->flags |= TPF_ATTACHED;
|
2012-06-19 07:34:13 +00:00
|
|
|
in_pcbref(inp);
|
|
|
|
|
|
|
|
/* Add the TOE PCB to the active list */
|
|
|
|
mtx_lock(&td->toep_list_lock);
|
|
|
|
TAILQ_INSERT_HEAD(&td->toep_list, toep, link);
|
|
|
|
mtx_unlock(&td->toep_list_lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This is _not_ the normal way to "unoffload" a socket. */
|
|
|
|
void
|
|
|
|
undo_offload_socket(struct socket *so)
|
|
|
|
{
|
|
|
|
struct inpcb *inp = sotoinpcb(so);
|
|
|
|
struct tcpcb *tp = intotcpcb(inp);
|
|
|
|
struct toepcb *toep = tp->t_toe;
|
|
|
|
struct tom_data *td = toep->td;
|
|
|
|
struct sockbuf *sb;
|
|
|
|
|
|
|
|
INP_WLOCK_ASSERT(inp);
|
|
|
|
|
|
|
|
sb = &so->so_snd;
|
|
|
|
SOCKBUF_LOCK(sb);
|
|
|
|
sb->sb_flags &= ~SB_NOCOALESCE;
|
|
|
|
SOCKBUF_UNLOCK(sb);
|
|
|
|
sb = &so->so_rcv;
|
|
|
|
SOCKBUF_LOCK(sb);
|
|
|
|
sb->sb_flags &= ~SB_NOCOALESCE;
|
|
|
|
SOCKBUF_UNLOCK(sb);
|
|
|
|
|
|
|
|
tp->tod = NULL;
|
|
|
|
tp->t_toe = NULL;
|
|
|
|
tp->t_flags &= ~TF_TOE;
|
|
|
|
|
|
|
|
toep->inp = NULL;
|
2012-08-21 18:30:16 +00:00
|
|
|
toep->flags &= ~TPF_ATTACHED;
|
2012-06-19 07:34:13 +00:00
|
|
|
if (in_pcbrele_wlocked(inp))
|
|
|
|
panic("%s: inp freed.", __func__);
|
|
|
|
|
|
|
|
mtx_lock(&td->toep_list_lock);
|
|
|
|
TAILQ_REMOVE(&td->toep_list, toep, link);
|
|
|
|
mtx_unlock(&td->toep_list_lock);
|
2016-05-07 00:33:35 +00:00
|
|
|
|
|
|
|
free_toepcb(toep);
|
2012-06-19 07:34:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
release_offload_resources(struct toepcb *toep)
|
|
|
|
{
|
|
|
|
struct tom_data *td = toep->td;
|
|
|
|
struct adapter *sc = td_adapter(td);
|
|
|
|
int tid = toep->tid;
|
|
|
|
|
2012-08-21 18:30:16 +00:00
|
|
|
KASSERT(!(toep->flags & TPF_CPL_PENDING),
|
2012-06-19 07:34:13 +00:00
|
|
|
("%s: %p has CPL pending.", __func__, toep));
|
2012-08-21 18:30:16 +00:00
|
|
|
KASSERT(!(toep->flags & TPF_ATTACHED),
|
2012-06-19 07:34:13 +00:00
|
|
|
("%s: %p is still attached.", __func__, toep));
|
|
|
|
|
2013-01-15 07:07:29 +00:00
|
|
|
CTR5(KTR_CXGBE, "%s: toep %p (tid %d, l2te %p, ce %p)",
|
|
|
|
__func__, toep, tid, toep->l2te, toep->ce);
|
2012-06-19 07:34:13 +00:00
|
|
|
|
2015-12-26 00:26:02 +00:00
|
|
|
/*
|
|
|
|
* These queues should have been emptied at approximately the same time
|
|
|
|
* that a normal connection's socket's so_snd would have been purged or
|
|
|
|
* drained. Do _not_ clean up here.
|
|
|
|
*/
|
|
|
|
MPASS(mbufq_len(&toep->ulp_pduq) == 0);
|
|
|
|
MPASS(mbufq_len(&toep->ulp_pdu_reclaimq) == 0);
|
2016-05-07 00:33:35 +00:00
|
|
|
#ifdef INVARIANTS
|
|
|
|
ddp_assert_empty(toep);
|
|
|
|
#endif
|
2012-08-17 00:49:29 +00:00
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
if (toep->l2te)
|
|
|
|
t4_l2t_release(toep->l2te);
|
|
|
|
|
|
|
|
if (tid >= 0) {
|
|
|
|
remove_tid(sc, tid);
|
|
|
|
release_tid(sc, tid, toep->ctrlq);
|
|
|
|
}
|
|
|
|
|
2013-01-15 07:07:29 +00:00
|
|
|
if (toep->ce)
|
|
|
|
release_lip(td, toep->ce);
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
mtx_lock(&td->toep_list_lock);
|
|
|
|
TAILQ_REMOVE(&td->toep_list, toep, link);
|
|
|
|
mtx_unlock(&td->toep_list_lock);
|
|
|
|
|
|
|
|
free_toepcb(toep);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The kernel is done with the TCP PCB and this is our opportunity to unhook the
|
|
|
|
* toepcb hanging off of it. If the TOE driver is also done with the toepcb (no
|
|
|
|
* pending CPL) then it is time to release all resources tied to the toepcb.
|
|
|
|
*
|
|
|
|
* Also gets called when an offloaded active open fails and the TOM wants the
|
|
|
|
* kernel to take the TCP PCB back.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
t4_pcb_detach(struct toedev *tod __unused, struct tcpcb *tp)
|
|
|
|
{
|
|
|
|
#if defined(KTR) || defined(INVARIANTS)
|
|
|
|
struct inpcb *inp = tp->t_inpcb;
|
|
|
|
#endif
|
|
|
|
struct toepcb *toep = tp->t_toe;
|
|
|
|
|
|
|
|
INP_WLOCK_ASSERT(inp);
|
|
|
|
|
|
|
|
KASSERT(toep != NULL, ("%s: toep is NULL", __func__));
|
2012-08-21 18:30:16 +00:00
|
|
|
KASSERT(toep->flags & TPF_ATTACHED,
|
2012-06-19 07:34:13 +00:00
|
|
|
("%s: not attached", __func__));
|
|
|
|
|
|
|
|
#ifdef KTR
|
|
|
|
if (tp->t_state == TCPS_SYN_SENT) {
|
|
|
|
CTR6(KTR_CXGBE, "%s: atid %d, toep %p (0x%x), inp %p (0x%x)",
|
|
|
|
__func__, toep->tid, toep, toep->flags, inp,
|
|
|
|
inp->inp_flags);
|
|
|
|
} else {
|
|
|
|
CTR6(KTR_CXGBE,
|
|
|
|
"t4_pcb_detach: tid %d (%s), toep %p (0x%x), inp %p (0x%x)",
|
|
|
|
toep->tid, tcpstates[tp->t_state], toep, toep->flags, inp,
|
|
|
|
inp->inp_flags);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
tp->t_toe = NULL;
|
|
|
|
tp->t_flags &= ~TF_TOE;
|
2012-08-21 18:30:16 +00:00
|
|
|
toep->flags &= ~TPF_ATTACHED;
|
2012-06-19 07:34:13 +00:00
|
|
|
|
2012-08-21 18:30:16 +00:00
|
|
|
if (!(toep->flags & TPF_CPL_PENDING))
|
2012-06-19 07:34:13 +00:00
|
|
|
release_offload_resources(toep);
|
|
|
|
}
|
|
|
|
|
2013-07-04 19:44:30 +00:00
|
|
|
/*
|
|
|
|
* setsockopt handler.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
t4_ctloutput(struct toedev *tod, struct tcpcb *tp, int dir, int name)
|
|
|
|
{
|
|
|
|
struct adapter *sc = tod->tod_softc;
|
|
|
|
struct toepcb *toep = tp->t_toe;
|
|
|
|
|
|
|
|
if (dir == SOPT_GET)
|
|
|
|
return;
|
|
|
|
|
|
|
|
CTR4(KTR_CXGBE, "%s: tp %p, dir %u, name %u", __func__, tp, dir, name);
|
|
|
|
|
|
|
|
switch (name) {
|
|
|
|
case TCP_NODELAY:
|
2016-07-05 01:29:24 +00:00
|
|
|
t4_set_tcb_field(sc, toep->ctrlq, toep->tid, W_TCB_T_FLAGS,
|
|
|
|
V_TF_NAGLE(1), V_TF_NAGLE(tp->t_flags & TF_NODELAY ? 0 : 1),
|
|
|
|
0, 0, toep->ofld_rxq->iq.abs_id);
|
2013-07-04 19:44:30 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
/*
|
|
|
|
* The TOE driver will not receive any more CPLs for the tid associated with the
|
|
|
|
* toepcb; release the hold on the inpcb.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
final_cpl_received(struct toepcb *toep)
|
|
|
|
{
|
|
|
|
struct inpcb *inp = toep->inp;
|
|
|
|
|
|
|
|
KASSERT(inp != NULL, ("%s: inp is NULL", __func__));
|
|
|
|
INP_WLOCK_ASSERT(inp);
|
2012-08-21 18:30:16 +00:00
|
|
|
KASSERT(toep->flags & TPF_CPL_PENDING,
|
2012-06-19 07:34:13 +00:00
|
|
|
("%s: CPL not pending already?", __func__));
|
|
|
|
|
|
|
|
CTR6(KTR_CXGBE, "%s: tid %d, toep %p (0x%x), inp %p (0x%x)",
|
|
|
|
__func__, toep->tid, toep, toep->flags, inp, inp->inp_flags);
|
|
|
|
|
2016-05-07 00:33:35 +00:00
|
|
|
if (toep->ulp_mode == ULP_MODE_TCPDDP)
|
|
|
|
release_ddp_resources(toep);
|
2012-06-19 07:34:13 +00:00
|
|
|
toep->inp = NULL;
|
2012-08-21 18:30:16 +00:00
|
|
|
toep->flags &= ~TPF_CPL_PENDING;
|
2015-12-26 00:26:02 +00:00
|
|
|
mbufq_drain(&toep->ulp_pdu_reclaimq);
|
2012-06-19 07:34:13 +00:00
|
|
|
|
2012-08-21 18:30:16 +00:00
|
|
|
if (!(toep->flags & TPF_ATTACHED))
|
2012-06-19 07:34:13 +00:00
|
|
|
release_offload_resources(toep);
|
|
|
|
|
|
|
|
if (!in_pcbrele_wlocked(inp))
|
|
|
|
INP_WUNLOCK(inp);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
insert_tid(struct adapter *sc, int tid, void *ctx)
|
|
|
|
{
|
|
|
|
struct tid_info *t = &sc->tids;
|
|
|
|
|
|
|
|
t->tid_tab[tid] = ctx;
|
|
|
|
atomic_add_int(&t->tids_in_use, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void *
|
|
|
|
lookup_tid(struct adapter *sc, int tid)
|
|
|
|
{
|
|
|
|
struct tid_info *t = &sc->tids;
|
|
|
|
|
|
|
|
return (t->tid_tab[tid]);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
update_tid(struct adapter *sc, int tid, void *ctx)
|
|
|
|
{
|
|
|
|
struct tid_info *t = &sc->tids;
|
|
|
|
|
|
|
|
t->tid_tab[tid] = ctx;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
remove_tid(struct adapter *sc, int tid)
|
|
|
|
{
|
|
|
|
struct tid_info *t = &sc->tids;
|
|
|
|
|
|
|
|
t->tid_tab[tid] = NULL;
|
|
|
|
atomic_subtract_int(&t->tids_in_use, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
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");
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* What mtu_idx to use, given a 4-tuple and/or an MSS cap
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
find_best_mtu_idx(struct adapter *sc, struct in_conninfo *inc, int pmss)
|
|
|
|
{
|
|
|
|
unsigned short *mtus = &sc->params.mtus[0];
|
2013-01-15 00:24:01 +00:00
|
|
|
int i, mss, n;
|
2012-06-19 07:34:13 +00:00
|
|
|
|
|
|
|
KASSERT(inc != NULL || pmss > 0,
|
|
|
|
("%s: at least one of inc/pmss must be specified", __func__));
|
|
|
|
|
|
|
|
mss = inc ? tcp_mssopt(inc) : pmss;
|
|
|
|
if (pmss > 0 && mss > pmss)
|
|
|
|
mss = pmss;
|
|
|
|
|
2013-01-15 00:24:01 +00:00
|
|
|
if (inc->inc_flags & INC_ISIPV6)
|
|
|
|
n = sizeof(struct ip6_hdr) + sizeof(struct tcphdr);
|
|
|
|
else
|
|
|
|
n = sizeof(struct ip) + sizeof(struct tcphdr);
|
|
|
|
|
|
|
|
for (i = 0; i < NMTUS - 1 && mtus[i + 1] <= mss + n; i++)
|
|
|
|
continue;
|
2012-06-19 07:34:13 +00:00
|
|
|
|
|
|
|
return (i);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Determine the receive window size for a socket.
|
|
|
|
*/
|
|
|
|
u_long
|
|
|
|
select_rcv_wnd(struct socket *so)
|
|
|
|
{
|
|
|
|
unsigned long wnd;
|
|
|
|
|
|
|
|
SOCKBUF_LOCK_ASSERT(&so->so_rcv);
|
|
|
|
|
|
|
|
wnd = sbspace(&so->so_rcv);
|
|
|
|
if (wnd < MIN_RCV_WND)
|
|
|
|
wnd = MIN_RCV_WND;
|
|
|
|
|
|
|
|
return min(wnd, MAX_RCV_WND);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
select_rcv_wscale(void)
|
|
|
|
{
|
|
|
|
int wscale = 0;
|
|
|
|
unsigned long space = sb_max;
|
|
|
|
|
|
|
|
if (space > MAX_RCV_WND)
|
|
|
|
space = MAX_RCV_WND;
|
|
|
|
|
|
|
|
while (wscale < TCP_MAX_WINSHIFT && (TCP_MAXWIN << wscale) < space)
|
|
|
|
wscale++;
|
|
|
|
|
|
|
|
return (wscale);
|
|
|
|
}
|
|
|
|
|
|
|
|
extern int always_keepalive;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* socket so could be a listening socket too.
|
|
|
|
*/
|
|
|
|
uint64_t
|
2015-12-03 00:02:01 +00:00
|
|
|
calc_opt0(struct socket *so, struct vi_info *vi, struct l2t_entry *e,
|
2012-06-19 07:34:13 +00:00
|
|
|
int mtu_idx, int rscale, int rx_credits, int ulp_mode)
|
|
|
|
{
|
|
|
|
uint64_t opt0;
|
|
|
|
|
|
|
|
KASSERT(rx_credits <= M_RCV_BUFSIZ,
|
|
|
|
("%s: rcv_bufsiz too high", __func__));
|
|
|
|
|
|
|
|
opt0 = F_TCAM_BYPASS | V_WND_SCALE(rscale) | V_MSS_IDX(mtu_idx) |
|
|
|
|
V_ULP_MODE(ulp_mode) | V_RCV_BUFSIZ(rx_credits);
|
|
|
|
|
|
|
|
if (so != NULL) {
|
|
|
|
struct inpcb *inp = sotoinpcb(so);
|
|
|
|
struct tcpcb *tp = intotcpcb(inp);
|
|
|
|
int keepalive = always_keepalive ||
|
|
|
|
so_options_get(so) & SO_KEEPALIVE;
|
|
|
|
|
|
|
|
opt0 |= V_NAGLE((tp->t_flags & TF_NODELAY) == 0);
|
|
|
|
opt0 |= V_KEEP_ALIVE(keepalive != 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (e != NULL)
|
|
|
|
opt0 |= V_L2T_IDX(e->idx);
|
|
|
|
|
2015-12-03 00:02:01 +00:00
|
|
|
if (vi != NULL) {
|
2016-09-17 22:13:03 +00:00
|
|
|
opt0 |= V_SMAC_SEL(vi->smt_idx);
|
2015-12-03 00:02:01 +00:00
|
|
|
opt0 |= V_TX_CHAN(vi->pi->tx_chan);
|
2012-06-19 07:34:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return htobe64(opt0);
|
|
|
|
}
|
|
|
|
|
2013-03-30 02:26:20 +00:00
|
|
|
uint64_t
|
2015-12-03 00:02:01 +00:00
|
|
|
select_ntuple(struct vi_info *vi, struct l2t_entry *e)
|
2012-06-19 07:34:13 +00:00
|
|
|
{
|
2015-12-03 00:02:01 +00:00
|
|
|
struct adapter *sc = vi->pi->adapter;
|
2013-07-04 17:55:52 +00:00
|
|
|
struct tp_params *tp = &sc->params.tp;
|
2015-12-03 00:02:01 +00:00
|
|
|
uint16_t viid = vi->viid;
|
2013-07-04 17:55:52 +00:00
|
|
|
uint64_t ntuple = 0;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize each of the fields which we care about which are present
|
|
|
|
* in the Compressed Filter Tuple.
|
|
|
|
*/
|
|
|
|
if (tp->vlan_shift >= 0 && e->vlan != CPL_L2T_VLAN_NONE)
|
|
|
|
ntuple |= (uint64_t)(F_FT_VLAN_VLD | e->vlan) << tp->vlan_shift;
|
|
|
|
|
|
|
|
if (tp->port_shift >= 0)
|
|
|
|
ntuple |= (uint64_t)e->lport << tp->port_shift;
|
|
|
|
|
|
|
|
if (tp->protocol_shift >= 0)
|
|
|
|
ntuple |= (uint64_t)IPPROTO_TCP << tp->protocol_shift;
|
|
|
|
|
|
|
|
if (tp->vnic_shift >= 0) {
|
|
|
|
uint32_t vf = G_FW_VIID_VIN(viid);
|
|
|
|
uint32_t pf = G_FW_VIID_PFN(viid);
|
|
|
|
uint32_t vld = G_FW_VIID_VIVLD(viid);
|
|
|
|
|
|
|
|
ntuple |= (uint64_t)(V_FT_VNID_ID_VF(vf) | V_FT_VNID_ID_PF(pf) |
|
|
|
|
V_FT_VNID_ID_VLD(vld)) << tp->vnic_shift;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_t4(sc))
|
|
|
|
return (htobe32((uint32_t)ntuple));
|
2013-03-30 02:26:20 +00:00
|
|
|
else
|
|
|
|
return (htobe64(V_FILTER_TUPLE(ntuple)));
|
2012-06-19 07:34:13 +00:00
|
|
|
}
|
|
|
|
|
2013-01-15 00:24:01 +00:00
|
|
|
void
|
|
|
|
set_tcpddp_ulp_mode(struct toepcb *toep)
|
|
|
|
{
|
|
|
|
|
|
|
|
toep->ulp_mode = ULP_MODE_TCPDDP;
|
|
|
|
toep->ddp_flags = DDP_OK;
|
|
|
|
}
|
|
|
|
|
2013-01-26 03:01:51 +00:00
|
|
|
int
|
|
|
|
negative_advice(int status)
|
|
|
|
{
|
|
|
|
|
|
|
|
return (status == CPL_ERR_RTX_NEG_ADVICE ||
|
|
|
|
status == CPL_ERR_PERSIST_NEG_ADVICE ||
|
|
|
|
status == CPL_ERR_KEEPALV_NEG_ADVICE);
|
|
|
|
}
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
static int
|
|
|
|
alloc_tid_tabs(struct tid_info *t)
|
|
|
|
{
|
|
|
|
size_t size;
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
size = t->ntids * sizeof(*t->tid_tab) +
|
|
|
|
t->natids * sizeof(*t->atid_tab) +
|
|
|
|
t->nstids * sizeof(*t->stid_tab);
|
|
|
|
|
|
|
|
t->tid_tab = malloc(size, M_CXGBE, M_ZERO | M_NOWAIT);
|
|
|
|
if (t->tid_tab == NULL)
|
|
|
|
return (ENOMEM);
|
|
|
|
|
|
|
|
mtx_init(&t->atid_lock, "atid lock", NULL, MTX_DEF);
|
|
|
|
t->atid_tab = (union aopen_entry *)&t->tid_tab[t->ntids];
|
|
|
|
t->afree = t->atid_tab;
|
|
|
|
t->atids_in_use = 0;
|
|
|
|
for (i = 1; i < t->natids; i++)
|
|
|
|
t->atid_tab[i - 1].next = &t->atid_tab[i];
|
|
|
|
t->atid_tab[t->natids - 1].next = NULL;
|
|
|
|
|
|
|
|
mtx_init(&t->stid_lock, "stid lock", NULL, MTX_DEF);
|
2013-01-11 00:07:01 +00:00
|
|
|
t->stid_tab = (struct listen_ctx **)&t->atid_tab[t->natids];
|
2012-06-19 07:34:13 +00:00
|
|
|
t->stids_in_use = 0;
|
2013-01-11 00:07:01 +00:00
|
|
|
TAILQ_INIT(&t->stids);
|
|
|
|
t->nstids_free_head = t->nstids;
|
2012-06-19 07:34:13 +00:00
|
|
|
|
|
|
|
atomic_store_rel_int(&t->tids_in_use, 0);
|
|
|
|
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
free_tid_tabs(struct tid_info *t)
|
|
|
|
{
|
|
|
|
KASSERT(t->tids_in_use == 0,
|
|
|
|
("%s: %d tids still in use.", __func__, t->tids_in_use));
|
|
|
|
KASSERT(t->atids_in_use == 0,
|
|
|
|
("%s: %d atids still in use.", __func__, t->atids_in_use));
|
|
|
|
KASSERT(t->stids_in_use == 0,
|
|
|
|
("%s: %d tids still in use.", __func__, t->stids_in_use));
|
|
|
|
|
|
|
|
free(t->tid_tab, M_CXGBE);
|
|
|
|
t->tid_tab = NULL;
|
|
|
|
|
|
|
|
if (mtx_initialized(&t->atid_lock))
|
|
|
|
mtx_destroy(&t->atid_lock);
|
|
|
|
if (mtx_initialized(&t->stid_lock))
|
|
|
|
mtx_destroy(&t->stid_lock);
|
|
|
|
}
|
|
|
|
|
2013-01-15 07:07:29 +00:00
|
|
|
static int
|
|
|
|
add_lip(struct adapter *sc, struct in6_addr *lip)
|
|
|
|
{
|
|
|
|
struct fw_clip_cmd c;
|
|
|
|
|
|
|
|
ASSERT_SYNCHRONIZED_OP(sc);
|
|
|
|
/* mtx_assert(&td->clip_table_lock, MA_OWNED); */
|
|
|
|
|
|
|
|
memset(&c, 0, sizeof(c));
|
|
|
|
c.op_to_write = htonl(V_FW_CMD_OP(FW_CLIP_CMD) | F_FW_CMD_REQUEST |
|
|
|
|
F_FW_CMD_WRITE);
|
|
|
|
c.alloc_to_len16 = htonl(F_FW_CLIP_CMD_ALLOC | FW_LEN16(c));
|
|
|
|
c.ip_hi = *(uint64_t *)&lip->s6_addr[0];
|
|
|
|
c.ip_lo = *(uint64_t *)&lip->s6_addr[8];
|
|
|
|
|
2013-04-18 19:52:11 +00:00
|
|
|
return (-t4_wr_mbox_ns(sc, sc->mbox, &c, sizeof(c), &c));
|
2013-01-15 07:07:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
delete_lip(struct adapter *sc, struct in6_addr *lip)
|
|
|
|
{
|
|
|
|
struct fw_clip_cmd c;
|
|
|
|
|
|
|
|
ASSERT_SYNCHRONIZED_OP(sc);
|
|
|
|
/* mtx_assert(&td->clip_table_lock, MA_OWNED); */
|
|
|
|
|
|
|
|
memset(&c, 0, sizeof(c));
|
|
|
|
c.op_to_write = htonl(V_FW_CMD_OP(FW_CLIP_CMD) | F_FW_CMD_REQUEST |
|
|
|
|
F_FW_CMD_READ);
|
|
|
|
c.alloc_to_len16 = htonl(F_FW_CLIP_CMD_FREE | FW_LEN16(c));
|
|
|
|
c.ip_hi = *(uint64_t *)&lip->s6_addr[0];
|
|
|
|
c.ip_lo = *(uint64_t *)&lip->s6_addr[8];
|
|
|
|
|
2013-04-18 19:52:11 +00:00
|
|
|
return (-t4_wr_mbox_ns(sc, sc->mbox, &c, sizeof(c), &c));
|
2013-01-15 07:07:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct clip_entry *
|
|
|
|
search_lip(struct tom_data *td, struct in6_addr *lip)
|
|
|
|
{
|
|
|
|
struct clip_entry *ce;
|
|
|
|
|
|
|
|
mtx_assert(&td->clip_table_lock, MA_OWNED);
|
|
|
|
|
|
|
|
TAILQ_FOREACH(ce, &td->clip_table, link) {
|
|
|
|
if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip))
|
|
|
|
return (ce);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct clip_entry *
|
|
|
|
hold_lip(struct tom_data *td, struct in6_addr *lip)
|
|
|
|
{
|
|
|
|
struct clip_entry *ce;
|
|
|
|
|
|
|
|
mtx_lock(&td->clip_table_lock);
|
|
|
|
ce = search_lip(td, lip);
|
|
|
|
if (ce != NULL)
|
|
|
|
ce->refcount++;
|
|
|
|
mtx_unlock(&td->clip_table_lock);
|
|
|
|
|
|
|
|
return (ce);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
release_lip(struct tom_data *td, struct clip_entry *ce)
|
|
|
|
{
|
|
|
|
|
|
|
|
mtx_lock(&td->clip_table_lock);
|
|
|
|
KASSERT(search_lip(td, &ce->lip) == ce,
|
|
|
|
("%s: CLIP entry %p p not in CLIP table.", __func__, ce));
|
|
|
|
KASSERT(ce->refcount > 0,
|
|
|
|
("%s: CLIP entry %p has refcount 0", __func__, ce));
|
|
|
|
--ce->refcount;
|
|
|
|
mtx_unlock(&td->clip_table_lock);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
init_clip_table(struct adapter *sc, struct tom_data *td)
|
|
|
|
{
|
|
|
|
|
|
|
|
ASSERT_SYNCHRONIZED_OP(sc);
|
|
|
|
|
|
|
|
mtx_init(&td->clip_table_lock, "CLIP table lock", NULL, MTX_DEF);
|
|
|
|
TAILQ_INIT(&td->clip_table);
|
2013-04-18 19:52:11 +00:00
|
|
|
td->clip_gen = -1;
|
|
|
|
|
|
|
|
update_clip_table(sc, td);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
update_clip(struct adapter *sc, void *arg __unused)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (begin_synchronized_op(sc, NULL, HOLD_LOCK, "t4tomuc"))
|
|
|
|
return;
|
|
|
|
|
2015-02-08 09:28:55 +00:00
|
|
|
if (uld_active(sc, ULD_TOM))
|
2013-04-18 19:52:11 +00:00
|
|
|
update_clip_table(sc, sc->tom_softc);
|
|
|
|
|
|
|
|
end_synchronized_op(sc, LOCK_HELD);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
t4_clip_task(void *arg, int count)
|
|
|
|
{
|
|
|
|
|
|
|
|
t4_iterate(update_clip, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
update_clip_table(struct adapter *sc, struct tom_data *td)
|
|
|
|
{
|
2015-07-29 08:12:05 +00:00
|
|
|
struct rm_priotracker in6_ifa_tracker;
|
2013-04-18 19:52:11 +00:00
|
|
|
struct in6_ifaddr *ia;
|
|
|
|
struct in6_addr *lip, tlip;
|
|
|
|
struct clip_head stale;
|
|
|
|
struct clip_entry *ce, *ce_temp;
|
|
|
|
int rc, gen = atomic_load_acq_int(&in6_ifaddr_gen);
|
|
|
|
|
|
|
|
ASSERT_SYNCHRONIZED_OP(sc);
|
2013-01-15 07:07:29 +00:00
|
|
|
|
2015-07-29 08:12:05 +00:00
|
|
|
IN6_IFADDR_RLOCK(&in6_ifa_tracker);
|
2013-04-18 19:52:11 +00:00
|
|
|
mtx_lock(&td->clip_table_lock);
|
|
|
|
|
|
|
|
if (gen == td->clip_gen)
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
TAILQ_INIT(&stale);
|
|
|
|
TAILQ_CONCAT(&stale, &td->clip_table, link);
|
|
|
|
|
2013-01-15 07:07:29 +00:00
|
|
|
TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) {
|
|
|
|
lip = &ia->ia_addr.sin6_addr;
|
|
|
|
|
|
|
|
KASSERT(!IN6_IS_ADDR_MULTICAST(lip),
|
|
|
|
("%s: mcast address in in6_ifaddr list", __func__));
|
|
|
|
|
|
|
|
if (IN6_IS_ADDR_LOOPBACK(lip))
|
|
|
|
continue;
|
|
|
|
if (IN6_IS_SCOPE_EMBED(lip)) {
|
|
|
|
/* Remove the embedded scope */
|
|
|
|
tlip = *lip;
|
|
|
|
lip = &tlip;
|
|
|
|
in6_clearscope(lip);
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
* XXX: how to weed out the link local address for the loopback
|
|
|
|
* interface? It's fe80::1 usually (always?).
|
|
|
|
*/
|
|
|
|
|
2013-04-18 19:52:11 +00:00
|
|
|
/*
|
|
|
|
* If it's in the main list then we already know it's not stale.
|
|
|
|
*/
|
|
|
|
TAILQ_FOREACH(ce, &td->clip_table, link) {
|
|
|
|
if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip))
|
|
|
|
goto next;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If it's in the stale list we should move it to the main list.
|
|
|
|
*/
|
|
|
|
TAILQ_FOREACH(ce, &stale, link) {
|
|
|
|
if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) {
|
|
|
|
TAILQ_REMOVE(&stale, ce, link);
|
2013-01-15 07:07:29 +00:00
|
|
|
TAILQ_INSERT_TAIL(&td->clip_table, ce, link);
|
2013-04-18 19:52:11 +00:00
|
|
|
goto next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* A new IP6 address; add it to the CLIP table */
|
|
|
|
ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT);
|
|
|
|
memcpy(&ce->lip, lip, sizeof(ce->lip));
|
|
|
|
ce->refcount = 0;
|
|
|
|
rc = add_lip(sc, lip);
|
|
|
|
if (rc == 0)
|
|
|
|
TAILQ_INSERT_TAIL(&td->clip_table, ce, link);
|
|
|
|
else {
|
|
|
|
char ip[INET6_ADDRSTRLEN];
|
|
|
|
|
|
|
|
inet_ntop(AF_INET6, &ce->lip, &ip[0], sizeof(ip));
|
|
|
|
log(LOG_ERR, "%s: could not add %s (%d)\n",
|
|
|
|
__func__, ip, rc);
|
|
|
|
free(ce, M_CXGBE);
|
|
|
|
}
|
|
|
|
next:
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Remove stale addresses (those no longer in V_in6_ifaddrhead) that are
|
|
|
|
* no longer referenced by the driver.
|
|
|
|
*/
|
|
|
|
TAILQ_FOREACH_SAFE(ce, &stale, link, ce_temp) {
|
|
|
|
if (ce->refcount == 0) {
|
|
|
|
rc = delete_lip(sc, &ce->lip);
|
|
|
|
if (rc == 0) {
|
|
|
|
TAILQ_REMOVE(&stale, ce, link);
|
2013-01-15 07:07:29 +00:00
|
|
|
free(ce, M_CXGBE);
|
2013-04-18 19:52:11 +00:00
|
|
|
} else {
|
|
|
|
char ip[INET6_ADDRSTRLEN];
|
|
|
|
|
|
|
|
inet_ntop(AF_INET6, &ce->lip, &ip[0],
|
|
|
|
sizeof(ip));
|
|
|
|
log(LOG_ERR, "%s: could not delete %s (%d)\n",
|
|
|
|
__func__, ip, rc);
|
|
|
|
}
|
2013-01-15 07:07:29 +00:00
|
|
|
}
|
|
|
|
}
|
2013-04-18 19:52:11 +00:00
|
|
|
/* The ones that are still referenced need to stay in the CLIP table */
|
|
|
|
TAILQ_CONCAT(&td->clip_table, &stale, link);
|
|
|
|
|
|
|
|
td->clip_gen = gen;
|
|
|
|
done:
|
|
|
|
mtx_unlock(&td->clip_table_lock);
|
2015-07-29 08:12:05 +00:00
|
|
|
IN6_IFADDR_RUNLOCK(&in6_ifa_tracker);
|
2013-01-15 07:07:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
destroy_clip_table(struct adapter *sc, struct tom_data *td)
|
|
|
|
{
|
|
|
|
struct clip_entry *ce, *ce_temp;
|
|
|
|
|
|
|
|
if (mtx_initialized(&td->clip_table_lock)) {
|
|
|
|
mtx_lock(&td->clip_table_lock);
|
|
|
|
TAILQ_FOREACH_SAFE(ce, &td->clip_table, link, ce_temp) {
|
|
|
|
KASSERT(ce->refcount == 0,
|
|
|
|
("%s: CLIP entry %p still in use (%d)", __func__,
|
|
|
|
ce, ce->refcount));
|
|
|
|
TAILQ_REMOVE(&td->clip_table, ce, link);
|
|
|
|
delete_lip(sc, &ce->lip);
|
|
|
|
free(ce, M_CXGBE);
|
|
|
|
}
|
|
|
|
mtx_unlock(&td->clip_table_lock);
|
|
|
|
mtx_destroy(&td->clip_table_lock);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
static void
|
|
|
|
free_tom_data(struct adapter *sc, struct tom_data *td)
|
|
|
|
{
|
2013-01-15 07:07:29 +00:00
|
|
|
|
|
|
|
ASSERT_SYNCHRONIZED_OP(sc);
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
KASSERT(TAILQ_EMPTY(&td->toep_list),
|
|
|
|
("%s: TOE PCB list is not empty.", __func__));
|
|
|
|
KASSERT(td->lctx_count == 0,
|
|
|
|
("%s: lctx hash table is not empty.", __func__));
|
|
|
|
|
2016-08-31 23:23:46 +00:00
|
|
|
t4_free_ppod_region(&td->pr);
|
2013-01-15 07:07:29 +00:00
|
|
|
destroy_clip_table(sc, td);
|
2012-06-19 07:34:13 +00:00
|
|
|
|
|
|
|
if (td->listen_mask != 0)
|
|
|
|
hashdestroy(td->listen_hash, M_CXGBE, td->listen_mask);
|
|
|
|
|
2014-10-07 21:26:22 +00:00
|
|
|
if (mtx_initialized(&td->unsent_wr_lock))
|
|
|
|
mtx_destroy(&td->unsent_wr_lock);
|
2012-06-19 07:34:13 +00:00
|
|
|
if (mtx_initialized(&td->lctx_hash_lock))
|
|
|
|
mtx_destroy(&td->lctx_hash_lock);
|
|
|
|
if (mtx_initialized(&td->toep_list_lock))
|
|
|
|
mtx_destroy(&td->toep_list_lock);
|
|
|
|
|
|
|
|
free_tid_tabs(&sc->tids);
|
|
|
|
free(td, M_CXGBE);
|
|
|
|
}
|
|
|
|
|
2014-10-07 21:26:22 +00:00
|
|
|
static void
|
|
|
|
reclaim_wr_resources(void *arg, int count)
|
|
|
|
{
|
|
|
|
struct tom_data *td = arg;
|
|
|
|
STAILQ_HEAD(, wrqe) twr_list = STAILQ_HEAD_INITIALIZER(twr_list);
|
|
|
|
struct cpl_act_open_req *cpl;
|
|
|
|
u_int opcode, atid;
|
|
|
|
struct wrqe *wr;
|
|
|
|
struct adapter *sc;
|
|
|
|
|
|
|
|
mtx_lock(&td->unsent_wr_lock);
|
|
|
|
STAILQ_SWAP(&td->unsent_wr_list, &twr_list, wrqe);
|
|
|
|
mtx_unlock(&td->unsent_wr_lock);
|
|
|
|
|
|
|
|
while ((wr = STAILQ_FIRST(&twr_list)) != NULL) {
|
|
|
|
STAILQ_REMOVE_HEAD(&twr_list, link);
|
|
|
|
|
|
|
|
cpl = wrtod(wr);
|
|
|
|
opcode = GET_OPCODE(cpl);
|
|
|
|
|
|
|
|
switch (opcode) {
|
|
|
|
case CPL_ACT_OPEN_REQ:
|
|
|
|
case CPL_ACT_OPEN_REQ6:
|
|
|
|
atid = G_TID_TID(be32toh(OPCODE_TID(cpl)));
|
|
|
|
sc = td_adapter(td);
|
|
|
|
|
|
|
|
CTR2(KTR_CXGBE, "%s: atid %u ", __func__, atid);
|
|
|
|
act_open_failure_cleanup(sc, atid, EHOSTUNREACH);
|
|
|
|
free(wr, M_CXGBE);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
log(LOG_ERR, "%s: leaked work request %p, wr_len %d, "
|
|
|
|
"opcode %x\n", __func__, wr, wr->wr_len, opcode);
|
|
|
|
/* WR not freed here; go look at it with a debugger. */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
/*
|
|
|
|
* Ground control to Major TOM
|
|
|
|
* Commencing countdown, engines on
|
|
|
|
*/
|
|
|
|
static int
|
|
|
|
t4_tom_activate(struct adapter *sc)
|
|
|
|
{
|
|
|
|
struct tom_data *td;
|
|
|
|
struct toedev *tod;
|
2015-12-03 00:02:01 +00:00
|
|
|
struct vi_info *vi;
|
2016-07-05 01:29:24 +00:00
|
|
|
struct sge_ofld_rxq *ofld_rxq;
|
|
|
|
int i, j, rc, v;
|
2012-06-19 07:34:13 +00:00
|
|
|
|
2013-01-10 23:56:50 +00:00
|
|
|
ASSERT_SYNCHRONIZED_OP(sc);
|
2012-06-19 07:34:13 +00:00
|
|
|
|
|
|
|
/* per-adapter softc for TOM */
|
|
|
|
td = malloc(sizeof(*td), M_CXGBE, M_ZERO | M_NOWAIT);
|
|
|
|
if (td == NULL)
|
|
|
|
return (ENOMEM);
|
|
|
|
|
|
|
|
/* List of TOE PCBs and associated lock */
|
|
|
|
mtx_init(&td->toep_list_lock, "PCB list lock", NULL, MTX_DEF);
|
|
|
|
TAILQ_INIT(&td->toep_list);
|
|
|
|
|
|
|
|
/* Listen context */
|
|
|
|
mtx_init(&td->lctx_hash_lock, "lctx hash lock", NULL, MTX_DEF);
|
|
|
|
td->listen_hash = hashinit_flags(LISTEN_HASH_SIZE, M_CXGBE,
|
|
|
|
&td->listen_mask, HASH_NOWAIT);
|
|
|
|
|
2014-10-07 21:26:22 +00:00
|
|
|
/* List of WRs for which L2 resolution failed */
|
|
|
|
mtx_init(&td->unsent_wr_lock, "Unsent WR list lock", NULL, MTX_DEF);
|
|
|
|
STAILQ_INIT(&td->unsent_wr_list);
|
|
|
|
TASK_INIT(&td->reclaim_wr_resources, 0, reclaim_wr_resources, td);
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
/* TID tables */
|
|
|
|
rc = alloc_tid_tabs(&sc->tids);
|
|
|
|
if (rc != 0)
|
|
|
|
goto done;
|
|
|
|
|
2016-08-31 23:23:46 +00:00
|
|
|
rc = t4_init_ppod_region(&td->pr, &sc->vres.ddp,
|
|
|
|
t4_read_reg(sc, A_ULP_RX_TDDP_PSZ), "TDDP page pods");
|
|
|
|
if (rc != 0)
|
|
|
|
goto done;
|
|
|
|
t4_set_reg_field(sc, A_ULP_RX_TDDP_TAGMASK,
|
|
|
|
V_TDDPTAGMASK(M_TDDPTAGMASK), td->pr.pr_tag_mask);
|
2012-08-17 00:49:29 +00:00
|
|
|
|
2013-01-15 07:07:29 +00:00
|
|
|
/* CLIP table for IPv6 offload */
|
|
|
|
init_clip_table(sc, td);
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
/* toedev ops */
|
|
|
|
tod = &td->tod;
|
|
|
|
init_toedev(tod);
|
|
|
|
tod->tod_softc = sc;
|
|
|
|
tod->tod_connect = t4_connect;
|
|
|
|
tod->tod_listen_start = t4_listen_start;
|
|
|
|
tod->tod_listen_stop = t4_listen_stop;
|
|
|
|
tod->tod_rcvd = t4_rcvd;
|
|
|
|
tod->tod_output = t4_tod_output;
|
|
|
|
tod->tod_send_rst = t4_send_rst;
|
|
|
|
tod->tod_send_fin = t4_send_fin;
|
|
|
|
tod->tod_pcb_detach = t4_pcb_detach;
|
|
|
|
tod->tod_l2_update = t4_l2_update;
|
|
|
|
tod->tod_syncache_added = t4_syncache_added;
|
|
|
|
tod->tod_syncache_removed = t4_syncache_removed;
|
|
|
|
tod->tod_syncache_respond = t4_syncache_respond;
|
|
|
|
tod->tod_offload_socket = t4_offload_socket;
|
2013-07-04 19:44:30 +00:00
|
|
|
tod->tod_ctloutput = t4_ctloutput;
|
2012-06-19 07:34:13 +00:00
|
|
|
|
2015-12-03 00:02:01 +00:00
|
|
|
for_each_port(sc, i) {
|
|
|
|
for_each_vi(sc->port[i], v, vi) {
|
|
|
|
TOEDEV(vi->ifp) = &td->tod;
|
2016-07-05 01:29:24 +00:00
|
|
|
for_each_ofld_rxq(vi, j, ofld_rxq) {
|
|
|
|
ofld_rxq->iq.set_tcb_rpl = do_set_tcb_rpl;
|
|
|
|
ofld_rxq->iq.l2t_write_rpl = do_l2t_write_rpl2;
|
|
|
|
}
|
2015-12-03 00:02:01 +00:00
|
|
|
}
|
|
|
|
}
|
2012-06-19 07:34:13 +00:00
|
|
|
|
|
|
|
sc->tom_softc = td;
|
|
|
|
register_toedev(sc->tom_softc);
|
|
|
|
|
|
|
|
done:
|
|
|
|
if (rc != 0)
|
|
|
|
free_tom_data(sc, td);
|
|
|
|
return (rc);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
t4_tom_deactivate(struct adapter *sc)
|
|
|
|
{
|
|
|
|
int rc = 0;
|
|
|
|
struct tom_data *td = sc->tom_softc;
|
|
|
|
|
2013-01-10 23:56:50 +00:00
|
|
|
ASSERT_SYNCHRONIZED_OP(sc);
|
2012-06-19 07:34:13 +00:00
|
|
|
|
|
|
|
if (td == NULL)
|
|
|
|
return (0); /* XXX. KASSERT? */
|
|
|
|
|
|
|
|
if (sc->offload_map != 0)
|
|
|
|
return (EBUSY); /* at least one port has IFCAP_TOE enabled */
|
|
|
|
|
2015-02-08 09:28:55 +00:00
|
|
|
if (uld_active(sc, ULD_IWARP) || uld_active(sc, ULD_ISCSI))
|
|
|
|
return (EBUSY); /* both iWARP and iSCSI rely on the TOE. */
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
mtx_lock(&td->toep_list_lock);
|
|
|
|
if (!TAILQ_EMPTY(&td->toep_list))
|
|
|
|
rc = EBUSY;
|
|
|
|
mtx_unlock(&td->toep_list_lock);
|
|
|
|
|
|
|
|
mtx_lock(&td->lctx_hash_lock);
|
|
|
|
if (td->lctx_count > 0)
|
|
|
|
rc = EBUSY;
|
|
|
|
mtx_unlock(&td->lctx_hash_lock);
|
|
|
|
|
2014-10-07 21:26:22 +00:00
|
|
|
taskqueue_drain(taskqueue_thread, &td->reclaim_wr_resources);
|
|
|
|
mtx_lock(&td->unsent_wr_lock);
|
|
|
|
if (!STAILQ_EMPTY(&td->unsent_wr_list))
|
|
|
|
rc = EBUSY;
|
|
|
|
mtx_unlock(&td->unsent_wr_lock);
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
if (rc == 0) {
|
|
|
|
unregister_toedev(sc->tom_softc);
|
|
|
|
free_tom_data(sc, td);
|
|
|
|
sc->tom_softc = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (rc);
|
|
|
|
}
|
|
|
|
|
2013-04-18 19:52:11 +00:00
|
|
|
static void
|
|
|
|
t4_tom_ifaddr_event(void *arg __unused, struct ifnet *ifp)
|
|
|
|
{
|
|
|
|
|
|
|
|
atomic_add_rel_int(&in6_ifaddr_gen, 1);
|
|
|
|
taskqueue_enqueue_timeout(taskqueue_thread, &clip_task, -hz / 4);
|
|
|
|
}
|
|
|
|
|
2016-07-27 18:29:35 +00:00
|
|
|
static int
|
|
|
|
t4_aio_queue_tom(struct socket *so, struct kaiocb *job)
|
|
|
|
{
|
|
|
|
struct tcpcb *tp = so_sototcpcb(so);
|
|
|
|
struct toepcb *toep = tp->t_toe;
|
|
|
|
int error;
|
|
|
|
|
|
|
|
if (toep->ulp_mode == ULP_MODE_TCPDDP) {
|
|
|
|
error = t4_aio_queue_ddp(so, job);
|
|
|
|
if (error != EOPNOTSUPP)
|
|
|
|
return (error);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (t4_aio_queue_aiotx(so, job));
|
|
|
|
}
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
static int
|
|
|
|
t4_tom_mod_load(void)
|
|
|
|
{
|
|
|
|
int rc;
|
2013-01-15 00:24:01 +00:00
|
|
|
struct protosw *tcp_protosw, *tcp6_protosw;
|
2012-08-17 00:49:29 +00:00
|
|
|
|
2016-07-05 01:29:24 +00:00
|
|
|
/* CPL handlers */
|
|
|
|
t4_init_connect_cpl_handlers();
|
|
|
|
t4_init_listen_cpl_handlers();
|
|
|
|
t4_init_cpl_io_handlers();
|
|
|
|
|
2016-05-07 00:33:35 +00:00
|
|
|
rc = t4_ddp_mod_load();
|
|
|
|
if (rc != 0)
|
|
|
|
return (rc);
|
|
|
|
|
2012-08-17 00:49:29 +00:00
|
|
|
tcp_protosw = pffindproto(PF_INET, IPPROTO_TCP, SOCK_STREAM);
|
|
|
|
if (tcp_protosw == NULL)
|
|
|
|
return (ENOPROTOOPT);
|
2016-07-27 18:29:35 +00:00
|
|
|
bcopy(tcp_protosw, &toe_protosw, sizeof(toe_protosw));
|
|
|
|
bcopy(tcp_protosw->pr_usrreqs, &toe_usrreqs, sizeof(toe_usrreqs));
|
|
|
|
toe_usrreqs.pru_aio_queue = t4_aio_queue_tom;
|
|
|
|
toe_protosw.pr_usrreqs = &toe_usrreqs;
|
2012-06-19 07:34:13 +00:00
|
|
|
|
2013-01-15 00:24:01 +00:00
|
|
|
tcp6_protosw = pffindproto(PF_INET6, IPPROTO_TCP, SOCK_STREAM);
|
|
|
|
if (tcp6_protosw == NULL)
|
|
|
|
return (ENOPROTOOPT);
|
2016-07-27 18:29:35 +00:00
|
|
|
bcopy(tcp6_protosw, &toe6_protosw, sizeof(toe6_protosw));
|
|
|
|
bcopy(tcp6_protosw->pr_usrreqs, &toe6_usrreqs, sizeof(toe6_usrreqs));
|
|
|
|
toe6_usrreqs.pru_aio_queue = t4_aio_queue_tom;
|
|
|
|
toe6_protosw.pr_usrreqs = &toe6_usrreqs;
|
2013-01-15 00:24:01 +00:00
|
|
|
|
2013-04-18 19:52:11 +00:00
|
|
|
TIMEOUT_TASK_INIT(taskqueue_thread, &clip_task, 0, t4_clip_task, NULL);
|
|
|
|
ifaddr_evhandler = EVENTHANDLER_REGISTER(ifaddr_event,
|
|
|
|
t4_tom_ifaddr_event, NULL, EVENTHANDLER_PRI_ANY);
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
rc = t4_register_uld(&tom_uld_info);
|
|
|
|
if (rc != 0)
|
|
|
|
t4_tom_mod_unload();
|
|
|
|
|
|
|
|
return (rc);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
tom_uninit(struct adapter *sc, void *arg __unused)
|
|
|
|
{
|
2013-08-28 20:59:22 +00:00
|
|
|
if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4tomun"))
|
2013-01-10 23:56:50 +00:00
|
|
|
return;
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
/* Try to free resources (works only if no port has IFCAP_TOE) */
|
2015-02-08 09:28:55 +00:00
|
|
|
if (uld_active(sc, ULD_TOM))
|
2012-06-19 07:34:13 +00:00
|
|
|
t4_deactivate_uld(sc, ULD_TOM);
|
2013-01-10 23:56:50 +00:00
|
|
|
|
2013-08-28 20:59:22 +00:00
|
|
|
end_synchronized_op(sc, 0);
|
2012-06-19 07:34:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
t4_tom_mod_unload(void)
|
|
|
|
{
|
|
|
|
t4_iterate(tom_uninit, NULL);
|
|
|
|
|
|
|
|
if (t4_unregister_uld(&tom_uld_info) == EBUSY)
|
|
|
|
return (EBUSY);
|
|
|
|
|
2013-04-18 19:52:11 +00:00
|
|
|
if (ifaddr_evhandler) {
|
|
|
|
EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_evhandler);
|
|
|
|
taskqueue_cancel_timeout(taskqueue_thread, &clip_task, NULL);
|
|
|
|
}
|
|
|
|
|
2016-05-07 00:33:35 +00:00
|
|
|
t4_ddp_mod_unload();
|
|
|
|
|
2012-06-19 07:34:13 +00:00
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
#endif /* TCP_OFFLOAD */
|
|
|
|
|
|
|
|
static int
|
|
|
|
t4_tom_modevent(module_t mod, int cmd, void *arg)
|
|
|
|
{
|
|
|
|
int rc = 0;
|
|
|
|
|
|
|
|
#ifdef TCP_OFFLOAD
|
|
|
|
switch (cmd) {
|
|
|
|
case MOD_LOAD:
|
|
|
|
rc = t4_tom_mod_load();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MOD_UNLOAD:
|
|
|
|
rc = t4_tom_mod_unload();
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
rc = EINVAL;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
printf("t4_tom: compiled without TCP_OFFLOAD support.\n");
|
|
|
|
rc = EOPNOTSUPP;
|
|
|
|
#endif
|
|
|
|
return (rc);
|
|
|
|
}
|
|
|
|
|
|
|
|
static moduledata_t t4_tom_moddata= {
|
|
|
|
"t4_tom",
|
|
|
|
t4_tom_modevent,
|
2012-10-10 08:36:38 +00:00
|
|
|
0
|
2012-06-19 07:34:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
MODULE_VERSION(t4_tom, 1);
|
|
|
|
MODULE_DEPEND(t4_tom, toecore, 1, 1, 1);
|
|
|
|
MODULE_DEPEND(t4_tom, t4nex, 1, 1, 1);
|
|
|
|
DECLARE_MODULE(t4_tom, t4_tom_moddata, SI_SUB_EXEC, SI_ORDER_ANY);
|