Lines Matching full:qs
382 struct queue_set *qs = nic->qs; in nicvf_refill_rbdr() local
383 int rbdr_idx = qs->rbdr_cnt; in nicvf_refill_rbdr()
395 rbdr = &qs->rbdr[rbdr_idx]; in nicvf_refill_rbdr()
404 if (qcount >= (qs->rbdr_len - 1)) in nicvf_refill_rbdr()
407 refill_rb_cnt = qs->rbdr_len - qcount - 1; in nicvf_refill_rbdr()
628 struct queue_set *qs, int qidx) in nicvf_reclaim_snd_queue() argument
640 struct queue_set *qs, int qidx) in nicvf_reclaim_rcv_queue() argument
650 struct queue_set *qs, int qidx) in nicvf_reclaim_cmp_queue() argument
745 static void nicvf_rcv_queue_config(struct nicvf *nic, struct queue_set *qs, in nicvf_rcv_queue_config() argument
752 rq = &qs->rq[qidx]; in nicvf_rcv_queue_config()
759 nicvf_reclaim_rcv_queue(nic, qs, qidx); in nicvf_rcv_queue_config()
764 rq->cq_qs = qs->vnic_id; in nicvf_rcv_queue_config()
766 rq->start_rbdr_qs = qs->vnic_id; in nicvf_rcv_queue_config()
767 rq->start_qs_rbdr_idx = qs->rbdr_cnt - 1; in nicvf_rcv_queue_config()
768 rq->cont_rbdr_qs = qs->vnic_id; in nicvf_rcv_queue_config()
769 rq->cont_qs_rbdr_idx = qs->rbdr_cnt - 1; in nicvf_rcv_queue_config()
778 mbx.rq.qs_num = qs->vnic_id; in nicvf_rcv_queue_config()
789 (qs->vnic_id << 0); in nicvf_rcv_queue_config()
818 void nicvf_cmp_queue_config(struct nicvf *nic, struct queue_set *qs, in nicvf_cmp_queue_config() argument
824 cq = &qs->cq[qidx]; in nicvf_cmp_queue_config()
828 nicvf_reclaim_cmp_queue(nic, qs, qidx); in nicvf_cmp_queue_config()
848 cq_cfg.qsize = ilog2(qs->cq_len >> 10); in nicvf_cmp_queue_config()
859 static void nicvf_snd_queue_config(struct nicvf *nic, struct queue_set *qs, in nicvf_snd_queue_config() argument
866 sq = &qs->sq[qidx]; in nicvf_snd_queue_config()
870 nicvf_reclaim_snd_queue(nic, qs, qidx); in nicvf_snd_queue_config()
877 sq->cq_qs = qs->vnic_id; in nicvf_snd_queue_config()
882 mbx.sq.qs_num = qs->vnic_id; in nicvf_snd_queue_config()
897 sq_cfg.qsize = ilog2(qs->sq_len >> 10); in nicvf_snd_queue_config()
902 sq_cfg.cq_limit = (CMP_QUEUE_PIPELINE_RSVD * 256) / qs->cq_len; in nicvf_snd_queue_config()
917 static void nicvf_rbdr_config(struct nicvf *nic, struct queue_set *qs, in nicvf_rbdr_config() argument
923 rbdr = &qs->rbdr[qidx]; in nicvf_rbdr_config()
946 qidx, qs->rbdr_len - 1); in nicvf_rbdr_config()
957 struct queue_set *qs = nic->qs; in nicvf_qset_config() local
960 if (!qs) { in nicvf_qset_config()
966 qs->enable = enable; in nicvf_qset_config()
967 qs->vnic_id = nic->vf_id; in nicvf_qset_config()
970 mbx.qs.msg = NIC_MBOX_MSG_QS_CFG; in nicvf_qset_config()
971 mbx.qs.num = qs->vnic_id; in nicvf_qset_config()
972 mbx.qs.sqs_count = nic->sqs_count; in nicvf_qset_config()
974 mbx.qs.cfg = 0; in nicvf_qset_config()
975 qs_cfg = (struct qs_cfg *)&mbx.qs.cfg; in nicvf_qset_config()
976 if (qs->enable) { in nicvf_qset_config()
981 qs_cfg->vnic = qs->vnic_id; in nicvf_qset_config()
992 struct queue_set *qs = nic->qs; in nicvf_free_resources() local
995 for (qidx = 0; qidx < qs->rbdr_cnt; qidx++) in nicvf_free_resources()
996 nicvf_free_rbdr(nic, &qs->rbdr[qidx]); in nicvf_free_resources()
999 for (qidx = 0; qidx < qs->cq_cnt; qidx++) in nicvf_free_resources()
1000 nicvf_free_cmp_queue(nic, &qs->cq[qidx]); in nicvf_free_resources()
1003 for (qidx = 0; qidx < qs->sq_cnt; qidx++) in nicvf_free_resources()
1004 nicvf_free_snd_queue(nic, &qs->sq[qidx]); in nicvf_free_resources()
1010 struct queue_set *qs = nic->qs; in nicvf_alloc_resources() local
1013 for (qidx = 0; qidx < qs->rbdr_cnt; qidx++) { in nicvf_alloc_resources()
1014 if (nicvf_init_rbdr(nic, &qs->rbdr[qidx], qs->rbdr_len, in nicvf_alloc_resources()
1020 for (qidx = 0; qidx < qs->sq_cnt; qidx++) { in nicvf_alloc_resources()
1021 if (nicvf_init_snd_queue(nic, &qs->sq[qidx], qs->sq_len, qidx)) in nicvf_alloc_resources()
1026 for (qidx = 0; qidx < qs->cq_cnt; qidx++) { in nicvf_alloc_resources()
1027 if (nicvf_init_cmp_queue(nic, &qs->cq[qidx], qs->cq_len)) in nicvf_alloc_resources()
1039 struct queue_set *qs; in nicvf_set_qset_resources() local
1041 qs = devm_kzalloc(&nic->pdev->dev, sizeof(*qs), GFP_KERNEL); in nicvf_set_qset_resources()
1042 if (!qs) in nicvf_set_qset_resources()
1044 nic->qs = qs; in nicvf_set_qset_resources()
1047 qs->rbdr_cnt = DEFAULT_RBDR_CNT; in nicvf_set_qset_resources()
1048 qs->rq_cnt = min_t(u8, MAX_RCV_QUEUES_PER_QS, num_online_cpus()); in nicvf_set_qset_resources()
1049 qs->sq_cnt = min_t(u8, MAX_SND_QUEUES_PER_QS, num_online_cpus()); in nicvf_set_qset_resources()
1050 qs->cq_cnt = max_t(u8, qs->rq_cnt, qs->sq_cnt); in nicvf_set_qset_resources()
1053 qs->rbdr_len = RCV_BUF_COUNT; in nicvf_set_qset_resources()
1054 qs->sq_len = SND_QUEUE_LEN; in nicvf_set_qset_resources()
1055 qs->cq_len = CMP_QUEUE_LEN; in nicvf_set_qset_resources()
1057 nic->rx_queues = qs->rq_cnt; in nicvf_set_qset_resources()
1058 nic->tx_queues = qs->sq_cnt; in nicvf_set_qset_resources()
1067 struct queue_set *qs = nic->qs; in nicvf_config_data_transfer() local
1068 struct queue_set *pqs = nic->pnicvf->qs; in nicvf_config_data_transfer()
1071 if (!qs) in nicvf_config_data_transfer()
1079 qs->cq_len = pqs->cq_len; in nicvf_config_data_transfer()
1080 qs->sq_len = pqs->sq_len; in nicvf_config_data_transfer()
1087 for (qidx = 0; qidx < qs->sq_cnt; qidx++) in nicvf_config_data_transfer()
1088 nicvf_snd_queue_config(nic, qs, qidx, enable); in nicvf_config_data_transfer()
1089 for (qidx = 0; qidx < qs->cq_cnt; qidx++) in nicvf_config_data_transfer()
1090 nicvf_cmp_queue_config(nic, qs, qidx, enable); in nicvf_config_data_transfer()
1091 for (qidx = 0; qidx < qs->rbdr_cnt; qidx++) in nicvf_config_data_transfer()
1092 nicvf_rbdr_config(nic, qs, qidx, enable); in nicvf_config_data_transfer()
1093 for (qidx = 0; qidx < qs->rq_cnt; qidx++) in nicvf_config_data_transfer()
1094 nicvf_rcv_queue_config(nic, qs, qidx, enable); in nicvf_config_data_transfer()
1096 for (qidx = 0; qidx < qs->rq_cnt; qidx++) in nicvf_config_data_transfer()
1097 nicvf_rcv_queue_config(nic, qs, qidx, disable); in nicvf_config_data_transfer()
1098 for (qidx = 0; qidx < qs->rbdr_cnt; qidx++) in nicvf_config_data_transfer()
1099 nicvf_rbdr_config(nic, qs, qidx, disable); in nicvf_config_data_transfer()
1100 for (qidx = 0; qidx < qs->sq_cnt; qidx++) in nicvf_config_data_transfer()
1101 nicvf_snd_queue_config(nic, qs, qidx, disable); in nicvf_config_data_transfer()
1102 for (qidx = 0; qidx < qs->cq_cnt; qidx++) in nicvf_config_data_transfer()
1103 nicvf_cmp_queue_config(nic, qs, qidx, disable); in nicvf_config_data_transfer()
1820 rq = &nic->qs->rq[rq_idx]; in nicvf_update_rq_stats()
1833 sq = &nic->qs->sq[sq_idx]; in nicvf_update_sq_stats()