diff mbox

[API-NEXT,v3,03/11] linux-generic: pktio: implement odp_pktin_ts_res()

Message ID 1461133250-2403-4-git-send-email-matias.elo@nokia.com
State Superseded
Headers show

Commit Message

Elo, Matias (Nokia - FI/Espoo) April 20, 2016, 6:20 a.m. UTC
Add default implementations for odp_pktin_ts_res() using
odp global time.

Signed-off-by: Matias Elo <matias.elo@nokia.com>
---
 platform/linux-generic/include/odp_packet_io_internal.h |  1 +
 platform/linux-generic/odp_packet_io.c                  | 17 +++++++++++++++++
 platform/linux-generic/pktio/dpdk.c                     |  1 +
 platform/linux-generic/pktio/ipc.c                      |  3 ++-
 platform/linux-generic/pktio/loop.c                     |  1 +
 platform/linux-generic/pktio/netmap.c                   |  1 +
 platform/linux-generic/pktio/pcap.c                     |  1 +
 platform/linux-generic/pktio/socket.c                   |  1 +
 platform/linux-generic/pktio/socket_mmap.c              |  1 +
 platform/linux-generic/pktio/tap.c                      |  3 ++-
 10 files changed, 28 insertions(+), 2 deletions(-)

Comments

Bill Fischofer April 20, 2016, 11:49 p.m. UTC | #1
I'm afraid v3 is still failing to apply.  For Part 3 I get this:

bill@Ubuntu15:~/linaro/matias$ git am --reject ~/Mail/Incoming/Matias/17
Applying: linux-generic: pktio: implement odp_pktin_ts_res()
Checking patch platform/linux-generic/include/odp_packet_io_internal.h...
Checking patch platform/linux-generic/odp_packet_io.c...
error: while searching for:
return 0;
}

