diff mbox

[API-NEXT,PATCHv2] api: packet: update description for odp_packet_align()

Message ID 1461680243-2101-1-git-send-email-bill.fischofer@linaro.org
State Accepted
Commit 6bc64a5a2050693b6cd5ddf00550f9b90b60c048
Headers show

Commit Message

Bill Fischofer April 26, 2016, 2:17 p.m. UTC
Minor rewording for clarity and to specify 0 as a don't care value for
the align parameter and to define behavior on excessive alignment requests.

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 include/odp/api/spec/packet.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Maxim Uvarov April 26, 2016, 3:02 p.m. UTC | #1
Merged,

added Petri sign-off, for OK works from previous version.

Maxim.

On 04/26/16 17:17, Bill Fischofer wrote:
> Minor rewording for clarity and to specify 0 as a don't care value for
> the align parameter and to define behavior on excessive alignment requests.
>
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>   include/odp/api/spec/packet.h | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
> index de128df..5e84abb 100644
> --- a/include/odp/api/spec/packet.h
> +++ b/include/odp/api/spec/packet.h
> @@ -646,11 +646,11 @@ int odp_packet_rem_data(odp_packet_t *pkt, uint32_t offset, uint32_t len);
>    * Align packet data
>    *
>    * Modify packet data alignment so that 'len' bytes between 'offset' and
> - * 'offset' plus 'len' are contiguous in memory and start in minimum alignment
> + * 'offset' plus 'len' are contiguous in memory and have a minimum alignment
>    * of 'align' bytes.
>    *
>    * A successful operation overwrites the packet handle with a new handle, which
> - * application must use as the reference to the packet instead of the old
> + * the application must use as the reference to the packet instead of the old
>    * handle. Depending on the implementation, the old and new handles may be
>    * equal.
>    *
> @@ -667,7 +667,11 @@ int odp_packet_rem_data(odp_packet_t *pkt, uint32_t offset, uint32_t len);
>    * @param offset        Byte offset of the contiguous area
>    * @param len           Byte length of the contiguous area (0 ... packet_len)
>    * @param align         Minimum byte alignment of the contiguous area.
> - *                      Implementation rounds up to nearest power of two.
> + *                      Valid values are powers of 2. Use 0 to indicate no
> + *                      special alignment requirement. All implementations
> + *                      support alignments of up to at least 32 bytes. Request
> + *                      will fail if requested alignment exceeds implementation
> + *                      limits.
>    *
>    * @retval 0   Operation successful, old pointers remain valid
>    * @retval >0  Operation successful, old pointers need to be updated
diff mbox

Patch

diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
index de128df..5e84abb 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -646,11 +646,11 @@  int odp_packet_rem_data(odp_packet_t *pkt, uint32_t offset, uint32_t len);
  * Align packet data
  *
  * Modify packet data alignment so that 'len' bytes between 'offset' and
- * 'offset' plus 'len' are contiguous in memory and start in minimum alignment
+ * 'offset' plus 'len' are contiguous in memory and have a minimum alignment
  * of 'align' bytes.
  *
  * A successful operation overwrites the packet handle with a new handle, which
- * application must use as the reference to the packet instead of the old
+ * the application must use as the reference to the packet instead of the old
  * handle. Depending on the implementation, the old and new handles may be
  * equal.
  *
@@ -667,7 +667,11 @@  int odp_packet_rem_data(odp_packet_t *pkt, uint32_t offset, uint32_t len);
  * @param offset        Byte offset of the contiguous area
  * @param len           Byte length of the contiguous area (0 ... packet_len)
  * @param align         Minimum byte alignment of the contiguous area.
- *                      Implementation rounds up to nearest power of two.
+ *                      Valid values are powers of 2. Use 0 to indicate no
+ *                      special alignment requirement. All implementations
+ *                      support alignments of up to at least 32 bytes. Request
+ *                      will fail if requested alignment exceeds implementation
+ *                      limits.
  *
  * @retval 0   Operation successful, old pointers remain valid
  * @retval >0  Operation successful, old pointers need to be updated