This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, api-next has been updated via 2722279b31b075586551801eb2860687ff966ea8 (commit) via 837258c13bfbdd378d0d4fff6a2173a187d6e365 (commit) via 8d99a23c4f3adaee2df33985b9257c311708218a (commit) from a90a776079d1027bc360dff0e748a641ede0126e (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 2722279b31b075586551801eb2860687ff966ea8 Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Aug 9 14:11:53 2018 +0300
validation: packet: add packet subtype tests
Check that packet subtype is correct.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index 07f1d1fa..5b395c2a 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -225,6 +225,7 @@ static int alg_packet_op(odp_packet_t pkt, CU_ASSERT(ODP_EVENT_PACKET == odp_event_types(odp_packet_to_event(pkt), &subtype)); CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == subtype); + CU_ASSERT(odp_packet_subtype(pkt) == ODP_EVENT_PACKET_CRYPTO);
rc = odp_crypto_result(&result, pkt); if (rc < 0) { @@ -298,6 +299,7 @@ static int alg_packet_op_enq(odp_packet_t pkt, CU_ASSERT(ODP_EVENT_PACKET == odp_event_types(odp_packet_to_event(pkt), &subtype)); CU_ASSERT(ODP_EVENT_PACKET_CRYPTO == subtype); + CU_ASSERT(odp_packet_subtype(pkt) == ODP_EVENT_PACKET_CRYPTO);
rc = odp_crypto_result(&result, pkt); if (rc < 0) { diff --git a/test/validation/api/ipsec/ipsec.c b/test/validation/api/ipsec/ipsec.c index 31a6f9b5..be47d109 100644 --- a/test/validation/api/ipsec/ipsec.c +++ b/test/validation/api/ipsec/ipsec.c @@ -502,6 +502,7 @@ static int ipsec_send_in_one(const ipsec_test_part *part, pkto, &num_out, ¶m)); CU_ASSERT_EQUAL(num_out, part->out_pkt); + CU_ASSERT(odp_packet_subtype(*pkto) == ODP_EVENT_PACKET_IPSEC); } else if (ODP_IPSEC_OP_MODE_ASYNC == suite_context.inbound_op_mode) { CU_ASSERT_EQUAL(1, odp_ipsec_in_enq(&pkt, 1, ¶m));
@@ -517,6 +518,8 @@ static int ipsec_send_in_one(const ipsec_test_part *part, odp_event_types(event, &subtype)); CU_ASSERT_EQUAL(ODP_EVENT_PACKET_IPSEC, subtype); pkto[i] = odp_ipsec_packet_from_event(event); + CU_ASSERT(odp_packet_subtype(pkto[i]) == + ODP_EVENT_PACKET_IPSEC); } } else { odp_queue_t queue; @@ -555,7 +558,10 @@ static int ipsec_send_in_one(const ipsec_test_part *part, subtype); CU_ASSERT(!part->out[i].status.error.sa_lookup);
- pkto[i++] = odp_ipsec_packet_from_event(ev); + pkto[i] = odp_ipsec_packet_from_event(ev); + CU_ASSERT(odp_packet_subtype(pkto[i]) == + ODP_EVENT_PACKET_IPSEC); + i++; continue; } } @@ -586,6 +592,8 @@ static int ipsec_send_out_one(const ipsec_test_part *part, pkto, &num_out, ¶m)); CU_ASSERT_EQUAL(num_out, part->out_pkt); + CU_ASSERT(odp_packet_subtype(*pkto) == + ODP_EVENT_PACKET_IPSEC); } else if (ODP_IPSEC_OP_MODE_ASYNC == suite_context.outbound_op_mode) { CU_ASSERT_EQUAL(1, odp_ipsec_out_enq(&pkt, 1, ¶m));
@@ -601,6 +609,8 @@ static int ipsec_send_out_one(const ipsec_test_part *part, odp_event_types(event, &subtype)); CU_ASSERT_EQUAL(ODP_EVENT_PACKET_IPSEC, subtype); pkto[i] = odp_ipsec_packet_from_event(event); + CU_ASSERT(odp_packet_subtype(pkto[i]) == + ODP_EVENT_PACKET_IPSEC); } } else { struct odp_ipsec_out_inline_param_t inline_param; @@ -657,7 +667,10 @@ static int ipsec_send_out_one(const ipsec_test_part *part, subtype); CU_ASSERT(part->out[i].status.error.all);
- pkto[i++] = odp_ipsec_packet_from_event(ev); + pkto[i] = odp_ipsec_packet_from_event(ev); + CU_ASSERT(odp_packet_subtype(pkto[i]) == + ODP_EVENT_PACKET_IPSEC); + i++; continue; } } diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index a564c002..fa7ce8b8 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -319,6 +319,7 @@ static void packet_test_alloc_free(void) CU_ASSERT(odp_event_types(odp_packet_to_event(packet), &subtype) == ODP_EVENT_PACKET); CU_ASSERT(subtype == ODP_EVENT_PACKET_BASIC); + CU_ASSERT(odp_packet_subtype(packet) == ODP_EVENT_PACKET_BASIC); CU_ASSERT(odp_packet_to_u64(packet) != odp_packet_to_u64(ODP_PACKET_INVALID));
@@ -402,6 +403,8 @@ static void packet_test_alloc_free_multi(void) &subtype) == ODP_EVENT_PACKET); CU_ASSERT(subtype == ODP_EVENT_PACKET_BASIC); + CU_ASSERT(odp_packet_subtype(packet[i]) == + ODP_EVENT_PACKET_BASIC); CU_ASSERT(odp_packet_to_u64(packet[i]) != odp_packet_to_u64(ODP_PACKET_INVALID));
commit 837258c13bfbdd378d0d4fff6a2173a187d6e365 Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Aug 9 11:44:20 2018 +0300
linux-gen: packet: implementation subtype api
Add inlined implementation of the new subtype API call and use that internally.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h index 9a285fe4..ca3abbfa 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inline_types.h @@ -45,6 +45,7 @@ typedef struct _odp_packet_inline_offset_t { uint16_t timestamp; uint16_t input_flags; uint16_t flags; + uint16_t subtype;
} _odp_packet_inline_offset_t;
diff --git a/platform/linux-generic/include/odp/api/plat/packet_inlines.h b/platform/linux-generic/include/odp/api/plat/packet_inlines.h index e2c32728..ec5beb81 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inlines.h @@ -19,6 +19,7 @@ #include <odp/api/hints.h> #include <odp/api/time.h> #include <odp/api/abi/buffer.h> +#include <odp/api/abi/event.h>
#include <odp/api/plat/packet_inline_types.h> #include <odp/api/plat/pool_inline_types.h> @@ -64,6 +65,7 @@ #define odp_packet_to_event __odp_packet_to_event #define odp_packet_from_event_multi __odp_packet_from_event_multi #define odp_packet_to_event_multi __odp_packet_to_event_multi + #define odp_packet_subtype __odp_packet_subtype #else #undef _ODP_INLINE #define _ODP_INLINE @@ -355,6 +357,11 @@ _ODP_INLINE void odp_packet_to_event_multi(const odp_packet_t pkt[], ev[i] = odp_packet_to_event(pkt[i]); }
+_ODP_INLINE odp_event_subtype_t odp_packet_subtype(odp_packet_t pkt) +{ + return (odp_event_subtype_t)_odp_pkt_get(pkt, int8_t, subtype); +} + /** @endcond */
#endif diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index cd2db2ec..9b995c61 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -155,11 +155,6 @@ static inline seg_entry_t *seg_entry_last(odp_packet_hdr_t *hdr) return &last->buf_hdr.seg[last_seg]; }
-static inline odp_event_subtype_t packet_subtype(odp_packet_t pkt) -{ - return packet_hdr(pkt)->subtype; -} - static inline void packet_subtype_set(odp_packet_t pkt, int ev) { packet_hdr(pkt)->subtype = ev; diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c index fa20af5f..bb378528 100644 --- a/platform/linux-generic/odp_event.c +++ b/platform/linux-generic/odp_event.c @@ -19,6 +19,7 @@
/* Inlined API functions */ #include <odp/api/plat/event_inlines.h> +#include <odp/api/plat/packet_inlines.h>
odp_event_subtype_t odp_event_subtype(odp_event_t event) { @@ -26,7 +27,7 @@ odp_event_subtype_t odp_event_subtype(odp_event_t event) ODP_EVENT_PACKET) return ODP_EVENT_NO_SUBTYPE;
- return packet_subtype(odp_packet_from_event(event)); + return odp_packet_subtype(odp_packet_from_event(event)); }
odp_event_type_t odp_event_types(odp_event_t event, @@ -36,7 +37,7 @@ odp_event_type_t odp_event_types(odp_event_t event, odp_event_type_t event_type = _odp_buffer_event_type(buf);
*subtype = event_type == ODP_EVENT_PACKET ? - packet_subtype(odp_packet_from_event(event)) : + odp_packet_subtype(odp_packet_from_event(event)) : ODP_EVENT_NO_SUBTYPE;
return event_type; diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 11f8bd43..7bb93e1e 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -50,7 +50,8 @@ const _odp_packet_inline_offset_t ODP_ALIGNED_CACHE _odp_packet_inline = { .flow_hash = offsetof(odp_packet_hdr_t, flow_hash), .timestamp = offsetof(odp_packet_hdr_t, timestamp), .input_flags = offsetof(odp_packet_hdr_t, p.input_flags), - .flags = offsetof(odp_packet_hdr_t, p.flags) + .flags = offsetof(odp_packet_hdr_t, p.flags), + .subtype = offsetof(odp_packet_hdr_t, subtype)
};
diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index faaef3ab..4c0cba3f 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -18,6 +18,7 @@ #include <odp/api/hints.h> #include <odp/api/plat/byteorder_inlines.h> #include <odp_queue_if.h> +#include <odp/api/plat/packet_inlines.h>
#include <protocols/eth.h> #include <protocols/ip.h> @@ -309,7 +310,7 @@ static int loopback_send(pktio_entry_t *pktio_entry, int index ODP_UNUSED, for (i = 0; i < nb_tx; ++i) { odp_ipsec_packet_result_t result;
- if (packet_subtype(pkt_tbl[i]) == + if (odp_packet_subtype(pkt_tbl[i]) == ODP_EVENT_PACKET_IPSEC && pktio_entry->s.config.outbound_ipsec) {
commit 8d99a23c4f3adaee2df33985b9257c311708218a Author: Petri Savolainen petri.savolainen@linaro.org Date: Thu Aug 9 10:59:25 2018 +0300
api: packet: add subtype call
This call is useful when packet subtype needs to be checked sometime after an event has been converted into a packet. The first application stage (receiving and converting events) does not have to record packet subtype for following application stages that process only packets, not events.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 66665e12..78e519ac 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -224,6 +224,19 @@ typedef enum odp_packet_chksum_status_t {
} odp_packet_chksum_status_t;
+/** + * Event subtype of a packet + * + * Returns the subtype of a packet event. Subtype tells if the packet contains + * only basic metadata (ODP_EVENT_PACKET_BASIC) or in addition to that some + * specific metadata (e.g. ODP_EVENT_PACKET_CRYPTO or ODP_EVENT_PACKET_IPSEC). + * + * @param packet Packet handle + * + * @return Packet subtype + */ +odp_event_subtype_t odp_packet_subtype(odp_packet_t packet); + /* * * Alloc and free
-----------------------------------------------------------------------
Summary of changes: include/odp/api/spec/packet.h | 13 +++++++++++++ .../include/odp/api/plat/packet_inline_types.h | 1 + .../linux-generic/include/odp/api/plat/packet_inlines.h | 7 +++++++ platform/linux-generic/include/odp_packet_internal.h | 5 ----- platform/linux-generic/odp_event.c | 5 +++-- platform/linux-generic/odp_packet.c | 3 ++- platform/linux-generic/pktio/loop.c | 3 ++- test/validation/api/crypto/odp_crypto_test_inp.c | 2 ++ test/validation/api/ipsec/ipsec.c | 17 +++++++++++++++-- test/validation/api/packet/packet.c | 3 +++ 10 files changed, 48 insertions(+), 11 deletions(-)
hooks/post-receive