[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <50ABB38202000078000AA0FD@nat28.tlf.novell.com>
Date: Tue, 20 Nov 2012 15:44:50 +0000
From: "Jan Beulich" <JBeulich@...e.com>
To: "Ian Campbell" <Ian.Campbell@...rix.com>
Cc: "Stefan Bader" <stefan.bader@...onical.com>,
"Sander Eikelenboom" <linux@...elenboom.it>,
"Eric Dumazet" <edumazet@...gle.com>,
"KonradRzeszutekWilk" <konrad@...nel.org>,
"xen-devel@...ts.xen.org" <xen-devel@...ts.xen.org>,
"ANNIE LI" <annie.li@...cle.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [Xen-devel] [PATCH] xen/netfront: handle compound page
fragments on transmit
>>> On 20.11.12 at 16:06, Ian Campbell <Ian.Campbell@...rix.com> wrote:
> On Tue, 2012-11-20 at 14:32 +0000, Jan Beulich wrote:
>> > @@ -517,15 +540,16 @@ static int xennet_start_xmit(struct sk_buff *skb,
>> > struct net_device *dev)
>> > grant_ref_t ref;
>> > unsigned long mfn;
>> > int notify;
>> > - int frags = skb_shinfo(skb)->nr_frags;
>> > + int slots;
>> > unsigned int offset = offset_in_page(data);
>> > unsigned int len = skb_headlen(skb);
>> > unsigned long flags;
>> >
>> > - frags += DIV_ROUND_UP(offset + len, PAGE_SIZE);
>> > - if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
>> > - printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
>> > - frags);
>> > + slots = DIV_ROUND_UP(offset + len, PAGE_SIZE) +
>> > + xennet_count_skb_frag_slots(skb);
>> > + if (unlikely(slots > MAX_SKB_FRAGS + 1)) {
>>
>> But still - isn't this wrong now (i.e. can't it now validly exceed the
>> boundary checked for)?
>
> In practice no because of the property that the number of pages backing
> the frags is <= MAX_SKB_FRAGS even if you are using compound pages as
> the frags.
So are you saying that there is something in the system
preventing up to MAX_SKB_FRAGS * SKB_FRAG_PAGE_ORDER
(or NETDEV_FRAG_PAGE_MAX_ORDER) skb-s to be created? I
didn't find any. I do notice that __netdev_alloc_frag() currently
never gets called with a size larger than PAGE_SIZE, but
considering that the function just recently got made capable of
that, I'm sure respective users will show up rather sooner than
later.
Jan
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists