diff mbox series

[ovs-dev,39/62] netdev-offload-dpdk: Add geneve opt header parse/push item code

Message ID 20201228092520.11807-40-taoyunxiang@cmss.chinamobile.com
State Not Applicable
Headers show
Series DPDK Offload API to test | expand

Commit Message

Tao YunXiang Dec. 28, 2020, 9:24 a.m. UTC
From: Rongyin <rongyin@cmss.chinamobile.com>

Code Source From: Self Code

Description:

     Add geneve opt header parse/push item code

Jira:  #[Optional]
市场项目编号(名称):[Optional]

NOTE: we should wait intel DPDK geneve release
---
 lib/netdev-offload-dpdk.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index 4867053..4c0a5be 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -755,12 +755,11 @@  parse_geneve_match(struct flow_patterns *patterns,
                    const struct match *match)
 {
     struct rte_flow_item_geneve *vx_spec, *vx_mask;
-    /* TBD 
+    /* TBD */
     uint8_t data_len;
     uint32_t len,opt_data;
     struct geneve_opt *opt;
     uint8_t i;
-     */
 
     if (is_all_zeros(&match->wc.masks.tunnel, sizeof match->wc.masks.tunnel)) {
         return -1;
@@ -785,19 +784,18 @@  parse_geneve_match(struct flow_patterns *patterns,
 
     add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_GENEVE, vx_spec, vx_mask);
 
-    /* TBD: add option hdr 
+    /* TBD: add option hdr */
     len = match->flow.tunnel.metadata.present.len;
     if (len > 0) {
         opt = &match->flow.tunnel.metadata.opts.gnv;
         data_len = opt->length*4;
         uint8_t *buf = (opt+1);
         for (i=0; i<data_len; i++) {
-            uint8_t val = *buf[i];
+            uint8_t val = *(buf+i);
             opt_data = opt_data | val ;
             opt_data = (i==data_len-1)? opt_data: opt_data<< 8;
         }
     }
-    */
     return 0;
 }