[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC PATCH V3 04/16] netback: switch to per-cpu scratch space.



Hi,

On Mon, Jan 30, 2012 at 9:45 AM, Wei Liu <wei.liu2@xxxxxxxxxx> wrote:
>
>        skb_queue_head_init(&rxq);
> @@ -534,13 +527,16 @@ void xen_netbk_rx_action(struct xen_netbk *netbk)
>                        break;
>        }
>
> -       BUG_ON(npo.meta_prod > ARRAY_SIZE(netbk->meta));
> +       BUG_ON(npo.meta_prod > MAX_PENDING_REQS);

While you are already here,
how about having WARN_ON() ?

>
> -       if (!npo.copy_prod)
> +       if (!npo.copy_prod) {
> +               put_cpu_ptr(gco);
> +               put_cpu_ptr(m);
>                return;
> +       }
>
> -       BUG_ON(npo.copy_prod > ARRAY_SIZE(netbk->grant_copy_op));
> -       ret = HYPERVISOR_grant_table_op(GNTTABOP_copy, &netbk->grant_copy_op,
> +       BUG_ON(npo.copy_prod > (2 * XEN_NETIF_RX_RING_SIZE));

And may be here, too...

If there is serious bug, may be system will crash at a later point
But, IMHO, WARN_ON() is the correct function for drivers at least.

> +       ret = HYPERVISOR_grant_table_op(GNTTABOP_copy, gco,
>                                        npo.copy_prod);
>        BUG_ON(ret != 0);
>
-- 
Thanks,
Viral Mehta

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.