DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] questions about new offload ethdev api
@ 2018-01-23 13:53 Olivier Matz
  2018-01-23 14:34 ` Shahaf Shuler
  0 siblings, 1 reply; 7+ messages in thread
From: Olivier Matz @ 2018-01-23 13:53 UTC (permalink / raw)
  To: dev, Ananyev, Konstantin, Shahaf Shuler, Ferruh Yigit,
	Thomas Monjalon, Bruce Richardson, Andrew Rybchenko

Hi,

I'm currently porting an application to the new ethdev offload api,
and I have two questions about it.

1/ inconsistent offload capa for PMDs using the old API?

It is stated in struct rte_eth_txmode:

   /**
    * Per-port Tx offloads to be set using DEV_TX_OFFLOAD_* flags.
    * Only offloads set on tx_offload_capa field on rte_eth_dev_info
    * structure are allowed to be set.
    */
    uint64_t offloads;

So, if I want to enable DEV_TX_OFFLOAD_MULTI_SEGS for the whole ethdev,
I must check that DEV_TX_OFFLOAD_MULTI_SEGS is advertised in
dev_info->tx_offload_capa.

In my understanding, many PMDs are still using the old API, and there is
a conversion layer in ethdev when doing dev_configure(). But I don't see
any similar mechanism for the dev_info. Therefore,
DEV_TX_OFFLOAD_MULTI_SEGS is not present in tx_offload_capa, and if I
follow the API comment, I'm not allowed to use this feature.

Am I missing something or is it a bug?

It looks that testpmd does not check the capa before setting the an
offload flag. This could be a workaround in my application.

2/ meaning of rxmode.jumbo_frame, rxmode.enable_scatter, rxmode.max_rx_pkt_len

While it's not related to the new API, it is probably a good opportunity
to clarify the meaning of these flags. I'm not able to find a good
documentation about them.

Here is my understanding, the configuration only depends on:
- the maximum rx frame length
- the amount of data available in a mbuf (minus headroom)

Flags to set in rxmode (example):
+---------------+----------------+----------------+-----------------+
|               |mbuf_data_len=1K|mbuf_data_len=2K|mbuf_data_len=16K|
+---------------+----------------+----------------+-----------------+
|max_rx_len=1500|enable_scatter  |                |                 |
+---------------+----------------+----------------+-----------------+
|max_rx_len=9000|enable_scatter, |enable_scatter, |jumbo_frame      |
|               |jumbo_frame     |jumbo_frame     |                 |
+---------------+----------------+----------------+-----------------+

If this table is correct, the flag jumbo_frame would be equivalent to
check if max_rx_pkt_len is above a threshold.

And enable_scatter could be deduced from the mbuf size of the given rxq
(which is a bit harder but maybe doable).

Thanks,
Olivier

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

end of thread, other threads:[~2019-12-27 14:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-23 13:53 [dpdk-dev] questions about new offload ethdev api Olivier Matz
2018-01-23 14:34 ` Shahaf Shuler
2018-03-08 15:45   ` Ferruh Yigit
2019-12-10 18:07   ` Ferruh Yigit
2019-12-16  8:39     ` Andrew Rybchenko
2019-12-27 13:54       ` Olivier Matz
2019-12-27 14:23         ` Ananyev, Konstantin

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