Update firmware version check

make ddp a tunable

Obtained from:	Chelsio Inc.
MFC after:	3 days
This commit is contained in:
kmacy 2008-11-12 04:45:09 +00:00
parent f8fc18af0b
commit bae7e3ef64
5 changed files with 28 additions and 17 deletions

View File

@ -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];
};
/*

View File

@ -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);
}
/**

View File

@ -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:

View File

@ -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;

View File

@ -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;