From owner-svn-src-head@freebsd.org Thu Nov 9 15:35:52 2017 Return-Path: Delivered-To: svn-src-head@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 6AEBCE5398F; Thu, 9 Nov 2017 15:35:52 +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 375226B19A; Thu, 9 Nov 2017 15:35:52 +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 vA9FZpQ6045037; Thu, 9 Nov 2017 15:35:51 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9FZp6Q045036; Thu, 9 Nov 2017 15:35:51 GMT (envelope-from np@FreeBSD.org) Message-Id: <201711091535.vA9FZp6Q045036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 9 Nov 2017 15:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325596 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 325596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 09 Nov 2017 15:35:52 -0000 Author: np Date: Thu Nov 9 15:35:51 2017 New Revision: 325596 URL: https://svnweb.freebsd.org/changeset/base/325596 Log: cxgbe(4): Do not request settings not supported by the port. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Thu Nov 9 14:31:25 2017 (r325595) +++ head/sys/dev/cxgbe/common/t4_hw.c Thu Nov 9 15:35:51 2017 (r325596) @@ -3682,7 +3682,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m { struct fw_port_cmd c; unsigned int mdi = V_FW_PORT_CAP_MDI(FW_PORT_CAP_MDI_AUTO); - unsigned int aneg, fc, fec, speed; + unsigned int aneg, fc, fec, speed, rcap; fc = 0; if (lc->requested_fc & PAUSE_RX) @@ -3727,6 +3727,13 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m V_FW_PORT_CAP_SPEED(M_FW_PORT_CAP_SPEED); } + rcap = aneg | speed | fc | fec | mdi; + if ((rcap | lc->supported) != lc->supported) { + CH_WARN(adap, "rcap 0x%08x, pcap 0x%08x\n", rcap, + lc->supported); + rcap &= lc->supported; + } + memset(&c, 0, sizeof(c)); c.op_to_portid = cpu_to_be32(V_FW_CMD_OP(FW_PORT_CMD) | F_FW_CMD_REQUEST | F_FW_CMD_EXEC | @@ -3734,7 +3741,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m c.action_to_len16 = cpu_to_be32(V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_L1_CFG) | FW_LEN16(c)); - c.u.l1cfg.rcap = cpu_to_be32(aneg | speed | fc | fec | mdi); + c.u.l1cfg.rcap = cpu_to_be32(rcap); return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL); }