Skip to content

Commit d21a857

Browse files
Geetha sowjanyadavem330
authored andcommitted
octeontx2-pf: cn10k: Initialise NIX context
On CN10K platform NIX RQ and SQ context structure got changed. This patch uses new mbox message "NIX_CN10K_AQ_ENQ" for NIX context initialization on CN10K platform. This patch also updates the nix_rx_parse_s and nix_sqe_sg_s structures to add packet steering bit feilds. Signed-off-by: Geetha sowjanya <[email protected]> Signed-off-by: Sunil Goutham <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3feac50 commit d21a857

File tree

2 files changed

+80
-31
lines changed

2 files changed

+80
-31
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c

Lines changed: 73 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
767836
static 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

844889
static int otx2_cq_init(struct otx2_nic *pfvf, u16 qidx)

drivers/net/ethernet/marvell/octeontx2/nic/otx2_struct.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ struct nix_rx_parse_s {
142142
u64 vtag0_ptr : 8; /* W5 */
143143
u64 vtag1_ptr : 8;
144144
u64 flow_key_alg : 5;
145-
u64 rsvd_383_341 : 43;
145+
u64 rsvd_359_341 : 19;
146+
u64 color : 2;
147+
u64 rsvd_383_362 : 22;
146148
u64 rsvd_447_384; /* W6 */
147149
};
148150

@@ -218,7 +220,8 @@ struct nix_sqe_ext_s {
218220
u64 vlan1_ins_tci : 16;
219221
u64 vlan0_ins_ena : 1;
220222
u64 vlan1_ins_ena : 1;
221-
u64 rsvd_127_114 : 14;
223+
u64 init_color : 2;
224+
u64 rsvd_127_116 : 12;
222225
};
223226

224227
struct nix_sqe_sg_s {
@@ -237,7 +240,8 @@ struct nix_sqe_sg_s {
237240
/* NIX send memory subdescriptor structure */
238241
struct nix_sqe_mem_s {
239242
u64 offset : 16; /* W0 */
240-
u64 rsvd_52_16 : 37;
243+
u64 rsvd_51_16 : 36;
244+
u64 per_lso_seg : 1;
241245
u64 wmem : 1;
242246
u64 dsz : 2;
243247
u64 alg : 4;

0 commit comments

Comments
 (0)