Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Aug 2016 08:57:51 +0000 (UTC)
From:      Sepherosa Ziehau <sephe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303764 - head/sys/dev/hyperv/vmbus
Message-ID:  <201608050857.u758vpRi074774@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sephe
Date: Fri Aug  5 08:57:51 2016
New Revision: 303764
URL: https://svnweb.freebsd.org/changeset/base/303764

Log:
  hyperv/vmbus: Only make sure the TX bufring will not be closed.
  
  KVP can write data, whose size is > 1/2 TX bufring size.
  
  MFC after:	1 week
  Sponsored by:	Microsoft OSTC
  Differential Revision:	https://reviews.freebsd.org/D7414

Modified:
  head/sys/dev/hyperv/vmbus/vmbus_brvar.h

Modified: head/sys/dev/hyperv/vmbus/vmbus_brvar.h
==============================================================================
--- head/sys/dev/hyperv/vmbus/vmbus_brvar.h	Fri Aug  5 06:23:06 2016	(r303763)
+++ head/sys/dev/hyperv/vmbus/vmbus_brvar.h	Fri Aug  5 08:57:51 2016	(r303764)
@@ -74,8 +74,12 @@ struct sysctl_oid;
 static __inline int
 vmbus_txbr_maxpktsz(const struct vmbus_txbr *tbr)
 {
-	/* 1/2 data size */
-	return (tbr->txbr_dsize / 2);
+	/*
+	 * - 64 bits for the trailing start index (- sizeof(uint64_t)).
+	 * - The rindex and windex can't be same (- 1).  See
+	 *   the comment near vmbus_bufring.br_{r,w}index.
+	 */
+	return (tbr->txbr_dsize - sizeof(uint64_t) - 1);
 }
 
 void		vmbus_br_sysctl_create(struct sysctl_ctx_list *ctx,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608050857.u758vpRi074774>