Hi Lorenzo, On Thu, May 23, 2024 at 02:06:16PM +0200, Lorenzo Bianconi wrote: > From: Florian Westphal <fw@xxxxxxxxx> > > This adds a small internal mapping table so that a new bpf (xdp) kfunc > can perform lookups in a flowtable. > > As-is, xdp program has access to the device pointer, but no way to do a > lookup in a flowtable -- there is no way to obtain the needed struct > without questionable stunts. > > This allows to obtain an nf_flowtable pointer given a net_device > structure. > > In order to keep backward compatibility, the infrastructure allows the > user to add a given device to multiple flowtables, but it will always > return the first added mapping performing the lookup since it assumes > the right configuration is 1:1 mapping between flowtables and net_devices. Would it be possible to move this new code in _offload.c to nf_flow_table_xdp.c? The flowtable offload code is already a bit convoluted, the hardware offload API for payload matching results in chatty with many sparse warnings (unless I adds casting everywhere), but I remember I failed to provide a convincing improvements on that front without requiring changes to drivers at the time. This is of course no related to this series.