From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHEc1-0002pf-NP for qemu-devel@nongnu.org; Mon, 20 Jul 2015 13:12:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHEbx-0004Uv-TT for qemu-devel@nongnu.org; Mon, 20 Jul 2015 13:12:21 -0400 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:35022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHEbx-0004Ue-NI for qemu-devel@nongnu.org; Mon, 20 Jul 2015 13:12:17 -0400 Received: by wgav7 with SMTP id v7so70354942wga.2 for ; Mon, 20 Jul 2015 10:12:17 -0700 (PDT) Date: Mon, 20 Jul 2015 18:12:09 +0100 From: Stefan Hajnoczi Message-ID: <20150720171209.GD3607@stefanha-thinkpad.redhat.com> References: <1435632157-9275-1-git-send-email-famz@redhat.com> <20150702123916.GD21214@stefanha-thinkpad.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4zI0WCX1RcnW9Hbu" Content-Disposition: inline In-Reply-To: <20150702123916.GD21214@stefanha-thinkpad.home> Subject: Re: [Qemu-devel] [PATCH] xen: Drop net_rx_ok List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: jasowang@redhat.com, Fam Zheng , qemu-devel@nongnu.org --4zI0WCX1RcnW9Hbu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 drop > > the packet if the device is not ready, so drop net_xen_info.can_receive. >=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? Ping? --4zI0WCX1RcnW9Hbu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVrSvpAAoJEJykq7OBq3PI+SwIAIW4Z/m7dB0hokZNGSVTVm6D El2myrMq+Oc6RWDsfV943AFukiavBXKqFuLQwcpuQcGUOFtRKxD6NSiAN4+nP444 cczw8XX2cFOTX2mFjA4k+lCVjGrIPcVQ2E1qeAC1oTdaMi52f4N5ENYqagCcfS98 pne269BRrHz1/aAnwSd0sY9hdZW5rZig0IrgcQ6+g1EP8GtiUclZ+4FmRn5+QHuH iVEyf+uUcZMO6J4GJNZm9i3zWTpkKEK+dIHEBOkB466E7WgAFub49lH+bnM4Ar+d wNSZ2VxLFENwf9odwy38bRZJ6Y2AvkZr/4EzxRnvLP7M/olmV7xTABSXDORvN7I= =soeB -----END PGP SIGNATURE----- --4zI0WCX1RcnW9Hbu--