• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/sys/dev/xen/netback/

Lines Matching defs:pkt

160 static int	xnb_ring2pkt(struct xnb_pkt *pkt,
163 static void xnb_txpkt2rsp(const struct xnb_pkt *pkt,
165 static struct mbuf *xnb_pkt2mbufc(const struct xnb_pkt *pkt, struct ifnet *ifp);
166 static int xnb_txpkt2gnttab(const struct xnb_pkt *pkt,
174 struct xnb_pkt *pkt,
176 static int xnb_rxpkt2gnttab(const struct xnb_pkt *pkt,
181 static int xnb_rxpkt2rsp(const struct xnb_pkt *pkt,
281 xnb_dump_pkt(const struct xnb_pkt *pkt) {
282 if (pkt == NULL) {
286 DPRINTF("pkt address= %p\n", pkt);
287 DPRINTF("pkt->size=%d\n", pkt->size);
288 DPRINTF("pkt->car_size=%d\n", pkt->car_size);
289 DPRINTF("pkt->flags=0x%04x\n", pkt->flags);
290 DPRINTF("pkt->list_len=%d\n", pkt->list_len);
291 /* DPRINTF("pkt->extra"); TODO */
292 DPRINTF("pkt->car=%d\n", pkt->car);
293 DPRINTF("pkt->cdr=%d\n", pkt->cdr);
294 DPRINTF("pkt->error=%d\n", pkt->error);
1476 * \param[out] pkt The returned packet. If there is an error building
1477 * the packet, pkt.list_len will be set to 0.
1483 xnb_ring2pkt(struct xnb_pkt *pkt, const netif_tx_back_ring_t *tx_ring,
1488 * 1) Initialize pkt
1493 * 6) Finalize pkt (stuff like car_size and list_len)
1500 xnb_pkt_initialize(pkt);
1505 pkt->size = tx->size;
1506 pkt->flags = tx->flags & ~NETTXF_more_data;
1508 pkt->list_len++;
1509 pkt->car = idx;
1514 if ((pkt->flags & NETTXF_extra_info) &&
1518 pkt->extra.type = ext->type;
1519 switch (pkt->extra.type) {
1521 pkt->extra.u.gso = ext->u.gso;
1532 __func__, __LINE__, pkt->extra.type);
1541 pkt->extra.flags = ext->flags;
1560 pkt->cdr = idx;
1565 pkt->list_len++;
1583 xnb_pkt_invalidate(pkt);
1587 pkt->car_size = pkt->size - cdr_size;
1590 xnb_pkt_invalidate(pkt);
1598 * Respond to all the requests that constituted pkt. Builds the responses and
1600 * \param[in] pkt the packet that needs a response
1606 xnb_txpkt2rsp(const struct xnb_pkt *pkt, netif_tx_back_ring_t *ring,
1622 status = (xnb_pkt_is_valid(pkt) == 0) || error ?
1624 KASSERT((pkt->list_len == 0) || (ring->rsp_prod_pvt == pkt->car),
1627 if (pkt->list_len >= 1) {
1636 if (pkt->flags & NETRXF_extra_info) {
1643 for (i=0; i < pkt->list_len - 1; i++) {
1658 * \param[in] pkt A packet to model the mbuf chain after
1663 xnb_pkt2mbufc(const struct xnb_pkt *pkt, struct ifnet *ifp)
1672 m = m_getm(NULL, pkt->size, M_NOWAIT, MT_DATA);
1676 if (pkt->flags & NETTXF_data_validated) {
1695 * Build a gnttab_copy table that can be used to copy data from a pkt
1698 * \param[in] pkt pkt's associated requests form the src for
1707 xnb_txpkt2gnttab(const struct xnb_pkt *pkt, struct mbuf *mbufc,
1714 RING_IDX r_idx = pkt->car; /* index into tx ring buffer */
1718 uint16_t size_remaining = pkt->size;
1724 r_idx == pkt->car ? pkt->car_size : txq->size;
1753 r_idx = (r_idx == pkt->car) ? pkt->cdr : r_idx + 1;
1817 struct xnb_pkt pkt;
1823 num_consumed = xnb_ring2pkt(&pkt, txb, txb->req_cons);
1834 if (xnb_pkt_is_valid(&pkt) == 0) {
1836 xnb_txpkt2rsp(&pkt, txb, 1);
1844 *mbufc = xnb_pkt2mbufc(&pkt, ifnet);
1851 xnb_txpkt2rsp(&pkt, txb, 1);
1858 nr_ents = xnb_txpkt2gnttab(&pkt, *mbufc, gnttab, txb, otherend);
1868 xnb_txpkt2rsp(&pkt, txb, 0);
1876 * \param[out] pkt Storage for the newly generated xnb_pkt
1881 * \retval EINVAL mbufc was corrupt or not convertible into a pkt
1886 xnb_mbufc2pkt(const struct mbuf *mbufc, struct xnb_pkt *pkt,
1895 xnb_pkt_invalidate(pkt);
1900 xnb_pkt_validate(pkt);
1901 pkt->flags = 0;
1902 pkt->size = mbufc->m_pkthdr.len;
1903 pkt->car = start;
1904 pkt->car_size = mbufc->m_len;
1907 pkt->flags |= NETRXF_extra_info;
1908 pkt->extra.u.gso.size = mbufc->m_pkthdr.tso_segsz;
1909 pkt->extra.u.gso.type = XEN_NETIF_GSO_TYPE_TCPV4;
1910 pkt->extra.u.gso.pad = 0;
1911 pkt->extra.u.gso.features = 0;
1912 pkt->extra.type = XEN_NETIF_EXTRA_TYPE_GSO;
1913 pkt->extra.flags = 0;
1914 pkt->cdr = start + 2;
1916 pkt->cdr = start + 1;
1919 pkt->flags |=
1929 pkt->list_len = howmany(pkt->size, PAGE_SIZE);
1931 if (pkt->list_len > 1) {
1932 pkt->flags |= NETRXF_more_data;
1935 slots_required = pkt->list_len +
1936 (pkt->flags & NETRXF_extra_info ? 1 : 0);
1938 xnb_pkt_invalidate(pkt);
1950 * \param[in] pkt pkt's associated responses form the dest for the copy
1959 xnb_rxpkt2gnttab(const struct xnb_pkt *pkt, const struct mbuf *mbufc,
1966 RING_IDX r_idx = pkt->car; /* index into rx ring buffer */
1972 size_remaining = (xnb_pkt_is_valid(pkt) != 0) ? pkt->size : 0;
2008 r_idx = (r_idx == pkt->car) ? pkt->cdr : r_idx + 1;
2021 * Generates responses for all the requests that constituted pkt. Builds
2024 * \param[in] pkt the packet that needs a response
2034 xnb_rxpkt2rsp(const struct xnb_pkt *pkt, const gnttab_copy_table gnttab,
2087 const int has_extra = pkt->flags & NETRXF_extra_info;
2107 ext->u.gso.size = pkt->extra.u.gso.size;
2116 if (i < pkt->list_len - 1)
2121 (pkt->flags & NETRXF_data_validated)) {
2348 * Requeue pkt and send when space is
2395 * \retval EINVAL mbufc was corrupt or not convertible into a pkt
2401 struct xnb_pkt pkt;
2406 error = xnb_mbufc2pkt(mbufc, &pkt, ring->rsp_prod_pvt, space);
2409 n_entries = xnb_rxpkt2gnttab(&pkt, mbufc, gnttab, ring, otherend);
2417 n_reqs = xnb_rxpkt2rsp(&pkt, gnttab, n_entries, ring);