Lines Matching refs:ppe_cb
18 void hns_ppe_set_tso_enable(struct hns_ppe_cb *ppe_cb, u32 value) in hns_ppe_set_tso_enable() argument
20 dsaf_set_dev_bit(ppe_cb, PPEV2_CFG_TSO_EN_REG, 0, !!value); in hns_ppe_set_tso_enable()
23 void hns_ppe_set_rss_key(struct hns_ppe_cb *ppe_cb, in hns_ppe_set_rss_key() argument
29 dsaf_write_dev(ppe_cb, PPEV2_RSS_KEY_REG + key_item * 0x4, in hns_ppe_set_rss_key()
33 void hns_ppe_set_indir_table(struct hns_ppe_cb *ppe_cb, in hns_ppe_set_indir_table() argument
40 reg_value = dsaf_read_dev(ppe_cb, in hns_ppe_set_indir_table()
56 ppe_cb, PPEV2_INDRECTION_TBL_REG + i * 0x4, reg_value); in hns_ppe_set_indir_table()
83 struct_size(ppe_common, ppe_cb, ppe_num), in hns_ppe_common_get_cfg()
119 struct hns_ppe_cb *ppe_cb; in hns_ppe_get_cfg() local
123 ppe_cb = &ppe_common->ppe_cb[i]; in hns_ppe_get_cfg()
124 ppe_cb->dev = ppe_common->dev; in hns_ppe_get_cfg()
125 ppe_cb->next = NULL; in hns_ppe_get_cfg()
126 ppe_cb->ppe_common_cb = ppe_common; in hns_ppe_get_cfg()
127 ppe_cb->index = i; in hns_ppe_get_cfg()
128 ppe_cb->io_base = hns_ppe_get_iobase(ppe_common, i); in hns_ppe_get_cfg()
129 ppe_cb->virq = 0; in hns_ppe_get_cfg()
133 static void hns_ppe_cnt_clr_ce(struct hns_ppe_cb *ppe_cb) in hns_ppe_cnt_clr_ce() argument
135 dsaf_set_dev_bit(ppe_cb, PPE_TNL_0_5_CNT_CLR_CE_REG, in hns_ppe_cnt_clr_ce()
139 static void hns_ppe_set_vlan_strip(struct hns_ppe_cb *ppe_cb, int en) in hns_ppe_set_vlan_strip() argument
141 dsaf_write_dev(ppe_cb, PPEV2_VLAN_STRIP_EN_REG, en); in hns_ppe_set_vlan_strip()
149 static void hns_ppe_checksum_hw(struct hns_ppe_cb *ppe_cb, u32 value) in hns_ppe_checksum_hw() argument
151 dsaf_set_dev_field(ppe_cb, PPE_CFG_PRO_CHECK_EN_REG, in hns_ppe_checksum_hw()
185 static void hns_ppe_set_port_mode(struct hns_ppe_cb *ppe_cb, in hns_ppe_set_port_mode() argument
188 dsaf_write_dev(ppe_cb, PPE_CFG_XGE_MODE_REG, mode); in hns_ppe_set_port_mode()
257 static void hns_ppe_exc_irq_en(struct hns_ppe_cb *ppe_cb, int en) in hns_ppe_exc_irq_en() argument
269 dsaf_write_dev(ppe_cb, PPE_RINT_REG, clr_vlue); in hns_ppe_exc_irq_en()
272 dsaf_write_dev(ppe_cb, PPE_INTEN_REG, msk_vlue & vld_msk); in hns_ppe_exc_irq_en()
275 int hns_ppe_wait_tx_fifo_clean(struct hns_ppe_cb *ppe_cb) in hns_ppe_wait_tx_fifo_clean() argument
282 val = dsaf_read_dev(ppe_cb, PPE_CURR_TX_FIFO0_REG) & 0x3ffU; in hns_ppe_wait_tx_fifo_clean()
290 dev_err(ppe_cb->dev, "hns ppe tx fifo clean wait timeout, still has %u pkt.\n", in hns_ppe_wait_tx_fifo_clean()
302 static void hns_ppe_init_hw(struct hns_ppe_cb *ppe_cb) in hns_ppe_init_hw() argument
304 struct ppe_common_cb *ppe_common_cb = ppe_cb->ppe_common_cb; in hns_ppe_init_hw()
305 u32 port = ppe_cb->index; in hns_ppe_init_hw()
310 netdev_rss_key_fill(ppe_cb->rss_key, HNS_PPEV2_RSS_KEY_SIZE); in hns_ppe_init_hw()
317 hns_ppe_exc_irq_en(ppe_cb, 0); in hns_ppe_init_hw()
320 hns_ppe_set_port_mode(ppe_cb, PPE_MODE_GE); in hns_ppe_init_hw()
321 dsaf_write_dev(ppe_cb, PPE_CFG_PAUSE_IDLE_CNT_REG, 0); in hns_ppe_init_hw()
323 hns_ppe_set_port_mode(ppe_cb, PPE_MODE_XGE); in hns_ppe_init_hw()
326 hns_ppe_checksum_hw(ppe_cb, 0xffffffff); in hns_ppe_init_hw()
327 hns_ppe_cnt_clr_ce(ppe_cb); in hns_ppe_init_hw()
330 hns_ppe_set_vlan_strip(ppe_cb, 0); in hns_ppe_init_hw()
332 dsaf_write_dev(ppe_cb, PPE_CFG_MAX_FRAME_LEN_REG, in hns_ppe_init_hw()
336 hns_ppe_set_rss_key(ppe_cb, ppe_cb->rss_key); in hns_ppe_init_hw()
340 ppe_cb->rss_indir_table[i] = i; in hns_ppe_init_hw()
341 hns_ppe_set_indir_table(ppe_cb, ppe_cb->rss_indir_table); in hns_ppe_init_hw()
349 static void hns_ppe_uninit_hw(struct hns_ppe_cb *ppe_cb) in hns_ppe_uninit_hw() argument
353 if (ppe_cb->ppe_common_cb) { in hns_ppe_uninit_hw()
354 struct dsaf_device *dsaf_dev = ppe_cb->ppe_common_cb->dsaf_dev; in hns_ppe_uninit_hw()
356 port = ppe_cb->index; in hns_ppe_uninit_hw()
367 hns_ppe_uninit_hw(&ppe_common->ppe_cb[i]); in hns_ppe_uninit_ex()
368 memset(&ppe_common->ppe_cb[i], 0, sizeof(struct hns_ppe_cb)); in hns_ppe_uninit_ex()
404 hns_ppe_init_hw(&ppe_common->ppe_cb[i]); in hns_ppe_reset_common()
414 void hns_ppe_update_stats(struct hns_ppe_cb *ppe_cb) in hns_ppe_update_stats() argument
416 struct hns_ppe_hw_stats *hw_stats = &ppe_cb->hw_stats; in hns_ppe_update_stats()
419 += dsaf_read_dev(ppe_cb, PPE_HIS_RX_SW_PKT_CNT_REG); in hns_ppe_update_stats()
421 += dsaf_read_dev(ppe_cb, PPE_HIS_RX_WR_BD_OK_PKT_CNT_REG); in hns_ppe_update_stats()
423 += dsaf_read_dev(ppe_cb, PPE_HIS_RX_PKT_NO_BUF_CNT_REG); in hns_ppe_update_stats()
425 += dsaf_read_dev(ppe_cb, PPE_HIS_RX_APP_BUF_FAIL_CNT_REG); in hns_ppe_update_stats()
427 += dsaf_read_dev(ppe_cb, PPE_HIS_RX_APP_BUF_WAIT_CNT_REG); in hns_ppe_update_stats()
429 += dsaf_read_dev(ppe_cb, PPE_HIS_RX_PKT_DROP_FUL_CNT_REG); in hns_ppe_update_stats()
431 += dsaf_read_dev(ppe_cb, PPE_HIS_RX_PKT_DROP_PRT_CNT_REG); in hns_ppe_update_stats()
434 += dsaf_read_dev(ppe_cb, PPE_HIS_TX_BD_CNT_REG); in hns_ppe_update_stats()
436 += dsaf_read_dev(ppe_cb, PPE_HIS_TX_PKT_CNT_REG); in hns_ppe_update_stats()
438 += dsaf_read_dev(ppe_cb, PPE_HIS_TX_PKT_OK_CNT_REG); in hns_ppe_update_stats()
440 += dsaf_read_dev(ppe_cb, PPE_HIS_TX_PKT_EPT_CNT_REG); in hns_ppe_update_stats()
442 += dsaf_read_dev(ppe_cb, PPE_HIS_TX_PKT_CS_FAIL_CNT_REG); in hns_ppe_update_stats()
463 void hns_ppe_get_strings(struct hns_ppe_cb *ppe_cb, int stringset, u8 *data) in hns_ppe_get_strings() argument
465 int index = ppe_cb->index; in hns_ppe_get_strings()
483 void hns_ppe_get_stats(struct hns_ppe_cb *ppe_cb, u64 *data) in hns_ppe_get_stats() argument
486 struct hns_ppe_hw_stats *hw_stats = &ppe_cb->hw_stats; in hns_ppe_get_stats()
543 void hns_ppe_get_regs(struct hns_ppe_cb *ppe_cb, void *data) in hns_ppe_get_regs() argument
545 struct ppe_common_cb *ppe_common = ppe_cb->ppe_common_cb; in hns_ppe_get_regs()
576 regs[525] = dsaf_read_dev(ppe_cb, PPE_CFG_TX_FIFO_THRSLD_REG); in hns_ppe_get_regs()
577 regs[526] = dsaf_read_dev(ppe_cb, PPE_CFG_RX_FIFO_THRSLD_REG); in hns_ppe_get_regs()
578 regs[527] = dsaf_read_dev(ppe_cb, PPE_CFG_RX_FIFO_PAUSE_THRSLD_REG); in hns_ppe_get_regs()
579 regs[528] = dsaf_read_dev(ppe_cb, PPE_CFG_RX_FIFO_SW_BP_THRSLD_REG); in hns_ppe_get_regs()
580 regs[529] = dsaf_read_dev(ppe_cb, PPE_CFG_PAUSE_IDLE_CNT_REG); in hns_ppe_get_regs()
581 regs[530] = dsaf_read_dev(ppe_cb, PPE_CFG_BUS_CTRL_REG); in hns_ppe_get_regs()
582 regs[531] = dsaf_read_dev(ppe_cb, PPE_CFG_TNL_TO_BE_RST_REG); in hns_ppe_get_regs()
583 regs[532] = dsaf_read_dev(ppe_cb, PPE_CURR_TNL_CAN_RST_REG); in hns_ppe_get_regs()
585 regs[533] = dsaf_read_dev(ppe_cb, PPE_CFG_XGE_MODE_REG); in hns_ppe_get_regs()
586 regs[534] = dsaf_read_dev(ppe_cb, PPE_CFG_MAX_FRAME_LEN_REG); in hns_ppe_get_regs()
587 regs[535] = dsaf_read_dev(ppe_cb, PPE_CFG_RX_PKT_MODE_REG); in hns_ppe_get_regs()
588 regs[536] = dsaf_read_dev(ppe_cb, PPE_CFG_RX_VLAN_TAG_REG); in hns_ppe_get_regs()
589 regs[537] = dsaf_read_dev(ppe_cb, PPE_CFG_TAG_GEN_REG); in hns_ppe_get_regs()
590 regs[538] = dsaf_read_dev(ppe_cb, PPE_CFG_PARSE_TAG_REG); in hns_ppe_get_regs()
591 regs[539] = dsaf_read_dev(ppe_cb, PPE_CFG_PRO_CHECK_EN_REG); in hns_ppe_get_regs()
593 regs[540] = dsaf_read_dev(ppe_cb, PPE_INTEN_REG); in hns_ppe_get_regs()
594 regs[541] = dsaf_read_dev(ppe_cb, PPE_RINT_REG); in hns_ppe_get_regs()
595 regs[542] = dsaf_read_dev(ppe_cb, PPE_INTSTS_REG); in hns_ppe_get_regs()
596 regs[543] = dsaf_read_dev(ppe_cb, PPE_CFG_RX_PKT_INT_REG); in hns_ppe_get_regs()
598 regs[544] = dsaf_read_dev(ppe_cb, PPE_CFG_HEAT_DECT_TIME0_REG); in hns_ppe_get_regs()
599 regs[545] = dsaf_read_dev(ppe_cb, PPE_CFG_HEAT_DECT_TIME1_REG); in hns_ppe_get_regs()
602 regs[546] = dsaf_read_dev(ppe_cb, PPE_HIS_RX_SW_PKT_CNT_REG); in hns_ppe_get_regs()
603 regs[547] = dsaf_read_dev(ppe_cb, PPE_HIS_RX_WR_BD_OK_PKT_CNT_REG); in hns_ppe_get_regs()
604 regs[548] = dsaf_read_dev(ppe_cb, PPE_HIS_RX_PKT_NO_BUF_CNT_REG); in hns_ppe_get_regs()
605 regs[549] = dsaf_read_dev(ppe_cb, PPE_HIS_TX_BD_CNT_REG); in hns_ppe_get_regs()
606 regs[550] = dsaf_read_dev(ppe_cb, PPE_HIS_TX_PKT_CNT_REG); in hns_ppe_get_regs()
607 regs[551] = dsaf_read_dev(ppe_cb, PPE_HIS_TX_PKT_OK_CNT_REG); in hns_ppe_get_regs()
608 regs[552] = dsaf_read_dev(ppe_cb, PPE_HIS_TX_PKT_EPT_CNT_REG); in hns_ppe_get_regs()
609 regs[553] = dsaf_read_dev(ppe_cb, PPE_HIS_TX_PKT_CS_FAIL_CNT_REG); in hns_ppe_get_regs()
610 regs[554] = dsaf_read_dev(ppe_cb, PPE_HIS_RX_APP_BUF_FAIL_CNT_REG); in hns_ppe_get_regs()
611 regs[555] = dsaf_read_dev(ppe_cb, PPE_HIS_RX_APP_BUF_WAIT_CNT_REG); in hns_ppe_get_regs()
612 regs[556] = dsaf_read_dev(ppe_cb, PPE_HIS_RX_PKT_DROP_FUL_CNT_REG); in hns_ppe_get_regs()
613 regs[557] = dsaf_read_dev(ppe_cb, PPE_HIS_RX_PKT_DROP_PRT_CNT_REG); in hns_ppe_get_regs()
615 regs[558] = dsaf_read_dev(ppe_cb, PPE_TNL_0_5_CNT_CLR_CE_REG); in hns_ppe_get_regs()
616 regs[559] = dsaf_read_dev(ppe_cb, PPE_CFG_AXI_DBG_REG); in hns_ppe_get_regs()
617 regs[560] = dsaf_read_dev(ppe_cb, PPE_HIS_PRO_ERR_REG); in hns_ppe_get_regs()
618 regs[561] = dsaf_read_dev(ppe_cb, PPE_HIS_TNL_FIFO_ERR_REG); in hns_ppe_get_regs()
619 regs[562] = dsaf_read_dev(ppe_cb, PPE_CURR_CFF_DATA_NUM_REG); in hns_ppe_get_regs()
620 regs[563] = dsaf_read_dev(ppe_cb, PPE_CURR_RX_ST_REG); in hns_ppe_get_regs()
621 regs[564] = dsaf_read_dev(ppe_cb, PPE_CURR_TX_ST_REG); in hns_ppe_get_regs()
622 regs[565] = dsaf_read_dev(ppe_cb, PPE_CURR_RX_FIFO0_REG); in hns_ppe_get_regs()
623 regs[566] = dsaf_read_dev(ppe_cb, PPE_CURR_RX_FIFO1_REG); in hns_ppe_get_regs()
624 regs[567] = dsaf_read_dev(ppe_cb, PPE_CURR_TX_FIFO0_REG); in hns_ppe_get_regs()
625 regs[568] = dsaf_read_dev(ppe_cb, PPE_CURR_TX_FIFO1_REG); in hns_ppe_get_regs()
626 regs[569] = dsaf_read_dev(ppe_cb, PPE_ECO0_REG); in hns_ppe_get_regs()
627 regs[570] = dsaf_read_dev(ppe_cb, PPE_ECO1_REG); in hns_ppe_get_regs()
628 regs[571] = dsaf_read_dev(ppe_cb, PPE_ECO2_REG); in hns_ppe_get_regs()