[ovs-dev] [PATCH 1/9] netdev: Extend rx_recv to pass multiple packets.

Ben Pfaff blp at nicira.com
Wed Mar 19 03:59:23 UTC 2014


On Tue, Mar 18, 2014 at 08:22:00PM -0700, Pravin Shelar wrote:
> On Tue, Mar 18, 2014 at 5:01 PM, Ben Pfaff <blp at nicira.com> wrote:
> > On Tue, Mar 18, 2014 at 01:53:06PM -0700, Pravin wrote:
> >> DPDK can receive multiple packets but current netdev API does
> >> not allow that.  Following patch allows dpif-netdev receive batch
> >> of packet in a rx_recv() call for any netdev port.  This will be
> >> used by dpdk-netdev.
> >>
> >> Signed-off-by: Pravin B Shelar <pshelar at nicira.com>
> >
> > I didn't fully review this since Jarno already did, but I have a few
> > comments to add to Jarno's.
> >
> > +    /* Attempts to receive batch of packets from 'rx' and place array of pointers
> > +     * into '*pkt'. netdev is responsible for allocating buffers.
> > +     * '*cnt' points to packet count for given batch. Once packets are returned
> > +     * to caller, netdev should give up ownership of ofbpuf data.
> >
> > I think that this means that '*cnt' is used on input to indicate the
> > size of the array and on output to indicate the number of packets.  If
> > so, then I'd prefer to use separate parameters for that, just because
> > I often find this kind of interface awkward.
> >
> *cnt only returns packet count. All caller are expected to pass array
> of size MAX_RX_BATCH. I will document it.

I see, thanks, that will make the API clear.



More information about the dev mailing list