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

Reply via email to