WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel][PV-ops][PATCH 1/2] VNIF(netback): Using smart pollingins

To: James Harper <james.harper@xxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel][PV-ops][PATCH 1/2] VNIF(netback): Using smart pollinginstead of event notification.
From: "Xu, Dongxiao" <dongxiao.xu@xxxxxxxxx>
Date: Thu, 1 Oct 2009 01:29:23 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "jeremy@xxxxxxxx" <jeremy@xxxxxxxx>
Delivery-date: Wed, 30 Sep 2009 10:29:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AEC6C66638C05B468B556EA548C1A77D0177D644@trantor>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <EADF0A36011179459010BDF5142A457501CEB8B29A@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, <AEC6C66638C05B468B556EA548C1A77D0177D644@trantor>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcpBm9hiks1uc4WgTdiHnY0OtSalmAAACqMAAAS9asAAELdM0g==
Thread-topic: [Xen-devel][PV-ops][PATCH 1/2] VNIF(netback): Using smart pollinginstead of event notification.
See below comments.

Thanks!
Dongxiao

________________________________________
From: James Harper [james.harper@xxxxxxxxxxxxxxxx]
Sent: Wednesday, September 30, 2009 2:27 AM
To: Xu, Dongxiao; xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Xen-devel][PV-ops][PATCH 1/2] VNIF(netback): Using smart 
pollinginstead of event notification.

>
> +             /* netfront_smartpoll_active indicates whether netfront
timer
> +                 * is active.
> +                 */
> +             if ((netif->smart_poll == 1)) {
> +                     if
(!(netif->rx.sring->netfront_smartpoll_active)) {
> +                             notify_remote_via_irq(irq);
> +
netif->rx.sring->netfront_smartpoll_active = 1;
> +                     }
> +             }

I think that the frontend should use the event field to turn off
notification here. It should set it to the number of outstanding rx
slots less some number, eg if it had filled the ring with rx slots (eg
256), then prod + 128 might be a good number. That way if a lot of small
packets come it, the frontend will still get notified if the ring is
half empty even if the 1Khz timer wasn't elapsed yet. Otherwise the rx
ring could starve.

[Dongxiao]: In our patch, netfront will NOT be notified while polling data. 
Netback only notifies it once when data comes but netfront timer is not active. 
After the notification, netfront will do polling until there is no data coming 
during 
100ms. So it eliminates most of the event channel notification. 

>       netif->tx.rsp_prod_pvt = ++i;
>       RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&netif->tx, notify);
> -     if (notify)
> +     /* netfront_smartpoll_active indicates whether netfront timer is
> +         * active.
> +         */
> +     if ((netif->smart_poll == 1)) {
> +             if (!(netif->rx.sring->netfront_smartpoll_active)) {
> +                     notify_remote_via_irq(netif->irq);
> +                     netif->rx.sring->netfront_smartpoll_active = 1;
> +             }
> +     } else if (notify)
>               notify_remote_via_irq(netif->irq);
>  }

I'm not so sure about this either. The frontend knows how many
outstanding tx packets it has put on the ring, and it is reasonable to
assume that they will be sent in a timely manner, so I think in this
case the frontend is in the best position to set the event to an
acceptable value and the backend will notify on that basis.

[Dongxiao]: Actually our patch has eliminate most of the notification, so it is 
unnecessary for 
netfront to set the event field. As described before, netfront is only notified 
once when its timer
is not active. Thanks!

James
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel