DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shahaf Shuler <shahafs@mellanox.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>,
	Wenzhuo Lu <wenzhuo.lu@intel.com>,
	 Jingjing Wu <jingjing.wu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Wei Dai <wei.dai@intel.com>,
	Qi Zhang <qi.z.zhang@intel.com>
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: check if CRC strip offload supported
Date: Thu, 10 May 2018 04:39:20 +0000	[thread overview]
Message-ID: <DB7PR05MB442632DC51BC1B8C308F27AAC3980@DB7PR05MB4426.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20180509220904.128983-1-ferruh.yigit@intel.com>

Thursday, May 10, 2018 1:09 AM, Ferruh Yigit:
> Subject: [PATCH] app/testpmd: check if CRC strip offload supported
> 
> Testpmd set CRC_STRIP offload blindly, this is wrong according offload API
> definition, and will cause error for the PMDs that doesn't support CRC_STRIP
> like virtual PMDs.
> 
> Check if underlying device report this capability and don't set it if not
> supported.
> 
> Fixes: 0074d02fca21 ("app/testpmd: convert to new Rx offloads API")
> Cc: shahafs@mellanox.com
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Yes this is the correct behavior. I hope all the PMDs report the CRC strip correctly. 

Acked-by: Shahaf Shuler < shahafs@mellanox.com>

> ---
> Cc: Wei Dai <wei.dai@intel.com>
> Cc: Qi Zhang <qi.z.zhang@intel.com>
> ---
>  app/test-pmd/testpmd.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> db23f23e5..1938283f6 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -701,6 +701,11 @@ init_config(void)
>  		port->dev_conf.txmode = tx_mode;
>  		port->dev_conf.rxmode = rx_mode;
>  		rte_eth_dev_info_get(pid, &port->dev_info);
> +
> +		if (!(port->dev_info.rx_offload_capa &
> +					DEV_RX_OFFLOAD_CRC_STRIP))
> +			port->dev_conf.rxmode.offloads &=
> +				~DEV_RX_OFFLOAD_CRC_STRIP;
>  		if (!(port->dev_info.tx_offload_capa &
>  		      DEV_TX_OFFLOAD_MBUF_FAST_FREE))
>  			port->dev_conf.txmode.offloads &=
> --
> 2.14.3

  reply	other threads:[~2018-05-10  4:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 22:09 Ferruh Yigit
2018-05-10  4:39 ` Shahaf Shuler [this message]
2018-05-11 15:36   ` Iremonger, Bernard
2018-05-11 16:27     ` Ferruh Yigit

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=DB7PR05MB442632DC51BC1B8C308F27AAC3980@DB7PR05MB4426.eurprd05.prod.outlook.com \
    --to=shahafs@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=wei.dai@intel.com \
    --cc=wenzhuo.lu@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).