7 .Nd Device Dependent Transmit and Receive Functions
10 .Ss "Interface Manipulation Functions"
12 .Fn isc_txd_encap "void *sc, if_pkt_into_t pi"
14 .Fn isc_txd_flush "void *sc, uint16_t qid, uint32_t _pidx_or_credits_"
16 .Fn isc_txd_credits_update "void *sc, uint16_t qid, uint32_t credits"
18 .Fn isc_rxd_available "void *sc, uint16_t qsid, uint32_t cidx"
20 .Fn isc_rxd_refill "void *sc, uint16_t qsid, uint8_t flid, uint32_t pidx, uint64_t *paddrs, caddr_t *vaddrs, uint16_t count"
22 .Fn isc_rxd_flush "void *sc, uint16_t qsid, uint8_t flid, uint32_t pidx"
24 .Fn isc_rxd_pkt_get "void *sc, if_rxd_info_t ri"
25 .Ss "Global Variables"
26 .Vt extern struct if_txrx
28 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.
30 .Ss The if_pkt_info Structure
32 .Vt "struct if_pkt_info"
34 .Bl -tag -width ".Va if_capabilities" -offset indent
37 Denotes the size of packet to be sent on the transmit queue.
39 .Pq Vt "bus_dma_segment_t *"
40 A pointer to the bus_dma_segment of the device independent transfer queue defined in iflib.
42 Unique index value assigned sequentially to each transmit queue. Used to reference the currently transmitting queue.
45 Number of descriptors to be read into the device dependent transfer descriptors.
48 Number of descriptors in use. Calculated by subtracting the old pidx value from the new pidx value.
51 Flags defined on a per packet basis.
54 Value of first pidx sent to the isc_encap function for encapsulation and subsequent transmission.
57 Value set after the termination of the isc_encap function. This value will become the first pidx sent to the isc-encap the next time that the function is called.
58 .It Va \fBThe Following Fields Are Used For Offload Handling\fP
61 Flags describing the checksum values. Used on a per packet basis.
64 Size of the TSO Segment Size.
67 Flags describing the operational parameters of the mbuf.
70 Contains the VLAN information in the Ethernet Frame.
73 Type of ethernet header protocol as contained by the struct ether_vlan_header.
76 Length of the Ethernet Header.
79 Length of the TCP Header
82 Length of the TCP Header.
85 Flags describing the operational parameters of the TCP Header.
88 Specifies the type of IP Protocol in use. Example TCP, UDP, or SCTP.
90 .Ss The if_rxd_info Structure
92 .Vt "struct if_rxd_info"
94 .Bl -tag -width ".Va if_capabilities" -offset indent
97 Unique index value assigned sequentially to each receive queue. Used to reference the currently receiving queue.
100 Contains the VLAN information in the Ethernet Frame.
103 Denotes the size of a received packet.
104 .It Va iri_next_offset
106 Denotes the offset value for the next packet to be receive. A Null value signifies the end of packet.
109 Denotes the index value of the packet currently being processed in the consumer queue.
112 Value of the RSS hash for the packet.
115 Flags describing the operational parameters of the mbuf contained in the receive packet.
116 .It Va iri_csum_flags
118 Flags describing the checksum value contained in the receive packet.
121 Checksum data contained in the mbuf packet header.
123 .Pq Vt "struct mbuf *"
124 A mbuf for drivers that manage their own receive queues.
126 .Pq Vt "struct ifnet *"
127 A link back to the interface structure. Utilized by drivers that have multiple interface per softc.
130 The value of the RSS hash type.
133 The length of any padding contained by the received data.
136 Represents the type of queue event. If value >= 0 then it is the freelist id otherwise it is a completion queue event.
139 All function calls are associated exclusively with either packet transmission or receipt.
140 The void *sc passed as the first arguement to all of the following functions repressents the driver's softc.
141 .Ss Transmit Packet Functions
142 .Bl -ohang -offset indent
144 Transmit function that sends a packet on an interface. The if_pkt_info data structure contains data information fields describing the packet. This function returns 0 if successful, otherwise an error value is returned.
146 Flush function is called immediately after the isc_txd_encap function transmits a packet. It updates the hardware producer index or increments the descriptors used to pidx_or_credits in the queue designated by the qid number. This is often referred to as poking the doorbell register.
147 .It Fn isc_txd_credits_update
148 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.
150 .Ss Receive Packet Functions
151 .Bl -ohang -offset indent
152 .It Fn isc_rxd_available
153 Function calculates the remaining number of descriptors from a position given by idx. The function returns this value.
154 .It Fn isc_rxd_refill
155 Starting with the physical address paddrs, the function reads a packet into the rx_ring until a value designated by count is reached. vaddrs is typically not needed and is provided for devices that place their own metadata in the packet header.
157 Flush function updates the producer pointer on the free list flid in queue set number qid to pidx to reflect the presence of new buffers.
158 .It Fn isc_rxd_pkt_get
159 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 by ri is returned in the data structure if_rxd_info
162 iflibdd(9), iflibdi(9)
164 This manual page was written by