[lkml]   [2010]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH v16 11/17]Add a hook to intercept external buffers from NIC driver.
    On Wed, Dec 1, 2010 at 4:08 PM,  <> wrote:
    > From: Xin Xiaohui <>
    > @@ -2891,6 +2925,11 @@ static int __netif_receive_skb(struct sk_buff *skb)
    >  ncls:
    >  #endif
    > +       /* To intercept mediate passthru(zero-copy) packets here */
    > +       skb = handle_mpassthru(skb, &pt_prev, &ret, orig_dev);
    > +       if (!skb)
    > +               goto out;
    > +
    >        /* Handle special case of bridge or macvlan */

    I think it won't work if the skbs is captured by the previous ptype.
    We need to trace the skb pages(skb_shared_info.frags[*].page), but
    currently, there isn't a easy way to do that. skb pages are treated as
    normal pages, and anyone can get it freely. And it is the problem in
    the way to fix the potential data corruption bug.

    Eric thinks af_packets(mmap) isn't worth fixing. But if this patch
    serial has the same problem. It will be worth.

    My idea is adding a new function dtor pointer and some other args
    pointers to the struct skb_shared_info. If skb_shared_info.dtor
    exists, the pages in skb_shared_info.frags are private to this
    skb->head. Anyone who wants to get these pages, should copy them

    Changli Gao(
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2010-12-01 10:41    [W:0.023 / U:10.116 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site