1*41ce3b17Snaddy.\" $OpenBSD: ifiq_input.9,v 1.4 2022/03/31 17:27:23 naddy Exp $ 26cb86191Sdlg.\" 36cb86191Sdlg.\" Copyright (c) 2020 David Gwynne <dlg@openbsd.org> 46cb86191Sdlg.\" 56cb86191Sdlg.\" Permission to use, copy, modify, and distribute this software for any 66cb86191Sdlg.\" purpose with or without fee is hereby granted, provided that the above 76cb86191Sdlg.\" copyright notice and this permission notice appear in all copies. 86cb86191Sdlg.\" 96cb86191Sdlg.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 106cb86191Sdlg.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 116cb86191Sdlg.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 126cb86191Sdlg.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 136cb86191Sdlg.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 146cb86191Sdlg.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 156cb86191Sdlg.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 166cb86191Sdlg.\" 17*41ce3b17Snaddy.Dd $Mdocdate: March 31 2022 $ 186cb86191Sdlg.Dt IFIQ_INPUT 9 196cb86191Sdlg.Os 206cb86191Sdlg.Sh NAME 216cb86191Sdlg.Nm ifiq_input , 226cb86191Sdlg.Nm ifiq_enqueue 236cb86191Sdlg.Nd network interface input queue (ifiqueue) API 246cb86191Sdlg.Sh SYNOPSIS 256cb86191Sdlg.In net/if_var.h 266cb86191Sdlg.Ft int 276cb86191Sdlg.Fn ifiq_input "struct ifiqueue *ifiq" "struct mbuf_list *ml" 286cb86191Sdlg.Ft void 296cb86191Sdlg.Fn ifiq_enqueue "struct ifiqueue *ifiq" "struct mbuf *m" 306cb86191Sdlg.Sh DESCRIPTION 316cb86191SdlgThe network interface input queue (ifiqueue) API provides functions 326cb86191Sdlgfor network drivers to queue received packets for processing by the 336cb86191Sdlgnetwork stack. 346cb86191Sdlg.Bl -tag -width Ds 356cb86191Sdlg.It Fn ifiq_input "struct ifiqueue *ifq" "struct mbuf_list *ml" 366cb86191SdlgEnqueue the list of mbufs in 376cb86191Sdlg.Fa ml 386cb86191Sdlgon the 396cb86191Sdlg.Fa ifiq 406cb86191Sdlginterface input queue and notify the network stack to process them. 41*41ce3b17SnaddyIf the queue rejects the packets, they will be freed 42a672f2afSjmcand counted as drops. 436cb86191Sdlg.It Fn ifiq_enqueue "struct ifiqueue *ifq" "struct mbuf *m" 446cb86191SdlgEnqueue the mbuf 456cb86191Sdlg.Fa m 466cb86191Sdlgon the 476cb86191Sdlg.Fa ifiq 486cb86191Sdlginterface input queue and notify the network stack to process it. 496cb86191Sdlg.El 506cb86191Sdlg.Sh CONTEXT 51a672f2afSjmc.Fn ifiq_input 526cb86191Sdlgand 536cb86191Sdlg.Fn ifiq_enqueue 546cb86191Sdlgcan be called during autoconf, from process context, or from interrupt context. 556cb86191Sdlg.Sh RETURN VALUES 566cb86191Sdlg.Fn ifiq_input 576cb86191Sdlgreturns a non-zero value if mbufs are queued too rapidly for the 586cb86191Sdlgstack to process. 596cb86191SdlgIf possible, the caller should attempt to reduce the number of mbufs 60a672f2afSjmcbeing generated in the future. 61a672f2afSjmcFor example, if mbufs are being received from 626cb86191Sdlghardware managed with the interface RX ring API, 635c51f77dSdlg.Xr if_rxr_livelocked 9 646cb86191Sdlgcan be called to indicate to the hardware that backpressure is required. 656cb86191Sdlg.Sh SEE ALSO 665c51f77dSdlg.Xr if_rxr_livelocked 9 67