From owner-svn-src-all@freebsd.org Sat Sep 17 22:13:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DF6CBDEFA3; Sat, 17 Sep 2016 22:13:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54364ABF; Sat, 17 Sep 2016 22:13:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8HMD3pR085805; Sat, 17 Sep 2016 22:13:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8HMD3vs085800; Sat, 17 Sep 2016 22:13:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201609172213.u8HMD3vs085800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 17 Sep 2016 22:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305906 - in head/sys/dev/cxgbe: . common tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2016 22:13:04 -0000 Author: np Date: Sat Sep 17 22:13:03 2016 New Revision: 305906 URL: https://svnweb.freebsd.org/changeset/base/305906 Log: cxgbe/t4_tom: The SMAC entry for a VI is at a different location in the T6. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sat Sep 17 21:49:11 2016 (r305905) +++ head/sys/dev/cxgbe/adapter.h Sat Sep 17 22:13:03 2016 (r305906) @@ -231,6 +231,7 @@ struct vi_info { int if_flags; uint16_t *rss, *nm_rss; + int smt_idx; /* for convenience */ uint16_t viid; int16_t xact_addr_filt;/* index of exact MAC address filter */ uint16_t rss_size; /* size of VI's RSS table slice */ Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Sat Sep 17 21:49:11 2016 (r305905) +++ head/sys/dev/cxgbe/common/t4_hw.c Sat Sep 17 22:13:03 2016 (r305906) @@ -8100,6 +8100,10 @@ int t4_port_init(struct adapter *adap, i return ret; p->vi[0].viid = ret; + if (chip_id(adap) <= CHELSIO_T5) + p->vi[0].smt_idx = (ret & 0x7f) << 1; + else + p->vi[0].smt_idx = (ret & 0x7f); p->tx_chan = j; p->rx_chan_map = t4_get_mps_bg_map(adap, j); p->lport = j; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Sep 17 21:49:11 2016 (r305905) +++ head/sys/dev/cxgbe/t4_main.c Sat Sep 17 22:13:03 2016 (r305906) @@ -2030,6 +2030,10 @@ vcxgbe_attach(device_t dev) return (-rc); } vi->viid = rc; + if (chip_id(sc) <= CHELSIO_T5) + vi->smt_idx = (rc & 0x7f) << 1; + else + vi->smt_idx = (rc & 0x7f); param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_RSSINFO) | Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Sat Sep 17 21:49:11 2016 (r305905) +++ head/sys/dev/cxgbe/tom/t4_tom.c Sat Sep 17 22:13:03 2016 (r305906) @@ -538,7 +538,6 @@ select_rcv_wscale(void) } extern int always_keepalive; -#define VIID_SMACIDX(v) (((unsigned int)(v) & 0x7f) << 1) /* * socket so could be a listening socket too. @@ -569,7 +568,7 @@ calc_opt0(struct socket *so, struct vi_i opt0 |= V_L2T_IDX(e->idx); if (vi != NULL) { - opt0 |= V_SMAC_SEL(VIID_SMACIDX(vi->viid)); + opt0 |= V_SMAC_SEL(vi->smt_idx); opt0 |= V_TX_CHAN(vi->pi->tx_chan); }