On 10/13/2015 16:50, Nicolas Morey-Chaisemartin wrote:

On 10/09/2015 01:59 PM, Maxim Uvarov wrote:
Signed-off-by: Maxim Uvarov <maxim.uva...@linaro.org>
---
  platform/linux-generic/Makefile.am                 |   2 +
  .../linux-generic/include/odp_buffer_internal.h    |   3 +
  .../linux-generic/include/odp_packet_io_internal.h |  35 +
  .../include/odp_packet_io_ipc_internal.h           |  51 ++
  platform/linux-generic/include/odp_shm_internal.h  |  20 +
  platform/linux-generic/odp_packet_io.c             |   1 +
  platform/linux-generic/odp_pool.c                  |  11 +-
  platform/linux-generic/odp_shared_memory.c         |  10 +-
  platform/linux-generic/pktio/io_ops.c              |   1 +
  platform/linux-generic/pktio/ipc.c                 | 720 +++++++++++++++++++++
  platform/linux-generic/pktio/ring.c                |   1 +
  11 files changed, 851 insertions(+), 4 deletions(-)
  create mode 100644 platform/linux-generic/include/odp_packet_io_ipc_internal.h
  create mode 100644 platform/linux-generic/include/odp_shm_internal.h
  create mode 100644 platform/linux-generic/pktio/ipc.c
  create mode 120000 platform/linux-generic/pktio/ring.c

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index b9ed3b0..71353dd 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -151,9 +151,11 @@ __LIB__libodp_la_SOURCES = \
                           odp_packet_flags.c \
                           odp_packet_io.c \
                           pktio/io_ops.c \
+                          pktio/ipc.c \
                           pktio/loop.c \
                           pktio/socket.c \
                           pktio/socket_mmap.c \
+                          pktio/ring.c \
                           odp_pool.c \
                           odp_queue.c \
                           odp_rwlock.c \
diff --git a/platform/linux-generic/include/odp_buffer_internal.h 
b/platform/linux-generic/include/odp_buffer_internal.h
index 4cacca1..a078e52 100644
--- a/platform/linux-generic/include/odp_buffer_internal.h
+++ b/platform/linux-generic/include/odp_buffer_internal.h
@@ -132,6 +132,9 @@ struct odp_buffer_hdr_t {
        uint32_t                 uarea_size; /* size of user area */
        uint32_t                 segcount;   /* segment count */
        uint32_t                 segsize;    /* segment size */
+       /* ipc mapped process can not walk over pointers,
+        * offset has to be used */
+       uint64_t                 ipc_addr_offset[ODP_BUFFER_MAX_SEG];
        void                    *addr[ODP_BUFFER_MAX_SEG]; /* block addrs */
        uint64_t                 order;      /* sequence for ordered queues */
        queue_entry_t           *origin_qe;  /* ordered queue origin */
I haven't been through everything yet but should this be an union with the addr 
?
The odp_buffer_hdr_t is already quite large as it is.

Nicolas
Unfortunately that can not be union. Because of pool can be used by current process and also with other process which mapped this pool I will have the same code in new version until I will find better solution to lower this struct size. Might be we don't need u64 for offsets here.

Maxim.


_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to