On 03/12/2020 19:52, John Ousterhout wrote: > Homa uses GRO to collect batches of packets for protocol processing, > but there are times when it wants to push a batch of packet up through > the stack immediately (it doesn't want any more packets to be > processed at NAPI level before pushing the batch up). However, I can't > see a way to achieve this goal. It's kinda hacky, but you might be able to call netif_receive_skb_internal() yourself, and then return ERR_PTR(-EINPROGRESS), so that dev_gro_receive() returns GRO_CONSUMED. Of course, you'd need to be careful about out-of-order issues in case any earlier homa packets were still sitting in the rx_list.
Other than that, I don't think there's currently a way for a protocol to tell GRO to flush out the whole rx_list (which could be argued to be a layering violation, anyway). You might potentially be able to add a flag to struct napi_gro_cb and teach napi_gro_complete() or gro_normal_one() to check for it, but — we'd only consider adding something like that with an in-tree user, which your protocol doesn't appear to be AFAICT. -ed