Petri Savolainen(psavol) replied on github web page:
include/odp/api/spec/comp.h
line 30
@@ -0,0 +1,873 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP Compression
+ */
+
+#ifndef ODP_API_COMP_H_
+#define ODP_API_COMP_H_
+
+#include <odp/visibility_begin.h>
+#include <odp/api/support.h>
+#include <odp/api/packet.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @defgroup odp_compression ODP COMP
+ * ODP Compression is an API set to do compression+hash or decompression+hash
+ * operations on data. Hash is calculated on plaintext.
+ *
+ * if opcode = ODP_COMP_COMPRESS, then it will apply hash and then compress,
+ * if opcode = ODP_COMP_DECOMPRESS, then it will decompress and then apply
+ * hash.
Comment:
This is description of how de/-compression operation work. This should be
specified at operation documentation, and optimally only there. Otherwise, we
are in danger of this spec getting deprecated (== in conflict with operation
documentation) without noticing.
> Petri Savolainen(psavol) wrote:
> True, all types need to be odp_ prefixed. Also this type would be better to
> typedef and pull out (from inside of algo_param_t) since it's used in two
> places already.
>> Petri Savolainen(psavol) wrote:
>> As a side note: it might be logical, we might want to add `odp_support_t`
>> field to notify user if implementation supports stateful compression. I can
>> easily assume that there might be implementations implementing only
>> stateless compression.
>>> Petri Savolainen(psavol) wrote:
>>> odp_comp_alg_deflate_param, please.
>>>> Petri Savolainen(psavol) wrote:
>>>> Please check the see list. It mentions non-existing functions.
>>>>> Petri Savolainen(psavol) wrote:
>>>>> no result here
>>>>>> Petri Savolainen(psavol) wrote:
>>>>>> s/Else/Otherwise/
>>>>>>> Petri Savolainen(psavol) wrote:
>>>>>>> ... an error....
>>>>>>>> Petri Savolainen(psavol) wrote:
>>>>>>>> ... with valid pkt_out and pkt_in being ODP_PACKET_INVALID...
>>>>>>>>> Petri Savolainen(psavol) wrote:
>>>>>>>>> It is an error to call this api when session was created in
>>>>>>>>> ODP_COMP_ASYNC mode.
>>>>>>>>>> Petri Savolainen(psavol) wrote:
>>>>>>>>>> As said, single and multi versions are possible, but not as proposed
>>>>>>>>>> in this patch. Both versions should have the same param structure
>>>>>>>>>> and specification. Only difference would be pkt_in[] vs pkt_in,
>>>>>>>>>> pkt_out[] vs pkt_out, param[] vs. param ...
>>>>>>>>>>> Petri Savolainen(psavol) wrote:
>>>>>>>>>>> Then I propose to add a new API like
>>>>>>>>>>>
>>>>>>>>>>> odp_comp_compress_multi(const odp_packet_t pkt_in[], odp_packet_t
>>>>>>>>>>> pkt_out[], const odp_comp_compress_param_t param[], int num_pkt);
>>>>>>>>>>>
>>>>>>>>>>> which takes of handling multiple packets and retain current version
>>>>>>>>>>> for single packet handling.
>>>>>>>>>>>
>>>>>>>>>>> Thanks
>>>>>>>>>>>
>>>>>>>>>>> Shally
>>>>>>>>>>> @bala-manoharan
>>>>>>>>>>>> Petri Savolainen(psavol) wrote:
>>>>>>>>>>>> Results for both sync and async through result function:
>>>>>>>>>>>>
>>>>>>>>>>>> int odp_comp_result(odp_comp_packet_result_t *result, odp_packet_t
>>>>>>>>>>>> packet);
>>>>>>>>>>>>
>>>>>>>>>>>> OR have the results as output parameter. Results function is
>>>>>>>>>>>> needed any way for the async operation.
>>>>>>>>>>>>> Petri Savolainen(psavol) wrote:
>>>>>>>>>>>>> int odp_comp_compress(const odp_packet_t pkt_in[], odp_packet_t
>>>>>>>>>>>>> pkt_out[], const odp_comp_compress_param_t param[], int num_pkt);
>>>>>>>>>>>>>
>>>>>>>>>>>>> Single packet version may be also added, but is not necessary
>>>>>>>>>>>>> since couple of additional if-clauses does not significant
>>>>>>>>>>>>> overhead when compare CPU cycles of the entire comp operation.
>>>>>>>>>>>>>
>>>>>>>>>>>>> int odp_comp_compress_single(odp_packet_t pkt_in, odp_packet_t
>>>>>>>>>>>>> pkt_out, const odp_comp_compress_param_t param);
>>>>>>>>>>>>>
>>>>>>>>>>>>> The two prototypes would be the same except [] and num_pkt.
>>>>>>>>>>>>>
https://github.com/Linaro/odp/pull/156#discussion_r137501370
updated_at 2017-09-07 10:22:18