OK, I’ll create a matching bug report.

-Matias

From: Bill Fischofer [mailto:[email protected]]
Sent: Tuesday, September 06, 2016 4:01 PM
To: Elo, Matias (Nokia - FI/Espoo) <[email protected]>
Cc: LNG ODP Mailman List <[email protected]>; Mattila, Juha (Nokia - 
FI/Oulu) <[email protected]>
Subject: Re: [lng-odp] [PATCH] linux-gen: tap: add classifier support

Is this a bug against the current pktio? If so, there should be a Bug opened to 
reflect this and commit log should point to the Bug being fixed.

On Tue, Sep 6, 2016 at 3:41 PM, Matias Elo 
<[email protected]<mailto:[email protected]>> wrote:
From: Juha Mattila <[email protected]<mailto:[email protected]>>

Add missing classifier support to tap pktio.

Signed-off-by: Juha Mattila 
<[email protected]<mailto:[email protected]>>
Signed-off-by: Matias Elo <[email protected]<mailto:[email protected]>>

Reviewed-and-tested-by: Bill Fischofer 
<[email protected]<mailto:[email protected]>>

---
 platform/linux-generic/pktio/tap.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/platform/linux-generic/pktio/tap.c 
b/platform/linux-generic/pktio/tap.c
index d758a39..ac20456 100644
--- a/platform/linux-generic/pktio/tap.c
+++ b/platform/linux-generic/pktio/tap.c
@@ -43,6 +43,7 @@
 #include <odp_packet_socket.h>
 #include <odp_packet_internal.h>
 #include <odp_packet_io_internal.h>
+#include <odp_classification_internal.h>

 #define BUF_SIZE 65536

@@ -185,8 +186,17 @@ static odp_packet_t pack_odp_pkt(pktio_entry_t 
*pktio_entry, const void *data,
 {
        odp_packet_t pkt;
        odp_packet_hdr_t *pkt_hdr;
+       odp_packet_hdr_t parsed_hdr;
        int num;

+       if (pktio_cls_enabled(pktio_entry)) {
+               if (cls_classify_packet(pktio_entry, data, len, len,
+                                       &pktio_entry->s.pkt_tap.pool,
+                                       &parsed_hdr)) {
+                       return ODP_PACKET_INVALID;
+               }
+       }
+
        num = packet_alloc_multi(pktio_entry->s.pkt_tap.pool, len, &pkt, 1);

        if (num != 1)
@@ -199,7 +209,12 @@ static odp_packet_t pack_odp_pkt(pktio_entry_t 
*pktio_entry, const void *data,
        }

        pkt_hdr = odp_packet_hdr(pkt);
-       packet_parse_l2(&pkt_hdr->p, len);
+
+       if (pktio_cls_enabled(pktio_entry))
+               copy_packet_cls_metadata(&parsed_hdr, pkt_hdr);
+       else
+               packet_parse_l2(&pkt_hdr->p, len);
+
        packet_set_ts(pkt_hdr, ts);
        pkt_hdr->input = pktio_entry->s.handle;

--
2.7.4

Reply via email to