From owner-svn-src-head@FreeBSD.ORG Wed Nov 12 04:45:09 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B50B81065672; Wed, 12 Nov 2008 04:45:09 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A00708FC18; Wed, 12 Nov 2008 04:45:09 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAC4j9Jv020264; Wed, 12 Nov 2008 04:45:09 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAC4j9d5020259; Wed, 12 Nov 2008 04:45:09 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200811120445.mAC4j9d5020259@svn.freebsd.org> From: Kip Macy Date: Wed, 12 Nov 2008 04:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184861 - in head/sys/dev/cxgb: common ulp/tom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 12 Nov 2008 04:45:09 -0000 Author: kmacy Date: Wed Nov 12 04:45:09 2008 New Revision: 184861 URL: http://svn.freebsd.org/changeset/base/184861 Log: Update firmware version check make ddp a tunable Obtained from: Chelsio Inc. MFC after: 3 days Modified: head/sys/dev/cxgb/common/cxgb_ctl_defs.h head/sys/dev/cxgb/common/cxgb_t3_hw.c head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c head/sys/dev/cxgb/ulp/tom/cxgb_tom.c head/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c Modified: head/sys/dev/cxgb/common/cxgb_ctl_defs.h ============================================================================== --- head/sys/dev/cxgb/common/cxgb_ctl_defs.h Wed Nov 12 04:43:55 2008 (r184860) +++ head/sys/dev/cxgb/common/cxgb_ctl_defs.h Wed Nov 12 04:45:09 2008 (r184861) @@ -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]; }; /* Modified: head/sys/dev/cxgb/common/cxgb_t3_hw.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_t3_hw.c Wed Nov 12 04:43:55 2008 (r184860) +++ head/sys/dev/cxgb/common/cxgb_t3_hw.c Wed Nov 12 04:45:09 2008 (r184861) @@ -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); } /** Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Nov 12 04:43:55 2008 (r184860) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Nov 12 04:45:09 2008 (r184861) @@ -3449,9 +3449,7 @@ process_pass_accept_req(struct socket *s V_TF_DDP_OFF(1) | TP_DDP_TIMER_WORKAROUND_VAL, 1); } else - printf("not offloading\n"); - - + DPRINTF("no DDP\n"); return; reject: Modified: head/sys/dev/cxgb/ulp/tom/cxgb_tom.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_tom.c Wed Nov 12 04:43:55 2008 (r184860) +++ head/sys/dev/cxgb/ulp/tom/cxgb_tom.c Wed Nov 12 04:45:09 2008 (r184861) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -90,13 +89,6 @@ __FBSDID("$FreeBSD$"); #include -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, str } 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 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; Modified: head/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c Wed Nov 12 04:43:55 2008 (r184860) +++ head/sys/dev/cxgb/ulp/tom/cxgb_tom_sysctl.c Wed Nov 12 04:45:09 2008 (r184861) @@ -76,6 +76,10 @@ __FBSDID("$FreeBSD$"); #include #include +/* 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_tunab .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;