void odp_pktio_print(odp_pktio_t id)
{
pktio_entry_t *entry;

error: patch failed: platform/linux-generic/odp_packet_io.c:921
Checking patch platform/linux-generic/pktio/dpdk.c...
Checking patch platform/linux-generic/pktio/ipc.c...
Checking patch platform/linux-generic/pktio/loop.c...
Checking patch platform/linux-generic/pktio/netmap.c...
Checking patch platform/linux-generic/pktio/pcap.c...
Checking patch platform/linux-generic/pktio/socket.c...
Checking patch platform/linux-generic/pktio/socket_mmap.c...
Checking patch platform/linux-generic/pktio/tap.c...
Applied patch platform/linux-generic/include/odp_packet_io_internal.h
cleanly.
Applying patch platform/linux-generic/odp_packet_io.c with 1 reject...
Rejected hunk #1.
Applied patch platform/linux-generic/pktio/dpdk.c cleanly.
Applied patch platform/linux-generic/pktio/ipc.c cleanly.
Applied patch platform/linux-generic/pktio/loop.c cleanly.
Applied patch platform/linux-generic/pktio/netmap.c cleanly.
Applied patch platform/linux-generic/pktio/pcap.c cleanly.
Applied patch platform/linux-generic/pktio/socket.c cleanly.
Applied patch platform/linux-generic/pktio/socket_mmap.c cleanly.
Applied patch platform/linux-generic/pktio/tap.c cleanly.
Patch failed at 0001 linux-generic: pktio: implement odp_pktin_ts_res()
The copy of the patch that failed is found in:
   /home/bill/linaro/matias/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

On Wed, Apr 20, 2016 at 1:20 AM, Matias Elo <matias.elo@nokia.com> wrote:

> Add default implementations for odp_pktin_ts_res() using

> odp global time.

>

> Signed-off-by: Matias Elo <matias.elo@nokia.com>

> ---

>  platform/linux-generic/include/odp_packet_io_internal.h |  1 +

>  platform/linux-generic/odp_packet_io.c                  | 17

> +++++++++++++++++

>  platform/linux-generic/pktio/dpdk.c                     |  1 +

>  platform/linux-generic/pktio/ipc.c                      |  3 ++-

>  platform/linux-generic/pktio/loop.c                     |  1 +

>  platform/linux-generic/pktio/netmap.c                   |  1 +

>  platform/linux-generic/pktio/pcap.c                     |  1 +

>  platform/linux-generic/pktio/socket.c                   |  1 +

>  platform/linux-generic/pktio/socket_mmap.c              |  1 +

>  platform/linux-generic/pktio/tap.c                      |  3 ++-

>  10 files changed, 28 insertions(+), 2 deletions(-)

>

> diff --git a/platform/linux-generic/include/odp_packet_io_internal.h

> b/platform/linux-generic/include/odp_packet_io_internal.h

> index aaa9387..c76ea1f 100644

> --- a/platform/linux-generic/include/odp_packet_io_internal.h

> +++ b/platform/linux-generic/include/odp_packet_io_internal.h

> @@ -184,6 +184,7 @@ typedef struct pktio_if_ops {

>         int (*stop)(pktio_entry_t *pktio_entry);

>         int (*stats)(pktio_entry_t *pktio_entry, odp_pktio_stats_t *stats);

>         int (*stats_reset)(pktio_entry_t *pktio_entry);

> +       uint64_t (*pktin_ts_res)(pktio_entry_t *pktio_entry);

>         int (*recv)(pktio_entry_t *pktio_entry, odp_packet_t pkt_table[],

>                     unsigned len);

>         int (*send)(pktio_entry_t *pktio_entry, odp_packet_t pkt_table[],

> diff --git a/platform/linux-generic/odp_packet_io.c

> b/platform/linux-generic/odp_packet_io.c

> index 574f987..295a758 100644

> --- a/platform/linux-generic/odp_packet_io.c

> +++ b/platform/linux-generic/odp_packet_io.c

> @@ -921,6 +921,23 @@ int odp_pktio_info(odp_pktio_t id, odp_pktio_info_t

> *info)

>         return 0;

>  }

>

> +uint64_t odp_pktin_ts_res(odp_pktio_t id)

> +{

> +       pktio_entry_t *entry;

> +

> +       entry = get_pktio_entry(id);

> +

> +       if (entry == NULL) {

> +               ODP_DBG("pktio entry %d does not exist\n", id);

> +               return 0;

> +       }

> +

> +       if (entry->s.ops->pktin_ts_res)

> +               return entry->s.ops->pktin_ts_res(entry);

> +

> +       return odp_time_global_res();

> +}

> +

>  void odp_pktio_print(odp_pktio_t id)

>  {

>         pktio_entry_t *entry;

> diff --git a/platform/linux-generic/pktio/dpdk.c

> b/platform/linux-generic/pktio/dpdk.c

> index 0e57d90..d67fb01 100644

> --- a/platform/linux-generic/pktio/dpdk.c

> +++ b/platform/linux-generic/pktio/dpdk.c

> @@ -927,6 +927,7 @@ const pktio_if_ops_t dpdk_pktio_ops = {

>         .promisc_mode_get = dpdk_promisc_mode_get,

>         .mac_get = dpdk_mac_addr_get,

>         .capability = dpdk_capability,

> +       .pktin_ts_res = NULL,

>         .input_queues_config = dpdk_input_queues_config,

>         .output_queues_config = dpdk_output_queues_config

>  };

> diff --git a/platform/linux-generic/pktio/ipc.c

> b/platform/linux-generic/pktio/ipc.c

> index 18fa5c6..ca8eaa5 100644

> --- a/platform/linux-generic/pktio/ipc.c

> +++ b/platform/linux-generic/pktio/ipc.c

> @@ -725,5 +725,6 @@ const pktio_if_ops_t ipc_pktio_ops = {

>         .mtu_get = ipc_mtu_get,

>         .promisc_mode_set = NULL,

>         .promisc_mode_get = NULL,

> -       .mac_get = ipc_mac_addr_get

> +       .mac_get = ipc_mac_addr_get,

> +       .pktin_ts_res = NULL,

>  };

> diff --git a/platform/linux-generic/pktio/loop.c

> b/platform/linux-generic/pktio/loop.c

> index 0ea6d0e..1a7a572 100644

> --- a/platform/linux-generic/pktio/loop.c

> +++ b/platform/linux-generic/pktio/loop.c

> @@ -184,6 +184,7 @@ const pktio_if_ops_t loopback_pktio_ops = {

>         .mac_get = loopback_mac_addr_get,

>         .link_status = loopback_link_status,

>         .capability = NULL,

> +       .pktin_ts_res = NULL,

>         .input_queues_config = NULL,

>         .output_queues_config = NULL,

>         .recv_queue = NULL,

> diff --git a/platform/linux-generic/pktio/netmap.c

> b/platform/linux-generic/pktio/netmap.c

> index 0e160c5..cf116fe 100644

> --- a/platform/linux-generic/pktio/netmap.c

> +++ b/platform/linux-generic/pktio/netmap.c

> @@ -861,6 +861,7 @@ const pktio_if_ops_t netmap_pktio_ops = {

>         .promisc_mode_get = netmap_promisc_mode_get,

>         .mac_get = netmap_mac_addr_get,

>         .capability = netmap_capability,

> +       .pktin_ts_res = NULL,

>         .input_queues_config = netmap_input_queues_config,

>         .output_queues_config = netmap_output_queues_config,

>         .recv_queue = netmap_recv_queue,

> diff --git a/platform/linux-generic/pktio/pcap.c

> b/platform/linux-generic/pktio/pcap.c

> index d1458bf..d33f04f 100644

> --- a/platform/linux-generic/pktio/pcap.c

> +++ b/platform/linux-generic/pktio/pcap.c

> @@ -407,6 +407,7 @@ const pktio_if_ops_t pcap_pktio_ops = {

>         .promisc_mode_get = pcapif_promisc_mode_get,

>         .mac_get = pcapif_mac_addr_get,

>         .capability = NULL,

> +       .pktin_ts_res = NULL,

>         .input_queues_config = NULL,

>         .output_queues_config = NULL,

>         .recv_queue = NULL,

> diff --git a/platform/linux-generic/pktio/socket.c

> b/platform/linux-generic/pktio/socket.c

> index edc36a1..7416a8c 100644

> --- a/platform/linux-generic/pktio/socket.c

> +++ b/platform/linux-generic/pktio/socket.c

> @@ -856,6 +856,7 @@ const pktio_if_ops_t sock_mmsg_pktio_ops = {

>         .mac_get = sock_mac_addr_get,

>         .link_status = sock_link_status,

>         .capability = NULL,

> +       .pktin_ts_res = NULL,

>         .input_queues_config = NULL,

>         .output_queues_config = NULL,

>         .recv_queue = NULL,

> diff --git a/platform/linux-generic/pktio/socket_mmap.c

> b/platform/linux-generic/pktio/socket_mmap.c

> index caca708..d36668a 100644

> --- a/platform/linux-generic/pktio/socket_mmap.c

> +++ b/platform/linux-generic/pktio/socket_mmap.c

> @@ -625,6 +625,7 @@ const pktio_if_ops_t sock_mmap_pktio_ops = {

>         .mac_get = sock_mmap_mac_addr_get,

>         .link_status = sock_mmap_link_status,

>         .capability = NULL,

> +       .pktin_ts_res = NULL,

>         .input_queues_config = NULL,

>         .output_queues_config = NULL,

>         .recv_queue = NULL,

> diff --git a/platform/linux-generic/pktio/tap.c

> b/platform/linux-generic/pktio/tap.c

> index c895878..d075bbb 100644

> --- a/platform/linux-generic/pktio/tap.c

> +++ b/platform/linux-generic/pktio/tap.c

> @@ -323,5 +323,6 @@ const pktio_if_ops_t tap_pktio_ops = {

>         .mtu_get = tap_mtu_get,

>         .promisc_mode_set = tap_promisc_mode_set,

>         .promisc_mode_get = tap_promisc_mode_get,

> -       .mac_get = tap_mac_addr_get

> +       .mac_get = tap_mac_addr_get,

> +       .pktin_ts_res = NULL,

>  };

> --

> 1.9.1

>

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>
diff mbox

Patch

diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h
index aaa9387..c76ea1f 100644
--- a/platform/linux-generic/include/odp_packet_io_internal.h
+++ b/platform/linux-generic/include/odp_packet_io_internal.h
@@ -184,6 +184,7 @@  typedef struct pktio_if_ops {
 	int (*stop)(pktio_entry_t *pktio_entry);
 	int (*stats)(pktio_entry_t *pktio_entry, odp_pktio_stats_t *stats);
 	int (*stats_reset)(pktio_entry_t *pktio_entry);
+	uint64_t (*pktin_ts_res)(pktio_entry_t *pktio_entry);
 	int (*recv)(pktio_entry_t *pktio_entry, odp_packet_t pkt_table[],
 		    unsigned len);
 	int (*send)(pktio_entry_t *pktio_entry, odp_packet_t pkt_table[],
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c
index 574f987..295a758 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -921,6 +921,23 @@  int odp_pktio_info(odp_pktio_t id, odp_pktio_info_t *info)
 	return 0;
 }
 
+uint64_t odp_pktin_ts_res(odp_pktio_t id)
+{
+	pktio_entry_t *entry;
+
+	entry = get_pktio_entry(id);
+
+	if (entry == NULL) {
+		ODP_DBG("pktio entry %d does not exist\n", id);
+		return 0;
+	}
+
+	if (entry->s.ops->pktin_ts_res)
+		return entry->s.ops->pktin_ts_res(entry);
+
+	return odp_time_global_res();
+}
+
 void odp_pktio_print(odp_pktio_t id)
 {
 	pktio_entry_t *entry;
diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c
index 0e57d90..d67fb01 100644
--- a/platform/linux-generic/pktio/dpdk.c
+++ b/platform/linux-generic/pktio/dpdk.c
@@ -927,6 +927,7 @@  const pktio_if_ops_t dpdk_pktio_ops = {
 	.promisc_mode_get = dpdk_promisc_mode_get,
 	.mac_get = dpdk_mac_addr_get,
 	.capability = dpdk_capability,
+	.pktin_ts_res = NULL,
 	.input_queues_config = dpdk_input_queues_config,
 	.output_queues_config = dpdk_output_queues_config
 };
diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c
index 18fa5c6..ca8eaa5 100644
--- a/platform/linux-generic/pktio/ipc.c
+++ b/platform/linux-generic/pktio/ipc.c
@@ -725,5 +725,6 @@  const pktio_if_ops_t ipc_pktio_ops = {
 	.mtu_get = ipc_mtu_get,
 	.promisc_mode_set = NULL,
 	.promisc_mode_get = NULL,
-	.mac_get = ipc_mac_addr_get
+	.mac_get = ipc_mac_addr_get,
+	.pktin_ts_res = NULL,
 };
diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c
index 0ea6d0e..1a7a572 100644
--- a/platform/linux-generic/pktio/loop.c
+++ b/platform/linux-generic/pktio/loop.c
@@ -184,6 +184,7 @@  const pktio_if_ops_t loopback_pktio_ops = {
 	.mac_get = loopback_mac_addr_get,
 	.link_status = loopback_link_status,
 	.capability = NULL,
+	.pktin_ts_res = NULL,
 	.input_queues_config = NULL,
 	.output_queues_config = NULL,
 	.recv_queue = NULL,
diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c
index 0e160c5..cf116fe 100644
--- a/platform/linux-generic/pktio/netmap.c
+++ b/platform/linux-generic/pktio/netmap.c
@@ -861,6 +861,7 @@  const pktio_if_ops_t netmap_pktio_ops = {
 	.promisc_mode_get = netmap_promisc_mode_get,
 	.mac_get = netmap_mac_addr_get,
 	.capability = netmap_capability,
+	.pktin_ts_res = NULL,
 	.input_queues_config = netmap_input_queues_config,
 	.output_queues_config = netmap_output_queues_config,
 	.recv_queue = netmap_recv_queue,
diff --git a/platform/linux-generic/pktio/pcap.c b/platform/linux-generic/pktio/pcap.c
index d1458bf..d33f04f 100644
--- a/platform/linux-generic/pktio/pcap.c
+++ b/platform/linux-generic/pktio/pcap.c
@@ -407,6 +407,7 @@  const pktio_if_ops_t pcap_pktio_ops = {
 	.promisc_mode_get = pcapif_promisc_mode_get,
 	.mac_get = pcapif_mac_addr_get,
 	.capability = NULL,
+	.pktin_ts_res = NULL,
 	.input_queues_config = NULL,
 	.output_queues_config = NULL,
 	.recv_queue = NULL,
diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c
index edc36a1..7416a8c 100644
--- a/platform/linux-generic/pktio/socket.c
+++ b/platform/linux-generic/pktio/socket.c
@@ -856,6 +856,7 @@  const pktio_if_ops_t sock_mmsg_pktio_ops = {
 	.mac_get = sock_mac_addr_get,
 	.link_status = sock_link_status,
 	.capability = NULL,
+	.pktin_ts_res = NULL,
 	.input_queues_config = NULL,
 	.output_queues_config = NULL,
 	.recv_queue = NULL,
diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c
index caca708..d36668a 100644
--- a/platform/linux-generic/pktio/socket_mmap.c
+++ b/platform/linux-generic/pktio/socket_mmap.c
@@ -625,6 +625,7 @@  const pktio_if_ops_t sock_mmap_pktio_ops = {
 	.mac_get = sock_mmap_mac_addr_get,
 	.link_status = sock_mmap_link_status,
 	.capability = NULL,
+	.pktin_ts_res = NULL,
 	.input_queues_config = NULL,
 	.output_queues_config = NULL,
 	.recv_queue = NULL,
diff --git a/platform/linux-generic/pktio/tap.c b/platform/linux-generic/pktio/tap.c
index c895878..d075bbb 100644
--- a/platform/linux-generic/pktio/tap.c
+++ b/platform/linux-generic/pktio/tap.c
@@ -323,5 +323,6 @@  const pktio_if_ops_t tap_pktio_ops = {
 	.mtu_get = tap_mtu_get,
 	.promisc_mode_set = tap_promisc_mode_set,
 	.promisc_mode_get = tap_promisc_mode_get,
-	.mac_get = tap_mac_addr_get
+	.mac_get = tap_mac_addr_get,
+	.pktin_ts_res = NULL,
 };