summaryrefslogtreecommitdiffstats
path: root/sys/dev/cxgb
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2008-11-12 04:45:09 +0000
committerkmacy <kmacy@FreeBSD.org>2008-11-12 04:45:09 +0000
commitbae7e3ef64374d24a9ddb3967b8d4050f60ea54e (patch)
tree99c0711e7bd1798d98efb180563ba24d21ea9246 /sys/dev/cxgb
parentf8fc18af0be8b07ceea186f9946b378e3a68c8c1 (diff)
downloadFreeBSD-src-bae7e3ef64374d24a9ddb3967b8d4050f60ea54e.zip
FreeBSD-src-bae7e3ef64374d24a9ddb3967b8d4050f60ea54e.tar.gz
Update firmware version check
make ddp a tunable Obtained from: Chelsio Inc. MFC after: 3 days
Diffstat (limited to 'sys/dev/cxgb')
-rw-r--r--sys/dev/cxgb/common/cxgb_ctl_defs.h2
-rw-r--r--sys/dev/cxgb/common/cxgb_t3_hw.c10
-rw-r--r--sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c4
-rw-r--r--sys/dev/cxgb/ulp/tom/cxgb_tom.c12
-rw-r--r--sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c17
5 files changed, 28 insertions, 17 deletions
diff --git a/sys/dev/cxgb/common/cxgb_ctl_defs.h b/sys/dev/cxgb/common/cxgb_ctl_defs.h
index 11ed65a..b228a25 100644
--- a/sys/dev/cxgb/common/cxgb_ctl_defs.h
+++ b/sys/dev/cxgb/common/cxgb_ctl_defs.h
@@ -85,7 +85,7 @@ struct ddp_params {
struct adap_ports {
unsigned int nports; /* number of ports on this adapter */
- struct net_device *lldevs[2];
+ struct net_device *lldevs[MAX_NPORTS];
};
/*
diff --git a/sys/dev/cxgb/common/cxgb_t3_hw.c b/sys/dev/cxgb/common/cxgb_t3_hw.c
index d0f7c84..813fdb9 100644
--- a/sys/dev/cxgb/common/cxgb_t3_hw.c
+++ b/sys/dev/cxgb/common/cxgb_t3_hw.c
@@ -740,7 +740,8 @@ enum {
SF_ERASE_SECTOR = 0xd8, /* erase sector */
FW_FLASH_BOOT_ADDR = 0x70000, /* start address of FW in flash */
- FW_VERS_ADDR = 0x77ffc, /* flash address holding FW version */
+ OLD_FW_VERS_ADDR = 0x77ffc, /* flash address holding FW version */
+ FW_VERS_ADDR = 0x7fffc, /* flash address holding FW version */
FW_MIN_SIZE = 8, /* at least version and csum */
FW_MAX_SIZE = FW_VERS_ADDR - FW_FLASH_BOOT_ADDR,
@@ -1027,7 +1028,12 @@ enum fw_version_type {
*/
int t3_get_fw_version(adapter_t *adapter, u32 *vers)
{
- return t3_read_flash(adapter, FW_VERS_ADDR, 1, vers, 0);
+ int ret = t3_read_flash(adapter, FW_VERS_ADDR, 1, vers, 0);
+
+ if (!ret && *vers != 0xffffffff)
+ return 0;
+ else
+ return t3_read_flash(adapter, OLD_FW_VERS_ADDR, 1, vers, 0);
}
/**
diff --git a/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c b/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
index 22fb58d..7903288 100644
--- a/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
+++ b/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
@@ -3449,9 +3449,7 @@ process_pass_accept_req(struct socket *so, struct mbuf *m, struct toedev *tdev,
V_TF_DDP_OFF(1) |
TP_DDP_TIMER_WORKAROUND_VAL, 1);
} else
- printf("not offloading\n");
-
-
+ DPRINTF("no DDP\n");
return;
reject:
diff --git a/sys/dev/cxgb/ulp/tom/cxgb_tom.c b/sys/dev/cxgb/ulp/tom/cxgb_tom.c
index d586883..5654794 100644
--- a/sys/dev/cxgb/ulp/tom/cxgb_tom.c
+++ b/sys/dev/cxgb/ulp/tom/cxgb_tom.c
@@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$");
#include <sys/sockopt.h>
#include <sys/sockstate.h>
#include <sys/sockbuf.h>
-#include <sys/sysctl.h>
#include <sys/syslog.h>
#include <sys/taskqueue.h>
@@ -90,13 +89,6 @@ __FBSDID("$FreeBSD$");
#include <ulp/tom/cxgb_tcp.h>
-static int activated = 1;
-TUNABLE_INT("hw.t3toe.activated", &activated);
-SYSCTL_NODE(_hw, OID_AUTO, t3toe, CTLFLAG_RD, 0, "T3 toe driver parameters");
-SYSCTL_UINT(_hw_t3toe, OID_AUTO, activated, CTLFLAG_RDTUN, &activated, 0,
- "enable TOE at init time");
-
-
TAILQ_HEAD(, adapter) adapter_list;
static struct rwlock adapter_list_lock;
@@ -938,7 +930,7 @@ do_act_establish(struct t3cdev *dev, struct mbuf *m)
} else {
log(LOG_ERR, "%s: received clientless CPL command 0x%x\n",
- dev->name, CPL_PASS_ACCEPT_REQ);
+ dev->name, CPL_ACT_ESTABLISH);
return CPL_RET_BUF_DONE | CPL_RET_BAD_MSG;
}
}
@@ -1360,8 +1352,6 @@ t3_toe_attach(struct toedev *dev, const struct offload_id *entry)
t3_init_tunables(t);
mtx_init(&t->listen_lock, "tom data listeners", NULL, MTX_DEF);
CTR2(KTR_TOM, "t3_toe_attach dev=%p entry=%p", dev, entry);
- /* Adjust TOE activation for this module */
- t->conf.activated = activated;
dev->tod_can_offload = can_offload;
dev->tod_connect = t3_connect;
diff --git a/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c b/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c
index d39f20e..be22676 100644
--- a/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c
+++ b/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c
@@ -76,6 +76,10 @@ __FBSDID("$FreeBSD$");
#include <ulp/tom/cxgb_defs.h>
#include <ulp/tom/cxgb_t3_ddp.h>
+/* Avoid clutter in the hw.* space, keep all toe tunables within hw.cxgb */
+SYSCTL_DECL(_hw_cxgb);
+SYSCTL_NODE(_hw_cxgb, OID_AUTO, toe, CTLFLAG_RD, 0, "TOE parameters");
+
static struct tom_tunables default_tunable_vals = {
.max_host_sndbuf = 32 * 1024,
.tx_hold_thres = 0,
@@ -100,11 +104,24 @@ static struct tom_tunables default_tunable_vals = {
.activated = 1,
};
+static int activated = 1;
+TUNABLE_INT("hw.cxgb.toe.activated", &activated);
+SYSCTL_UINT(_hw_cxgb_toe, OID_AUTO, activated, CTLFLAG_RDTUN, &activated, 0,
+ "enable TOE at init time");
+
+static int ddp = 1;
+TUNABLE_INT("hw.cxgb.toe.ddp", &ddp);
+SYSCTL_UINT(_hw_cxgb_toe, OID_AUTO, ddp, CTLFLAG_RDTUN, &ddp, 0, "enable DDP");
+
void
t3_init_tunables(struct tom_data *t)
{
t->conf = default_tunable_vals;
+ /* Adjust tunables */
+ t->conf.activated = activated;
+ t->conf.ddp = ddp;
+
/* Now apply device specific fixups. */
t->conf.mss = T3C_DATA(t->cdev)->tx_max_chunk;
t->conf.max_wrs = T3C_DATA(t->cdev)->max_wrs;
OpenPOWER on IntegriCloud