Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/xen/netback/netback.c
Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | static int xnb_recv(netif_tx_back_ring_t *txb, domid_t otherend, | ||||
gnttab_copy_table gnttab); | gnttab_copy_table gnttab); | ||||
static int xnb_ring2pkt(struct xnb_pkt *pkt, | static int xnb_ring2pkt(struct xnb_pkt *pkt, | ||||
const netif_tx_back_ring_t *tx_ring, | const netif_tx_back_ring_t *tx_ring, | ||||
RING_IDX start); | RING_IDX start); | ||||
static void xnb_txpkt2rsp(const struct xnb_pkt *pkt, | static void xnb_txpkt2rsp(const struct xnb_pkt *pkt, | ||||
netif_tx_back_ring_t *ring, int error); | netif_tx_back_ring_t *ring, int error); | ||||
static struct mbuf *xnb_pkt2mbufc(const struct xnb_pkt *pkt, struct ifnet *ifp); | static struct mbuf *xnb_pkt2mbufc(const struct xnb_pkt *pkt, struct ifnet *ifp); | ||||
static int xnb_txpkt2gnttab(const struct xnb_pkt *pkt, | static int xnb_txpkt2gnttab(const struct xnb_pkt *pkt, | ||||
const struct mbuf *mbufc, | struct mbuf *mbufc, | ||||
gnttab_copy_table gnttab, | gnttab_copy_table gnttab, | ||||
const netif_tx_back_ring_t *txb, | const netif_tx_back_ring_t *txb, | ||||
domid_t otherend_id); | domid_t otherend_id); | ||||
static void xnb_update_mbufc(struct mbuf *mbufc, | static void xnb_update_mbufc(struct mbuf *mbufc, | ||||
const gnttab_copy_table gnttab, int n_entries); | const gnttab_copy_table gnttab, int n_entries); | ||||
static int xnb_mbufc2pkt(const struct mbuf *mbufc, | static int xnb_mbufc2pkt(const struct mbuf *mbufc, | ||||
struct xnb_pkt *pkt, | struct xnb_pkt *pkt, | ||||
RING_IDX start, int space); | RING_IDX start, int space); | ||||
▲ Show 20 Lines • Show All 1,528 Lines • ▼ Show 20 Lines | |||||
* the copy operation | * the copy operation | ||||
* \param[in] mbufc mbufc's storage forms the dest for the copy operation | * \param[in] mbufc mbufc's storage forms the dest for the copy operation | ||||
* \param[out] gnttab Storage for the returned grant table | * \param[out] gnttab Storage for the returned grant table | ||||
* \param[in] txb Pointer to the backend ring structure | * \param[in] txb Pointer to the backend ring structure | ||||
* \param[in] otherend_id The domain ID of the other end of the copy | * \param[in] otherend_id The domain ID of the other end of the copy | ||||
* \return The number of gnttab entries filled | * \return The number of gnttab entries filled | ||||
*/ | */ | ||||
static int | static int | ||||
xnb_txpkt2gnttab(const struct xnb_pkt *pkt, const struct mbuf *mbufc, | xnb_txpkt2gnttab(const struct xnb_pkt *pkt, struct mbuf *mbufc, | ||||
gnttab_copy_table gnttab, const netif_tx_back_ring_t *txb, | gnttab_copy_table gnttab, const netif_tx_back_ring_t *txb, | ||||
domid_t otherend_id) | domid_t otherend_id) | ||||
{ | { | ||||
const struct mbuf *mbuf = mbufc;/* current mbuf within the chain */ | struct mbuf *mbuf = mbufc;/* current mbuf within the chain */ | ||||
int gnt_idx = 0; /* index into grant table */ | int gnt_idx = 0; /* index into grant table */ | ||||
RING_IDX r_idx = pkt->car; /* index into tx ring buffer */ | RING_IDX r_idx = pkt->car; /* index into tx ring buffer */ | ||||
int r_ofs = 0; /* offset of next data within tx request's data area */ | int r_ofs = 0; /* offset of next data within tx request's data area */ | ||||
int m_ofs = 0; /* offset of next data within mbuf's data area */ | int m_ofs = 0; /* offset of next data within mbuf's data area */ | ||||
/* size in bytes that still needs to be represented in the table */ | /* size in bytes that still needs to be represented in the table */ | ||||
uint16_t size_remaining = pkt->size; | uint16_t size_remaining = pkt->size; | ||||
while (size_remaining > 0) { | while (size_remaining > 0) { | ||||
▲ Show 20 Lines • Show All 795 Lines • Show Last 20 Lines |