From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJiGK-0002sn-7N for qemu-devel@nongnu.org; Mon, 27 Jul 2015 09:16:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJiGG-0006AI-GG for qemu-devel@nongnu.org; Mon, 27 Jul 2015 09:16:12 -0400 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:33841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJiGG-00069q-6M for qemu-devel@nongnu.org; Mon, 27 Jul 2015 09:16:08 -0400 Received: by wibud3 with SMTP id ud3so139666885wib.1 for ; Mon, 27 Jul 2015 06:16:07 -0700 (PDT) Date: Mon, 27 Jul 2015 14:16:04 +0100 From: Stefan Hajnoczi Message-ID: <20150727131604.GC12145@stefanha-thinkpad.redhat.com> References: <1435632157-9275-1-git-send-email-famz@redhat.com> <20150702123916.GD21214@stefanha-thinkpad.home> <20150720171209.GD3607@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RIYY1s2vRbPFwWeW" Content-Disposition: inline In-Reply-To: <20150720171209.GD3607@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH] xen: Drop net_rx_ok List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini , Chen Gang Cc: jasowang@redhat.com, Fam Zheng , qemu-devel@nongnu.org, stefanha@redhat.com --RIYY1s2vRbPFwWeW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 20, 2015 at 06:12:09PM +0100, Stefan Hajnoczi wrote: > On Thu, Jul 02, 2015 at 01:39:16PM +0100, Stefan Hajnoczi wrote: > > On Tue, Jun 30, 2015 at 10:42:37AM +0800, Fam Zheng wrote: > > > This is necessary because once we return false from .can_receive, we > > > need to flush the queue when the .can_receive conditions become true > > > again, (for example when more buffer is available). > > >=20 > > > We can rely on net_rx_packet (which checks the same conditions) to dr= op > > > the packet if the device is not ready, so drop net_xen_info.can_recei= ve. > >=20 > > This patch changes behavior: > >=20 > > Previously can_receive() false meant packets are queued. > >=20 > > Now those same conditions result in net_rx_packet() returning -1, so > > packets are discarded. > >=20 > > In order to keep the spirit of the queuing mechanism - where we tell a > > sender to hold off until more rx buffers become available - I think the > > following line in net_rx_packet() needs to be changed: > >=20 > > if (rc =3D=3D rp || RING_REQUEST_CONS_OVERFLOW(&netdev->rx_ring, rc))= { > > xen_be_printf(&netdev->xendev, 2, "no buffer, drop packet\n"); > > return -1; <-- this should be changed to return 0 > > } > >=20 > > That change assumes that net_event()'s flush is always called when the > > rx ring gets more free space. > >=20 > > Any thoughts from Xen folks? >=20 > Ping? Need input from Xen developers. Ping? --RIYY1s2vRbPFwWeW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVti8UAAoJEJykq7OBq3PIW3gIAIcxgoaakrEse0vF8p02Bkf+ eVfvyGDz+lTmn+IvI0CBrJNcAilEYJj8jK0zViyU+ewnvevWYJ8hy6lYDaAha1FO 2fZBNjWdX2nD7rCdVLTqRMHQihUnNtUJ/OTNo3upfd5WdyBl+hvYz5EKYk/0eVsw wjr4KeIXsNm1UqxROKowgk+rpHthLG4KUdDHmwos7S33dDrJ9iVGKN7m8Ax2F23b J5+wt3wlhfYXS1gl+zU5yZzPyM9BDRtQed3jpcrXkND1hFtcoBGMBYW2IHBP4NEZ bnASsTO9DAOQZtyoSSHg6YGd+7WztXQPpAxYKM5CLPEKZ1VHnLSiUthg5eVqinw= =7FQO -----END PGP SIGNATURE----- --RIYY1s2vRbPFwWeW--