[lng-odp-dpk,PATCHv3,01/24] linux-dpdk: clean up macros

Message ID 1492691794-24245-2-git-send-email-balakrishna.garapati@linaro.org
State New
Headers show
Series
  • porting & fixes after odp v1.14 merge
Related show

Commit Message

Krishna Garapati April 20, 2017, 12:36 p.m.
porting "commit-ID: c15da68b8dc3187c1929ff7d7705a0958856cbad"
from odp.

Signed-off-by: Balakrishna Garapati <balakrishna.garapati@linaro.org>
---
 platform/linux-dpdk/include/odp_packet_io_internal.h |  2 +-
 platform/linux-dpdk/odp_packet.c                     |  4 ++--
 platform/linux-dpdk/odp_pool.c                       | 16 ++++++++--------
 3 files changed, 11 insertions(+), 11 deletions(-)

Comments

Yi He April 21, 2017, 5:27 a.m. | #1
For this patch series:

Reviewed-and-tested-by: Yi He <yi.he@linaro.org>


On 20 April 2017 at 20:36, Balakrishna Garapati <
balakrishna.garapati@linaro.org> wrote:

> porting "commit-ID: c15da68b8dc3187c1929ff7d7705a0958856cbad"
> from odp.
>
> Signed-off-by: Balakrishna Garapati <balakrishna.garapati@linaro.org>
> ---
>  platform/linux-dpdk/include/odp_packet_io_internal.h |  2 +-
>  platform/linux-dpdk/odp_packet.c                     |  4 ++--
>  platform/linux-dpdk/odp_pool.c                       | 16 ++++++++--------
>  3 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/platform/linux-dpdk/include/odp_packet_io_internal.h
> b/platform/linux-dpdk/include/odp_packet_io_internal.h
> index b54e5a0..361ba50 100644
> --- a/platform/linux-dpdk/include/odp_packet_io_internal.h
> +++ b/platform/linux-dpdk/include/odp_packet_io_internal.h
> @@ -117,7 +117,7 @@ struct pktio_entry {
>
>  typedef union {
>         struct pktio_entry s;
> -       uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(struct
> pktio_entry))];
> +       uint8_t pad[ROUNDUP_CACHE_LINE_(sizeof(struct pktio_entry))];
>  } pktio_entry_t;
>
>  typedef struct {
> diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_
> packet.c
> index 4201da3..1decd69 100644
> --- a/platform/linux-dpdk/odp_packet.c
> +++ b/platform/linux-dpdk/odp_packet.c
> @@ -848,7 +848,7 @@ int odp_packet_align(odp_packet_t *pkt, uint32_t
> offset, uint32_t len,
>
>         if (seglen >= len) {
>                 misalign = align <= 1 ? 0 :
> -                       ODP_ALIGN_ROUNDUP(uaddr, align) - uaddr;
> +                       ROUNDUP_ALIGN(uaddr, align) - uaddr;
>                 if (misalign == 0)
>                         return 0;
>                 shift = align - misalign;
> @@ -858,7 +858,7 @@ int odp_packet_align(odp_packet_t *pkt, uint32_t
> offset, uint32_t len,
>                 shift  = len - seglen;
>                 uaddr -= shift;
>                 misalign = align <= 1 ? 0 :
> -                       ODP_ALIGN_ROUNDUP(uaddr, align) - uaddr;
> +                       ROUNDUP_ALIGN(uaddr, align) - uaddr;
>                 if (misalign)
>                         shift += align - misalign;
>         }
> diff --git a/platform/linux-dpdk/odp_pool.c b/platform/linux-dpdk/odp_
> pool.c
> index cf7b1db..b40d8aa 100644
> --- a/platform/linux-dpdk/odp_pool.c
> +++ b/platform/linux-dpdk/odp_pool.c
> @@ -343,7 +343,7 @@ odp_pool_t odp_pool_create(const char *name,
> odp_pool_param_t *params)
>                         /* Validate requested buffer alignment */
>                         if (buf_align > ODP_CONFIG_BUFFER_ALIGN_MAX ||
>                             buf_align !=
> -                           ODP_ALIGN_ROUNDDOWN_POWER_2(buf_align,
> buf_align)) {
> +                           ROUNDDOWN_POWER2(buf_align, buf_align)) {
>                                 UNLOCK(&pool->s.lock);
>                                 return ODP_POOL_INVALID;
>                         }
> @@ -355,8 +355,8 @@ odp_pool_t odp_pool_create(const char *name,
> odp_pool_param_t *params)
>                                 buf_align = ODP_CONFIG_BUFFER_ALIGN_MIN;
>
>                         if (params->buf.align != 0)
> -                               blk_size = ODP_ALIGN_ROUNDUP(blk_size,
> -                                                            buf_align);
> +                               blk_size = ROUNDUP_ALIGN(blk_size,
> +                                                        buf_align);
>
>                         hdr_size = sizeof(odp_buffer_hdr_t);
>                         CHECK_U16_OVERFLOW(blk_size);
> @@ -386,15 +386,15 @@ odp_pool_t odp_pool_create(const char *name,
> odp_pool_param_t *params)
>                         if ((max_len + blk_size) / blk_size >
> params->pkt.num)
>                                 blk_size = (max_len + params->pkt.num) /
>                                         params->pkt.num;
> -                       blk_size = ODP_ALIGN_ROUNDUP(headroom + blk_size +
> -                                                    tailroom, min_align);
> +                       blk_size = ROUNDUP_ALIGN(headroom + blk_size +
> +                                                tailroom, min_align);
>                         /* Segment size minus headroom might be rounded
> down by
>                          * the driver to the nearest multiple of 1024.
> Round it
>                          * up here to make sure the requested size still
> going
>                          * to fit there without segmentation.
>                          */
> -                       blk_size = ODP_ALIGN_ROUNDUP(blk_size - headroom,
> -                                                    min_seg_len) +
> headroom;
> +                       blk_size = ROUNDUP_ALIGN(blk_size - headroom,
> +                                                min_seg_len) + headroom;
>
>                         hdr_size = sizeof(odp_packet_hdr_t) +
>                                    params->pkt.uarea_size;
> @@ -425,7 +425,7 @@ odp_pool_t odp_pool_create(const char *name,
> odp_pool_param_t *params)
>                 }
>
>                 mb_ctor_arg.seg_buf_offset =
> -                       (uint16_t) ODP_CACHE_LINE_SIZE_ROUNDUP(hdr_size);
> +                       (uint16_t)ROUNDUP_CACHE_LINE(hdr_size);
>                 mb_ctor_arg.seg_buf_size = mbp_ctor_arg.pkt.mbuf_data_
> room_size;
>                 mb_ctor_arg.type = params->type;
>                 mb_size = mb_ctor_arg.seg_buf_offset +
> mb_ctor_arg.seg_buf_size;
> --
> 1.9.1
>
> _______________________________________________
> lng-odp-dpdk mailing list
> lng-odp-dpdk@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp-dpdk
>

Patch hide | download patch | download mbox

diff --git a/platform/linux-dpdk/include/odp_packet_io_internal.h b/platform/linux-dpdk/include/odp_packet_io_internal.h
index b54e5a0..361ba50 100644
--- a/platform/linux-dpdk/include/odp_packet_io_internal.h
+++ b/platform/linux-dpdk/include/odp_packet_io_internal.h
@@ -117,7 +117,7 @@  struct pktio_entry {
 
 typedef union {
 	struct pktio_entry s;
-	uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(struct pktio_entry))];
+	uint8_t pad[ROUNDUP_CACHE_LINE_(sizeof(struct pktio_entry))];
 } pktio_entry_t;
 
 typedef struct {
diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c
index 4201da3..1decd69 100644
--- a/platform/linux-dpdk/odp_packet.c
+++ b/platform/linux-dpdk/odp_packet.c
@@ -848,7 +848,7 @@  int odp_packet_align(odp_packet_t *pkt, uint32_t offset, uint32_t len,
 
 	if (seglen >= len) {
 		misalign = align <= 1 ? 0 :
-			ODP_ALIGN_ROUNDUP(uaddr, align) - uaddr;
+			ROUNDUP_ALIGN(uaddr, align) - uaddr;
 		if (misalign == 0)
 			return 0;
 		shift = align - misalign;
@@ -858,7 +858,7 @@  int odp_packet_align(odp_packet_t *pkt, uint32_t offset, uint32_t len,
 		shift  = len - seglen;
 		uaddr -= shift;
 		misalign = align <= 1 ? 0 :
-			ODP_ALIGN_ROUNDUP(uaddr, align) - uaddr;
+			ROUNDUP_ALIGN(uaddr, align) - uaddr;
 		if (misalign)
 			shift += align - misalign;
 	}
diff --git a/platform/linux-dpdk/odp_pool.c b/platform/linux-dpdk/odp_pool.c
index cf7b1db..b40d8aa 100644
--- a/platform/linux-dpdk/odp_pool.c
+++ b/platform/linux-dpdk/odp_pool.c
@@ -343,7 +343,7 @@  odp_pool_t odp_pool_create(const char *name, odp_pool_param_t *params)
 			/* Validate requested buffer alignment */
 			if (buf_align > ODP_CONFIG_BUFFER_ALIGN_MAX ||
 			    buf_align !=
-			    ODP_ALIGN_ROUNDDOWN_POWER_2(buf_align, buf_align)) {
+			    ROUNDDOWN_POWER2(buf_align, buf_align)) {
 				UNLOCK(&pool->s.lock);
 				return ODP_POOL_INVALID;
 			}
@@ -355,8 +355,8 @@  odp_pool_t odp_pool_create(const char *name, odp_pool_param_t *params)
 				buf_align = ODP_CONFIG_BUFFER_ALIGN_MIN;
 
 			if (params->buf.align != 0)
-				blk_size = ODP_ALIGN_ROUNDUP(blk_size,
-							     buf_align);
+				blk_size = ROUNDUP_ALIGN(blk_size,
+							 buf_align);
 
 			hdr_size = sizeof(odp_buffer_hdr_t);
 			CHECK_U16_OVERFLOW(blk_size);
@@ -386,15 +386,15 @@  odp_pool_t odp_pool_create(const char *name, odp_pool_param_t *params)
 			if ((max_len + blk_size) / blk_size > params->pkt.num)
 				blk_size = (max_len + params->pkt.num) /
 					params->pkt.num;
-			blk_size = ODP_ALIGN_ROUNDUP(headroom + blk_size +
-						     tailroom, min_align);
+			blk_size = ROUNDUP_ALIGN(headroom + blk_size +
+						 tailroom, min_align);
 			/* Segment size minus headroom might be rounded down by
 			 * the driver to the nearest multiple of 1024. Round it
 			 * up here to make sure the requested size still going
 			 * to fit there without segmentation.
 			 */
-			blk_size = ODP_ALIGN_ROUNDUP(blk_size - headroom,
-						     min_seg_len) + headroom;
+			blk_size = ROUNDUP_ALIGN(blk_size - headroom,
+						 min_seg_len) + headroom;
 
 			hdr_size = sizeof(odp_packet_hdr_t) +
 				   params->pkt.uarea_size;
@@ -425,7 +425,7 @@  odp_pool_t odp_pool_create(const char *name, odp_pool_param_t *params)
 		}
 
 		mb_ctor_arg.seg_buf_offset =
-			(uint16_t) ODP_CACHE_LINE_SIZE_ROUNDUP(hdr_size);
+			(uint16_t)ROUNDUP_CACHE_LINE(hdr_size);
 		mb_ctor_arg.seg_buf_size = mbp_ctor_arg.pkt.mbuf_data_room_size;
 		mb_ctor_arg.type = params->type;
 		mb_size = mb_ctor_arg.seg_buf_offset + mb_ctor_arg.seg_buf_size;