net/ice/base: increase protocol offset size
authorQi Zhang <qi.z.zhang@intel.com>
Mon, 25 Mar 2019 05:44:50 +0000 (13:44 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 29 Mar 2019 16:25:31 +0000 (17:25 +0100)
OS package's format is changed, field vector's protocol offset size is
changed from 8 bit to 16 bit. So base code also need to align to this,
or PMD will not be able to load OS package correctly.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Reviewed-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
drivers/net/ice/base/ice_flex_type.h
drivers/net/ice/base/ice_flow.c
drivers/net/ice/base/ice_flow.h
drivers/net/ice/base/ice_protocol_type.h

index 365f333..f259e13 100644 (file)
@@ -5,12 +5,18 @@
 #ifndef _ICE_FLEX_TYPE_H_
 #define _ICE_FLEX_TYPE_H_
 
+#define ICE_FV_OFFSET_INVAL    0x1FF
+
+#pragma pack(1)
 /* Extraction Sequence (Field Vector) Table */
 struct ice_fv_word {
        u8 prot_id;
-       u8 off;         /* Offset within the protocol header */
+       u16 off;                /* Offset within the protocol header */
+       u8 resvrd;
 };
 
+#pragma pack()
+
 #define ICE_MAX_FV_WORDS 48
 struct ice_fv {
        struct ice_fv_word ew[ICE_MAX_FV_WORDS];
index 98727cf..be819e0 100644 (file)
@@ -516,7 +516,7 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params,
        struct ice_flow_fld_info *flds;
        u16 cnt, ese_bits, i;
        s16 adj = 0;
-       u8 off;
+       u16 off;
 
        flds = params->prof->segs[seg].fields;
 
@@ -956,7 +956,10 @@ ice_flow_add_prof_sync(struct ice_hw *hw, enum ice_block blk,
                return ICE_ERR_NO_MEMORY;
 
        /* initialize extraction sequence to all invalid (0xff) */
-       ice_memset(params.es, 0xff, sizeof(params.es), ICE_NONDMA_MEM);
+       for (i = 0; i < ICE_MAX_FV_WORDS; i++) {
+               params.es[i].prot_id = ICE_PROT_INVALID;
+               params.es[i].off = ICE_FV_OFFSET_INVAL;
+       }
 
        params.blk = blk;
        params.prof->id = prof_id;
index bad925c..f0c74a3 100644 (file)
@@ -174,7 +174,7 @@ enum ice_flow_priority {
 
 struct ice_flow_seg_xtrct {
        u8 prot_id;     /* Protocol ID of extracted header field */
-       u8 off;         /* Starting offset of the field in header in bytes */
+       u16 off;        /* Starting offset of the field in header in bytes */
        u8 idx;         /* Index of FV entry used */
        u8 disp;        /* Displacement of field in bits fr. FV entry's start */
 };
index 6b3bd65..e572dd3 100644 (file)
@@ -223,7 +223,7 @@ struct ice_prot_lkup_ext {
        u16 prot_type;
        u8 n_val_words;
        /* create a buffer to hold max words per recipe */
-       u8 field_off[ICE_MAX_CHAIN_WORDS];
+       u16 field_off[ICE_MAX_CHAIN_WORDS];
 
        struct ice_fv_word fv_words[ICE_MAX_CHAIN_WORDS];