MCPcopy Create free account
hub / github.com/F-Stack/f-stack / iflib_rx_structures_setup

Function iflib_rx_structures_setup

freebsd/net/iflib.c:5837–5876  ·  view source on GitHub ↗

* * Initialize all receive rings. * **********************************************************************/

Source from the content-addressed store, hash-verified

5835 *
5836 **********************************************************************/
5837static int
5838iflib_rx_structures_setup(if_ctx_t ctx)
5839{
5840 iflib_rxq_t rxq = ctx->ifc_rxqs;
5841 int q;
5842#if defined(INET6) || defined(INET)
5843 int err, i;
5844#endif
5845
5846 for (q = 0; q < ctx->ifc_softc_ctx.isc_nrxqsets; q++, rxq++) {
5847#if defined(INET6) || defined(INET)
5848 if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO) {
5849 err = tcp_lro_init_args(&rxq->ifr_lc, ctx->ifc_ifp,
5850 TCP_LRO_ENTRIES, min(1024,
5851 ctx->ifc_softc_ctx.isc_nrxd[rxq->ifr_fl_offset]));
5852 if (err != 0) {
5853 device_printf(ctx->ifc_dev,
5854 "LRO Initialization failed!\n");
5855 goto fail;
5856 }
5857 }
5858#endif
5859 IFDI_RXQ_SETUP(ctx, rxq->ifr_id);
5860 }
5861 return (0);
5862#if defined(INET6) || defined(INET)
5863fail:
5864 /*
5865 * Free LRO resources allocated so far, we will only handle
5866 * the rings that completed, the failing case will have
5867 * cleaned up for itself. 'q' failed, so its the terminus.
5868 */
5869 rxq = ctx->ifc_rxqs;
5870 for (i = 0; i < q; ++i, rxq++) {
5871 if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO)
5872 tcp_lro_free(&rxq->ifr_lc);
5873 }
5874 return (err);
5875#endif
5876}
5877
5878/*********************************************************************
5879 *

Callers 1

Calls 5

if_getcapabilitiesFunction · 0.85
tcp_lro_init_argsFunction · 0.85
minFunction · 0.85
device_printfFunction · 0.85
tcp_lro_freeFunction · 0.85

Tested by

no test coverage detected