From patchwork Mon Dec 1 14:07:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 41771 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1C3B720672 for ; Mon, 1 Dec 2014 14:08:29 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id r20sf6754810wiv.1 for ; Mon, 01 Dec 2014 06:08:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:cc:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=7ceOjyb99t2m0otoiRTBtdbaJrelRjk8BIldjDnVG/4=; b=avMb5ZsHbCdYqHlaItym/GA0zFP0/CEU+2QRFZDpJ9JRHOnBsg4mwjY9caF7IhRygY FFH4R6bLJmPKYRj/+VgCxMSWrPlS3R3OO9l6GX2ksM3g/Ic2lWUyjekIYa16ymXDdAR8 wNXU0hczjtoiZApA+ZWS+UHaoZJmWPQcdYZ6kCtSALs6craR5t1ZBEOMSM0w0oWvepCm dN0/OMNzITiHrTFFXQqkQ3r9njbus5lUKsO0FtzA6yuKfXvflvR8E0SGNIYMa/tEOMrO smGWYU2OHlF9fAGa/FTW9SA4DiLXB57Yu3wba0N+bP8cNHr5OHdkxgfCtTRfXWkv+y9N nvLg== X-Gm-Message-State: ALoCoQmm+jraHyQ9VKWicnRD7jtT5q1ouS3jYE6JmM0fLWUAtEgpAsUBs+VX3W7n05KD3GeUE35z X-Received: by 10.180.98.165 with SMTP id ej5mr15322851wib.1.1417442908383; Mon, 01 Dec 2014 06:08:28 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.3.132 with SMTP id c4ls109912lac.81.gmail; Mon, 01 Dec 2014 06:08:28 -0800 (PST) X-Received: by 10.152.22.135 with SMTP id d7mr56815251laf.46.1417442908211; Mon, 01 Dec 2014 06:08:28 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id p2si9231715laf.103.2014.12.01.06.08.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Dec 2014 06:08:28 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id z11so8554105lbi.10 for ; Mon, 01 Dec 2014 06:08:28 -0800 (PST) X-Received: by 10.152.3.67 with SMTP id a3mr12922050laa.56.1417442908082; Mon, 01 Dec 2014 06:08:28 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp293000lbc; Mon, 1 Dec 2014 06:08:26 -0800 (PST) X-Received: by 10.224.53.132 with SMTP id m4mr85868150qag.85.1417442905866; Mon, 01 Dec 2014 06:08:25 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id n16si20606336qae.44.2014.12.01.06.08.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Dec 2014 06:08:25 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XvReJ-0000qg-U3; Mon, 01 Dec 2014 14:08:23 +0000 Received: from mail-wg0-f47.google.com ([74.125.82.47]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XvReD-0000qM-Oc for lng-odp@lists.linaro.org; Mon, 01 Dec 2014 14:08:17 +0000 Received: by mail-wg0-f47.google.com with SMTP id n12so14264371wgh.20 for ; Mon, 01 Dec 2014 06:08:12 -0800 (PST) X-Received: by 10.194.175.202 with SMTP id cc10mr92591559wjc.27.1417442892205; Mon, 01 Dec 2014 06:08:12 -0800 (PST) Received: from localhost.localdomain ([90.152.119.35]) by mx.google.com with ESMTPSA id k5sm20393410wjn.1.2014.12.01.06.08.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Dec 2014 06:08:11 -0800 (PST) From: Zoltan Kiss To: venkatesh.vivekanandan@linaro.org Date: Mon, 1 Dec 2014 14:07:50 +0000 Message-Id: <1417442870-6894-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [EXPERIMENTAL] ODP DPDK sync with latest ODP (partial) X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zoltan.kiss@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 I've started to sync up ODP DPDK with the latest ODP, but I got stucked. These are the changes I've made so far, they apply the following changes: https://git.linaro.org/lng/odp.git/commitdiff/0ecee33aefdb002d0014b12ef962abe32cca0a8b https://git.linaro.org/lng/odp.git/commitdiff/59bdddc183e3ec790bd264950023c1e3059d53b0 https://git.linaro.org/lng/odp.git/commitdiff/7a6c3779f1495166ae10697f7ae7bc26a266583f https://git.linaro.org/lng/odp.git/commitdiff/4f7a5cbb08297b83b795521d79a4d74115a619f9 https://git.linaro.org/lng/odp.git/commitdiff/6f9938ee You can use this in the future as a starting point to sync up to the latest ODP. diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index fcc6619..8edd660 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -51,9 +51,7 @@ include_HEADERS = \ $(top_srcdir)/platform/linux-generic/include/api/odp_ticketlock.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_time.h \ $(top_srcdir)/platform/linux-generic/include/api/odp_timer.h \ - $(top_srcdir)/platform/linux-generic/include/api/odp_version.h \ - $(top_srcdir)/platform/linux-generic/include/api/odp_pktio_socket.h \ - $(srcdir)/include/api/odp_pktio_types.h + $(top_srcdir)/platform/linux-generic/include/api/odp_version.h subdirheadersdir = $(includedir)/helper subdirheaders_HEADERS = \ diff --git a/platform/linux-dpdk/include/api/odp_debug.h b/platform/linux-dpdk/include/api/odp_debug.h index 6b145b5..b8c7f92 100644 --- a/platform/linux-dpdk/include/api/odp_debug.h +++ b/platform/linux-dpdk/include/api/odp_debug.h @@ -55,30 +55,76 @@ extern "C" { #define ODP_STATIC_ASSERT(cond, msg) _Static_assert(1, msg) /** + * ODP log level. + */ +typedef enum odp_log_level { + ODP_LOG_DBG, + ODP_LOG_ERR, + ODP_LOG_UNIMPLEMENTED, + ODP_LOG_ABORT, + ODP_LOG_PRINT +} odp_log_level_e; + +/** + * ODP default LOG macro. + */ +#define ODP_LOG(level, fmt, ...) \ +do { \ + switch (level) { \ + case ODP_LOG_ERR: \ + fprintf(stderr, "%s:%d:%s():" fmt, __FILE__, \ + __LINE__, __func__, ##__VA_ARGS__); \ + break; \ + case ODP_LOG_DBG: \ + if (ODP_DEBUG_PRINT == 1) \ + fprintf(stderr, "%s:%d:%s():" fmt, __FILE__, \ + __LINE__, __func__, ##__VA_ARGS__); \ + break; \ + case ODP_LOG_PRINT: \ + fprintf(stdout, "%s:%d:%s():" fmt, __FILE__, \ + __LINE__, __func__, ##__VA_ARGS__); \ + break; \ + case ODP_LOG_ABORT: \ + fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \ + __LINE__, __func__, ##__VA_ARGS__); \ + abort(); \ + break; \ + case ODP_LOG_UNIMPLEMENTED: \ + fprintf(stderr, \ + "%s:%d:The function %s() is not implemented\n" \ + fmt, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \ + break; \ + default: \ + fprintf(stderr, "Unknown LOG level"); \ + break;\ + } \ +} while (0) + +/** + * Printing macro, which prints output when the application + * calls one of the ODP APIs specifically for dumping internal data. + */ +#define ODP_PRINT(fmt, ...) \ + ODP_LOG(ODP_LOG_PRINT, fmt, ##__VA_ARGS__) + +/** * Debug printing macro, which prints output when DEBUG flag is set. */ #define ODP_DBG(fmt, ...) \ - do { if (ODP_DEBUG_PRINT == 1) \ - printf(fmt, ##__VA_ARGS__); \ - } while (0) + ODP_LOG(ODP_LOG_DBG, fmt, ##__VA_ARGS__) /** * Print output to stderr (file, line and function). */ #define ODP_ERR(fmt, ...) \ -do { fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \ - __LINE__, __func__, ##__VA_ARGS__); \ -} while (0) + ODP_LOG(ODP_LOG_ERR, fmt, ##__VA_ARGS__) /** * Print output to stderr (file, line and function), * then abort. */ #define ODP_ABORT(fmt, ...) \ -do { fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, \ - __LINE__, __func__, ##__VA_ARGS__); \ - abort(); \ -} while (0) + ODP_LOG(ODP_LOG_ABORT, fmt, ##__VA_ARGS__) #ifdef __cplusplus } diff --git a/platform/linux-dpdk/include/api/odp_packet.h b/platform/linux-dpdk/include/api/odp_packet.h index 64a92e8..8cd1c5d 100644 --- a/platform/linux-dpdk/include/api/odp_packet.h +++ b/platform/linux-dpdk/include/api/odp_packet.h @@ -60,7 +60,7 @@ odp_packet_t odp_packet_from_buffer(odp_buffer_t buf); * * @return Buffer handle */ -odp_buffer_t odp_buffer_from_packet(odp_packet_t pkt); +odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt); /** * Set the packet length @@ -98,53 +98,49 @@ void odp_packet_set_ctx(odp_packet_t buf, const void *ctx); void *odp_packet_get_ctx(odp_packet_t buf); /** - * Get address to the start of the packet buffer + * Packet buffer start address + * + * Returns a pointer to the start of the packet buffer. The address is not + * necessarily the same as packet data address. E.g. on a received Ethernet + * frame, the protocol header may start 2 or 6 bytes within the buffer to + * ensure 32 or 64-bit alignment of the IP header. * - * The address of the packet buffer is not necessarily the same as the start - * address of the received frame, e.g. an eth frame may be offset by 2 or 6 - * bytes to ensure 32 or 64-bit alignment of the IP header. * Use odp_packet_l2(pkt) to get the start address of a received valid frame - * or odp_packet_start(pkt) to get the start address even if no valid L2 header - * could be found. + * or odp_packet_data(pkt) to get the current packet data address. * * @param pkt Packet handle * * @return Pointer to the start of the packet buffer * - * @see odp_packet_l2(), odp_packet_start() + * @see odp_packet_l2(), odp_packet_data() */ -uint8_t *odp_packet_buf_addr(odp_packet_t pkt); +uint8_t *odp_packet_addr(odp_packet_t pkt); /** - * Get pointer to the start of the received frame - * - * The address of the packet buffer is not necessarily the same as the start - * address of the received frame, e.g. an eth frame may be offset by 2 or 6 - * bytes to ensure 32 or 64-bit alignment of the IP header. - * Use odp_packet_l2(pkt) to get the start address of a received valid eth frame + * Packet data address * - * odp_packet_start() will always return a pointer to the start of the frame, - * even if the frame is unrecognized and no valid L2 header could be found. + * Returns the current packet data address. When a packet is received from + * packet input, the data address points to the first byte of the packet. * * @param pkt Packet handle * - * @return Pointer to the start of the received frame + * @return Pointer to the packet data * - * @see odp_packet_l2(), odp_packet_buf_addr() + * @see odp_packet_l2(), odp_packet_addr() */ -uint8_t *odp_packet_start(odp_packet_t pkt); +uint8_t *odp_packet_data(odp_packet_t pkt); /** * Get pointer to the start of the L2 frame * * The L2 frame header address is not necessarily the same as the address of the - * packet buffer, see odp_packet_buf_addr() + * packet buffer, see odp_packet_addr() * * @param pkt Packet handle * * @return Pointer to L2 header or NULL if not found * - * @see odp_packet_buf_addr(), odp_packet_start() + * @see odp_packet_addr(), odp_packet_data() */ uint8_t *odp_packet_l2(odp_packet_t pkt); diff --git a/platform/linux-dpdk/include/api/odp_packet_io.h b/platform/linux-dpdk/include/api/odp_packet_io.h index bd6868a..cf7f151 100644 --- a/platform/linux-dpdk/include/api/odp_packet_io.h +++ b/platform/linux-dpdk/include/api/odp_packet_io.h @@ -23,8 +23,6 @@ extern "C" { #include #include -#include - /** ODP packet IO handle */ typedef uint32_t odp_pktio_t; @@ -40,8 +38,7 @@ typedef uint32_t odp_pktio_t; * * @return ODP packet IO handle or ODP_PKTIO_INVALID on error */ -odp_pktio_t odp_pktio_open(const char *dev, odp_buffer_pool_t pool, - odp_pktio_params_t *params); +odp_pktio_t odp_pktio_open(const char *dev, odp_buffer_pool_t pool); /** * Close an ODP packet IO instance diff --git a/platform/linux-dpdk/include/api/odp_pktio_types.h b/platform/linux-dpdk/include/api/odp_pktio_types.h deleted file mode 100644 index b23e6da..0000000 --- a/platform/linux-dpdk/include/api/odp_pktio_types.h +++ /dev/null @@ -1,45 +0,0 @@ - -/* Copyright (c) 2013, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ODP_PKTIO_TYPES_H -#define ODP_PKTIO_TYPES_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* We should ensure that future enum values will never overlap, otherwise - * applications that want netmap suport might get in trouble if the odp lib - * was not built with netmap support and there are more types define below - */ - -typedef enum { - ODP_PKTIO_TYPE_SOCKET_BASIC = 0x1, - ODP_PKTIO_TYPE_SOCKET_MMSG, - ODP_PKTIO_TYPE_SOCKET_MMAP, - ODP_PKTIO_TYPE_NETMAP, - ODP_PKTIO_TYPE_DPDK, -} odp_pktio_type_t; - -#include -#ifdef ODP_HAVE_NETMAP -#include -#endif - -typedef union odp_pktio_params_t { - odp_pktio_type_t type; - socket_params_t sock_params; -#ifdef ODP_HAVE_NETMAP - netmap_params_t nm_params; -#endif -} odp_pktio_params_t; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-dpdk/include/odp_packet_io_internal.h b/platform/linux-dpdk/include/odp_packet_io_internal.h index 9263349..0071e7d 100644 --- a/platform/linux-dpdk/include/odp_packet_io_internal.h +++ b/platform/linux-dpdk/include/odp_packet_io_internal.h @@ -25,12 +25,21 @@ extern "C" { #endif #include +/** + * Packet IO types + */ +typedef enum { + ODP_PKTIO_TYPE_SOCKET_BASIC = 0x1, + ODP_PKTIO_TYPE_SOCKET_MMSG, + ODP_PKTIO_TYPE_SOCKET_MMAP, +} odp_pktio_type_t; + struct pktio_entry { odp_spinlock_t lock; /**< entry spinlock */ int taken; /**< is entry taken(1) or free(0) */ odp_queue_t inq_default; /**< default input queue, if set */ odp_queue_t outq_default; /**< default out queue */ - odp_pktio_params_t params; /**< pktio parameters */ + odp_pktio_type_t type; /**< pktio type */ pkt_dpdk_t pkt_dpdk; /**< using DPDK API for IO */ }; diff --git a/platform/linux-dpdk/odp_init.c b/platform/linux-dpdk/odp_init.c index fa10022..0dd1a65 100644 --- a/platform/linux-dpdk/odp_init.c +++ b/platform/linux-dpdk/odp_init.c @@ -45,7 +45,8 @@ int odp_init_dpdk(void) return 0; } -int odp_init_global(void) +int odp_init_global(odp_init_t *params ODP_UNUSED, + odp_platform_init_t *platform_params ODP_UNUSED) { odp_thread_init_global(); @@ -95,9 +96,9 @@ int odp_init_global(void) } -int odp_init_local(int thr_id) +int odp_init_local(void) { - odp_thread_init_local(thr_id); + odp_thread_init_local(); if (odp_pktio_init_local()) { ODP_ERR("ODP packet io local init failed.\n"); diff --git a/platform/linux-dpdk/odp_linux.c b/platform/linux-dpdk/odp_linux.c index 96c91a5..72f0723 100644 --- a/platform/linux-dpdk/odp_linux.c +++ b/platform/linux-dpdk/odp_linux.c @@ -35,7 +35,7 @@ static void *odp_run_start_routine(void *arg) odp_start_args_t *start_args = arg; /* ODP thread local init */ - odp_init_local(start_args->thr_id); + odp_init_local(); return start_args->start_routine(start_args->arg); } @@ -66,7 +66,6 @@ void odph_linux_pthread_create(odph_linux_pthread_t *thread_tbl, int num, start_args->start_routine = start_routine; start_args->arg = arg; - odp_thread_create(cpu); start_args->thr_id = cpu; /* If not master core */ if (cpu != 0) { diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c index a1443dc..1f6b70d 100644 --- a/platform/linux-dpdk/odp_packet.c +++ b/platform/linux-dpdk/odp_packet.c @@ -41,7 +41,7 @@ odp_packet_t odp_packet_from_buffer(odp_buffer_t buf) return (odp_packet_t)buf; } -odp_buffer_t odp_buffer_from_packet(odp_packet_t pkt) +odp_buffer_t odp_packet_to_buffer(odp_packet_t pkt) { return (odp_buffer_t)pkt; } @@ -88,12 +88,12 @@ size_t odp_packet_get_len(odp_packet_t pkt) return mb->pkt_len; } -uint8_t *odp_packet_buf_addr(odp_packet_t pkt) +uint8_t *odp_packet_addr(odp_packet_t pkt) { - return odp_buffer_addr(odp_buffer_from_packet(pkt)); + return odp_buffer_addr(odp_packet_to_buffer(pkt)); } -uint8_t *odp_packet_start(odp_packet_t pkt) +uint8_t *odp_packet_data(odp_packet_t pkt) { struct rte_mbuf *mb = &(odp_packet_hdr(pkt)->buf_hdr.mb); return ((uint8_t *)(mb->buf_addr) + mb->data_off); @@ -107,7 +107,7 @@ uint8_t *odp_packet_l2(odp_packet_t pkt) if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) return NULL; - return odp_packet_start(pkt) + offset; + return odp_packet_data(pkt) + offset; } size_t odp_packet_l2_offset(odp_packet_t pkt) @@ -127,7 +127,7 @@ uint8_t *odp_packet_l3(odp_packet_t pkt) if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) return NULL; - return odp_packet_start(pkt) + offset; + return odp_packet_data(pkt) + offset; } size_t odp_packet_l3_offset(odp_packet_t pkt) @@ -147,7 +147,7 @@ uint8_t *odp_packet_l4(odp_packet_t pkt) if (odp_unlikely(offset == ODP_PACKET_OFFSET_INVALID)) return NULL; - return odp_packet_start(pkt) + offset; + return odp_packet_data(pkt) + offset; } size_t odp_packet_l4_offset(odp_packet_t pkt) @@ -200,7 +200,7 @@ void odp_packet_parse(odp_packet_t pkt, size_t len, size_t frame_offset) pkt_hdr->input_flags.l2 = 1; pkt_hdr->l2_offset = 0; - eth = (odph_ethhdr_t *)odp_packet_start(pkt); + eth = (odph_ethhdr_t *)odp_packet_data(pkt); ethtype = odp_be_to_cpu_16(eth->type); vlan = (odph_vlanhdr_t *)ð->type; @@ -367,7 +367,7 @@ void odp_packet_print(odp_packet_t pkt) printf("\n%s\n", str); rte_pktmbuf_dump(stdout, &hdr->buf_hdr.mb, 32); - p = odp_packet_start(pkt); + p = odp_packet_data(pkt); printf("00000000: %02X %02X %02X %02X %02X %02X %02X %02X\n", p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]); printf("00000008: %02X %02X %02X %02X %02X %02X %02X %02X\n", diff --git a/platform/linux-dpdk/odp_packet_io.c b/platform/linux-dpdk/odp_packet_io.c index 79394bb..7b088ca 100644 --- a/platform/linux-dpdk/odp_packet_io.c +++ b/platform/linux-dpdk/odp_packet_io.c @@ -22,7 +22,6 @@ #include #include -#include #ifdef ODP_HAVE_NETMAP #include #endif @@ -115,16 +114,14 @@ static void unlock_entry(pktio_entry_t *entry) odp_spinlock_unlock(&entry->s.lock); } -static void init_pktio_entry(pktio_entry_t *entry, odp_pktio_params_t *params) +static void init_pktio_entry(pktio_entry_t *entry) { set_taken(entry); entry->s.inq_default = ODP_QUEUE_INVALID; memset(&entry->s.pkt_dpdk, 0, sizeof(entry->s.pkt_dpdk)); - /* Save pktio parameters, type is the most useful */ - memcpy(&entry->s.params, params, sizeof(*params)); } -static odp_pktio_t alloc_lock_pktio_entry(odp_pktio_params_t *params) +static odp_pktio_t alloc_lock_pktio_entry(void) { odp_pktio_t id; pktio_entry_t *entry; @@ -135,7 +132,7 @@ static odp_pktio_t alloc_lock_pktio_entry(odp_pktio_params_t *params) if (is_free(entry)) { lock_entry(entry); if (is_free(entry)) { - init_pktio_entry(entry, params); + init_pktio_entry(entry); id = i + 1; return id; /* return with entry locked! */ } @@ -158,21 +155,15 @@ static int free_pktio_entry(odp_pktio_t id) return 0; } -odp_pktio_t odp_pktio_open(const char *dev, odp_buffer_pool_t pool, - odp_pktio_params_t *params) +odp_pktio_t odp_pktio_open(const char *dev, odp_buffer_pool_t pool) { odp_pktio_t id; pktio_entry_t *pktio_entry; int res; - if (params == NULL) { - ODP_ERR("Invalid pktio params\n"); - return ODP_PKTIO_INVALID; - } - ODP_DBG("Allocating dpdk pktio\n"); - id = alloc_lock_pktio_entry(params); + id = alloc_lock_pktio_entry(); if (id == ODP_PKTIO_INVALID) { ODP_ERR("No resources available.\n"); return ODP_PKTIO_INVALID; @@ -377,11 +368,11 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry) if (pkts > 0) { pkt = pkt_tbl[0]; - buf = odp_buffer_from_packet(pkt); + buf = odp_packet_to_buffer(pkt); buf_hdr = odp_buf_to_hdr(buf); for (i = 1, j = 0; i < pkts; ++i) { - buf = odp_buffer_from_packet(pkt_tbl[i]); + buf = odp_packet_to_buffer(pkt_tbl[i]); tmp_hdr_tbl[j++] = odp_buf_to_hdr(buf); } queue_enq_multi(qentry, tmp_hdr_tbl, j); @@ -413,7 +404,7 @@ int pktin_deq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], int num) QUEUE_MULTI_MAX); if (pkts > 0) { for (i = 0; i < pkts; ++i) { - buf = odp_buffer_from_packet(pkt_tbl[i]); + buf = odp_packet_to_buffer(pkt_tbl[i]); tmp_hdr_tbl[i] = odp_buf_to_hdr(buf); } queue_enq_multi(qentry, tmp_hdr_tbl, pkts);