return primary ? primary->device_obj : channel->device_obj;
}
+/* Network processing softirq
+ * Process data in incoming ring buffer from host
+ * Stops when ring is empty or budget is met or exceeded.
+ */
int netvsc_poll(struct napi_struct *napi, int budget)
{
struct netvsc_channel *nvchan
}
hv_pkt_iter_close(channel);
- /* If ring is empty and NAPI is not doing polling */
+ /* If budget was not exhausted and
+ * not doing busy poll
+ * then re-enable host interrupts
+ * and reschedule if ring is not empty.
+ */
if (work_done < budget &&
napi_complete_done(napi, work_done) &&
hv_end_read(&channel->inbound) != 0)
return work_done;
}
+/* Call back when data is available in host ring buffer.
+ * Processing is deferred until network softirq (NAPI)
+ */
void netvsc_channel_cb(void *context)
{
struct netvsc_channel *nvchan = context;