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: "Xu, Dongxiao" <dongxiao.xu@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel][PV-ops][PATCH 1/2] VNIF(netback): Using smart pollinginstead of event notification.
From: "James Harper" <james.harper@xxxxxxxxxxxxxxxx>
Date: Wed, 30 Sep 2009 19:27:02 +1000
Cc:
Delivery-date: Wed, 30 Sep 2009 02:27:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <EADF0A36011179459010BDF5142A457501CEB8B29A@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcpBm9hiks1uc4WgTdiHnY0OtSalmAAACqMAAAS9asA=
Thread-topic: [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.

>       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.

James


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