From owner-svn-src-head@freebsd.org Sun Oct 11 20:59:41 2015 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 80265A11E00; Sun, 11 Oct 2015 20:59:41 +0000 (UTC) (envelope-from cem@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 4BA4F1499; Sun, 11 Oct 2015 20:59:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9BKxex4087049; Sun, 11 Oct 2015 20:59:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9BKxeS9087048; Sun, 11 Oct 2015 20:59:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510112059.t9BKxeS9087048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 11 Oct 2015 20:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289155 - head/sys/dev/ntb/if_ntb X-SVN-Group: head 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.20 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: Sun, 11 Oct 2015 20:59:41 -0000 Author: cem Date: Sun Oct 11 20:59:40 2015 New Revision: 289155 URL: https://svnweb.freebsd.org/changeset/base/289155 Log: NTB: MFV 90f9e934: reset tx_index on link toggle If the NTB link toggles, the driver could stop receiving due to the tx_index not being set to 0 on the transmitting size on a link-up event. This is due to the driver expecting the incoming data to start at the beginning of the receive buffer and not at a random place. Authored by: Jon Mason Obtained from: Linux Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/if_ntb/if_ntb.c Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Sun Oct 11 20:59:02 2015 (r289154) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Sun Oct 11 20:59:40 2015 (r289155) @@ -562,7 +562,6 @@ ntb_transport_init_queue(struct ntb_netd qp->tx_max_frame = min(transport_mtu + sizeof(struct ntb_payload_header), tx_size); qp->tx_max_entry = tx_size / qp->tx_max_frame; - qp->tx_index = 0; callout_init(&qp->link_work, 0); callout_init(&qp->queue_full, 1); @@ -1192,7 +1191,6 @@ ntb_transport_setup_qp_mw(struct ntb_net rx_size); qp->rx_max_entry = rx_size / qp->rx_max_frame; qp->rx_index = 0; - qp->tx_index = 0; qp->remote_rx_info->entry = qp->rx_max_entry; @@ -1206,6 +1204,7 @@ ntb_transport_setup_qp_mw(struct ntb_net qp->rx_pkts = 0; qp->tx_pkts = 0; + qp->tx_index = 0; } static void