| 824 | } |
| 825 | |
| 826 | int |
| 827 | ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index, |
| 828 | uint16_t ntxq_descs, struct ionic_tx_qcq **txq_out) |
| 829 | { |
| 830 | struct ionic_tx_qcq *txq; |
| 831 | uint16_t flags = 0, num_segs_fw = 1; |
| 832 | int err; |
| 833 | |
| 834 | if (lif->features & IONIC_ETH_HW_TX_SG) { |
| 835 | flags |= IONIC_QCQ_F_SG; |
| 836 | num_segs_fw = IONIC_TX_MAX_SG_ELEMS_V1 + 1; |
| 837 | } |
| 838 | if (lif->state & IONIC_LIF_F_Q_IN_CMB) |
| 839 | flags |= IONIC_QCQ_F_CMB; |
| 840 | |
| 841 | IONIC_PRINT(DEBUG, "txq %u num_segs %u", index, num_segs_fw); |
| 842 | |
| 843 | err = ionic_qcq_alloc(lif, |
| 844 | IONIC_QTYPE_TXQ, |
| 845 | sizeof(struct ionic_tx_qcq), |
| 846 | socket_id, |
| 847 | index, |
| 848 | "tx", |
| 849 | flags, |
| 850 | ntxq_descs, |
| 851 | num_segs_fw, |
| 852 | sizeof(struct ionic_txq_desc), |
| 853 | sizeof(struct ionic_txq_comp), |
| 854 | sizeof(struct ionic_txq_sg_desc_v1), |
| 855 | (struct ionic_qcq **)&txq); |
| 856 | if (err) |
| 857 | return err; |
| 858 | |
| 859 | txq->flags = flags; |
| 860 | txq->num_segs_fw = num_segs_fw; |
| 861 | |
| 862 | lif->txqcqs[index] = txq; |
| 863 | *txq_out = txq; |
| 864 | |
| 865 | return 0; |
| 866 | } |
| 867 | |
| 868 | static int |
| 869 | ionic_admin_qcq_alloc(struct ionic_lif *lif) |
no test coverage detected