From patchwork Tue Jan 30 16:00:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126270 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp3490127ljd; Tue, 30 Jan 2018 08:06:04 -0800 (PST) X-Google-Smtp-Source: AH8x224h0NH28ltlCuHHLobukkrXytZgUABLA+ZBHcJLp/8PuY00EYgu8Rp1PS8BChIJAgHwc5P+ X-Received: by 10.237.61.66 with SMTP id h2mr46570427qtf.268.1517328363939; Tue, 30 Jan 2018 08:06:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517328363; cv=none; d=google.com; s=arc-20160816; b=Hm+k06NMApk+XVIUSLJ8j/udXdpSEZKACs8XWhmDpHq+WoWPXR06MIKD9PRJK4ff6b MyBFiBuwXHwSuoPhkhwBad6+wajPoMyRGmMWkixTeizwu0YnFX/acSFq51cmoF4YrNql wh7WT+HiWHUpJCGGC8wTEeIRTAqeuw/aQw5DTACJ3lHDLqznuoV2lN/IA8BeCDiEUbw3 ibUDFuZyCqLy1rC3Ng7nEZkKz/pk5rEF7/YXrf0xK2d9feBnhFcyI5irLF4F7H0ql+/t 21H5N57nA30NErmtR+aZ2N5r56/noC0YG26xtL6cMKMUicb+pPUa+Q9M7Ifv8EEVkxL6 zEXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=CFcc7HJPnyTSue+9OH36ly1PlxpZte5vMo0NPRwMYh0=; b=zUpBtMYXiNZbB0h1rjorUthHwDawTP3qfCRYUP+B2a0X2iHRcVdKeZ51iiMjLhjaMq CvT7KhJlF8x25MzAZVxW7And4LSoH3n1NLPXR2UhsQY1OgGwCyKgi6XzGdHcRqnjLscl I5faa6gs5sFrqDwrh0Fj86xWrcvPY6ByvKQX70kjuX2J4XkNmDF6aaA1r7s3AkxJJODW WBLkL/72/c3JiAeBOT5uUvv+lkDKdp5bEGgZ+RlHiqLog6M4c433DHSPc5pFmMEpYsU5 qOjSwU4e6n74oHcpLApNdES4JoMxEtHI7ybElbic79tUAZHokvj+JEG7mRdqmRzWJr1A N9Ug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id m8si4732468qte.189.2018.01.30.08.06.03; Tue, 30 Jan 2018 08:06:03 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 96CC861763; Tue, 30 Jan 2018 16:06:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C482161741; Tue, 30 Jan 2018 16:01:01 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 7BF6561527; Tue, 30 Jan 2018 16:00:25 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id A197A60A6E for ; Tue, 30 Jan 2018 16:00:16 +0000 (UTC) Received: from mxback13j.mail.yandex.net (mxback13j.mail.yandex.net [IPv6:2a02:6b8:0:1619::88]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 0DDF01843B7 for ; Tue, 30 Jan 2018 19:00:15 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback13j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 2spVxGpYOV-0EXOGDtJ; Tue, 30 Jan 2018 19:00:14 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Nz8CQ597Mi-0EROJla6; Tue, 30 Jan 2018 19:00:14 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 30 Jan 2018 19:00:03 +0300 Message-Id: <1517328009-16379-6-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517328009-16379-1-git-send-email-odpbot@yandex.ru> References: <1517328009-16379-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 437 Subject: [lng-odp] [PATCH v1 5/11] linux-gen: packet: remove odp_packet_hdr function X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Use only one function (packet_hdr) in handle to header pointer conversion. odp_packet_hdr is bad name for an implementation internal function as API function prefix is odp_packet_. Signed-off-by: Petri Savolainen --- /** Email created from pull request 437 (psavol:master-packet-optim) ** https://github.com/Linaro/odp/pull/437 ** Patch: https://github.com/Linaro/odp/pull/437.patch ** Base sha: b95ccd3db6eeb7358a877541747e06354429acdd ** Merge commit sha: ab7875c186fe80cfe103c5be5634b0eda312aed4 **/ .../include/odp/api/plat/packet_inlines.h | 5 ----- .../linux-generic/include/odp_packet_internal.h | 8 ++++---- platform/linux-generic/odp_crypto.c | 4 ++-- platform/linux-generic/odp_ipsec.c | 8 ++++---- platform/linux-generic/odp_packet.c | 10 +++++----- platform/linux-generic/odp_packet_flags.c | 22 +++++++++++----------- platform/linux-generic/odp_packet_io.c | 4 ++-- platform/linux-generic/pktio/dpdk.c | 12 ++++++------ platform/linux-generic/pktio/ipc.c | 14 +++++++------- platform/linux-generic/pktio/loop.c | 2 +- platform/linux-generic/pktio/netmap.c | 2 +- platform/linux-generic/pktio/pcap.c | 2 +- platform/linux-generic/pktio/socket.c | 2 +- platform/linux-generic/pktio/socket_mmap.c | 2 +- platform/linux-generic/pktio/tap.c | 2 +- 15 files changed, 47 insertions(+), 52 deletions(-) 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 90e205fd4..dee8f71ce 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inlines.h @@ -228,11 +228,6 @@ static inline void _odp_packet_prefetch(odp_packet_t pkt, uint32_t offset, (void)pkt; (void)offset; (void)len; } -static inline odp_buffer_t packet_to_buffer(odp_packet_t pkt) -{ - return (odp_buffer_t)pkt; -} - static inline int _odp_packet_copy_from_mem(odp_packet_t pkt, uint32_t offset, uint32_t len, const void *src) { diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 32e41d7f5..89009a021 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -169,7 +169,7 @@ typedef struct { /** * Return the packet header */ -static inline odp_packet_hdr_t *odp_packet_hdr(odp_packet_t pkt) +static inline odp_packet_hdr_t *packet_hdr(odp_packet_t pkt) { return (odp_packet_hdr_t *)(uintptr_t)pkt; } @@ -181,7 +181,7 @@ static inline odp_packet_t packet_handle(odp_packet_hdr_t *pkt_hdr) static inline odp_buffer_hdr_t *packet_to_buf_hdr(odp_packet_t pkt) { - return &odp_packet_hdr(pkt)->buf_hdr; + return &packet_hdr(pkt)->buf_hdr; } static inline odp_packet_t packet_from_buf_hdr(odp_buffer_hdr_t *buf_hdr) @@ -201,12 +201,12 @@ static inline seg_entry_t *seg_entry_last(odp_packet_hdr_t *hdr) static inline odp_event_subtype_t packet_subtype(odp_packet_t pkt) { - return odp_packet_hdr(pkt)->subtype; + return packet_hdr(pkt)->subtype; } static inline void packet_subtype_set(odp_packet_t pkt, int ev) { - odp_packet_hdr(pkt)->subtype = ev; + packet_hdr(pkt)->subtype = ev; } /** diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 8ae484fd8..325a9d066 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -1434,7 +1434,7 @@ odp_event_t odp_crypto_packet_to_event(odp_packet_t pkt) static odp_crypto_packet_result_t *get_op_result_from_packet(odp_packet_t pkt) { - odp_packet_hdr_t *hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *hdr = packet_hdr(pkt); return &hdr->crypto_op_result; } @@ -1520,7 +1520,7 @@ int odp_crypto_int(odp_packet_t pkt_in, (rc_cipher == ODP_CRYPTO_ALG_ERR_NONE) && (rc_auth == ODP_CRYPTO_ALG_ERR_NONE); - pkt_hdr = odp_packet_hdr(out_pkt); + pkt_hdr = packet_hdr(out_pkt); pkt_hdr->p.error_flags.crypto_err = !op_result->ok; /* Synchronous, simply return results */ diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index 521627f1d..586653d4e 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -158,7 +158,7 @@ static odp_ipsec_packet_result_t *ipsec_pkt_result(odp_packet_t packet) ODP_ASSERT(ODP_EVENT_PACKET_IPSEC == odp_event_subtype(odp_packet_to_event(packet))); - return &odp_packet_hdr(packet)->ipsec_ctx; + return &packet_hdr(packet)->ipsec_ctx; } static inline int _odp_ipv4_csum(odp_packet_t pkt, @@ -829,7 +829,7 @@ static ipsec_sa_t *ipsec_in_single(odp_packet_t pkt, return ipsec_sa; err: - pkt_hdr = odp_packet_hdr(pkt); + pkt_hdr = packet_hdr(pkt); pkt_hdr->p.error_flags.ipsec_err = 1; *pkt_out = pkt; @@ -1404,7 +1404,7 @@ static ipsec_sa_t *ipsec_out_single(odp_packet_t pkt, return ipsec_sa; err: - pkt_hdr = odp_packet_hdr(pkt); + pkt_hdr = packet_hdr(pkt); pkt_hdr->p.error_flags.ipsec_err = 1; @@ -1652,7 +1652,7 @@ int _odp_ipsec_try_inline(odp_packet_t pkt) result->sa = ipsec_sa->ipsec_sa_hdl; result->flag.inline_mode = 1; - pkt_hdr = odp_packet_hdr(pkt); + pkt_hdr = packet_hdr(pkt); pkt_hdr->p.input_flags.dst_queue = 1; pkt_hdr->dst_queue = queue_fn->from_ext(ipsec_sa->queue); diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 2867e67e9..043e4cb5c 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -49,11 +49,6 @@ const _odp_packet_inline_offset_t ODP_ALIGNED_CACHE _odp_packet_inline = { #include -static inline odp_packet_hdr_t *packet_hdr(odp_packet_t pkt) -{ - return (odp_packet_hdr_t *)(uintptr_t)pkt; -} - static inline odp_buffer_t buffer_handle(odp_packet_hdr_t *pkt_hdr) { return (odp_buffer_t)pkt_hdr; @@ -69,6 +64,11 @@ odp_packet_t _odp_packet_from_buf_hdr(odp_buffer_hdr_t *buf_hdr) return (odp_packet_t)buf_hdr; } +static inline odp_buffer_t packet_to_buffer(odp_packet_t pkt) +{ + return (odp_buffer_t)pkt; +} + static inline seg_entry_t *seg_entry(odp_packet_hdr_t *hdr, uint32_t seg_idx) { diff --git a/platform/linux-generic/odp_packet_flags.c b/platform/linux-generic/odp_packet_flags.c index 96507c664..2909703f3 100644 --- a/platform/linux-generic/odp_packet_flags.c +++ b/platform/linux-generic/odp_packet_flags.c @@ -11,18 +11,18 @@ #include #define retflag(pkt, x) do { \ - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); \ + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); \ return pkt_hdr->p.x; \ } while (0) #define setflag(pkt, x, v) do { \ - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); \ + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); \ pkt_hdr->p.x = (v) & 1; \ } while (0) int odp_packet_has_error(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); return pkt_hdr->p.error_flags.all != 0; } @@ -31,7 +31,7 @@ int odp_packet_has_error(odp_packet_t pkt) int odp_packet_has_l2_error(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); /* L2 parsing is always done by default and hence no additional check is required */ return pkt_hdr->p.error_flags.frame_len @@ -46,7 +46,7 @@ int odp_packet_has_l3(odp_packet_t pkt) int odp_packet_has_l3_error(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); return pkt_hdr->p.error_flags.ip_err; } @@ -58,7 +58,7 @@ int odp_packet_has_l4(odp_packet_t pkt) int odp_packet_has_l4_error(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); return pkt_hdr->p.error_flags.tcp_err | pkt_hdr->p.error_flags.udp_err; } @@ -150,14 +150,14 @@ odp_packet_color_t odp_packet_color(odp_packet_t pkt) void odp_packet_color_set(odp_packet_t pkt, odp_packet_color_t color) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); pkt_hdr->p.input_flags.color = color; } odp_bool_t odp_packet_drop_eligible(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); return !pkt_hdr->p.input_flags.nodrop; } @@ -174,7 +174,7 @@ int8_t odp_packet_shaper_len_adjust(odp_packet_t pkt) void odp_packet_shaper_len_adjust_set(odp_packet_t pkt, int8_t adj) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); pkt_hdr->p.output_flags.shaper_len_adj = adj; } @@ -288,14 +288,14 @@ void odp_packet_has_icmp_set(odp_packet_t pkt, int val) void odp_packet_has_flow_hash_clr(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); pkt_hdr->p.input_flags.flow_hash = 0; } void odp_packet_has_ts_clr(odp_packet_t pkt) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); pkt_hdr->p.input_flags.timestamp = 0; } diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index b8dd7c90d..460891d06 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -570,7 +570,7 @@ static inline int pktin_recv_buf(odp_pktin_queue_t queue, for (i = 0; i < pkts; i++) { pkt = packets[i]; - pkt_hdr = odp_packet_hdr(pkt); + pkt_hdr = packet_hdr(pkt); buf_hdr = packet_to_buf_hdr(pkt); if (pkt_hdr->p.input_flags.dst_queue) { @@ -698,7 +698,7 @@ int sched_cb_pktin_poll_one(int pktio_index, num_rx = 0; for (i = 0; i < num_pkts; i++) { pkt = packets[i]; - pkt_hdr = odp_packet_hdr(pkt); + pkt_hdr = packet_hdr(pkt); if (odp_unlikely(pkt_hdr->p.input_flags.dst_queue)) { queue = pkt_hdr->dst_queue; buf_hdr = packet_to_buf_hdr(pkt); diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 86d7a4513..bd6920e6a 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -262,7 +262,7 @@ static int pool_dequeue_bulk(struct rte_mempool *mp, void **obj_table, for (i = 0; i < pkts; i++) { odp_packet_t pkt = packet_tbl[i]; - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); struct rte_mbuf *mbuf = (struct rte_mbuf *) (uintptr_t)pkt_hdr->extra; if (pkt_hdr->extra_type != PKT_EXTRA_TYPE_DPDK) @@ -468,7 +468,7 @@ static inline int mbuf_to_pkt(pktio_entry_t *pktio_entry, } pkt = pkt_table[i]; - pkt_hdr = odp_packet_hdr(pkt); + pkt_hdr = packet_hdr(pkt); pull_tail(pkt_hdr, alloc_len - pkt_len); if (_odp_packet_copy_from_mem(pkt, 0, pkt_len, data) != 0) @@ -636,7 +636,7 @@ static inline int pkt_to_mbuf(pktio_entry_t *pktio_entry, return 0; } for (i = 0; i < num; i++) { - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt_table[i]); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt_table[i]); pkt_len = packet_len(pkt_hdr); @@ -697,7 +697,7 @@ static inline int mbuf_to_pkt_zero(pktio_entry_t *pktio_entry, pkt_len = rte_pktmbuf_pkt_len(mbuf); pkt = (odp_packet_t)mbuf->userdata; - pkt_hdr = odp_packet_hdr(pkt); + pkt_hdr = packet_hdr(pkt); if (pktio_cls_enabled(pktio_entry)) { if (cls_classify_packet(pktio_entry, @@ -754,7 +754,7 @@ static inline int pkt_to_mbuf_zero(pktio_entry_t *pktio_entry, for (i = 0; i < num; i++) { odp_packet_t pkt = pkt_table[i]; - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); struct rte_mbuf *mbuf = (struct rte_mbuf *) (uintptr_t)pkt_hdr->extra; uint16_t pkt_len = odp_packet_len(pkt); @@ -1606,7 +1606,7 @@ static int dpdk_send(pktio_entry_t *pktio_entry, int index, for (i = 0; i < mbufs && freed != copy_count; i++) { odp_packet_t pkt = pkt_table[i]; - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); if (pkt_hdr->buf_hdr.segcount > 1) { if (odp_likely(i < tx_pkts)) diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c index b6c493ea0..95b526646 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -507,14 +507,14 @@ static int ipc_pktio_recv_lockless(pktio_entry_t *pktio_entry, memcpy(pkt_data, rmt_data_ptr, phdr->frame_len); /* Copy packets L2, L3 parsed offsets and size */ - copy_packet_cls_metadata(phdr, odp_packet_hdr(pkt)); + copy_packet_cls_metadata(phdr, packet_hdr(pkt)); - odp_packet_hdr(pkt)->frame_len = phdr->frame_len; - odp_packet_hdr(pkt)->headroom = phdr->headroom; - odp_packet_hdr(pkt)->tailroom = phdr->tailroom; + packet_hdr(pkt)->frame_len = phdr->frame_len; + packet_hdr(pkt)->headroom = phdr->headroom; + packet_hdr(pkt)->tailroom = phdr->tailroom; /* Take classification fields */ - odp_packet_hdr(pkt)->p = phdr->p; + packet_hdr(pkt)->p = phdr->p; pkt_table[i] = pkt; } @@ -604,7 +604,7 @@ static int ipc_pktio_send_lockless(pktio_entry_t *pktio_entry, odp_packet_hdr_t *pkt_hdr; pool_t *pool; - pkt_hdr = odp_packet_hdr(pkt); + pkt_hdr = packet_hdr(pkt); pool = pkt_hdr->buf_hdr.pool_ptr; if (pool->pool_idx != ipc_pool->pool_idx || @@ -626,7 +626,7 @@ static int ipc_pktio_send_lockless(pktio_entry_t *pktio_entry, for (i = 0; i < num; i++) { uint64_t data_pool_off; odp_packet_t pkt = pkt_table_mapped[i]; - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); odp_pool_t pool_hdl = odp_packet_pool(pkt); pool_t *pool = pool_entry_from_hdl(pool_hdl); diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c index aecb0263a..0cf45acbd 100644 --- a/platform/linux-generic/pktio/loop.c +++ b/platform/linux-generic/pktio/loop.c @@ -101,7 +101,7 @@ static int loopback_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED, pkt = packet_from_buf_hdr(hdr_tbl[i]); pkt_len = odp_packet_len(pkt); - pkt_hdr = odp_packet_hdr(pkt); + pkt_hdr = packet_hdr(pkt); packet_parse_reset(pkt_hdr); if (pktio_cls_enabled(pktio_entry)) { diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c index c03564f4e..66fe247d3 100644 --- a/platform/linux-generic/pktio/netmap.c +++ b/platform/linux-generic/pktio/netmap.c @@ -647,7 +647,7 @@ static inline int netmap_pkt_to_odp(pktio_entry_t *pktio_entry, } pkt = pkt_tbl[i]; - pkt_hdr = odp_packet_hdr(pkt); + pkt_hdr = packet_hdr(pkt); pull_tail(pkt_hdr, alloc_len - len); /* For now copy the data in the mbuf, diff --git a/platform/linux-generic/pktio/pcap.c b/platform/linux-generic/pktio/pcap.c index 76cbf9eef..889903ddd 100644 --- a/platform/linux-generic/pktio/pcap.c +++ b/platform/linux-generic/pktio/pcap.c @@ -248,7 +248,7 @@ static int pcapif_recv_pkt(pktio_entry_t *pktio_entry, int index ODP_UNUSED, if (ts != NULL) ts_val = odp_time_global(); - pkt_hdr = odp_packet_hdr(pkt); + pkt_hdr = packet_hdr(pkt); if (_odp_packet_copy_from_mem(pkt, 0, hdr->caplen, data) != 0) { ODP_ERR("failed to copy packet data\n"); diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index 71980b540..749377c09 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -639,7 +639,7 @@ static int sock_mmsg_recv(pktio_entry_t *pktio_entry, int index ODP_UNUSED, void *base = msgvec[i].msg_hdr.msg_iov->iov_base; struct ethhdr *eth_hdr = base; odp_packet_t pkt = pkt_table[i]; - odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + odp_packet_hdr_t *pkt_hdr = packet_hdr(pkt); uint16_t pkt_len = msgvec[i].msg_len; int ret; diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c index 2ace1a597..852bc7669 100644 --- a/platform/linux-generic/pktio/socket_mmap.c +++ b/platform/linux-generic/pktio/socket_mmap.c @@ -243,7 +243,7 @@ static inline unsigned pkt_mmap_v2_rx(pktio_entry_t *pktio_entry, frame_num = next_frame_num; continue; } - hdr = odp_packet_hdr(pkt_table[nb_rx]); + hdr = packet_hdr(pkt_table[nb_rx]); ret = _odp_packet_copy_from_mem(pkt_table[nb_rx], 0, pkt_len, pkt_buf); if (ret != 0) { diff --git a/platform/linux-generic/pktio/tap.c b/platform/linux-generic/pktio/tap.c index ccfa19b25..56f90b31b 100644 --- a/platform/linux-generic/pktio/tap.c +++ b/platform/linux-generic/pktio/tap.c @@ -280,7 +280,7 @@ static odp_packet_t pack_odp_pkt(pktio_entry_t *pktio_entry, const void *data, return ODP_PACKET_INVALID; } - pkt_hdr = odp_packet_hdr(pkt); + pkt_hdr = packet_hdr(pkt); if (pktio_cls_enabled(pktio_entry)) copy_packet_cls_metadata(&parsed_hdr, pkt_hdr);