From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAekU-0003O2-1Q for qemu-devel@nongnu.org; Thu, 02 Jul 2015 09:41:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAekT-0004Bo-2W for qemu-devel@nongnu.org; Thu, 02 Jul 2015 09:41:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAekS-0004Be-T0 for qemu-devel@nongnu.org; Thu, 02 Jul 2015 09:41:52 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 874A691775 for ; Thu, 2 Jul 2015 13:41:52 +0000 (UTC) Date: Thu, 2 Jul 2015 13:39:16 +0100 From: Stefan Hajnoczi Message-ID: <20150702123916.GD21214@stefanha-thinkpad.home> References: <1435632157-9275-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LTeJQqWS0MN7I/qa" Content-Disposition: inline In-Reply-To: <1435632157-9275-1-git-send-email-famz@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: Fam Zheng Cc: jasowang@redhat.com, qemu-devel@nongnu.org --LTeJQqWS0MN7I/qa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. This patch changes behavior: Previously can_receive() false meant packets are queued. Now those same conditions result in net_rx_packet() returning -1, so packets are discarded. 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: 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 } That change assumes that net_event()'s flush is always called when the rx ring gets more free space. Any thoughts from Xen folks? --LTeJQqWS0MN7I/qa Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVlTD0AAoJEJykq7OBq3PIQ8cH/3cTf0JPis2AXqPbBYOy6pZI 2vBkkEJLD8gHOK4gopfkbOALOP6QsBXSAIFVVp4BWsWIeRtKBSXAf5TdQb7JOIVs 4MbraqjF+SejGAQFdJLEhRwOFI0vTBJzR/DtnsU/ZzJ3vT07BnBb8bvrr1ie/NNU oR6La5ZADlz1FDiJ7K5sFCLzS97Wo46UxSj31UQ1S7/WO3L79eDQiM6FwoVpE2t6 AxrY0f5qTZ2LzXknzxLxoKVDgQG7/4u3DxAjIkZwPqhNtPXHemCi1KcA6ShlLvXO EpLtAx+PvjfWtKk7QYSm85UwbGCjt9sDZBt0HafH1Z8Fmhn5xk7pNZCFaK11tf0= =c5Q5 -----END PGP SIGNATURE----- --LTeJQqWS0MN7I/qa--