DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFC]lib/ethdev: fix data type in tc_rxq and tc_txq
@ 2020-08-08  1:09 humin (Q)
  0 siblings, 0 replies; 3+ messages in thread
From: humin (Q) @ 2020-08-08  1:09 UTC (permalink / raw)
  To: dev, ferruh.yigit, linuxarm, bruce.richardson, jerin.jacob,
	Zhouchang (Forest), lihuisong, Zhouchang (Forest),
	liudongdong (C),
	lihuisong

Currently, base and nb_queue in the tc_rxq and tc_txq information
of queue and TC mapping on both TX and RX paths are uint8_t.
The structure is as follows:

struct rte_eth_dcb_tc_queue_mapping {
     /** rx queues assigned to tc per Pool */
     struct {
         uint8_t base;
         uint8_t nb_queue;
     } tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
     /** rx queues assigned to tc per Pool */
     struct {
         uint8_t base;
         uint8_t nb_queue;
     } tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
};

However, these datas will be truncated when queue number under a TC
is greater than 256. So it is necessay for data type of base and
nb_queue to change from uint8_t to uint16_t.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [RFC]lib/ethdev: fix data type in tc_rxq and tc_txq
  2020-08-07 12:33 humin (Q)
@ 2020-08-18  1:43 ` humin (Q)
  0 siblings, 0 replies; 3+ messages in thread
From: humin (Q) @ 2020-08-18  1:43 UTC (permalink / raw)
  To: dev, ferruh.yigit, Linuxarm, bruce.richardson, jerin.jacob,
	liudongdong (C), Zhouchang (Forest), lihuisong (C),
	Huwei (Xavier)

Dear all:
Are there any suggestions for this patch?


在 2020/8/7 20:33, humin (Q) 写道:
> Currently, base and nb_queue in the tc_rxq and tc_txq information
> of queue and TC mapping on both TX and RX paths are uint8_t.
> The structure is as follows:
> 
> struct rte_eth_dcb_tc_queue_mapping {
>      /** rx queues assigned to tc per Pool */
>      struct {
>          uint8_t base;
>          uint8_t nb_queue;
>      } tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
>      /** rx queues assigned to tc per Pool */
>      struct {
>          uint8_t base;
>          uint8_t nb_queue;
>      } tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
> };
> 
> However, these datas will be truncated when queue number under a TC
> is greater than 256. So it is necessay for data type of base and
> nb_queue to change from uint8_t to uint16_t.
> 
> 
> [RFC]lib/ethdev: fix rx/tx queue stats mapping API
> 
> Currently, only statistics of rx/tx queues with queue_id less than
> RTE_ETHDEV_QUEUE_STAT_CNTRS can be displayed. If there is a certain
> application scenario that it needs to use 256 or more than 256 queues
> and display all statistics of rx/tx queue. At this moment, we have to
> change the macro to be equaled to the queue number.
> 
> However, modifying the macro to be greater than 256 will trigger
> many errors and warnings from test-pmd, PMD driver and librte_ethdev
> during compiling dpdk project. But it is possible and permited that
> rx/tx queue number is greater than 256 and all statistics of rx/tx
> queue need to be displayed. In addition, the data type of rx/tx queue
> number in rte_eth_dev_configure API is 'uint16_t'. So It is unreasonable
> to use the 'uint8_t' type for variables that control which per-queue
> statistics can be displayed.
> 
> In these modifications, related API in /lib/librte_ethdev/rte_ethdev.c
> is as follows:
> static int
> -set_queue_stats_mapping(uint16_t port_id, uint16_t queue_id, uint8_t 
> stat_idx,
> +set_queue_stats_mapping(uint16_t port_id, uint16_t queue_id, uint16_t 
> stat_idx,
>                  uint8_t is_rx)
> int
>   rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t 
> tx_queue_id,
> -               uint8_t stat_idx)
> +               uint16_t stat_idx)
> 
> int
>   rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t 
> rx_queue_id,
> -               uint8_t stat_idx)
> +               uint16_t stat_idx)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [RFC]lib/ethdev: fix data type in tc_rxq and tc_txq
@ 2020-08-07 12:33 humin (Q)
  2020-08-18  1:43 ` humin (Q)
  0 siblings, 1 reply; 3+ messages in thread
From: humin (Q) @ 2020-08-07 12:33 UTC (permalink / raw)
  To: dev, ferruh.yigit, Linuxarm, bruce.richardson, jerin.jacob,
	liudongdong (C), Zhouchang (Forest), lihuisong (C),
	Huwei (Xavier)

Currently, base and nb_queue in the tc_rxq and tc_txq information
of queue and TC mapping on both TX and RX paths are uint8_t.
The structure is as follows:

struct rte_eth_dcb_tc_queue_mapping {
	/** rx queues assigned to tc per Pool */
	struct {
		uint8_t base;
		uint8_t nb_queue;
	} tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
	/** rx queues assigned to tc per Pool */
	struct {
		uint8_t base;
		uint8_t nb_queue;
	} tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];
};

However, these datas will be truncated when queue number under a TC
is greater than 256. So it is necessay for data type of base and
nb_queue to change from uint8_t to uint16_t.


[RFC]lib/ethdev: fix rx/tx queue stats mapping API

Currently, only statistics of rx/tx queues with queue_id less than
RTE_ETHDEV_QUEUE_STAT_CNTRS can be displayed. If there is a certain
application scenario that it needs to use 256 or more than 256 queues
and display all statistics of rx/tx queue. At this moment, we have to
change the macro to be equaled to the queue number.

However, modifying the macro to be greater than 256 will trigger
many errors and warnings from test-pmd, PMD driver and librte_ethdev
during compiling dpdk project. But it is possible and permited that
rx/tx queue number is greater than 256 and all statistics of rx/tx
queue need to be displayed. In addition, the data type of rx/tx queue
number in rte_eth_dev_configure API is 'uint16_t'. So It is unreasonable
to use the 'uint8_t' type for variables that control which per-queue
statistics can be displayed.

In these modifications, related API in /lib/librte_ethdev/rte_ethdev.c
is as follows:
static int
-set_queue_stats_mapping(uint16_t port_id, uint16_t queue_id, uint8_t 
stat_idx,
+set_queue_stats_mapping(uint16_t port_id, uint16_t queue_id, uint16_t 
stat_idx,
                 uint8_t is_rx)
int
  rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t 
tx_queue_id,
-               uint8_t stat_idx)
+               uint16_t stat_idx)

int
  rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t 
rx_queue_id,
-               uint8_t stat_idx)
+               uint16_t stat_idx)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-18  1:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-08  1:09 [dpdk-dev] [RFC]lib/ethdev: fix data type in tc_rxq and tc_txq humin (Q)
  -- strict thread matches above, loose matches on Subject: below --
2020-08-07 12:33 humin (Q)
2020-08-18  1:43 ` humin (Q)

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).