static void recv_sbd_ipc_frames(struct mem_link_device *mld, struct mem_snapshot *mst) { struct sbd_link_device *sl = &mld->sbd_link_dev; int i; for (i = 0; i < sl->num_channels; i++) { struct sbd_ring_buffer *rb = sbd_id2rb(sl, i, RX); if (unlikely(rb_empty(rb))) continue; if (likely(sipc_ps_ch(rb->ch))) rx_net_frames_from_rb(rb); else rx_ipc_frames_from_rb(rb); } }
int mem_netdev_poll(struct napi_struct *napi, int budget) { int rcvd; struct vnet *vnet = netdev_priv(napi->dev); struct mem_link_device *mld = container_of(vnet->ld, struct mem_link_device, link_dev); struct sbd_ring_buffer *rb = sbd_ch2rb(&mld->sbd_link_dev, vnet->iod->id, RX); rcvd = rx_net_frames_from_rb(rb, budget); /* no more ring buffer to process */ if (rcvd < budget) { napi_complete(napi); //vnet->ld->enable_irq(vnet->ld); } mif_debug("%d pkts\n", rcvd); return rcvd; }
/** @brief receive all @b IPC message frames in all RXQs In a for loop,\n 1) Checks any REQ_ACK received.\n 2) Receives all IPC link frames in every RXQ.\n 3) Sends RES_ACK if there was REQ_ACK from CP.\n 4) Checks any RES_ACK received.\n @param mld the pointer to a mem_link_device instance @param mst the pointer to a mem_snapshot instance */ void recv_sbd_ipc_frames(struct mem_link_device *mld) { struct sbd_link_device *sl = &mld->sbd_link_dev; int i; for (i = 0; i < sl->num_channels; i++) { struct sbd_ring_buffer *rb = sbd_id2rb(sl, i, RX); if (unlikely(rb_empty(rb))) continue; if (likely(sipc_ps_ch(rb->ch))) { #ifdef CONFIG_LINK_DEVICE_NAPI //mld->link_dev.disable_irq(&mld->link_dev); if (napi_schedule_prep(&rb->iod->napi)) __napi_schedule(&rb->iod->napi); #else rx_net_frames_from_rb(rb, 0); #endif } else { rx_ipc_frames_from_rb(rb); } } }