* [PATCH 0/2] add private dump for vhost and virtio @ 2023-01-19 12:30 Chengwen Feng 2023-01-19 12:30 ` [PATCH 1/2] net/virtio: support private dump Chengwen Feng ` (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Chengwen Feng @ 2023-01-19 12:30 UTC (permalink / raw) To: thomas, ferruh.yigit; +Cc: dev This patch addes private dump for vhost and virtio PMDs. Chengwen Feng (2): net/virtio: support private dump net/vhost: support private dump drivers/net/vhost/rte_eth_vhost.c | 21 +++++++++++++++++++++ drivers/net/virtio/virtio_ethdev.c | 19 +++++++++++++++++++ 2 files changed, 40 insertions(+) -- 2.17.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] net/virtio: support private dump 2023-01-19 12:30 [PATCH 0/2] add private dump for vhost and virtio Chengwen Feng @ 2023-01-19 12:30 ` Chengwen Feng 2023-02-01 10:29 ` Maxime Coquelin 2023-01-19 12:30 ` [PATCH 2/2] net/vhost: " Chengwen Feng 2023-02-03 14:59 ` [PATCH 0/2] add private dump for vhost and virtio Maxime Coquelin 2 siblings, 1 reply; 6+ messages in thread From: Chengwen Feng @ 2023-01-19 12:30 UTC (permalink / raw) To: thomas, ferruh.yigit, Maxime Coquelin, Chenbo Xia; +Cc: dev This patch implements eth_dev_priv_dump callback which could use for debugging. Signed-off-by: Chengwen Feng <fengchengwen@huawei.com> --- 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 760ba4e368..0ad740b253 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1019,6 +1019,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 */ @@ -1055,6 +1073,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.17.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] net/virtio: support private dump 2023-01-19 12:30 ` [PATCH 1/2] net/virtio: support private dump Chengwen Feng @ 2023-02-01 10:29 ` Maxime Coquelin 0 siblings, 0 replies; 6+ messages in thread From: Maxime Coquelin @ 2023-02-01 10:29 UTC (permalink / raw) To: Chengwen Feng, thomas, ferruh.yigit, Chenbo Xia; +Cc: dev On 1/19/23 13:30, Chengwen Feng wrote: > This patch implements eth_dev_priv_dump callback which could use for > debugging. > > Signed-off-by: Chengwen Feng <fengchengwen@huawei.com> > --- > 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 760ba4e368..0ad740b253 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -1019,6 +1019,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 > */ > @@ -1055,6 +1073,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, > }; > > /* Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Thanks, Maxime ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] net/vhost: support private dump 2023-01-19 12:30 [PATCH 0/2] add private dump for vhost and virtio Chengwen Feng 2023-01-19 12:30 ` [PATCH 1/2] net/virtio: support private dump Chengwen Feng @ 2023-01-19 12:30 ` Chengwen Feng 2023-02-01 10:29 ` Maxime Coquelin 2023-02-03 14:59 ` [PATCH 0/2] add private dump for vhost and virtio Maxime Coquelin 2 siblings, 1 reply; 6+ messages in thread From: Chengwen Feng @ 2023-01-19 12:30 UTC (permalink / raw) To: thomas, ferruh.yigit, Maxime Coquelin, Chenbo Xia; +Cc: dev This patch implements eth_dev_priv_dump callback which could use for debugging. Signed-off-by: Chengwen Feng <fengchengwen@huawei.com> --- drivers/net/vhost/rte_eth_vhost.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index b152279fac..9c609b45a3 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -1484,6 +1484,26 @@ 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, "features: 0x%" PRIx64 "\n", internal->features); + 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); + fprintf(f, "rx_sw_csum: %d\n", internal->rx_sw_csum); + fprintf(f, "tx_sw_csum: %d\n", internal->tx_sw_csum); + + return 0; +} + static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop, @@ -1504,6 +1524,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.17.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] net/vhost: support private dump 2023-01-19 12:30 ` [PATCH 2/2] net/vhost: " Chengwen Feng @ 2023-02-01 10:29 ` Maxime Coquelin 0 siblings, 0 replies; 6+ messages in thread From: Maxime Coquelin @ 2023-02-01 10:29 UTC (permalink / raw) To: Chengwen Feng, thomas, ferruh.yigit, Chenbo Xia; +Cc: dev On 1/19/23 13:30, Chengwen Feng wrote: > This patch implements eth_dev_priv_dump callback which could use for > debugging. > > Signed-off-by: Chengwen Feng <fengchengwen@huawei.com> > --- > drivers/net/vhost/rte_eth_vhost.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c > index b152279fac..9c609b45a3 100644 > --- a/drivers/net/vhost/rte_eth_vhost.c > +++ b/drivers/net/vhost/rte_eth_vhost.c > @@ -1484,6 +1484,26 @@ 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, "features: 0x%" PRIx64 "\n", internal->features); > + 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); > + fprintf(f, "rx_sw_csum: %d\n", internal->rx_sw_csum); > + fprintf(f, "tx_sw_csum: %d\n", internal->tx_sw_csum); > + > + return 0; > +} > + > static const struct eth_dev_ops ops = { > .dev_start = eth_dev_start, > .dev_stop = eth_dev_stop, > @@ -1504,6 +1524,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 Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Thanks, Maxime ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] add private dump for vhost and virtio 2023-01-19 12:30 [PATCH 0/2] add private dump for vhost and virtio Chengwen Feng 2023-01-19 12:30 ` [PATCH 1/2] net/virtio: support private dump Chengwen Feng 2023-01-19 12:30 ` [PATCH 2/2] net/vhost: " Chengwen Feng @ 2023-02-03 14:59 ` Maxime Coquelin 2 siblings, 0 replies; 6+ messages in thread From: Maxime Coquelin @ 2023-02-03 14:59 UTC (permalink / raw) To: Chengwen Feng, thomas, ferruh.yigit; +Cc: dev On 1/19/23 13:30, Chengwen Feng wrote: > This patch addes private dump for vhost and virtio PMDs. > > Chengwen Feng (2): > net/virtio: support private dump > net/vhost: support private dump > > drivers/net/vhost/rte_eth_vhost.c | 21 +++++++++++++++++++++ > drivers/net/virtio/virtio_ethdev.c | 19 +++++++++++++++++++ > 2 files changed, 40 insertions(+) > Applied to dpdk-next-virtio/main. Thanks, Maxime ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-02-03 14:59 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-01-19 12:30 [PATCH 0/2] add private dump for vhost and virtio Chengwen Feng 2023-01-19 12:30 ` [PATCH 1/2] net/virtio: support private dump Chengwen Feng 2023-02-01 10:29 ` Maxime Coquelin 2023-01-19 12:30 ` [PATCH 2/2] net/vhost: " Chengwen Feng 2023-02-01 10:29 ` Maxime Coquelin 2023-02-03 14:59 ` [PATCH 0/2] add private dump for vhost and virtio Maxime Coquelin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).