From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH 6/7] net/ice/base: add flow module Date: Wed, 16 Jan 2019 12:14:56 +0000 Message-ID: <9d5993d2-cbd7-7726-a543-4c5517de1ee6@intel.com> References: <20190115125658.15421-1-qi.z.zhang@intel.com> <20190115125658.15421-7-qi.z.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: paul.m.stillwell.jr@intel.com, dev@dpdk.org, bruce.richardson@intel.com To: Qi Zhang , wenzhuo.lu@intel.com, qiming.yang@intel.com Return-path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 32BFF1041 for ; Wed, 16 Jan 2019 13:15:02 +0100 (CET) In-Reply-To: <20190115125658.15421-7-qi.z.zhang@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > Signed-off-by: Paul M Stillwell Jr <...> > +/** > + * 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); ^~~~~~~~~~~~~~~~~~