[Click] ToDevice and pkts "too small"
Eddie Kohler
kohler at cs.ucla.edu
Wed Aug 29 04:27:19 EDT 2007
Torquato,
This is a good point, and a reasonable patch sketch. I checked in a version;
let me know if it works for you!
Eddie
Torquato Bertani wrote:
> Hi all,
> I found a strange thing in ToDevice element. If I use a configuration
> like this one:
>
> FromHost->Classifier(12/806, -)->Queue->ToDevice(eth0); //Send ARP
> pkts to ethernet
>
> Click reports the error: ToDevice: too small: len 42 tailroom 4
>
> I know that tailroom is too small to pad the pkt till 60 bytes. In
> this case why ToDevice doesn't call the function Packet::put()? This
> function will cal Packet::expensive_put() and then everything should
> work. I see that ToDevice call tha function skb_put() to pad the pkt
> till 60 bytes if tailroom is enough, is right or can be improved
> calling Packet::put() ?
>
> I modified the code to use Packet::put() if tailroom isn't enough and
> it works but I'd like to know if it's correct or not.
>
> Thanks
>
> Thor
>
> todevice.cc:399
> if (!_no_pad && skb1->len < 60) {
> if (skb_tailroom(skb1) < 60 - skb1->len) {
> WritablePacket *q = p->put(60 - skb1->len);
> p = q; //Is this correct?
> // printk("ToDevice: too small: len %d tailroom %d\n",
> // skb1->len, skb_tailroom(skb1));
> // kfree_skb(skb1);
> // return -1;
> } else {
> skb_put(skb1, 60 - skb1->len);
> }
> }
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
More information about the click
mailing list