diff options
author | Nicolas Morey-Chaisemartin <nmorey@kalray.eu> | 2015-07-15 18:19:10 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-07-16 13:47:53 +0300 |
commit | d13815e4bf303d1fa6b9a62251fd2d849642c66b (patch) | |
tree | 4a31df14f87035baa1e8ca4653fb77fc55570778 /platform/linux-generic/pktio/io_ops.c | |
parent | 31f5da88309e9c080600ff49178174a906af85f6 (diff) |
linux-generic: packet_io: use generic interface for pktio implementations
Each packet_io type now implements a pktio_if_ops_t structure which serves
as the only interface use by odp_packet_io.c.
The type of a device is retrieved by calling the pktio_XX open function in
order from the global pktio_if_ops struct and by stopping on the
first successful order.
As a result odp_pktio_type_t has been removed, and implementation can
be extended by just adding a new pktio_if_opts_t structure to pktio_if_opts
Signed-off-by: Clément Leger <cleger@kalray.eu>
Signed-off-by: Nicolas Morey-Chaisemartin <nmorey@kalray.eu>
Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic/pktio/io_ops.c')
-rw-r--r-- | platform/linux-generic/pktio/io_ops.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/linux-generic/pktio/io_ops.c b/platform/linux-generic/pktio/io_ops.c new file mode 100644 index 000000000..6cd3d003c --- /dev/null +++ b/platform/linux-generic/pktio/io_ops.c @@ -0,0 +1,19 @@ +/* Copyright (c) 2013, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp_packet_io_internal.h> + +/* Ops for all implementation of pktio. + * Order matters. The first implementation to setup successfully + * will be picked. + * Array must be NULL terminated */ +const pktio_if_ops_t * const pktio_if_ops[] = { + &loopback_pktio_ops, + &sock_mmap_pktio_ops, + &sock_mmsg_pktio_ops, + &sock_basic_pktio_ops, + NULL +}; |