diff mbox series

[API-NEXT,v3,1/1] linux-gen: pktio: loop: reset packet subtype on loopback

Message ID 1499850011-9130-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v3,1/1] linux-gen: pktio: loop: reset packet subtype on loopback | expand

Commit Message

Github ODP bot July 12, 2017, 9 a.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


loop interface can get any kind of packets, but should output only basic
packets. Reset packet subtype on loopback.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 68 (lumag:packet-loop)
 ** https://github.com/Linaro/odp/pull/68
 ** Patch: https://github.com/Linaro/odp/pull/68.patch
 ** Base sha: ee5be324411a7520528a367967c28fc529d3bc2e
 ** Merge commit sha: 1d53262ac97803775f439a7ebce2d3bb10cdc3b2
 **/
 platform/linux-generic/pktio/loop.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Maxim Uvarov July 17, 2017, 9:38 p.m. UTC | #1
On 07/12/17 12:00, Github ODP bot wrote:
> From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

> 

> loop interface can get any kind of packets, but should output only basic

> packets. Reset packet subtype on loopback.

> 

> Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

> ---

> /** Email created from pull request 68 (lumag:packet-loop)

>  ** https://github.com/Linaro/odp/pull/68

>  ** Patch: https://github.com/Linaro/odp/pull/68.patch

>  ** Base sha: ee5be324411a7520528a367967c28fc529d3bc2e

>  ** Merge commit sha: 1d53262ac97803775f439a7ebce2d3bb10cdc3b2

>  **/

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

>  1 file changed, 2 insertions(+)

> 

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

> index c825393a..b1d311fa 100644

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

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

> @@ -165,6 +165,8 @@ static int loopback_send(pktio_entry_t *pktio_entry, int index ODP_UNUSED,

>  

>  	for (i = 0; i < len; ++i) {

>  		hdr_tbl[i] = packet_to_buf_hdr(pkt_tbl[i]);

> +		_odp_buffer_event_subtype_set(hdr_tbl[i]->handle.handle,

> +					      ODP_EVENT_PACKET_BASIC);

>  		bytes += odp_packet_len(pkt_tbl[i]);

>  	}

>  

> 

why only loop pktio? Should ODP_EVENT_PACKET_BASIC be assumed for all
packets from pool ODP_POOL_PACKET type?

Maxim.
Dmitry Eremin-Solenikov July 18, 2017, 10 a.m. UTC | #2
On 18.07.2017 00:38, Maxim Uvarov wrote:
> On 07/12/17 12:00, Github ODP bot wrote:

>> From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

>>

>> loop interface can get any kind of packets, but should output only basic

>> packets. Reset packet subtype on loopback.

>>

>> Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

>> ---

>> /** Email created from pull request 68 (lumag:packet-loop)

>>  ** https://github.com/Linaro/odp/pull/68

>>  ** Patch: https://github.com/Linaro/odp/pull/68.patch

>>  ** Base sha: ee5be324411a7520528a367967c28fc529d3bc2e

>>  ** Merge commit sha: 1d53262ac97803775f439a7ebce2d3bb10cdc3b2

>>  **/

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

>>  1 file changed, 2 insertions(+)

>>

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

>> index c825393a..b1d311fa 100644

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

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

>> @@ -165,6 +165,8 @@ static int loopback_send(pktio_entry_t *pktio_entry, int index ODP_UNUSED,

>>  

>>  	for (i = 0; i < len; ++i) {

>>  		hdr_tbl[i] = packet_to_buf_hdr(pkt_tbl[i]);

>> +		_odp_buffer_event_subtype_set(hdr_tbl[i]->handle.handle,

>> +					      ODP_EVENT_PACKET_BASIC);

>>  		bytes += odp_packet_len(pkt_tbl[i]);

>>  	}

>>  

>>

> why only loop pktio? Should ODP_EVENT_PACKET_BASIC be assumed for all

> packets from pool ODP_POOL_PACKET type?


loop pktio in some cases reuses old packets, instead of allocating new
ones. Maybe I need to change this patch to check if the packet comes
from ipsec and then to process it further via odp_ipsec_result() before
sending it further. I will think about it till tomorrow.

-- 
With best wishes
Dmitry
diff mbox series

Patch

diff --git a/platform/linux-generic/pktio/loop.c b/platform/linux-generic/pktio/loop.c
index c825393a..b1d311fa 100644
--- a/platform/linux-generic/pktio/loop.c
+++ b/platform/linux-generic/pktio/loop.c
@@ -165,6 +165,8 @@  static int loopback_send(pktio_entry_t *pktio_entry, int index ODP_UNUSED,
 
 	for (i = 0; i < len; ++i) {
 		hdr_tbl[i] = packet_to_buf_hdr(pkt_tbl[i]);
+		_odp_buffer_event_subtype_set(hdr_tbl[i]->handle.handle,
+					      ODP_EVENT_PACKET_BASIC);
 		bytes += odp_packet_len(pkt_tbl[i]);
 	}