From b1330a6fafd7df912e6dbdef45ee3a0e156b45b8 Mon Sep 17 00:00:00 2001 From: chenjiji09 Date: Mon, 27 Mar 2023 16:28:40 +0800 Subject: [PATCH] add private dump for bonding, virtio and vhost Sync some patchs from upstreaming branch and modifies are as follow: 1. Add private dump for bonding, virtio and vhost. 2. Support LACP info dump for bonding. 3. Display RSS hash key of flow rule in testpmd. --- ...c-free-mbuf-use-rte_pktmbuf_free_seg.patch | 107 ++++++++++ ...nding-support-private-dump-operation.patch | 150 ++++++++++++++ 0259-net-bonding-add-LACP-info-dump.patch | 187 ++++++++++++++++++ 0260-net-virtio-support-private-dump.patch | 56 ++++++ 0261-net-vhost-support-private-dump.patch | 55 ++++++ ...stpmd-show-private-info-in-port-info.patch | 37 ++++ ...md-display-RSS-hash-key-of-flow-rule.patch | 48 +++++ dpdk.spec | 19 +- 8 files changed, 658 insertions(+), 1 deletion(-) create mode 100644 0257-hinic-free-mbuf-use-rte_pktmbuf_free_seg.patch create mode 100644 0258-net-bonding-support-private-dump-operation.patch create mode 100644 0259-net-bonding-add-LACP-info-dump.patch create mode 100644 0260-net-virtio-support-private-dump.patch create mode 100644 0261-net-vhost-support-private-dump.patch create mode 100644 0262-app-testpmd-show-private-info-in-port-info.patch create mode 100644 0263-app-testpmd-display-RSS-hash-key-of-flow-rule.patch diff --git a/0257-hinic-free-mbuf-use-rte_pktmbuf_free_seg.patch b/0257-hinic-free-mbuf-use-rte_pktmbuf_free_seg.patch new file mode 100644 index 0000000..9a8d751 --- /dev/null +++ b/0257-hinic-free-mbuf-use-rte_pktmbuf_free_seg.patch @@ -0,0 +1,107 @@ +From b5c93dae2b73115c46f2e66dc87be61a200e006b Mon Sep 17 00:00:00 2001 +From: jiangheng12 +Date: Sat, 1 Apr 2023 21:56:20 +0800 +Subject: [PATCH] hinic: free tx mbuf use rte_pktmbuf_free_seg + +--- + drivers/net/hinic/hinic_pmd_tx.c | 27 ++++++++++++++++++--------- + drivers/net/hinic/hinic_pmd_tx.h | 9 +++++++++ + 2 files changed, 27 insertions(+), 9 deletions(-) + +diff --git a/drivers/net/hinic/hinic_pmd_tx.c b/drivers/net/hinic/hinic_pmd_tx.c +index f09b1a6..8eab94d 100644 +--- a/drivers/net/hinic/hinic_pmd_tx.c ++++ b/drivers/net/hinic/hinic_pmd_tx.c +@@ -30,13 +30,6 @@ + #define TX_MSS_DEFAULT 0x3E00 + #define TX_MSS_MIN 0x50 + +-#define HINIC_NONTSO_PKT_MAX_SGE 17 /* non-tso max sge 17 */ +-#define HINIC_NONTSO_SEG_NUM_INVALID(num) \ +- ((num) > HINIC_NONTSO_PKT_MAX_SGE) +- +-#define HINIC_TSO_PKT_MAX_SGE 127 /* tso max sge 127 */ +-#define HINIC_TSO_SEG_NUM_INVALID(num) ((num) > HINIC_TSO_PKT_MAX_SGE) +- + /* sizeof(struct hinic_sq_bufdesc) == 16, shift 4 */ + #define HINIC_BUF_DESC_SIZE(nr_descs) (SIZE_8BYTES(((u32)nr_descs) << 4)) + +@@ -640,6 +633,7 @@ static inline void hinic_xmit_mbuf_cleanup(struct hinic_txq *txq) + if (likely(mbuf->nb_segs == 1)) { + m = rte_pktmbuf_prefree_seg(mbuf); + tx_info->mbuf = NULL; ++ tx_info->nb_segs = 0; + + if (unlikely(m == NULL)) + continue; +@@ -653,8 +647,11 @@ static inline void hinic_xmit_mbuf_cleanup(struct hinic_txq *txq) + mbuf_free[nb_free++] = m; + } + } else { +- rte_pktmbuf_free(mbuf); ++ for (int j = 0; j < tx_info->nb_segs; j++) { ++ rte_pktmbuf_free_seg(tx_info->mbufs[j]); ++ } + tx_info->mbuf = NULL; ++ tx_info->nb_segs = 0; + } + } + +@@ -1191,6 +1188,13 @@ u16 hinic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, u16 nb_pkts) + tx_info->mbuf = mbuf_pkt; + tx_info->wqebb_cnt = wqe_wqebb_cnt; + ++ tx_info->nb_segs = mbuf_pkt->nb_segs; ++ struct rte_mbuf *tmp = mbuf_pkt; ++ for (int j = 0; j < mbuf_pkt->nb_segs; j++) { ++ tx_info->mbufs[j] = tmp; ++ tmp = tmp->next; ++ } ++ + /* 7. fill sq wqe header section */ + hinic_fill_sq_wqe_header(&sq_wqe->ctrl, queue_info, + sqe_info.sge_cnt, sqe_info.owner); +@@ -1231,7 +1235,12 @@ void hinic_free_all_tx_mbufs(struct hinic_txq *txq) + tx_info->cpy_mbuf = NULL; + } + +- rte_pktmbuf_free(tx_info->mbuf); ++ for (int j = 0; j < tx_info->nb_segs; j++) { ++ rte_pktmbuf_free_seg(tx_info->mbufs[j]); ++ tx_info->mbufs[j] = NULL; ++ } ++ tx_info->nb_segs = 0; ++ + hinic_update_sq_local_ci(nic_dev->hwdev, txq->q_id, + tx_info->wqebb_cnt); + +diff --git a/drivers/net/hinic/hinic_pmd_tx.h b/drivers/net/hinic/hinic_pmd_tx.h +index a3ec629..70159bd 100644 +--- a/drivers/net/hinic/hinic_pmd_tx.h ++++ b/drivers/net/hinic/hinic_pmd_tx.h +@@ -20,6 +20,13 @@ + RTE_MBUF_F_TX_OUTER_IP_CKSUM | \ + RTE_MBUF_F_TX_TCP_SEG) + ++#define HINIC_NONTSO_PKT_MAX_SGE 17 /* non-tso max sge 17 */ ++#define HINIC_NONTSO_SEG_NUM_INVALID(num) \ ++ ((num) > HINIC_NONTSO_PKT_MAX_SGE) ++ ++#define HINIC_TSO_PKT_MAX_SGE 127 /* tso max sge 127 */ ++#define HINIC_TSO_SEG_NUM_INVALID(num) ((num) > HINIC_TSO_PKT_MAX_SGE) ++ + enum sq_wqe_type { + SQ_NORMAL_WQE = 0, + }; +@@ -98,6 +105,8 @@ struct hinic_txq_stats { + + struct hinic_tx_info { + struct rte_mbuf *mbuf; ++ struct rte_mbuf *mbufs[HINIC_TSO_PKT_MAX_SGE]; ++ int nb_segs; + int wqebb_cnt; + struct rte_mbuf *cpy_mbuf; + }; +-- +2.23.0 + diff --git a/0258-net-bonding-support-private-dump-operation.patch b/0258-net-bonding-support-private-dump-operation.patch new file mode 100644 index 0000000..88867d1 --- /dev/null +++ b/0258-net-bonding-support-private-dump-operation.patch @@ -0,0 +1,150 @@ +From fdbebc668c5df36d34a64ba627b6e373263c1fca Mon Sep 17 00:00:00 2001 +From: Chengwen Feng +Date: Wed, 14 Dec 2022 06:13:23 +0000 +Subject: net/bonding: support private dump operation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ upstream commit 29e89fb1e30cf12937dec8a3f4f7ab86f0303d24 ] + +This patch implements eth_dev_priv_dump ops which could enhance the +debug capability. + +The dump output is similar to testpmd command +"show bonding config [port]". + +Signed-off-by: Chengwen Feng +Acked-by:Min Hu (Connor) +Acked-by: Huisong Li +Acked-by: Ferruh Yigit +--- + drivers/net/bonding/rte_eth_bond_pmd.c | 105 ++++++++++++++++++++++++- + 1 file changed, 104 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c +index 29871cf8a3..cf7d275bf5 100644 +--- a/drivers/net/bonding/rte_eth_bond_pmd.c ++++ b/drivers/net/bonding/rte_eth_bond_pmd.c +@@ -3297,6 +3297,108 @@ bond_ethdev_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) + rte_spinlock_unlock(&internals->lock); + } + ++static const char * ++bond_mode_name(uint8_t mode) ++{ ++ switch (mode) { ++ case BONDING_MODE_ROUND_ROBIN: ++ return "ROUND_ROBIN"; ++ case BONDING_MODE_ACTIVE_BACKUP: ++ return "ACTIVE_BACKUP"; ++ case BONDING_MODE_BALANCE: ++ return "BALANCE"; ++ case BONDING_MODE_BROADCAST: ++ return "BROADCAST"; ++ case BONDING_MODE_8023AD: ++ return "8023AD"; ++ case BONDING_MODE_TLB: ++ return "TLB"; ++ case BONDING_MODE_ALB: ++ return "ALB"; ++ default: ++ return "Unknown"; ++ } ++} ++ ++static int ++bond_ethdev_priv_dump(struct rte_eth_dev *dev, FILE *f) ++{ ++ struct bond_dev_private instant_priv; ++ const struct bond_dev_private *internals = &instant_priv; ++ int mode, i; ++ ++ /* Obtain a instance of dev_private to prevent data from being modified. */ ++ memcpy(&instant_priv, dev->data->dev_private, sizeof(struct bond_dev_private)); ++ mode = internals->mode; ++ ++ fprintf(f, " - Dev basic:\n"); ++ fprintf(f, "\tBonding mode: %s(%d)\n", bond_mode_name(mode), mode); ++ ++ if (mode == BONDING_MODE_BALANCE || mode == BONDING_MODE_8023AD) { ++ fprintf(f, "\tBalance Xmit Policy: "); ++ switch (internals->balance_xmit_policy) { ++ case BALANCE_XMIT_POLICY_LAYER2: ++ fprintf(f, "BALANCE_XMIT_POLICY_LAYER2"); ++ break; ++ case BALANCE_XMIT_POLICY_LAYER23: ++ fprintf(f, "BALANCE_XMIT_POLICY_LAYER23"); ++ break; ++ case BALANCE_XMIT_POLICY_LAYER34: ++ fprintf(f, "BALANCE_XMIT_POLICY_LAYER34"); ++ break; ++ default: ++ fprintf(f, "Unknown"); ++ } ++ fprintf(f, "\n"); ++ } ++ ++ if (mode == BONDING_MODE_8023AD) { ++ fprintf(f, "\tIEEE802.3AD Aggregator Mode: "); ++ switch (internals->mode4.agg_selection) { ++ case AGG_BANDWIDTH: ++ fprintf(f, "bandwidth"); ++ break; ++ case AGG_STABLE: ++ fprintf(f, "stable"); ++ break; ++ case AGG_COUNT: ++ fprintf(f, "count"); ++ break; ++ default: ++ fprintf(f, "unknown"); ++ } ++ fprintf(f, "\n"); ++ } ++ ++ if (internals->slave_count > 0) { ++ fprintf(f, "\tSlaves (%u): [", internals->slave_count); ++ for (i = 0; i < internals->slave_count - 1; i++) ++ fprintf(f, "%u ", internals->slaves[i].port_id); ++ ++ fprintf(f, "%u]\n", internals->slaves[internals->slave_count - 1].port_id); ++ } else { ++ fprintf(f, "\tSlaves: []\n"); ++ } ++ ++ if (internals->active_slave_count > 0) { ++ fprintf(f, "\tActive Slaves (%u): [", internals->active_slave_count); ++ for (i = 0; i < internals->active_slave_count - 1; i++) ++ fprintf(f, "%u ", internals->active_slaves[i]); ++ ++ fprintf(f, "%u]\n", internals->active_slaves[internals->active_slave_count - 1]); ++ ++ } else { ++ fprintf(f, "\tActive Slaves: []\n"); ++ } ++ ++ if (internals->user_defined_primary_port) ++ fprintf(f, "\tUser Defined Primary: [%u]\n", internals->primary_port); ++ if (internals->slave_count > 0) ++ fprintf(f, "\tCurrent Primary: [%u]\n", internals->current_primary_port); ++ ++ return 0; ++} ++ + const struct eth_dev_ops default_dev_ops = { + .dev_start = bond_ethdev_start, + .dev_stop = bond_ethdev_stop, +@@ -3323,7 +3425,8 @@ const struct eth_dev_ops default_dev_ops = { + .mac_addr_set = bond_ethdev_mac_address_set, + .mac_addr_add = bond_ethdev_mac_addr_add, + .mac_addr_remove = bond_ethdev_mac_addr_remove, +- .flow_ops_get = bond_flow_ops_get ++ .flow_ops_get = bond_flow_ops_get, ++ .eth_dev_priv_dump = bond_ethdev_priv_dump, + }; + + static int +-- +2.23.0 + diff --git a/0259-net-bonding-add-LACP-info-dump.patch b/0259-net-bonding-add-LACP-info-dump.patch new file mode 100644 index 0000000..6839d34 --- /dev/null +++ b/0259-net-bonding-add-LACP-info-dump.patch @@ -0,0 +1,187 @@ +From a74801e4c1d59a8e40317c8ea9e4ba3a5472d633 Mon Sep 17 00:00:00 2001 +From: Chengwen Feng +Date: Wed, 14 Dec 2022 06:13:24 +0000 +Subject: net/bonding: add LACP info dump +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ upstream commit b00119fc03dc585213236ea7f550662befa68fbe ] + +This patch adds dump lacp info in eth_dev_priv_dump ops. + +The extra dump output is similar to testpmd command +"show bonding lacp info [port]". + +Signed-off-by: Chengwen Feng +Acked-by:Min Hu (Connor) +Acked-by: Huisong Li +Acked-by: Ferruh Yigit +--- + drivers/net/bonding/rte_eth_bond_pmd.c | 143 ++++++++++++++++++++++++- + 1 file changed, 141 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c +index cf7d275bf5..0f2b21a568 100644 +--- a/drivers/net/bonding/rte_eth_bond_pmd.c ++++ b/drivers/net/bonding/rte_eth_bond_pmd.c +@@ -3320,8 +3320,8 @@ bond_mode_name(uint8_t mode) + } + } + +-static int +-bond_ethdev_priv_dump(struct rte_eth_dev *dev, FILE *f) ++static void ++dump_basic(const struct rte_eth_dev *dev, FILE *f) + { + struct bond_dev_private instant_priv; + const struct bond_dev_private *internals = &instant_priv; +@@ -3395,6 +3395,145 @@ bond_ethdev_priv_dump(struct rte_eth_dev *dev, FILE *f) + fprintf(f, "\tUser Defined Primary: [%u]\n", internals->primary_port); + if (internals->slave_count > 0) + fprintf(f, "\tCurrent Primary: [%u]\n", internals->current_primary_port); ++} ++ ++static void ++dump_lacp_conf(const struct rte_eth_bond_8023ad_conf *conf, FILE *f) ++{ ++ fprintf(f, "\tfast period: %u ms\n", conf->fast_periodic_ms); ++ fprintf(f, "\tslow period: %u ms\n", conf->slow_periodic_ms); ++ fprintf(f, "\tshort timeout: %u ms\n", conf->short_timeout_ms); ++ fprintf(f, "\tlong timeout: %u ms\n", conf->long_timeout_ms); ++ fprintf(f, "\taggregate wait timeout: %u ms\n", ++ conf->aggregate_wait_timeout_ms); ++ fprintf(f, "\ttx period: %u ms\n", conf->tx_period_ms); ++ fprintf(f, "\trx marker period: %u ms\n", conf->rx_marker_period_ms); ++ fprintf(f, "\tupdate timeout: %u ms\n", conf->update_timeout_ms); ++ switch (conf->agg_selection) { ++ case AGG_BANDWIDTH: ++ fprintf(f, "\taggregation mode: bandwidth\n"); ++ break; ++ case AGG_STABLE: ++ fprintf(f, "\taggregation mode: stable\n"); ++ break; ++ case AGG_COUNT: ++ fprintf(f, "\taggregation mode: count\n"); ++ break; ++ default: ++ fprintf(f, "\taggregation mode: invalid\n"); ++ break; ++ } ++ fprintf(f, "\n"); ++} ++ ++static void ++dump_lacp_port_param(const struct port_params *params, FILE *f) ++{ ++ char buf[RTE_ETHER_ADDR_FMT_SIZE]; ++ fprintf(f, "\t\tsystem priority: %u\n", params->system_priority); ++ rte_ether_format_addr(buf, RTE_ETHER_ADDR_FMT_SIZE, ¶ms->system); ++ fprintf(f, "\t\tsystem mac address: %s\n", buf); ++ fprintf(f, "\t\tport key: %u\n", params->key); ++ fprintf(f, "\t\tport priority: %u\n", params->port_priority); ++ fprintf(f, "\t\tport number: %u\n", params->port_number); ++} ++ ++static void ++dump_lacp_slave(const struct rte_eth_bond_8023ad_slave_info *info, FILE *f) ++{ ++ char a_state[256] = { 0 }; ++ char p_state[256] = { 0 }; ++ int a_len = 0; ++ int p_len = 0; ++ uint32_t i; ++ ++ static const char * const state[] = { ++ "ACTIVE", ++ "TIMEOUT", ++ "AGGREGATION", ++ "SYNCHRONIZATION", ++ "COLLECTING", ++ "DISTRIBUTING", ++ "DEFAULTED", ++ "EXPIRED" ++ }; ++ static const char * const selection[] = { ++ "UNSELECTED", ++ "STANDBY", ++ "SELECTED" ++ }; ++ ++ for (i = 0; i < RTE_DIM(state); i++) { ++ if ((info->actor_state >> i) & 1) ++ a_len += snprintf(&a_state[a_len], ++ RTE_DIM(a_state) - a_len, "%s ", ++ state[i]); ++ ++ if ((info->partner_state >> i) & 1) ++ p_len += snprintf(&p_state[p_len], ++ RTE_DIM(p_state) - p_len, "%s ", ++ state[i]); ++ } ++ fprintf(f, "\tAggregator port id: %u\n", info->agg_port_id); ++ fprintf(f, "\tselection: %s\n", selection[info->selected]); ++ fprintf(f, "\tActor detail info:\n"); ++ dump_lacp_port_param(&info->actor, f); ++ fprintf(f, "\t\tport state: %s\n", a_state); ++ fprintf(f, "\tPartner detail info:\n"); ++ dump_lacp_port_param(&info->partner, f); ++ fprintf(f, "\t\tport state: %s\n", p_state); ++ fprintf(f, "\n"); ++} ++ ++static void ++dump_lacp(uint16_t port_id, FILE *f) ++{ ++ struct rte_eth_bond_8023ad_slave_info slave_info; ++ struct rte_eth_bond_8023ad_conf port_conf; ++ uint16_t slaves[RTE_MAX_ETHPORTS]; ++ int num_active_slaves; ++ int i, ret; ++ ++ fprintf(f, " - Lacp info:\n"); ++ ++ num_active_slaves = rte_eth_bond_active_slaves_get(port_id, slaves, ++ RTE_MAX_ETHPORTS); ++ if (num_active_slaves < 0) { ++ fprintf(f, "\tFailed to get active slave list for port %u\n", ++ port_id); ++ return; ++ } ++ ++ fprintf(f, "\tIEEE802.3 port: %u\n", port_id); ++ ret = rte_eth_bond_8023ad_conf_get(port_id, &port_conf); ++ if (ret) { ++ fprintf(f, "\tGet bonded device %u 8023ad config failed\n", ++ port_id); ++ return; ++ } ++ dump_lacp_conf(&port_conf, f); ++ ++ for (i = 0; i < num_active_slaves; i++) { ++ ret = rte_eth_bond_8023ad_slave_info(port_id, slaves[i], ++ &slave_info); ++ if (ret) { ++ fprintf(f, "\tGet slave device %u 8023ad info failed\n", ++ slaves[i]); ++ return; ++ } ++ fprintf(f, "\tSlave Port: %u\n", slaves[i]); ++ dump_lacp_slave(&slave_info, f); ++ } ++} ++ ++static int ++bond_ethdev_priv_dump(struct rte_eth_dev *dev, FILE *f) ++{ ++ const struct bond_dev_private *internals = dev->data->dev_private; ++ ++ dump_basic(dev, f); ++ if (internals->mode == BONDING_MODE_8023AD) ++ dump_lacp(dev->data->port_id, f); + + return 0; + } +-- +2.23.0 + diff --git a/0260-net-virtio-support-private-dump.patch b/0260-net-virtio-support-private-dump.patch new file mode 100644 index 0000000..f2f6550 --- /dev/null +++ b/0260-net-virtio-support-private-dump.patch @@ -0,0 +1,56 @@ +From a247b89fe26e5bae41159dfa59475c04ae53e8e2 Mon Sep 17 00:00:00 2001 +From: Chengwen Feng +Date: Thu, 19 Jan 2023 12:30:55 +0000 +Subject: net/virtio: support private dump + +[ upstream commit 426858d6a9975a26539f0398037558dcb418947a ] + +This patch implements eth_dev_priv_dump callback which could use for +debugging. + +Signed-off-by: Chengwen Feng +Reviewed-by: Maxime Coquelin +--- + drivers/net/virtio/virtio_ethdev.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c +index b317649d7e..a38b15d01c 100644 +--- a/drivers/net/virtio/virtio_ethdev.c ++++ b/drivers/net/virtio/virtio_ethdev.c +@@ -1018,6 +1018,24 @@ virtio_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id) + return 0; + } + ++static int ++virtio_dev_priv_dump(struct rte_eth_dev *dev, FILE *f) ++{ ++ struct virtio_hw *hw = dev->data->dev_private; ++ ++ fprintf(f, "guest_features: 0x%" PRIx64 "\n", hw->guest_features); ++ fprintf(f, "vtnet_hdr_size: %u\n", hw->vtnet_hdr_size); ++ fprintf(f, "use_vec: rx-%u tx-%u\n", hw->use_vec_rx, hw->use_vec_tx); ++ fprintf(f, "use_inorder: rx-%u tx-%u\n", hw->use_inorder_rx, hw->use_inorder_tx); ++ fprintf(f, "intr_lsc: %u\n", hw->intr_lsc); ++ fprintf(f, "max_mtu: %u\n", hw->max_mtu); ++ fprintf(f, "max_rx_pkt_len: %zu\n", hw->max_rx_pkt_len); ++ fprintf(f, "max_queue_pairs: %u\n", hw->max_queue_pairs); ++ fprintf(f, "req_guest_features: 0x%" PRIx64 "\n", hw->req_guest_features); ++ ++ return 0; ++} ++ + /* + * dev_ops for virtio, bare necessities for basic operation + */ +@@ -1054,6 +1072,7 @@ static const struct eth_dev_ops virtio_eth_dev_ops = { + .mac_addr_remove = virtio_mac_addr_remove, + .mac_addr_set = virtio_mac_addr_set, + .get_monitor_addr = virtio_get_monitor_addr, ++ .eth_dev_priv_dump = virtio_dev_priv_dump, + }; + + /* +-- +2.23.0 + diff --git a/0261-net-vhost-support-private-dump.patch b/0261-net-vhost-support-private-dump.patch new file mode 100644 index 0000000..ec38d71 --- /dev/null +++ b/0261-net-vhost-support-private-dump.patch @@ -0,0 +1,55 @@ +From 423959cfe25c9dc231b80f3df59318585df3a023 Mon Sep 17 00:00:00 2001 +From: Chengwen Feng +Date: Thu, 19 Jan 2023 12:30:56 +0000 +Subject: net/vhost: support private dump + +[ upstream commit 47b9fb64c15d60e1c8c2c8f6e63824fd2cada428 ] + +This patch implements eth_dev_priv_dump callback which could use for +debugging. + +Signed-off-by: Chengwen Feng +Reviewed-by: Maxime Coquelin +--- + drivers/net/vhost/rte_eth_vhost.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c +index 070f0e6dfd..b120341d0c 100644 +--- a/drivers/net/vhost/rte_eth_vhost.c ++++ b/drivers/net/vhost/rte_eth_vhost.c +@@ -1429,6 +1429,23 @@ vhost_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc) + return 0; + } + ++static int ++vhost_dev_priv_dump(struct rte_eth_dev *dev, FILE *f) ++{ ++ struct pmd_internal *internal = dev->data->dev_private; ++ ++ fprintf(f, "iface_name: %s\n", internal->iface_name); ++ fprintf(f, "flags: 0x%" PRIx64 "\n", internal->flags); ++ fprintf(f, "disable_flags: 0x%" PRIx64 "\n", internal->disable_flags); ++ fprintf(f, "max_queues: %u\n", internal->max_queues); ++ fprintf(f, "vid: %d\n", internal->vid); ++ fprintf(f, "started: %d\n", rte_atomic32_read(&internal->started)); ++ fprintf(f, "dev_attached: %d\n", rte_atomic32_read(&internal->dev_attached)); ++ fprintf(f, "vlan_strip: %d\n", internal->vlan_strip); ++ ++ return 0; ++} ++ + static const struct eth_dev_ops ops = { + .dev_start = eth_dev_start, + .dev_stop = eth_dev_stop, +@@ -1449,6 +1466,7 @@ static const struct eth_dev_ops ops = { + .rx_queue_intr_enable = eth_rxq_intr_enable, + .rx_queue_intr_disable = eth_rxq_intr_disable, + .get_monitor_addr = vhost_get_monitor_addr, ++ .eth_dev_priv_dump = vhost_dev_priv_dump, + }; + + static int +-- +2.23.0 + diff --git a/0262-app-testpmd-show-private-info-in-port-info.patch b/0262-app-testpmd-show-private-info-in-port-info.patch new file mode 100644 index 0000000..3ba2887 --- /dev/null +++ b/0262-app-testpmd-show-private-info-in-port-info.patch @@ -0,0 +1,37 @@ +From 9f1acbbbe8050c3b8794d45a4af610f9e0774211 Mon Sep 17 00:00:00 2001 +From: Chengwen Feng +Date: Thu, 16 Mar 2023 09:32:16 +0000 +Subject: app/testpmd: show private info in port info + +[ upstream commit d0aa6cd7a43d737797ba139a7f18b879cc44dac3 ] + +This patch adds dump private info in 'show port info [port_id]' cmd. + +Signed-off-by: Chengwen Feng +Acked-by: Aman Singh +Acked-by: Ferruh Yigit +--- + app/test-pmd/config.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c +index 12386c4d82..873d1f1357 100644 +--- a/app/test-pmd/config.c ++++ b/app/test-pmd/config.c +@@ -891,6 +891,13 @@ port_infos_display(portid_t port_id) + printf("Switch Rx domain: %u\n", + dev_info.switch_info.rx_domain); + } ++ printf("Device private info:\n"); ++ ret = rte_eth_dev_priv_dump(port_id, stdout); ++ if (ret == -ENOTSUP) ++ printf(" none\n"); ++ else if (ret < 0) ++ fprintf(stderr, " Failed to dump private info with error (%d): %s\n", ++ ret, strerror(-ret)); + } + + void +-- +2.23.0 + diff --git a/0263-app-testpmd-display-RSS-hash-key-of-flow-rule.patch b/0263-app-testpmd-display-RSS-hash-key-of-flow-rule.patch new file mode 100644 index 0000000..3dd36b7 --- /dev/null +++ b/0263-app-testpmd-display-RSS-hash-key-of-flow-rule.patch @@ -0,0 +1,48 @@ +From 491333ae684b8303e019536900bb931b9f64b1ce Mon Sep 17 00:00:00 2001 +From: Huisong Li +Date: Thu, 16 Mar 2023 20:58:14 +0800 +Subject: app/testpmd: display RSS hash key of flow rule + +[ upstream commit f958bbe2210dcc888032e81ec1326c0df5e5c518 ] + +There are two ways to set RSS hash key with rte flow rule: +1. 'key_len' isn't zero and 'key' is NULL. +2. 'key_len' isn't zero and 'key' isn't NULL. +This patch adds displaying for the hash key of rte flow rule. + +Signed-off-by: Huisong Li +Signed-off-by: Dongdong Liu +Acked-by: Ferruh Yigit +--- + app/test-pmd/config.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c +index 873d1f1357..78af232a8a 100644 +--- a/app/test-pmd/config.c ++++ b/app/test-pmd/config.c +@@ -1651,6 +1651,21 @@ rss_config_display(struct rte_flow_action_rss *rss_conf) + return; + } + ++ printf(" RSS key:\n"); ++ if (rss_conf->key_len == 0) { ++ printf(" none"); ++ } else { ++ printf(" key_len: %u\n", rss_conf->key_len); ++ printf(" key: "); ++ if (rss_conf->key == NULL) { ++ printf("none"); ++ } else { ++ for (i = 0; i < rss_conf->key_len; i++) ++ printf("%02X", rss_conf->key[i]); ++ } ++ } ++ printf("\n"); ++ + printf(" types:\n"); + if (rss_conf->types == 0) { + printf(" none\n"); +-- +2.23.0 + diff --git a/dpdk.spec b/dpdk.spec index 09d7e5f..118e116 100644 --- a/dpdk.spec +++ b/dpdk.spec @@ -1,6 +1,6 @@ Name: dpdk Version: 21.11 -Release: 36 +Release: 38 Packager: packaging@6wind.com URL: http://dpdk.org %global source_version 21.11 @@ -274,6 +274,13 @@ Patch9253: 0253-net-hns3-reimplement-hash-flow-function.patch Patch9254: 0254-net-hns3-add-verification-of-RSS-types.patch Patch9255: 0255-test-mbuf-fix-mbuf-reset-test.patch Patch9256: 0256-examples-l3fwd-power-support-CPPC-cpufreq.patch +Patch9257: 0257-hinic-free-mbuf-use-rte_pktmbuf_free_seg.patch +Patch9258: 0258-net-bonding-support-private-dump-operation.patch +Patch9259: 0259-net-bonding-add-LACP-info-dump.patch +Patch9260: 0260-net-virtio-support-private-dump.patch +Patch9261: 0261-net-vhost-support-private-dump.patch +Patch9262: 0262-app-testpmd-show-private-info-in-port-info.patch +Patch9263: 0263-app-testpmd-display-RSS-hash-key-of-flow-rule.patch Summary: Data Plane Development Kit core Group: System Environment/Libraries @@ -416,6 +423,16 @@ strip -g $RPM_BUILD_ROOT/lib/modules/%{kern_devel_ver}/extra/dpdk/igb_uio.ko /usr/sbin/depmod %changelog +* Mon Mar 27 2023 chenjiji - 21.11-37 + Sync some patchs from upstreaming branch and modifies + are as follow: + 1. Add private dump for bonding, virtio and vhost. + 2. Support LACP info dump for bonding. + 3. Display RSS hash key of flow rule in testpmd. + +* Sat Apr 01 2023 jiangheng - 21.11-37 +- hinic: free tx mbuf use rte_pktmbuf_free_seg + * Thu Mar 23 2023 chenjiji - 21.11-36 Fix a m_buf pool was not freed bugs for test and support CPPC cpufreq for l3fwd-power. Patchs are as follow: -- Gitee