err_start_queue: /* Restarting the queue with old_mem should be successful as we haven't * changed any of the queue configuration, and there is not much we can * do to recover from a failure here. * * WARN if we fail to recover the old rx queue, and at least free * old_mem so we don't also leak that.
*/ if (qops->ndo_queue_start(dev, old_mem, rxq_idx)) {
WARN(1, "Failed to restart old queue in error path. RX queue %d may be unhealthy.",
rxq_idx);
qops->ndo_queue_mem_free(dev, old_mem);
}
int __net_mp_open_rxq(struct net_device *dev, unsignedint rxq_idx, conststruct pp_memory_provider_params *p, struct netlink_ext_ack *extack)
{ struct netdev_rx_queue *rxq; int ret;
if (!netdev_need_ops_lock(dev)) return -EOPNOTSUPP;
if (rxq_idx >= dev->real_num_rx_queues) {
NL_SET_ERR_MSG(extack, "rx queue index out of range"); return -ERANGE;
}
rxq_idx = array_index_nospec(rxq_idx, dev->real_num_rx_queues);
if (dev->cfg->hds_config != ETHTOOL_TCP_DATA_SPLIT_ENABLED) {
NL_SET_ERR_MSG(extack, "tcp-data-split is disabled"); return -EINVAL;
} if (dev->cfg->hds_thresh) {
NL_SET_ERR_MSG(extack, "hds-thresh is not zero"); return -EINVAL;
} if (dev_xdp_prog_count(dev)) {
NL_SET_ERR_MSG(extack, "unable to custom memory provider to device with XDP program attached"); return -EEXIST;
}
rxq = __netif_get_rx_queue(dev, rxq_idx); if (rxq->mp_params.mp_ops) {
NL_SET_ERR_MSG(extack, "designated queue already memory provider bound"); return -EEXIST;
} #ifdef CONFIG_XDP_SOCKETS if (rxq->pool) {
NL_SET_ERR_MSG(extack, "designated queue already in use by AF_XDP"); return -EBUSY;
} #endif
rxq->mp_params = *p;
ret = netdev_rx_queue_restart(dev, rxq_idx); if (ret) {
rxq->mp_params.mp_ops = NULL;
rxq->mp_params.mp_priv = NULL;
} return ret;
}
int net_mp_open_rxq(struct net_device *dev, unsignedint rxq_idx, struct pp_memory_provider_params *p)
{ int ret;
if (WARN_ON_ONCE(ifq_idx >= dev->real_num_rx_queues)) return;
rxq = __netif_get_rx_queue(dev, ifq_idx);
/* Callers holding a netdev ref may get here after we already * went thru shutdown via dev_memory_provider_uninstall().
*/ if (dev->reg_state > NETREG_REGISTERED &&
!rxq->mp_params.mp_ops) return;
if (WARN_ON_ONCE(rxq->mp_params.mp_ops != old_p->mp_ops ||
rxq->mp_params.mp_priv != old_p->mp_priv)) return;
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.