1.\" $OpenBSD: ifiq_input.9,v 1.3 2020/06/05 05:33:58 jmc Exp $ 2.\" 3.\" Copyright (c) 2020 David Gwynne <dlg@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: June 5 2020 $ 18.Dt IFIQ_INPUT 9 19.Os 20.Sh NAME 21.Nm ifiq_input , 22.Nm ifiq_enqueue 23.Nd network interface input queue (ifiqueue) API 24.Sh SYNOPSIS 25.In net/if_var.h 26.Ft int 27.Fn ifiq_input "struct ifiqueue *ifiq" "struct mbuf_list *ml" 28.Ft void 29.Fn ifiq_enqueue "struct ifiqueue *ifiq" "struct mbuf *m" 30.Sh DESCRIPTION 31The network interface input queue (ifiqueue) API provides functions 32for network drivers to queue received packets for processing by the 33network stack. 34.Bl -tag -width Ds 35.It Fn ifiq_input "struct ifiqueue *ifq" "struct mbuf_list *ml" 36Enqueue the list of mbufs in 37.Fa ml 38on the 39.Fa ifiq 40interface input queue and notify the network stack to process them. 41If the queue rejects the packets they will be freed 42and counted as drops. 43.It Fn ifiq_enqueue "struct ifiqueue *ifq" "struct mbuf *m" 44Enqueue the mbuf 45.Fa m 46on the 47.Fa ifiq 48interface input queue and notify the network stack to process it. 49.El 50.Sh CONTEXT 51.Fn ifiq_input 52and 53.Fn ifiq_enqueue 54can be called during autoconf, from process context, or from interrupt context. 55.Sh RETURN VALUES 56.Fn ifiq_input 57returns a non-zero value if mbufs are queued too rapidly for the 58stack to process. 59If possible, the caller should attempt to reduce the number of mbufs 60being generated in the future. 61For example, if mbufs are being received from 62hardware managed with the interface RX ring API, 63.Xr if_rxr_livelocked 9 64can be called to indicate to the hardware that backpressure is required. 65.Sh SEE ALSO 66.Xr if_rxr_livelocked 9 67