DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Wu, Yanglong" <yanglong.wu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Dai, Wei" <wei.dai@intel.com>, "Xing, Beilei" <beilei.xing@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 2/2] net/i40e: convert to new Tx offloads API
Date: Thu, 29 Mar 2018 05:51:43 +0000	[thread overview]
Message-ID: <039ED4275CED7440929022BC67E7061153175E05@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20180329052655.44220-1-yanglong.wu@intel.com>



> -----Original Message-----
> From: Wu, Yanglong
> Sent: Thursday, March 29, 2018 1:27 PM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Dai, Wei <wei.dai@intel.com>; Xing,
> Beilei <beilei.xing@intel.com>; Wu, Yanglong <yanglong.wu@intel.com>
> Subject: [PATCH v2 2/2] net/i40e: convert to new Tx offloads API

I think this is v3, not v2, please keep this correct and always update change log 
> 
> 
> +static int
> +i40e_check_tx_queue_offloads(struct rte_eth_dev *dev, uint64_t
> +requested) {
> +	struct rte_eth_dev_info dev_info;
> +	uint64_t mandatory = dev->data->dev_conf.txmode.offloads;
> +	uint64_t supported; /* All per port offloads */
> +
> +	dev->dev_ops->dev_infos_get(dev, &dev_info);
> +	supported = dev_info.tx_offload_capa ^
> dev_info.tx_queue_offload_capa;
> +	if ((requested & dev_info.tx_queue_offload_capa) != requested)
> +		return 0; /* requested range check */

I think the fix for rx should also be applied on tx, right?

Regards
Qi

> +	return !((mandatory ^ requested) & supported); }
> +
>  int
>  i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
>  			uint16_t queue_idx,
> @@ -2015,6 +2029,16 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev
> *dev,
>  	uint16_t tx_rs_thresh, tx_free_thresh;
>  	uint16_t reg_idx, i, base, bsf, tc_mapping;
>  	int q_offset;
> +	struct rte_eth_dev_info dev_info;
> +
> +	if (!i40e_check_tx_queue_offloads(dev, tx_conf->offloads)) {
> +		dev->dev_ops->dev_infos_get(dev, &dev_info);
> +		PMD_INIT_LOG(ERR, "%p: Tx queue offloads 0x%" PRIx64
> +			" don't match port  offloads 0x%" PRIx64
> +			" or supported offloads 0x%" PRIx64,
> +			(void *)dev, tx_conf->offloads,
> +			dev->data->dev_conf.txmode.offloads,
> +			dev_info.tx_offload_capa); }
> 
>  	if (hw->mac.type == I40E_MAC_VF || hw->mac.type ==
> I40E_MAC_X722_VF) {
>  		vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
> diff --git a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h index
> cb5f8c714..10feec4a2 100644
> --- a/drivers/net/i40e/i40e_rxtx.h
> +++ b/drivers/net/i40e/i40e_rxtx.h
> @@ -149,6 +149,7 @@ struct i40e_tx_queue {
>  	bool q_set; /**< indicate if tx queue has been configured */
>  	bool tx_deferred_start; /**< don't start this queue in dev start */
>  	uint8_t dcb_tc;         /**< Traffic class of tx queue */
> +	uint64_t offloads; /**< Tx offload flags of DEV_RX_OFFLOAD_* */
>  };
> 
>  /** Offload features */
> --
> 2.11.0

      reply	other threads:[~2018-03-29  5:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-02  9:05 [dpdk-dev] [DPDK] " Yanglong Wu
2018-03-27  8:49 ` [dpdk-dev] [PATCH v2 1/2] net/i40e: convert to new Rx " Yanglong Wu
2018-03-27  8:51 ` [dpdk-dev] [PATCH v2 2/2] net/i40e: convert to new Tx " Yanglong Wu
2018-03-28  2:04 ` [dpdk-dev] [PATCH v2 1/2] net/i40e: convert to new Rx " Yanglong Wu
2018-03-29  9:14   ` [dpdk-dev] [PATCH v3 " Yanglong Wu
2018-03-30  5:39   ` [dpdk-dev] [PATCH v3 0/2] net/i40e: convert to new Rx/Tx " Yanglong Wu
2018-03-30  5:39     ` [dpdk-dev] [PATCH v3 1/2] net/i40e: convert to new Rx " Yanglong Wu
2018-03-30  7:25       ` Zhang, Qi Z
2018-03-30  8:03         ` Wu, Yanglong
2018-03-30  5:39     ` [dpdk-dev] [PATCH v3 2/2] net/i40e: convert to new Tx " Yanglong Wu
2018-03-30  8:22     ` [dpdk-dev] [PATCH v4 0/2] convert to new Rx/Tx " Yanglong Wu
2018-03-30  8:22       ` [dpdk-dev] [PATCH v4 1/2] net/i40e: convert to new Rx " Yanglong Wu
2018-03-30  8:22       ` [dpdk-dev] [PATCH v4 2/2] net/i40e: convert to new Tx " Yanglong Wu
2018-03-30 10:33       ` [dpdk-dev] [PATCH v4 0/2] convert to new Rx/Tx " Zhang, Qi Z
2018-03-30 15:18         ` Zhang, Helin
2018-03-28  2:04 ` [dpdk-dev] [PATCH v2 2/2] net/i40e: convert to new Tx " Yanglong Wu
2018-03-29  9:17   ` [dpdk-dev] [PATCH v3 " Yanglong Wu
2018-03-29  5:23 ` [dpdk-dev] [PATCH v2 " Yanglong Wu
2018-03-29  5:26 ` Yanglong Wu
2018-03-29  5:51   ` Zhang, Qi Z [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=039ED4275CED7440929022BC67E7061153175E05@SHSMSX103.ccr.corp.intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=wei.dai@intel.com \
    --cc=yanglong.wu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).