@@ -764,11 +764,79 @@ static int otx2_rq_init(struct otx2_nic *pfvf, u16 qidx, u16 lpb_aura)
764764 return otx2_sync_mbox_msg (& pfvf -> mbox );
765765}
766766
767+ static int cn10k_sq_aq_init (struct otx2_nic * pfvf , u16 qidx , u16 sqb_aura )
768+ {
769+ struct nix_cn10k_aq_enq_req * aq ;
770+
771+ /* Get memory to put this msg */
772+ aq = otx2_mbox_alloc_msg_nix_cn10k_aq_enq (& pfvf -> mbox );
773+ if (!aq )
774+ return - ENOMEM ;
775+
776+ aq -> sq .cq = pfvf -> hw .rx_queues + qidx ;
777+ aq -> sq .max_sqe_size = NIX_MAXSQESZ_W16 ; /* 128 byte */
778+ aq -> sq .cq_ena = 1 ;
779+ aq -> sq .ena = 1 ;
780+ /* Only one SMQ is allocated, map all SQ's to that SMQ */
781+ aq -> sq .smq = pfvf -> hw .txschq_list [NIX_TXSCH_LVL_SMQ ][0 ];
782+ /* FIXME: set based on NIX_AF_DWRR_RPM_MTU*/
783+ aq -> sq .smq_rr_weight = OTX2_MAX_MTU ;
784+ aq -> sq .default_chan = pfvf -> hw .tx_chan_base ;
785+ aq -> sq .sqe_stype = NIX_STYPE_STF ; /* Cache SQB */
786+ aq -> sq .sqb_aura = sqb_aura ;
787+ aq -> sq .sq_int_ena = NIX_SQINT_BITS ;
788+ aq -> sq .qint_idx = 0 ;
789+ /* Due pipelining impact minimum 2000 unused SQ CQE's
790+ * need to maintain to avoid CQ overflow.
791+ */
792+ aq -> sq .cq_limit = ((SEND_CQ_SKID * 256 ) / (pfvf -> qset .sqe_cnt ));
793+
794+ /* Fill AQ info */
795+ aq -> qidx = qidx ;
796+ aq -> ctype = NIX_AQ_CTYPE_SQ ;
797+ aq -> op = NIX_AQ_INSTOP_INIT ;
798+
799+ return otx2_sync_mbox_msg (& pfvf -> mbox );
800+ }
801+
802+ static int otx2_sq_aq_init (struct otx2_nic * pfvf , u16 qidx , u16 sqb_aura )
803+ {
804+ struct nix_aq_enq_req * aq ;
805+
806+ /* Get memory to put this msg */
807+ aq = otx2_mbox_alloc_msg_nix_aq_enq (& pfvf -> mbox );
808+ if (!aq )
809+ return - ENOMEM ;
810+
811+ aq -> sq .cq = pfvf -> hw .rx_queues + qidx ;
812+ aq -> sq .max_sqe_size = NIX_MAXSQESZ_W16 ; /* 128 byte */
813+ aq -> sq .cq_ena = 1 ;
814+ aq -> sq .ena = 1 ;
815+ /* Only one SMQ is allocated, map all SQ's to that SMQ */
816+ aq -> sq .smq = pfvf -> hw .txschq_list [NIX_TXSCH_LVL_SMQ ][0 ];
817+ aq -> sq .smq_rr_quantum = DFLT_RR_QTM ;
818+ aq -> sq .default_chan = pfvf -> hw .tx_chan_base ;
819+ aq -> sq .sqe_stype = NIX_STYPE_STF ; /* Cache SQB */
820+ aq -> sq .sqb_aura = sqb_aura ;
821+ aq -> sq .sq_int_ena = NIX_SQINT_BITS ;
822+ aq -> sq .qint_idx = 0 ;
823+ /* Due pipelining impact minimum 2000 unused SQ CQE's
824+ * need to maintain to avoid CQ overflow.
825+ */
826+ aq -> sq .cq_limit = ((SEND_CQ_SKID * 256 ) / (pfvf -> qset .sqe_cnt ));
827+
828+ /* Fill AQ info */
829+ aq -> qidx = qidx ;
830+ aq -> ctype = NIX_AQ_CTYPE_SQ ;
831+ aq -> op = NIX_AQ_INSTOP_INIT ;
832+
833+ return otx2_sync_mbox_msg (& pfvf -> mbox );
834+ }
835+
767836static int otx2_sq_init (struct otx2_nic * pfvf , u16 qidx , u16 sqb_aura )
768837{
769838 struct otx2_qset * qset = & pfvf -> qset ;
770839 struct otx2_snd_queue * sq ;
771- struct nix_aq_enq_req * aq ;
772840 struct otx2_pool * pool ;
773841 int err ;
774842
@@ -811,34 +879,11 @@ static int otx2_sq_init(struct otx2_nic *pfvf, u16 qidx, u16 sqb_aura)
811879 sq -> stats .bytes = 0 ;
812880 sq -> stats .pkts = 0 ;
813881
814- /* Get memory to put this msg */
815- aq = otx2_mbox_alloc_msg_nix_aq_enq (& pfvf -> mbox );
816- if (!aq )
817- return - ENOMEM ;
818-
819- aq -> sq .cq = pfvf -> hw .rx_queues + qidx ;
820- aq -> sq .max_sqe_size = NIX_MAXSQESZ_W16 ; /* 128 byte */
821- aq -> sq .cq_ena = 1 ;
822- aq -> sq .ena = 1 ;
823- /* Only one SMQ is allocated, map all SQ's to that SMQ */
824- aq -> sq .smq = pfvf -> hw .txschq_list [NIX_TXSCH_LVL_SMQ ][0 ];
825- aq -> sq .smq_rr_quantum = DFLT_RR_QTM ;
826- aq -> sq .default_chan = pfvf -> hw .tx_chan_base ;
827- aq -> sq .sqe_stype = NIX_STYPE_STF ; /* Cache SQB */
828- aq -> sq .sqb_aura = sqb_aura ;
829- aq -> sq .sq_int_ena = NIX_SQINT_BITS ;
830- aq -> sq .qint_idx = 0 ;
831- /* Due pipelining impact minimum 2000 unused SQ CQE's
832- * need to maintain to avoid CQ overflow.
833- */
834- aq -> sq .cq_limit = ((SEND_CQ_SKID * 256 ) / (sq -> sqe_cnt ));
835-
836- /* Fill AQ info */
837- aq -> qidx = qidx ;
838- aq -> ctype = NIX_AQ_CTYPE_SQ ;
839- aq -> op = NIX_AQ_INSTOP_INIT ;
882+ if (is_dev_otx2 (pfvf -> pdev ))
883+ return otx2_sq_aq_init (pfvf , qidx , sqb_aura );
884+ else
885+ return cn10k_sq_aq_init (pfvf , qidx , sqb_aura );
840886
841- return otx2_sync_mbox_msg (& pfvf -> mbox );
842887}
843888
844889static int otx2_cq_init (struct otx2_nic * pfvf , u16 qidx )
0 commit comments