7 .Nd Device Dependent Transmit and Receive Functions
10 .Ss "Interface Manipulation Functions"
14 .Fa "if_pkt_into_t pi"
20 .Fa "uint32_t _pidx_or_credits_"
23 .Fo isc_txd_credits_update
40 .Fa "uint64_t *paddrs"
54 .Fa "if_rxd_info_t ri"
56 .Ss "Global Variables"
57 .Vt extern struct if_txrx
59 The device dependent mechanisms for handling packet transmit and receive are
60 primarily defined by the functions named above.
61 The if_pkt_info data structure contains statistics and identifying info
62 necessary for packet transmission.
63 While the data structure for packet receipt is the if_rxd_info structure.
65 .Ss The if_pkt_info Structure
67 .Vt "struct if_pkt_info"
69 .Bl -tag -width ".Va if_capabilities" -offset indent
72 Denotes the size of packet to be sent on the transmit queue.
74 .Pq Vt "bus_dma_segment_t *"
75 A pointer to the bus_dma_segment of the device independent transfer queue
78 Unique index value assigned sequentially to each transmit queue.
79 Used to reference the currently transmitting queue.
82 Number of descriptors to be read into the device dependent transfer
86 Number of descriptors in use.
87 Calculated by subtracting the old pidx value from the new pidx value.
90 Flags defined on a per packet basis.
93 Value of first pidx sent to the isc_encap function for encapsulation and
94 subsequent transmission.
97 Value set after the termination of the isc_encap function.
98 This value will become the first pidx sent to the isc-encap the next time that
99 the function is called.
100 .It Va \fBThe Following Fields Are Used For Offload Handling\fP
101 .It Va ipi_csum_flags
103 Flags describing the checksum values, used on a per packet basis.
106 Size of the TSO Segment Size.
109 Flags describing the operational parameters of the mbuf.
112 Contains the VLAN information in the Ethernet Frame.
115 Type of ethernet header protocol as contained by the struct ether_vlan_header.
118 Length of the Ethernet Header.
121 Length of the TCP Header
124 Length of the TCP Header.
125 .It Va ipi_tcp_hflags
127 Flags describing the operational parameters of the TCP Header.
130 Specifies the type of IP Protocol in use.
131 Example TCP, UDP, or SCTP.
133 .Ss The if_rxd_info Structure
135 .Vt "struct if_rxd_info"
137 .Bl -tag -width ".Va if_capabilities" -offset indent
140 Unique index value assigned sequentially to each receive queue.
141 Used to reference the currently receiving queue.
144 Contains the VLAN information in the Ethernet Frame.
147 Denotes the size of a received packet.
148 .It Va iri_next_offset
150 Denotes the offset value for the next packet to be receive.
151 A Null value signifies the end of packet.
154 Denotes the index value of the packet currently being processed in the
158 Value of the RSS hash for the packet.
161 Flags describing the operational parameters of the mbuf contained in the
163 .It Va iri_csum_flags
165 Flags describing the checksum value contained in the receive packet.
168 Checksum data contained in the
172 .Pq Vt "struct mbuf *"
173 A mbuf for drivers that manage their own receive queues.
175 .Pq Vt "struct ifnet *"
176 A link back to the interface structure.
177 Utilized by drivers that have multiple interface per softc.
180 The value of the RSS hash type.
183 The length of any padding contained by the received data.
186 Represents the type of queue event.
187 If value >= 0 then it is the freelist id otherwise it is a completion queue
191 All function calls are associated exclusively with either packet transmission
193 The void *sc passed as the first argument to all of the following functions
194 represents the driver's softc.
195 .Ss Transmit Packet Functions
196 .Bl -ohang -offset indent
198 Transmit function that sends a packet on an interface.
199 The if_pkt_info data structure contains data information fields describing the
201 This function returns 0 if successful, otherwise an error value is returned.
203 Flush function is called immediately after the isc_txd_encap function transmits
205 It updates the hardware producer index or increments the descriptors used to
206 pidx_or_credits in the queue designated by the qid number.
207 This is often referred to as poking the doorbell register.
208 .It Fn isc_txd_credits_update
209 Credit function advances the buffer ring and calculates the credits
210 (descriptors) processed.
211 Until the I/O is complete it cleans the range in case of multisegments and
212 updates the count of processed packets.
213 The function returns the number of processed credits.
215 .Ss Receive Packet Functions
216 .Bl -ohang -offset indent
217 .It Fn isc_rxd_available
218 Function calculates the remaining number of descriptors from a position given
220 The function returns this value.
221 .It Fn isc_rxd_refill
222 Starting with the physical address paddrs, the function reads a packet into the
223 rx_ring until a value designated by count is reached.
224 vaddrs is typically not needed and is provided for devices that place their own
225 metadata in the packet header.
227 Flush function updates the producer pointer on the free list flid in queue set
228 number qid to pidx to reflect the presence of new buffers.
229 .It Fn isc_rxd_pkt_get
230 Process a single software descriptor.
231 rxr->rx_base[i] contains a descriptor that describes a received packet.
232 Hardware specific information about the buffer referred to by ri is returned in
233 the data structure if_rxd_info
240 This manual page was written by