@@ -253,7 +253,7 @@ int otx2_config_pause_frm(struct otx2_nic *pfvf)
253253 struct cgx_pause_frm_cfg * req ;
254254 int err ;
255255
256- if (is_otx2_lbkvf (pfvf -> pdev ))
256+ if (is_otx2_lbkvf (pfvf -> pdev ) || is_otx2_sdp_rep ( pfvf -> pdev ) )
257257 return 0 ;
258258
259259 mutex_lock (& pfvf -> mbox .lock );
@@ -647,20 +647,31 @@ int otx2_txschq_config(struct otx2_nic *pfvf, int lvl, int prio, bool txschq_for
647647 req -> reg [2 ] = NIX_AF_MDQX_SCHEDULE (schq );
648648 req -> regval [2 ] = dwrr_val ;
649649 } else if (lvl == NIX_TXSCH_LVL_TL4 ) {
650+ int sdp_chan = hw -> tx_chan_base + prio ;
651+
652+ if (is_otx2_sdp_rep (pfvf -> pdev ))
653+ prio = 0 ;
650654 parent = schq_list [NIX_TXSCH_LVL_TL3 ][prio ];
651655 req -> reg [0 ] = NIX_AF_TL4X_PARENT (schq );
652656 req -> regval [0 ] = (u64 )parent << 16 ;
653657 req -> num_regs ++ ;
654658 req -> reg [1 ] = NIX_AF_TL4X_SCHEDULE (schq );
655659 req -> regval [1 ] = dwrr_val ;
660+ if (is_otx2_sdp_rep (pfvf -> pdev )) {
661+ req -> num_regs ++ ;
662+ req -> reg [2 ] = NIX_AF_TL4X_SDP_LINK_CFG (schq );
663+ req -> regval [2 ] = BIT_ULL (12 ) | BIT_ULL (13 ) |
664+ (sdp_chan & 0xff );
665+ }
656666 } else if (lvl == NIX_TXSCH_LVL_TL3 ) {
657667 parent = schq_list [NIX_TXSCH_LVL_TL2 ][prio ];
658668 req -> reg [0 ] = NIX_AF_TL3X_PARENT (schq );
659669 req -> regval [0 ] = (u64 )parent << 16 ;
660670 req -> num_regs ++ ;
661671 req -> reg [1 ] = NIX_AF_TL3X_SCHEDULE (schq );
662672 req -> regval [1 ] = dwrr_val ;
663- if (lvl == hw -> txschq_link_cfg_lvl ) {
673+ if (lvl == hw -> txschq_link_cfg_lvl &&
674+ !is_otx2_sdp_rep (pfvf -> pdev )) {
664675 req -> num_regs ++ ;
665676 req -> reg [2 ] = NIX_AF_TL3_TL2X_LINKX_CFG (schq , hw -> tx_link );
666677 /* Enable this queue and backpressure
@@ -677,7 +688,8 @@ int otx2_txschq_config(struct otx2_nic *pfvf, int lvl, int prio, bool txschq_for
677688 req -> reg [1 ] = NIX_AF_TL2X_SCHEDULE (schq );
678689 req -> regval [1 ] = (u64 )hw -> txschq_aggr_lvl_rr_prio << 24 | dwrr_val ;
679690
680- if (lvl == hw -> txschq_link_cfg_lvl ) {
691+ if (lvl == hw -> txschq_link_cfg_lvl &&
692+ !is_otx2_sdp_rep (pfvf -> pdev )) {
681693 req -> num_regs ++ ;
682694 req -> reg [2 ] = NIX_AF_TL3_TL2X_LINKX_CFG (schq , hw -> tx_link );
683695 /* Enable this queue and backpressure
@@ -736,6 +748,7 @@ EXPORT_SYMBOL(otx2_smq_flush);
736748
737749int otx2_txsch_alloc (struct otx2_nic * pfvf )
738750{
751+ int chan_cnt = pfvf -> hw .tx_chan_cnt ;
739752 struct nix_txsch_alloc_req * req ;
740753 struct nix_txsch_alloc_rsp * rsp ;
741754 int lvl , schq , rc ;
@@ -748,6 +761,12 @@ int otx2_txsch_alloc(struct otx2_nic *pfvf)
748761 /* Request one schq per level */
749762 for (lvl = 0 ; lvl < NIX_TXSCH_LVL_CNT ; lvl ++ )
750763 req -> schq [lvl ] = 1 ;
764+
765+ if (is_otx2_sdp_rep (pfvf -> pdev ) && chan_cnt > 1 ) {
766+ req -> schq [NIX_TXSCH_LVL_SMQ ] = chan_cnt ;
767+ req -> schq [NIX_TXSCH_LVL_TL4 ] = chan_cnt ;
768+ }
769+
751770 rc = otx2_sync_mbox_msg (& pfvf -> mbox );
752771 if (rc )
753772 return rc ;
@@ -758,10 +777,12 @@ int otx2_txsch_alloc(struct otx2_nic *pfvf)
758777 return PTR_ERR (rsp );
759778
760779 /* Setup transmit scheduler list */
761- for (lvl = 0 ; lvl < NIX_TXSCH_LVL_CNT ; lvl ++ )
780+ for (lvl = 0 ; lvl < NIX_TXSCH_LVL_CNT ; lvl ++ ) {
781+ pfvf -> hw .txschq_cnt [lvl ] = rsp -> schq [lvl ];
762782 for (schq = 0 ; schq < rsp -> schq [lvl ]; schq ++ )
763783 pfvf -> hw .txschq_list [lvl ][schq ] =
764784 rsp -> schq_list [lvl ][schq ];
785+ }
765786
766787 pfvf -> hw .txschq_link_cfg_lvl = rsp -> link_cfg_lvl ;
767788 pfvf -> hw .txschq_aggr_lvl_rr_prio = rsp -> aggr_lvl_rr_prio ;
@@ -799,12 +820,15 @@ EXPORT_SYMBOL(otx2_txschq_free_one);
799820
800821void otx2_txschq_stop (struct otx2_nic * pfvf )
801822{
802- int lvl , schq ;
823+ int lvl , schq , idx ;
803824
804825 /* free non QOS TLx nodes */
805- for (lvl = 0 ; lvl < NIX_TXSCH_LVL_CNT ; lvl ++ )
806- otx2_txschq_free_one (pfvf , lvl ,
807- pfvf -> hw .txschq_list [lvl ][0 ]);
826+ for (lvl = 0 ; lvl < NIX_TXSCH_LVL_CNT ; lvl ++ ) {
827+ for (idx = 0 ; idx < pfvf -> hw .txschq_cnt [lvl ]; idx ++ ) {
828+ otx2_txschq_free_one (pfvf , lvl ,
829+ pfvf -> hw .txschq_list [lvl ][idx ]);
830+ }
831+ }
808832
809833 /* Clear the txschq list */
810834 for (lvl = 0 ; lvl < NIX_TXSCH_LVL_CNT ; lvl ++ ) {
@@ -884,7 +908,7 @@ static int otx2_rq_init(struct otx2_nic *pfvf, u16 qidx, u16 lpb_aura)
884908 return otx2_sync_mbox_msg (& pfvf -> mbox );
885909}
886910
887- int otx2_sq_aq_init (void * dev , u16 qidx , u16 sqb_aura )
911+ int otx2_sq_aq_init (void * dev , u16 qidx , u8 chan_offset , u16 sqb_aura )
888912{
889913 struct otx2_nic * pfvf = dev ;
890914 struct otx2_snd_queue * sq ;
@@ -903,7 +927,7 @@ int otx2_sq_aq_init(void *dev, u16 qidx, u16 sqb_aura)
903927 aq -> sq .ena = 1 ;
904928 aq -> sq .smq = otx2_get_smq_idx (pfvf , qidx );
905929 aq -> sq .smq_rr_quantum = mtu_to_dwrr_weight (pfvf , pfvf -> tx_max_pktlen );
906- aq -> sq .default_chan = pfvf -> hw .tx_chan_base ;
930+ aq -> sq .default_chan = pfvf -> hw .tx_chan_base + chan_offset ;
907931 aq -> sq .sqe_stype = NIX_STYPE_STF ; /* Cache SQB */
908932 aq -> sq .sqb_aura = sqb_aura ;
909933 aq -> sq .sq_int_ena = NIX_SQINT_BITS ;
@@ -926,6 +950,7 @@ int otx2_sq_init(struct otx2_nic *pfvf, u16 qidx, u16 sqb_aura)
926950 struct otx2_qset * qset = & pfvf -> qset ;
927951 struct otx2_snd_queue * sq ;
928952 struct otx2_pool * pool ;
953+ u8 chan_offset ;
929954 int err ;
930955
931956 pool = & pfvf -> qset .pool [sqb_aura ];
@@ -972,7 +997,8 @@ int otx2_sq_init(struct otx2_nic *pfvf, u16 qidx, u16 sqb_aura)
972997 sq -> stats .bytes = 0 ;
973998 sq -> stats .pkts = 0 ;
974999
975- err = pfvf -> hw_ops -> sq_aq_init (pfvf , qidx , sqb_aura );
1000+ chan_offset = qidx % pfvf -> hw .tx_chan_cnt ;
1001+ err = pfvf -> hw_ops -> sq_aq_init (pfvf , qidx , chan_offset , sqb_aura );
9761002 if (err ) {
9771003 kfree (sq -> sg );
9781004 sq -> sg = NULL ;
@@ -1739,6 +1765,8 @@ void mbox_handler_nix_lf_alloc(struct otx2_nic *pfvf,
17391765 pfvf -> hw .sqb_size = rsp -> sqb_size ;
17401766 pfvf -> hw .rx_chan_base = rsp -> rx_chan_base ;
17411767 pfvf -> hw .tx_chan_base = rsp -> tx_chan_base ;
1768+ pfvf -> hw .rx_chan_cnt = rsp -> rx_chan_cnt ;
1769+ pfvf -> hw .tx_chan_cnt = rsp -> tx_chan_cnt ;
17421770 pfvf -> hw .lso_tsov4_idx = rsp -> lso_tsov4_idx ;
17431771 pfvf -> hw .lso_tsov6_idx = rsp -> lso_tsov6_idx ;
17441772 pfvf -> hw .cgx_links = rsp -> cgx_links ;
0 commit comments