netowrk device driver : issue while receiving packets spread over multiple buffers - Linux

This is a discussion on netowrk device driver : issue while receiving packets spread over multiple buffers - Linux ; Hello, I am writing an ethernet driver for cadence enhanced MAC in FE mode. The ethernet controller is having limitation that out of one frame it can copy only 512 bytes in one buffer. Hence the the received frame is ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: netowrk device driver : issue while receiving packets spread over multiple buffers

  1. netowrk device driver : issue while receiving packets spread over multiple buffers


    Hello,

    I am writing an ethernet driver for cadence enhanced MAC in FE mode.
    The ethernet controller is having limitation that out of one frame it
    can copy only 512 bytes in one buffer.
    Hence the the received frame is distributed over multiple buffers.
    So any frame which is more than 512 bytes will be in buffer pointed by
    next receive buffer queue descriptor.
    I am using NAPI mode in which when I am collecting the frame spread
    across multiple buffers and assign it to a single sk_buff handed over
    to stack, the data gets corrupt. And stack rejects the packet. One
    solution is to make receive buffer length 1536 bytes(jumbo frames) or
    1518 bytes which is IEEE 802.2/3 standard. But the controller doesn't
    accept the value greater than 512 and the allocated memory is wasted.
    So what care should I take while collecting the data spread across
    multiple buffers and sending to stack?


    Thanks,
    Sagar


  2. Re: netowrk device driver : issue while receiving packets spread over multiple buffers

    Sagar Borikar wrote:

    >
    > Hello,
    >
    > I am writing an ethernet driver for cadence enhanced MAC in FE mode.
    > The ethernet controller is having limitation that out of one frame it
    > can copy only 512 bytes in one buffer.
    > Hence the the received frame is distributed over multiple buffers.
    > So any frame which is more than 512 bytes will be in buffer pointed by
    > next receive buffer queue descriptor.
    > I am using NAPI mode in which when I am collecting the frame spread
    > across multiple buffers and assign it to a single sk_buff handed over
    > to stack, the data gets corrupt. And stack rejects the packet. One
    > solution is to make receive buffer length 1536 bytes(jumbo frames) or
    > 1518 bytes which is IEEE 802.2/3 standard. But the controller doesn't
    > accept the value greater than 512 and the allocated memory is wasted.
    > So what care should I take while collecting the data spread across
    > multiple buffers and sending to stack?
    >
    >
    > Thanks,
    > Sagar

    And you are not starting from an existing card driver why?
    --
    JosephKK
    Gegen dummheit kampfen die Gotter Selbst, vergebens.**
    --Schiller

+ Reply to Thread