On Mon, Apr 20, 2020 at 09:58:10AM -0500, Bodong Wang wrote: [...] > @@ -796,6 +799,16 @@ static void flow_offload_work_stats(struct flow_offload_work *offload) > FLOW_OFFLOAD_DIR_REPLY, > stats[1].pkts, stats[1].bytes); > } > + > + /* Clear HW_OFFLOAD immediately when lastused stopped updating, this can > + * happen in two scenarios: > + * > + * 1. TC rule on a higher level device (e.g. vxlan) was offloaded, but > + * HW driver is unloaded. > + * 2. One of the shared block driver is unloaded. > + */ > + if (!lastused) > + clear_bit(IPS_HW_OFFLOAD_BIT, &offload->flow->ct->status); > } Better inconditionally clear off the flag after the entry is removed from hardware instead of relying on the lastused field?