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

Function ionic_lif_queue_identify

dpdk/drivers/net/ionic/ionic_lif.c:931–1004  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

929}
930
931static void
932ionic_lif_queue_identify(struct ionic_lif *lif)
933{
934 struct ionic_adapter *adapter = lif->adapter;
935 struct ionic_dev *idev = &adapter->idev;
936 union ionic_q_identity *q_ident = &adapter->ident.txq;
937 uint32_t q_words = RTE_DIM(q_ident->words);
938 uint32_t cmd_words = RTE_DIM(idev->dev_cmd->data);
939 uint32_t i, nwords, qtype;
940 int err;
941
942 for (qtype = 0; qtype < RTE_DIM(ionic_qtype_vers); qtype++) {
943 struct ionic_qtype_info *qti = &lif->qtype_info[qtype];
944
945 /* Filter out the types this driver knows about */
946 switch (qtype) {
947 case IONIC_QTYPE_ADMINQ:
948 case IONIC_QTYPE_NOTIFYQ:
949 case IONIC_QTYPE_RXQ:
950 case IONIC_QTYPE_TXQ:
951 break;
952 default:
953 continue;
954 }
955
956 memset(qti, 0, sizeof(*qti));
957
958 ionic_dev_cmd_queue_identify(idev, IONIC_LIF_TYPE_CLASSIC,
959 qtype, ionic_qtype_vers[qtype]);
960 err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
961 if (err == -EINVAL) {
962 IONIC_PRINT(ERR, "qtype %d not supported\n", qtype);
963 continue;
964 } else if (err == -EIO) {
965 IONIC_PRINT(ERR, "q_ident failed, older FW\n");
966 return;
967 } else if (err) {
968 IONIC_PRINT(ERR, "q_ident failed, qtype %d: %d\n",
969 qtype, err);
970 return;
971 }
972
973 nwords = RTE_MIN(q_words, cmd_words);
974 for (i = 0; i < nwords; i++)
975 q_ident->words[i] = ioread32(&idev->dev_cmd->data[i]);
976
977 qti->version = q_ident->version;
978 qti->supported = q_ident->supported;
979 qti->features = rte_le_to_cpu_64(q_ident->features);
980 qti->desc_sz = rte_le_to_cpu_16(q_ident->desc_sz);
981 qti->comp_sz = rte_le_to_cpu_16(q_ident->comp_sz);
982 qti->sg_desc_sz = rte_le_to_cpu_16(q_ident->sg_desc_sz);
983 qti->max_sg_elems = rte_le_to_cpu_16(q_ident->max_sg_elems);
984 qti->sg_desc_stride =
985 rte_le_to_cpu_16(q_ident->sg_desc_stride);
986
987 IONIC_PRINT(DEBUG, " qtype[%d].version = %d",
988 qtype, qti->version);

Callers 1

ionic_lif_allocFunction · 0.85

Calls 4

memsetFunction · 0.85
ionic_dev_cmd_wait_checkFunction · 0.85
ioread32Function · 0.50

Tested by

no test coverage detected