On 1/15/2019 12:56 PM, Qi Zhang wrote: > Add the module that implemented flow abstraction that base on > flexible pipeline. > > Signed-off-by: Qi Zhang <qi.z.zh...@intel.com> > Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell...@intel.com>
<...> > +/** > + * ice_flow_find_entry - look for a flow entry using its unique ID > + * @hw: pointer to the hw struct > + * @blk: classification stage > + * @entry_id: unique ID to identify this flow entry > + * > + * This function looks for the flow entry with the specified unique ID in all > + * flow profiles of the specified classification stage. If the entry is > found, > + * and it returns the handle to the flow entry. Otherwise, it returns > + * ICE_FLOW_ENTRY_ID_INVAL. > + */ > +u64 ice_flow_find_entry(struct ice_hw *hw, enum ice_block blk, u64 entry_id) > +{ > + struct ice_flow_entry *found = NULL; > + struct ice_flow_prof *p; > + > + ice_acquire_lock(&hw->fl_profs_locks[blk]); > + > + LIST_FOR_EACH_ENTRY(p, &hw->fl_profs[blk], ice_flow_prof, l_entry) { > + struct ice_flow_entry *e; > + > + ice_acquire_lock(&p->entries_lock); > + LIST_FOR_EACH_ENTRY(e, &p->entries, ice_flow_entry, l_entry) > + if (e->id == entry_id) { > + found = e; > + break; > + } > + ice_release_lock(&p->entries_lock); > + > + if (found) > + break; > + } > + > + ice_release_lock(&hw->fl_profs_locks[blk]); > + > + return found ? ICE_FLOW_ENTRY_HNDL(found) : ICE_FLOW_ENTRY_HANDLE_INVAL; ICE_FLOW_ENTRY_HNDL macro is causing build error for 32-bits build [1], there are a few more usage of this macro, all are causing same issue: [1] Building i686-native-linuxapp-gcc ... In file included from .../drivers/net/ice/base/ice_flow.c:6: .../drivers/net/ice/base/ice_flow.c: In function ‘ice_flow_find_entry’: .../drivers/net/ice/base/ice_flow.h:242:33: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] #define ICE_FLOW_ENTRY_HNDL(e) ((u64)e) ^ .../drivers/net/ice/base/ice_flow.c:1247:17: note: in expansion of macro ‘ICE_FLOW_ENTRY_HNDL’ return found ? ICE_FLOW_ENTRY_HNDL(found) : ICE_FLOW_ENTRY_HANDLE_INVAL; ^~~~~~~~~~~~~~~~~~~ <...> > +/** > + * ice_flow_rem_entry - Remove a flow entry > + * @hw: pointer to the hw struct > + * @entry_h: handle to the flow entry to be removed > + */ > +enum ice_status ice_flow_rem_entry(struct ice_hw *hw, u64 entry_h) > +{ > + struct ice_flow_entry *entry; > + struct ice_flow_prof *prof; > + enum ice_status status; > + > + if (entry_h == ICE_FLOW_ENTRY_HANDLE_INVAL) > + return ICE_ERR_PARAM; > + > + entry = ICE_FLOW_ENTRY_PTR(entry_h); causing build error for 32-bits [2]: [2] .../drivers/net/ice/base/ice_flow.c: In function ‘ice_flow_rem_entry’: .../drivers/net/ice/base/ice_flow.h:243:32: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] #define ICE_FLOW_ENTRY_PTR(h) ((struct ice_flow_entry *)(h)) ^ .../drivers/net/ice/base/ice_flow.c:1350:10: note: in expansion of macro ‘ICE_FLOW_ENTRY_PTR’ entry = ICE_FLOW_ENTRY_PTR(entry_h); ^~~~~~~~~~~~~~~~~~