IFLIBTXTX(9)
π IFLIBTXTX(9) β the Kernel Developer's Manual glow-up π
okay so bestie, welcome to IFLIBTXTX(9) from the Kernel Developer's Manual. This is the page for iflibtxrx β Device Dependent Transmit and Receive Functions. Itβs giving βthe exact facts, but make it group chatβ energy, and the facts do not change. No cap. π
πΈ NAME πΈ
iflibtxrx β Device Dependent Transmit and Receive Functions
β¨ SYNOPSIS β¨
Hereβs the include, bestie β exact energy only, no renaming, no merging. periodt.
#include <ifdi_if.h>
π Interface Manipulation Functions π
int
isc_txd_encap(void *sc, if_pkt_info_t pi);
void
isc_txd_flush(void *sc, uint16_t qid, uint32_t _pidx_or_credits_);
int
isc_txd_credits_update(void *sc, uint16_t qid, bool clear);
int
isc_rxd_available(void *sc, uint16_t qsid, uint32_t cidx);
void
isc_rxd_refill(void *sc, uint16_t qsid, uint8_t flid, uint32_t pidx,
uint64_t *paddrs, caddr_t *vaddrs, uint16_t count);
void
isc_rxd_flush(void *sc, uint16_t qsid, uint8_t flid, uint32_t pidx);
int
isc_rxd_pkt_get(void *sc, if_rxd_info_t ri);
π Global Variables π
And the synopsis also lists this global variable, literally:
extern struct if_txrx
bestie, itβs written like that in the original β no semicolon added, no βfixingβ the vibe. π«Ά
π¦ DATA STRUCTURES π¦
The device dependent mechanisms for handling packet transmit and receive are primarily defined by the functions named above. The if_pkt_info data structure contains statistics and identifying info necessary for packet transmission. While the data structure for packet receipt is the if_rxd_info structure.
π The if_pkt_info Structure π
The fields of struct if_pkt_info are as follows:
ipi_len(uint32_t) β Denotes the size of packet to be sent on the transmit queue.ipi_segs(bus_dma_segment_t *) β A pointer to thebus_dma_segmentof the device independent transfer queue defined iniflib.ipi_qsidxβ Unique index value assigned sequentially to each transmit queue. Used to reference the currently transmitting queue.ipi_nsegs(uint16_t) β Number of descriptors to be read into the device dependent transfer descriptors.ipi_ndescs(uint16_t) β Number of descriptors in use. Calculated by subtracting the oldpidxvalue from the newpidxvalue.ipi_flags(uint16_t) β Flags defined on a per packet basis.ipi_pidx(uint32_t) β Value of firstpidxsent to theisc_encapfunction for encapsulation and subsequent transmission.ipi_new_pidx(uint32_t) β Value set after the termination of theisc_encapfunction. This value will become the firstpidxsent to theisc-encapthe next time that the function is called.
π The Following Fields Are Used For Offload Handling π
ipi_csum_flags(uint64_t) β Flags describing the checksum values, used on a per packet basis.ipi_tso_segsz(uint16_t) β Size of the TSO Segment Size.ipi_mflags(uint16_t) β Flags describing the operational parameters of the mbuf.ipi_vtag(uint16_t) β Contains the VLAN information in the Ethernet Frame.ipi_etype(uint16_t) β Type of ethernet header protocol as contained by thestruct ether_vlan_header.ipi_ehrdlen(uint8_t) β Length of the Ethernet Header.ipi_ip_hlen(uint8_t) β Length of the TCP Header.ipi_tcp_hlen(uint8_t) β Length of the TCP Header.ipi_tcp_hflags(uint8_t) β Flags describing the operational parameters of the TCP Header.ipi_ipproto(uint8_t) β Specifies the type of IP Protocol in use. Example TCP, UDP, or SCTP.
πΈ The if_rxd_info Structure πΈ
The fields of struct if_rxd_info are as follows:
iri_qsidx(uint16_t) β Unique index value assigned sequentially to each receive queue. Used to reference the currently receiving queue.iri_vtag(uint16_t) β Contains the VLAN information in the Ethernet Frame.iri_len(uint16_t) β Denotes the size of a received packet.iri_next_offset(uint16_t) β Denotes the offset value for the next packet to be receive. A Null value signifies the end of packet.iri_cidx(uint32_t) β Denotes the index value of the packet currently being processed in the consumer queue.iri_flowid(uint32_t) β Value of the RSS hash for the packet.iri_flags(uint) β Flags describing the operational parameters of the mbuf contained in the receive packet.iri_csum_flags(uint32_t) β Flags describing the checksum value contained in the receive packet.iri_csum_data(uint32_t) β Checksum data contained in thembuf(9)packet header.iri_m(struct mbuf *) β A mbuf for drivers that manage their own receive queues.iri_ifp(struct ifnet *) β A link back to the interface structure. Utilized by drivers that have multiple interface per softc.iri_rsstype(uint8_t) β The value of the RSS hash type.iri_pad(uint8_t) β The length of any padding contained by the received data.iri_qidx(uint8_t) β Represents the type of queue event. If value>= 0then it is the freelist id otherwise it is a completion queue event.
π₯ FUNCTIONS π₯
All function calls are associated exclusively with either packet transmission or receipt. The void *sc passed as the first argument to all of the following functions represents the driverβs softc. iykyk π
π Transmit Packet Functions π
isc_txd_encap()β Transmit function that sends a packet on an interface. Theif_pkt_infodata structure contains data information fields describing the packet. This function returns0if successful, otherwise an error value is returned.isc_txd_flush()β Flush function is called immediately after theisc_txd_encapfunction transmits a packet. It updates the hardware producer index or increments the descriptors used topidx_or_creditsin the queue designated by theqidnumber. This is often referred to as poking the doorbell register.isc_txd_credits_update()β Credit function advances the buffer ring and calculates the credits (descriptors) processed. Until the I/O is complete it cleans the range in case of multisegments and updates the count of processed packets. The function returns the number of processed credits.
π Receive Packet Functions π
isc_rxd_available()β Function calculates the remaining number of descriptors from a position given byidx. The function returns this value.isc_rxd_refill()β Starting with the physical addresspaddrs, the function reads a packet into therx_ringuntil a value designated bycountis reached.vaddrsis typically not needed and is provided for devices that place their own metadata in the packet header.isc_rxd_flush()β Flush function updates the producer pointer on the free listflidin queue set numberqidtopidxto reflect the presence of new buffers.isc_rxd_pkt_get()β Process a single software descriptor.rxr->rx_base[i]contains a descriptor that describes a received packet. Hardware specific information about the buffer referred to byriis returned in the data structureif_rxd_info.
π SEE ALSO π
π AUTHORS π
This manual page was written by Nicole Graziano.
okay bestie, thatβs the whole page π source/version: Debian; date: December 17, 2020; page: IFLIBTXTX(9). periodt β¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms