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

Function mlx5_shared_rxq_match

dpdk/drivers/net/mlx5/mlx5_rxq.c:761–825  ·  view source on GitHub ↗

* Check whether requested Rx queue configuration matches shared RXQ. * * @param rxq_ctrl * Pointer to shared RXQ. * @param dev * Pointer to Ethernet device structure. * @param idx * Queue index. * @param desc * Number of descriptors to configure in queue. * @param socket * NUMA socket on which memory must be allocated. * @param[in] conf * Thresholds parameters. * @param m

Source from the content-addressed store, hash-verified

759 * 0 on success, a negative errno value otherwise and rte_errno is set.
760 */
761static bool
762mlx5_shared_rxq_match(struct mlx5_rxq_ctrl *rxq_ctrl, struct rte_eth_dev *dev,
763 uint16_t idx, uint16_t desc, unsigned int socket,
764 const struct rte_eth_rxconf *conf,
765 struct rte_mempool *mp)
766{
767 struct mlx5_priv *spriv = LIST_FIRST(&rxq_ctrl->owners)->priv;
768 struct mlx5_priv *priv = dev->data->dev_private;
769 unsigned int i;
770
771 RTE_SET_USED(conf);
772 if (rxq_ctrl->socket != socket) {
773 DRV_LOG(ERR, "port %u queue index %u failed to join shared group: socket mismatch",
774 dev->data->port_id, idx);
775 return false;
776 }
777 if (rxq_ctrl->rxq.elts_n != log2above(desc)) {
778 DRV_LOG(ERR, "port %u queue index %u failed to join shared group: descriptor number mismatch",
779 dev->data->port_id, idx);
780 return false;
781 }
782 if (priv->mtu != spriv->mtu) {
783 DRV_LOG(ERR, "port %u queue index %u failed to join shared group: mtu mismatch",
784 dev->data->port_id, idx);
785 return false;
786 }
787 if (priv->dev_data->dev_conf.intr_conf.rxq !=
788 spriv->dev_data->dev_conf.intr_conf.rxq) {
789 DRV_LOG(ERR, "port %u queue index %u failed to join shared group: interrupt mismatch",
790 dev->data->port_id, idx);
791 return false;
792 }
793 if (mp != NULL && rxq_ctrl->rxq.mp != mp) {
794 DRV_LOG(ERR, "port %u queue index %u failed to join shared group: mempool mismatch",
795 dev->data->port_id, idx);
796 return false;
797 } else if (mp == NULL) {
798 if (conf->rx_nseg != rxq_ctrl->rxseg_n) {
799 DRV_LOG(ERR, "port %u queue index %u failed to join shared group: segment number mismatch",
800 dev->data->port_id, idx);
801 return false;
802 }
803 for (i = 0; i < conf->rx_nseg; i++) {
804 if (memcmp(&conf->rx_seg[i].split, &rxq_ctrl->rxseg[i],
805 sizeof(struct rte_eth_rxseg_split))) {
806 DRV_LOG(ERR, "port %u queue index %u failed to join shared group: segment %u configuration mismatch",
807 dev->data->port_id, idx, i);
808 return false;
809 }
810 }
811 }
812 if (priv->config.hw_padding != spriv->config.hw_padding) {
813 DRV_LOG(ERR, "port %u queue index %u failed to join shared group: padding mismatch",
814 dev->data->port_id, idx);
815 return false;
816 }
817 if (priv->config.cqe_comp != spriv->config.cqe_comp ||
818 (priv->config.cqe_comp &&

Callers 1

mlx5_rx_queue_setupFunction · 0.85

Calls 1

log2aboveFunction · 0.85

Tested by

no test coverage detected