if (dev->mtu > ETH_DATA_LEN) { /* For now, the driver doesn't support XDP functionality with * jumbo frames so we return error.
*/
NL_SET_ERR_MSG_MOD(extack, "Jumbo frames not supported"); return -EOPNOTSUPP;
}
need_update = !!adapter->xdp_prog != !!prog; if (if_running && need_update) { for (i = 0; i < adapter->num_rx_queues; i++) {
igc_disable_rx_ring(adapter->rx_ring[i]);
igc_disable_tx_ring(adapter->tx_ring[i]);
napi_disable(&adapter->rx_ring[i]->q_vector->napi);
}
}
old_prog = xchg(&adapter->xdp_prog, prog); if (old_prog)
bpf_prog_put(old_prog);
if (prog)
xdp_features_set_redirect_target(dev, true); else
xdp_features_clear_redirect_target(dev);
if (if_running && need_update) { for (i = 0; i < adapter->num_rx_queues; i++) {
napi_enable(&adapter->rx_ring[i]->q_vector->napi);
igc_enable_tx_ring(adapter->tx_ring[i]);
igc_enable_rx_ring(adapter->rx_ring[i]);
}
}
if (queue_id >= adapter->num_rx_queues ||
queue_id >= adapter->num_tx_queues) return -EINVAL;
frame_size = xsk_pool_get_rx_frame_size(pool); if (frame_size < ETH_FRAME_LEN + VLAN_HLEN * 2) { /* When XDP is enabled, the driver doesn't support frames that * span over multiple buffers. To avoid that, we check if xsk * frame size is big enough to fit the max ethernet frame size * + vlan double tagging.
*/ return -EOPNOTSUPP;
}
err = xsk_pool_dma_map(pool, dev, IGC_RX_DMA_ATTR); if (err) {
netdev_err(ndev, "Failed to map xsk pool\n"); return err;
}
rx_ring = adapter->rx_ring[queue_id];
tx_ring = adapter->tx_ring[queue_id]; /* Rx and Tx rings share the same napi context. */
napi = &rx_ring->q_vector->napi;
if (needs_reset) {
igc_disable_rx_ring(rx_ring);
igc_disable_tx_ring(tx_ring);
napi_disable(napi);
}
rx_ring = adapter->rx_ring[queue_id];
tx_ring = adapter->tx_ring[queue_id]; /* Rx and Tx rings share the same napi context. */
napi = &rx_ring->q_vector->napi;
if (needs_reset) {
igc_disable_rx_ring(rx_ring);
igc_disable_tx_ring(tx_ring);
napi_disable(napi);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.