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.
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.
On Thu, Dec 18, 2014 at 8:56 AM, Taras Kondratiuk <
[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]>
>> ---
>> 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