updates for hns3 ethernet pmd driver
cover updates for hns3 ethernet pmd driver
This series adds some updates for hns3 ethernet pmd driver.
The No.1 patch modifies the statistics information for sending and receiving packets.
The No.2 patch changes the return value of firmware processing timeout from -EBADE to -ETIME.
The No.3 patch adds commands between driver and firmware. The No.4 patch restores bus_master_en and msix_enable during PF FLR reset.
Chunsong Feng (1):
net/hns3: restores bus_master_en and msix_enable during PF FLR reset
Hao Chen (1):
net/hns3: modify the statistics for sending and receiving messages
Hongbo Zheng (1):
net/hns3: change the return value of firmware processing timeout from
-EBADE to -ETIME
humin (1):
net/hns3: Renew command and desc structure
drivers/net/hns3/hns3_cmd.c | 17 +--- drivers/net/hns3/hns3_cmd.h | 9 +- drivers/net/hns3/hns3_ethdev.c | 5 ++ drivers/net/hns3/hns3_ethdev_vf.c | 135 +++++++++++++++++++++++++++++- drivers/net/hns3/hns3_intr.c | 5 +- drivers/net/hns3/hns3_rxtx.c | 11 +-- drivers/net/hns3/hns3_rxtx.h | 3 - drivers/net/hns3/hns3_stats.c | 84 +++++-------------- 8 files changed, 168 insertions(+), 101 deletions(-)
Signature · 1 line
2.23.0
PATCH 1/4 net/hns3: modify the statistics for sending and receiving messages
From: Hao Chen <[email protected]>
In receiving direction, for FCS error messages, drivers no longer record them in rte_eth_stats.ipackets statistics.
In sending direction, for messages of illegal length, too long or equals 0, drivers will not notify the network card hardware to send them, will not continue to send the remaining message in burst, and will not record them in rte_eth_stats.opackets statistics.
--- drivers/net/hns3/hns3_rxtx.c | 11 ++--- drivers/net/hns3/hns3_rxtx.h | 3 -- drivers/net/hns3/hns3_stats.c | 84 ++++++++--------------------------- 3 files changed, 22 insertions(+), 76 deletions(-)
drivers/net/hns3/hns3_rxtx.c +3 -8
@@ -660,7 +660,6 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc, rxq->l4_csum_erros =0 ; rxq->ol3_csum_erros =0 ; rxq->ol4_csum_erros =0 ; - rxq->errors =0 ;rte_spinlock_lock (&hw->lock); dev->data->rx_queues[idx] = rxq;
@@ -816,14 +815,12 @@ hns3_handle_bdinfo(struct hns3_rx_queue *rxq, struct rte_mbuf *rxm,if (unlikely (l234_info &BIT (HNS3_RXD_L2E_B ))) { rxq->l2_errors++; - rxq->errors++;return -EINVAL ; }if (unlikely (rxm->pkt_len ==0 || (l234_info &BIT (HNS3_RXD_TRUNCAT_B )))) { rxq->pkt_len_errors++; - rxq->errors++;return -EINVAL ; }
@@ -979,6 +976,7 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) first_seg->pkt_len = pkt_len; first_seg->port = rxq->port_id; first_seg->hash.rss =rte_le_to_cpu_32 (rxdp->rx.rss_hash); + first_seg->ol_flags |=PKT_RX_RSS_HASH ;if (unlikely (hns3_get_bit (bd_base_info,HNS3_RXD_LUM_B ))) { first_seg->hash.fdir.hi =rte_le_to_cpu_32 (rxdp->rx.fd_id);
@@ -1097,7 +1095,6 @@ hns3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc, txq->next_to_clean =0 ; txq->tx_bd_ready = txq->nb_tx_desc; txq->port_id = dev->data->port_id; - txq->pkt_len_errors =0 ; txq->configured = true; txq->io_base = (void *)((char *)hw->io_base +HNS3_TQP_REG_OFFSET + idx *HNS3_TQP_REG_SIZE );
@@ -1604,10 +1601,8 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)* will be ignored. */ if (unlikely (tx_pkt->pkt_len >HNS3_MAX_FRAME_LEN || - tx_pkt->pkt_len ==0 )) { - txq->pkt_len_errors++; -continue ; - } + tx_pkt->pkt_len ==0 )) +break ; m_seg = tx_pkt;if (unlikely (nb_buf >HNS3_MAX_TX_BD_PER_PKT )) {
drivers/net/hns3/hns3_rxtx.h +0 -3
@@ -252,7 +252,6 @@ struct hns3_rx_queue {uint64_t l4_csum_erros;uint64_t ol3_csum_erros;uint64_t ol4_csum_erros; -uint64_t errors;/* num of error rx packets recorded by driver */ };struct hns3_tx_queue {
@@ -272,8 +271,6 @@ struct hns3_tx_queue {bool tx_deferred_start;/* don't start this queue in dev start */ bool configured;/* indicate if tx queue has been configured */ - -uint64_t pkt_len_errors; };#define HNS3_TX_CKSUM_OFFLOAD_MASK ( \
drivers/net/hns3/hns3_stats.c +19 -65
174 lines not on this page · raw message
Signature · 1 line
2.23.0
Re: [dpdk-dev] [PATCH 1/4] net/hns3: modify the statistics for sending and receiving messages
Quoted 4 lines · Wei Hu (Xavier)
From: Hao Chen <[email protected]>
In receiving direction, for FCS error messages, drivers no longer record them in rte_eth_stats.ipackets statistics.
If this patch is fixing statistics better to convert commit log into a fix patch with Fixes tags etc. This helps for your patches has been backported to LTS. Same for other patches in the set.
Quoted 8 lines
In sending direction, for messages of illegal length, too long or equals 0, drivers will not notify the network card hardware to send them, will not continue to send the remaining message in burst, and will not record them in rte_eth_stats.opackets statistics.
Signed-off-by Hao Chen <[email protected]>Signed-off-by Wei Hu (Xavier) <[email protected]>
<...>
drivers/net/hns3/hns3_rxtx.c hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) · line 979
Quoted 5 lines
drivers/net/hns3/hns3_rxtx.c +1
-0@@ -979,6 +976,7 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) first_seg->pkt_len = pkt_len; first_seg->port = rxq->port_id; first_seg->hash.rss =rte_le_to_cpu_32 (rxdp->rx.rss_hash); + first_seg->ol_flags |=PKT_RX_RSS_HASH ;
This is unrelated change for this patch, can you please extract into its own patch?
Re: [dpdk-dev] [PATCH 1/4] net/hns3: modify the statistics for sending and receiving messages
Hi, Ferruh Yigit
Quoted 16 lines · Ferruh Yigit
Quoted 4 lines · Wei Hu (Xavier)
From: Hao Chen <[email protected]>
In receiving direction, for FCS error messages, drivers no longer record them in rte_eth_stats.ipackets statistics.
If this patch is fixing statistics better to convert commit log into a fix patch with Fixes tags etc. This helps for your patches has been backported to LTS. Same for other patches in the set.
Quoted 7 lines
In sending direction, for messages of illegal length, too long or equals 0, drivers will not notify the network card hardware to send them, will not continue to send the remaining message in burst, and will not record them in rte_eth_stats.opackets statistics.
Signed-off-by Hao Chen <[email protected]>Signed-off-by Wei Hu (Xavier) <[email protected]>
Quoted 9 lines
<...>
drivers/net/hns3/hns3_rxtx.c hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) · line 979
Quoted 5 lines
drivers/net/hns3/hns3_rxtx.c +1
-0@@ -979,6 +976,7 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) first_seg->pkt_len = pkt_len; first_seg->port = rxq->port_id; first_seg->hash.rss =rte_le_to_cpu_32 (rxdp->rx.rss_hash); + first_seg->ol_flags |=PKT_RX_RSS_HASH ;This is unrelated change for this patch, can you please extract into its own patch?
We will fix them and send patch V2.
Thanks for your comment.
Regards
Xavier
PATCH 2/4 net/hns3: change the return value of firmware processing timeout from -EBADE to -ETIME
In reply to Wei Hu (Xavier)From: Hongbo Zheng <[email protected]>
Configuration commands are sent to firmware for processing. When firmware processing timeout, the corresponding error code is returned. Considering that it is more reasonable to use error code -ETIME for timeout error, the error code for processing timeout is changed from -EBADE to -ETIME.
--- drivers/net/hns3/hns3_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/hns3/hns3_cmd.c +1 -1
@@ -359,7 +359,7 @@ static int hns3_cmd_poll_reply(struct hns3_hw *hw) timeout++; }while (timeout < hw->cmq.tx_timeout);hns3_err (hw,"Wait for reply timeout" ); -return -EBADE ; +return -ETIME ; }/*
Signature · 1 line
2.23.0
PATCH 3/4 net/hns3: Renew command and desc structure
In reply to Wei Hu (Xavier)From: humin <[email protected]>
This patch adds commands and modifies descriptor structures for accessing manage table and mac table.
--- drivers/net/hns3/hns3_cmd.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/hns3/hns3_cmd.h +6 -3
@@ -217,6 +217,8 @@ enum hns3_opcode_type {/* PPP module intr commands */ HNS3_PPP_CMD0_INT_CMD =0x2100 ,HNS3_PPP_CMD1_INT_CMD =0x2101 , +HNS3_PPP_MAC_VLAN_IDX_RD =0x2104 , + HNS3_MAC_ETHERTYPE_IDX_RD = 0x2105, };#define HNS3_CMD_FLAG_IN BIT(0)
@@ -642,7 +644,7 @@ struct hns3_mac_mgr_tbl_entry_cmd {uint16_t vlan_tag;uint32_t mac_addr_hi32;uint16_t mac_addr_lo16; -uint16_t rsv1; +uint16_t index;uint16_t ethter_type;uint16_t egress_port;uint16_t egress_queue;
@@ -707,12 +709,13 @@ struct hns3_mac_vlan_tbl_entry_cmd {uint16_t vlan_tag;uint32_t mac_addr_hi32;uint16_t mac_addr_lo16; -uint16_t rsv1; +uint16_t port;uint8_t entry_type;uint8_t mc_mac_en;uint16_t egress_port;uint16_t egress_queue; -uint8_t rsv2[6 ]; +uint8_t rsv2[2 ]; +uint32_t index; };#define HNS3_TQP_RESET_B 0
Signature · 1 line
2.23.0
Re: [dpdk-dev] [PATCH 3/4] net/hns3: Renew command and desc structure
Quoted 6 lines · Wei Hu (Xavier)
From: humin <[email protected]>
This patch adds commands and modifies descriptor structures for accessing manage table and mac table.
Signed-off-by humin <[email protected]>
Can you please provide a "Name Surname <[email protected]>" format?
Quoted 32 lines
Signed-off-by Wei Hu (Xavier) <[email protected]>--- drivers/net/hns3/hns3_cmd.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/net/hns3/hns3_cmd.h +3
-2@@ -217,6 +217,8 @@ enum hns3_opcode_type {/* PPP module intr commands */ HNS3_PPP_CMD0_INT_CMD =0x2100 ,HNS3_PPP_CMD1_INT_CMD =0x2101 , +HNS3_PPP_MAC_VLAN_IDX_RD =0x2104 , + HNS3_MAC_ETHERTYPE_IDX_RD = 0x2105, };#define HNS3_CMD_FLAG_IN BIT(0)@@ -642,7 +644,7 @@ struct hns3_mac_mgr_tbl_entry_cmd {uint16_t vlan_tag;uint32_t mac_addr_hi32;uint16_t mac_addr_lo16; -uint16_t rsv1; +uint16_t index;uint16_t ethter_type;uint16_t egress_port;uint16_t egress_queue;@@ -707,12 +709,13 @@ struct hns3_mac_vlan_tbl_entry_cmd {uint16_t vlan_tag;uint32_t mac_addr_hi32;uint16_t mac_addr_lo16; -uint16_t rsv1;
drivers/net/hns3/hns3_cmd.h struct hns3_mac_vlan_tbl_entry_cmd { · line 720
Quoted 10 lines
drivers/net/hns3/hns3_cmd.h +3
-1+uint16_t port;uint8_t entry_type;uint8_t mc_mac_en;uint16_t egress_port;uint16_t egress_queue; -uint8_t rsv2[6 ]; +uint8_t rsv2[2 ]; +uint32_t index; };
Aren't these new fields and defines used at all? If not why added?
Re: [dpdk-dev] [PATCH 3/4] net/hns3: Renew command and desc structure
Hi, Ferruh Yigit
Quoted 44 lines · Ferruh Yigit
Quoted 6 lines · Wei Hu (Xavier)
From: humin <[email protected]>
This patch adds commands and modifies descriptor structures for accessing manage table and mac table.
Signed-off-by humin <[email protected]>Can you please provide a "Name Surname <[email protected]>" format?
Quoted 35 lines
Signed-off-by Wei Hu (Xavier) <[email protected]>--- drivers/net/hns3/hns3_cmd.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/net/hns3/hns3_cmd.h +4
-2@@ -217,6 +217,8 @@ enum hns3_opcode_type {/* PPP module intr commands */ HNS3_PPP_CMD0_INT_CMD =0x2100 ,HNS3_PPP_CMD1_INT_CMD =0x2101 , +HNS3_PPP_MAC_VLAN_IDX_RD =0x2104 , + HNS3_MAC_ETHERTYPE_IDX_RD = 0x2105, };#define HNS3_CMD_FLAG_IN BIT(0)@@ -642,7 +644,7 @@ struct hns3_mac_mgr_tbl_entry_cmd {uint16_t vlan_tag;uint32_t mac_addr_hi32;uint16_t mac_addr_lo16; -uint16_t rsv1; +uint16_t index;uint16_t ethter_type;uint16_t egress_port;uint16_t egress_queue;@@ -707,12 +709,13 @@ struct hns3_mac_vlan_tbl_entry_cmd {uint16_t vlan_tag;uint32_t mac_addr_hi32;uint16_t mac_addr_lo16; -uint16_t rsv1; +uint16_t port;uint8_t entry_type;uint8_t mc_mac_en;
Quoted 8 lines
drivers/net/hns3/hns3_cmd.h struct hns3_mac_vlan_tbl_entry_cmd { · line 720
Quoted 7 lines
drivers/net/hns3/hns3_cmd.h +2
-1uint16_t egress_port;uint16_t egress_queue; -uint8_t rsv2[6 ]; +uint8_t rsv2[2 ]; +uint32_t index; };Aren't these new fields and defines used at all? If not why added?
In fact ,this patch used for some query function in future. We will remove this patch from this series.
Thanks for your comments.
Regards
Xavier
Quoted 2 lines
PATCH 4/4 net/hns3: restores bus_master_en and msix_enable during PF FLR reset
In reply to Wei Hu (Xavier)From: Chunsong Feng <[email protected]>
PF FLR resets the PCIe ECAM space of all VFs under the PF and does not automatically recover. Therefore, the VF driver needs to restore the ECAM configuration, including bus_master_en, msix_enable.
--- drivers/net/hns3/hns3_cmd.c | 15 ---- drivers/net/hns3/hns3_ethdev.c | 5 ++ drivers/net/hns3/hns3_ethdev_vf.c | 135 +++++++++++++++++++++++++++++- drivers/net/hns3/hns3_intr.c | 5 +- 4 files changed, 139 insertions(+), 21 deletions(-)
drivers/net/hns3/hns3_cmd.c +0 -15
@@ -216,24 +216,9 @@ hns3_cmd_csq_clean(struct hns3_hw *hw)if (!is_valid_csq_clean_head (csq, head)) {struct hns3_adapter *hns =HNS3_DEV_HW_TO_ADAPTER (hw); -uint32_t global; -uint32_t fun_rst;hns3_err (hw,"wrong cmd head (%u, %u-%u)" , head, csq->next_to_use, csq->next_to_clean);rte_atomic16_set (&hw->reset.disable_cmd,1 ); -if (hns->is_vf) { - global =hns3_read_dev (hw,HNS3_VF_RST_ING ); - fun_rst =hns3_read_dev (hw,HNS3_FUN_RST_ING ); -hns3_err (hw,"Delayed VF reset global: %x fun_rst: %x" , - global, fun_rst); -hns3_atomic_set_bit (HNS3_VF_RESET , &hw->reset.pending); - }else { - global =hns3_read_dev (hw,HNS3_GLOBAL_RESET_REG ); - fun_rst =hns3_read_dev (hw,HNS3_FUN_RST_ING ); -hns3_err (hw,"Delayed IMP reset global: %x fun_rst: %x" , - global, fun_rst); -hns3_atomic_set_bit (HNS3_IMP_RESET , &hw->reset.pending); - }hns3_schedule_delayed_reset (hns);
drivers/net/hns3/hns3_ethdev.c +5 -0
@@ -4680,6 +4680,11 @@ hns3_reset_service(void *param)rte_atomic16_set (&hns->hw.reset.schedule,SCHEDULE_REQUESTED );hns3_err (hw,"Handling interrupts in delayed tasks" );hns3_interrupt_handler (&rte_eth_devices[hw->data->port_id]); + reset_level =hns3_get_reset_level (hns, &hw->reset.pending); +if (reset_level ==HNS3_NONE_RESET ) { +hns3_err (hw,"No reset level is set, try IMP reset" ); +hns3_atomic_set_bit (HNS3_IMP_RESET , &hw->reset.pending); + } }rte_atomic16_set (&hns->hw.reset.schedule,SCHEDULE_NONE );
drivers/net/hns3/hns3_ethdev_vf.c +131 -4
184 lines not on this page · raw message
drivers/net/hns3/hns3_intr.c +3 -2
@@ -890,11 +890,12 @@ hns3_reset_err_handle(struct hns3_adapter *hns)hns3_warn (hw,"%s reset fail fail_cnt:%" PRIx64" success_cnt:%" PRIx64" global_cnt:%" PRIx64" imp_cnt:%" PRIx64" request_cnt:%" PRIx64" exec_cnt:%" PRIx64 -" merge_cnt:%" PRIx64, +" merge_cnt:%" PRIx64"adapter_state:%d" , reset_string[hw->reset.level], hw->reset.stats.fail_cnt, hw->reset.stats.success_cnt, hw->reset.stats.global_cnt, hw->reset.stats.imp_cnt, hw->reset.stats.request_cnt, - hw->reset.stats.exec_cnt, hw->reset.stats.merge_cnt); + hw->reset.stats.exec_cnt, hw->reset.stats.merge_cnt, + hw->adapter_state);/* IMP no longer waiting the ready flag */ hns3_notify_reset_ready (hw, true);
Signature · 1 line
2.23.0
Hi, Ferruh Yigit
The page in patches.dpdk.org indicates that CI checking against this
series failed, the page as follows:
http://mails.dpdk.org/archives/test-report/2019-October/101655.html
Just like the previous failure of patch CI checking, this series based
on dpdk-next-net repo but CI checking based on dpdk repo.
Thanks.
Regards
Xavier
Quoted 33 lines · Wei Hu (Xavier)
This series adds some updates for hns3 ethernet pmd driver.
The No.1 patch modifies the statistics information for sending and receiving packets.
The No.2 patch changes the return value of firmware processing timeout from-EBADEto-ETIME.
The No.3 patch adds commands between driver and firmware. The No.4 patch restoresbus_master_enandmsix_enableduring PF FLR reset.Chunsong Feng (1):
net/hns3: restoresbus_master_enandmsix_enableduring PF FLR resetHao Chen (1):
net/hns3: modify the statistics for sending and receiving messagesHongbo Zheng (1):
net/hns3: change the return value of firmware processing timeout from
-EBADEto-ETIMEhumin (1):
net/hns3: Renew command and desc structuredrivers/net/hns3/hns3_cmd.c | 17 +--- drivers/net/hns3/hns3_cmd.h | 9 +- drivers/net/hns3/hns3_ethdev.c | 5 ++ drivers/net/hns3/hns3_ethdev_vf.c | 135 +++++++++++++++++++++++++++++- drivers/net/hns3/hns3_intr.c | 5 +- drivers/net/hns3/hns3_rxtx.c | 11 +-- drivers/net/hns3/hns3_rxtx.h | 3 - drivers/net/hns3/hns3_stats.c | 84 +++++-------------- 8 files changed, 168 insertions(+), 101 deletions(-)
Quoted 16 lines · Wei Hu (Xavier)
This series adds some updates for hns3 ethernet pmd driver.
The No.1 patch modifies the statistics information for sending and receiving packets.
The No.2 patch changes the return value of firmware processing timeout from-EBADEto-ETIME.
The No.3 patch adds commands between driver and firmware. The No.4 patch restoresbus_master_enandmsix_enableduring PF FLR reset.Chunsong Feng (1):
net/hns3: restoresbus_master_enandmsix_enableduring PF FLR resetHao Chen (1):
net/hns3: modify the statistics for sending and receiving messages
Quoted 7 lines
Hongbo Zheng (1):
net/hns3: change the return value of firmware processing timeout from
-EBADEto-ETIMEhumin (1):
net/hns3: Renew command and desc structure
Hi Xavier,
'check-git-log.sh' is giving some errors, can you please check them?
$ /devtools/check-git-log.sh -4
Wrong headline format:
net/hns3: restores bus_master_en and msix_enable during PF FLR reset
Wrong headline uppercase:
net/hns3: Renew command and desc structure
Headline too long:
net/hns3: modify the statistics for sending and receiving messages
net/hns3: change the return value of firmware processing timeout from
-EBADE to -ETIME
net/hns3: restores bus_master_en and msix_enable during PF FLR resetHi, Ferruh Yigit
Quoted 28 lines · Ferruh Yigit
Quoted 16 lines · Wei Hu (Xavier)
This series adds some updates for hns3 ethernet pmd driver.
The No.1 patch modifies the statistics information for sending and receiving packets.
The No.2 patch changes the return value of firmware processing timeout from-EBADEto-ETIME.
The No.3 patch adds commands between driver and firmware. The No.4 patch restoresbus_master_enandmsix_enableduring PF FLR reset.Chunsong Feng (1):
net/hns3: restoresbus_master_enandmsix_enableduring PF FLR resetHao Chen (1):
net/hns3: modify the statistics for sending and receiving messagesQuoted 7 lines
Hongbo Zheng (1):
net/hns3: change the return value of firmware processing timeout from
-EBADEto-ETIMEhumin (1):
net/hns3: Renew command and desc structureHi Xavier,
'
check-git-log.sh' is giving some errors, can you please check them?
Quoted 11 lines
$ /devtools/check-git-log.sh -4
Wrong headline format:
net/hns3: restores bus_master_en and msix_enable during PF FLR reset
Wrong headline uppercase:
net/hns3: Renew command and desc structure
Headline too long:
net/hns3: modify the statistics for sending and receiving messages
net/hns3: change the return value of firmware processing timeout from
-EBADE to -ETIME
net/hns3: restores bus_master_en and msix_enable during PF FLR reset We will fix it and send Patch V2.
Thanks for your comments.
Regards
Xavier