[dpdk-dev] [PATCH 1/5] net/qede: convert to new Rx/Tx offloads API
Andrew Rybchenko
arybchenko at solarflare.com
Fri May 11 11:16:56 CEST 2018
On 03/28/2018 03:15 AM, Rasesh Mody wrote:
> From: Harish Patil <harish.patil at cavium.com>
>
> Ethdev RX/TX offloads API has changed since:
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")
>
> This patch makes use of new offload flags as suggested and fix
> the default RX/TX configuration. Also indent the code properly
> around those changes.
>
> Signed-off-by: Harish Patil <harish.patil at cavium.com>
> Signed-off-by: Rasesh Mody <rasesh.mody at cavium.com>
> ---
> drivers/net/qede/qede_ethdev.c | 103 ++++++++++++++++++++++------------------
> drivers/net/qede/qede_rxtx.c | 2 +-
> drivers/net/qede/qede_rxtx.h | 2 -
> 3 files changed, 59 insertions(+), 48 deletions(-)
>
> diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
> index a91f436..6a51e3d 100644
> --- a/drivers/net/qede/qede_ethdev.c
> +++ b/drivers/net/qede/qede_ethdev.c
[...]
> @@ -1534,26 +1527,46 @@ static int qede_dev_configure(struct rte_eth_dev *eth_dev)
> dev_info->reta_size = ECORE_RSS_IND_TABLE_SIZE;
> dev_info->hash_key_size = ECORE_RSS_KEY_SIZE * sizeof(uint32_t);
> dev_info->flow_type_rss_offloads = (uint64_t)QEDE_RSS_OFFLOAD_ALL;
> -
> - dev_info->default_txconf = (struct rte_eth_txconf) {
> - .txq_flags = QEDE_TXQ_FLAGS,
> - };
> -
> - dev_info->rx_offload_capa = (DEV_RX_OFFLOAD_VLAN_STRIP |
> - DEV_RX_OFFLOAD_IPV4_CKSUM |
> + dev_info->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM |
> DEV_RX_OFFLOAD_UDP_CKSUM |
> DEV_RX_OFFLOAD_TCP_CKSUM |
> DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
> - DEV_RX_OFFLOAD_TCP_LRO);
> -
> + DEV_RX_OFFLOAD_TCP_LRO |
> + DEV_RX_OFFLOAD_CRC_STRIP |
> + DEV_RX_OFFLOAD_SCATTER |
> + DEV_RX_OFFLOAD_JUMBO_FRAME |
> + DEV_RX_OFFLOAD_VLAN_FILTER |
> + DEV_RX_OFFLOAD_VLAN_STRIP);
> + dev_info->rx_queue_offload_capa = 0;
> +
> + /* TX offloads are on a per-packet basis, so it is applicable
> + * to both at port and queue levels.
> + */
> dev_info->tx_offload_capa = (DEV_TX_OFFLOAD_VLAN_INSERT |
> DEV_TX_OFFLOAD_IPV4_CKSUM |
> DEV_TX_OFFLOAD_UDP_CKSUM |
> DEV_TX_OFFLOAD_TCP_CKSUM |
> DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
> - DEV_TX_OFFLOAD_TCP_TSO |
> + DEV_TX_OFFLOAD_QINQ_INSERT |
> + DEV_TX_OFFLOAD_MULTI_SEGS |
> + DEV_TX_OFFLOAD_TCP_TSO |
> DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
> DEV_TX_OFFLOAD_GENEVE_TNL_TSO);
> + dev_info->tx_queue_offload_capa = dev_info->tx_offload_capa;
> +
> + dev_info->default_txconf = (struct rte_eth_txconf) {
> + .txq_flags = DEV_TX_OFFLOAD_MULTI_SEGS,
It is incorrect to initialize TxQ flags using Tx offload define.
> + };
> +
> + dev_info->default_rxconf = (struct rte_eth_rxconf) {
> + /* Packets are always dropped if no descriptors are available */
> + .rx_drop_en = 1,
> + /* The below RX offloads are always enabled */
> + .offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
> + DEV_RX_OFFLOAD_IPV4_CKSUM |
> + DEV_RX_OFFLOAD_TCP_CKSUM |
> + DEV_RX_OFFLOAD_UDP_CKSUM),
> + };
>
> memset(&link, 0, sizeof(struct qed_link_output));
> qdev->ops->common->get_link(edev, &link);
More information about the dev
mailing list