On Wed, 10 Apr 2019 16:26:38 +0000, Vlad Buslov wrote: > >> Actually, I intended to modify fl_reoffload() to ignore filters with > >> 'deleted' flag set when adding, but I guess reusing 'reoffload_count' to > >> retry fl_hw_destroy_filter() would also work. > > > > Yeah, I don't see how you can ignore deleted safely. Perhaps lack of > > coffee :) > > Well, drivers are supposed to account for double deletion or deletion of > filters that were not successfully offloaded to them. If filter is not > marked as skip_sw, its creation will succeed even if hw callbacks have > failed, but __fl_delete() still calls fl_hw_destroy_filter() on such > filters. The main thing is that we must guarantee that code doesn't > delete a new filter with same key. However, in case of flower classifier > 'cookie' is pointer to filter, and filter is freed only when last > reference to it is released, so code is safe in this regard. > > So I guess there is nothing wrong with reoffload calling cb() > on all classifier filters (including marked as 'deleted'), if delete > code doesn't miss any of the callbacks afterwards.
Yup. Plus multiple/spurious deletes are already a fact of life, since we don't keep track of which callback accepted the filter and which didn't.