On Thu, Dec 18, 2014 at 09:27:32PM +0000, Bill Fischofer wrote:
> The MMAP code here as far as I can tell is never called, so I'm not sure how 
> it gets used.  Perhaps Ciprian can comment.
> 

MMAP is used if the platform (/kernel) supports it, I expect it's
actually the most commonly used of the 3 supported methods.

odp_pktio_open() will try each method in order MMAP->MMSG->BASIC until
one succeeds (unless they're explicitly disabled via an environment
variable).

> For the RAW code, on RX the effect is we can never receive a packet larger 
> than one segment.  So there's no way to even notice we have a problem. If a 
> packet tries to create a large packet itself (without having first received 
> it) then only the first segment would TX, meaning it would be discarded by 
> whoever gets it as an incomplete/damaged packet.  I'd rather just accept that 
> as a restriction for now ("results are undefined") and figure out how to 
> address this properly.

I think dropping frames larger than one segment is OK for now, not sure
about "undefined" though.

MMAP needs to be reworked a bit at some point, it uses a fixed maximum
frame length of 2048 bytes regardless of the buffer length used by the
application.

--
Stuart.

> 
> On Thu, Dec 18, 2014 at 8:56 AM, Taras Kondratiuk 
> <[email protected]<mailto:[email protected]>> wrote:
> On 12/18/2014 01:16 AM, Bill Fischofer wrote:
> Add segmented packet I/O support via sockets. RAW sockets limited to
> single segment.
> 
> Signed-off-by: Bill Fischofer 
> <[email protected]<mailto:[email protected]>>
> ---
>   platform/linux-generic/odp_packet_socket.c | 33 
> +++++++++++++++++-------------
>   1 file changed, 19 insertions(+), 14 deletions(-)
> 
> diff --git a/platform/linux-generic/odp_packet_socket.c 
> b/platform/linux-generic/odp_packet_socket.c
> index 2849065..340da88 100644
> --- a/platform/linux-generic/odp_packet_socket.c
> +++ b/platform/linux-generic/odp_packet_socket.c
> @@ -321,7 +321,8 @@ int recv_pkt_sock_basic(pkt_sock_t *const pkt_sock,
> 
>         for (i = 0; i < len; i++) {
>                 if (odp_likely(pkt == ODP_PACKET_INVALID)) {
> -                       pkt = _odp_packet_alloc(pkt_sock->pool);
> +                       pkt = odp_packet_alloc(pkt_sock->pool,
> +                                              pkt_sock->max_frame_len);
> 
> In seems only MMAP type supports segmented buffers as it uses
> odp_packet_copydata_*() API. RAW and MMSG operate only with a first
> segment. Should we add assert here to check that packet is unsegmented?
> 
> 
>                         if (odp_unlikely(pkt == ODP_PACKET_INVALID))
>                                 break;
>                 }
> 
> _______________________________________________
> lng-odp mailing list
> [email protected]
> http://lists.linaro.org/mailman/listinfo/lng-odp



_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to