All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
To: Denis Pryazhennikov <denis.pryazhennikov@arknetworks.am>, dev@dpdk.org
Cc: Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>,
	Ferruh Yigit <ferruh.yigit@amd.com>,
	Roman Zhukov <roman.zhukov@arknetworks.am>,
	Andy Moreton <amoreton@xilinx.com>
Subject: Re: [PATCH 4/4] net/sfc: add configurable Rx CRC stripping
Date: Wed, 7 Jun 2023 11:34:11 +0300	[thread overview]
Message-ID: <7ed9e133-4296-126d-8acc-c37b04c781fc@oktetlabs.ru> (raw)
In-Reply-To: <20230601114220.17796-5-denis.pryazhennikov@arknetworks.am>

On 6/1/23 14:42, Denis Pryazhennikov wrote:
> Configurable Rx CRC stripping is allowed only if
> running firmware variant supports it and if NIC is
> configured with single PF per port and without VFs.

I'd like to double-check one thing. Doesn't it require fixes on
datapath to report correct length? If no, it would be good to
see notes about it here.

> 
> Signed-off-by: Roman Zhukov <roman.zhukov@arknetworks.am>
> Signed-off-by: Denis Pryazhennikov <denis.pryazhennikov@arknetworks.am>
> Reviewed-by: Andy Moreton <amoreton@xilinx.com>
> ---
>   doc/guides/nics/features/sfc.ini |  1 +
>   doc/guides/nics/sfc_efx.rst      |  6 ++++--
>   drivers/net/sfc/sfc.h            |  1 +
>   drivers/net/sfc/sfc_ef10_rx.c    |  3 ++-
>   drivers/net/sfc/sfc_port.c       | 12 ++++++++++++
>   drivers/net/sfc/sfc_rx.c         |  6 +++++-
>   6 files changed, 25 insertions(+), 4 deletions(-)
> 
> diff --git a/doc/guides/nics/features/sfc.ini b/doc/guides/nics/features/sfc.ini
> index f5ac644278ae..c41c47a63d49 100644
> --- a/doc/guides/nics/features/sfc.ini
> +++ b/doc/guides/nics/features/sfc.ini
> @@ -23,6 +23,7 @@ RSS key update       = Y
>   RSS reta update      = Y
>   SR-IOV               = Y
>   Flow control         = Y
> +CRC offload          = Y
>   VLAN offload         = P
>   L3 checksum offload  = Y
>   L4 checksum offload  = Y
> diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst
> index de0656876b96..b3a44e7ddd92 100644
> --- a/doc/guides/nics/sfc_efx.rst
> +++ b/doc/guides/nics/sfc_efx.rst
> @@ -114,6 +114,10 @@ SFC EFX PMD has support for:
>   
>   - Loopback
>   
> +- Configurable Rx CRC stripping (if running firmware variant supports it and
> +  if NIC is configured with single PF per port and without VFs, otherwise
> +  always stripped)
> +
>   - SR-IOV PF
>   
>   - Port representors (see :ref: switch_representation)
> @@ -126,8 +130,6 @@ The features not yet supported include:
>   
>   - Priority-based flow control
>   
> -- Configurable RX CRC stripping (always stripped)
> -
>   - Header split on receive
>   
>   - VLAN filtering
> diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
> index 730d054aea74..5c97d5911eb2 100644
> --- a/drivers/net/sfc/sfc.h
> +++ b/drivers/net/sfc/sfc.h
> @@ -72,6 +72,7 @@ struct sfc_port {
>   	unsigned int			flow_ctrl;
>   	boolean_t			flow_ctrl_autoneg;
>   	size_t				pdu;
> +	boolean_t			include_fcs;

Please, put it after flow_ctrl_autoneg to use available hole.
There is no requirements to put it after pdu.

>   
>   	/*
>   	 * Flow API isolated mode overrides promisc and allmulti settings;
> diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
> index 7be224c9c412..08fe41fe5d94 100644
> --- a/drivers/net/sfc/sfc_ef10_rx.c
> +++ b/drivers/net/sfc/sfc_ef10_rx.c
> @@ -826,7 +826,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
>   	.dev_offload_capa	= RTE_ETH_RX_OFFLOAD_CHECKSUM |
>   				  RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM |
>   				  RTE_ETH_RX_OFFLOAD_RSS_HASH,
> -	.queue_offload_capa	= RTE_ETH_RX_OFFLOAD_SCATTER,
> +	.queue_offload_capa	= RTE_ETH_RX_OFFLOAD_SCATTER |
> +				  RTE_ETH_RX_OFFLOAD_KEEP_CRC,

Why is it queue level offload? It is configured per port. So,
it should be device level offload if I'm not mistaken.

>   	.get_dev_info		= sfc_ef10_rx_get_dev_info,
>   	.qsize_up_rings		= sfc_ef10_rx_qsize_up_rings,
>   	.qcreate		= sfc_ef10_rx_qcreate,
> diff --git a/drivers/net/sfc/sfc_port.c b/drivers/net/sfc/sfc_port.c
> index 5f312ab1ba83..24d2daf6282b 100644
> --- a/drivers/net/sfc/sfc_port.c
> +++ b/drivers/net/sfc/sfc_port.c
> @@ -250,6 +250,11 @@ sfc_port_start(struct sfc_adapter *sa)
>   	if (rc != 0)
>   		goto fail_mac_pdu_set;
>   
> +	sfc_log_init(sa, "set include FCS=%u", port->include_fcs);
> +	rc = efx_mac_include_fcs_set(sa->nic, port->include_fcs);
> +	if (rc != 0)
> +		goto fail_include_fcs_set;
> +
>   	if (!sfc_sa2shared(sa)->isolated) {
>   		struct rte_ether_addr *addr = &port->default_mac_addr;
>   
> @@ -337,6 +342,7 @@ sfc_port_start(struct sfc_adapter *sa)
>   	(void)efx_mac_drain(sa->nic, B_TRUE);
>   
>   fail_mac_drain:
> +fail_include_fcs_set:
>   fail_mac_stats_upload:
>   	(void)efx_mac_stats_periodic(sa->nic, &port->mac_stats_dma_mem,
>   				     0, B_FALSE);
> @@ -384,11 +390,17 @@ sfc_port_configure(struct sfc_adapter *sa)
>   {
>   	const struct rte_eth_dev_data *dev_data = sa->eth_dev->data;
>   	struct sfc_port *port = &sa->port;
> +	const struct rte_eth_rxmode *rxmode = &dev_data->dev_conf.rxmode;
>   
>   	sfc_log_init(sa, "entry");
>   
>   	port->pdu = EFX_MAC_PDU(dev_data->mtu);
>   
> +	if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_KEEP_CRC)
> +		port->include_fcs = true;
> +	else
> +		port->include_fcs = false;
> +
>   	return 0;
>   }
>   
> diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
> index edd0f0c03842..f80771778c64 100644
> --- a/drivers/net/sfc/sfc_rx.c
> +++ b/drivers/net/sfc/sfc_rx.c
> @@ -655,7 +655,8 @@ struct sfc_dp_rx sfc_efx_rx = {
>   	.features		= SFC_DP_RX_FEAT_INTR,
>   	.dev_offload_capa	= RTE_ETH_RX_OFFLOAD_CHECKSUM |
>   				  RTE_ETH_RX_OFFLOAD_RSS_HASH,
> -	.queue_offload_capa	= RTE_ETH_RX_OFFLOAD_SCATTER,
> +	.queue_offload_capa	= RTE_ETH_RX_OFFLOAD_SCATTER |
> +				  RTE_ETH_RX_OFFLOAD_KEEP_CRC,

It seems it should be device level offload as above.

>   	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
>   	.qcreate		= sfc_efx_rx_qcreate,
>   	.qdestroy		= sfc_efx_rx_qdestroy,
> @@ -938,6 +939,9 @@ sfc_rx_get_offload_mask(struct sfc_adapter *sa)
>   	if (encp->enc_tunnel_encapsulations_supported == 0)
>   		no_caps |= RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM;
>   
> +	if (encp->enc_rx_include_fcs_supported == 0)
> +		no_caps |= RTE_ETH_RX_OFFLOAD_KEEP_CRC;
> +
>   	return ~no_caps;
>   }
>   


  reply	other threads:[~2023-06-07  8:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 11:42 [PATCH 0/4] net/sfc: support KEEP_CRC offload Denis Pryazhennikov
2023-06-01 11:42 ` [PATCH 1/4] common/sfc_efx/base: NIC Partitioning mode discovery using heuristic approach Denis Pryazhennikov
2023-06-02  9:43   ` Andrew Rybchenko
2023-06-01 11:42 ` [PATCH 2/4] common/sfc_efx/base: detect and report FCS include support Denis Pryazhennikov
2023-06-07  8:27   ` Andrew Rybchenko
2023-06-01 11:42 ` [PATCH 3/4] common/sfc_efx/base: add support for configure MAC to keep FCS Denis Pryazhennikov
2023-06-07  8:28   ` Andrew Rybchenko
2023-06-01 11:42 ` [PATCH 4/4] net/sfc: add configurable Rx CRC stripping Denis Pryazhennikov
2023-06-07  8:34   ` Andrew Rybchenko [this message]
2023-06-08 16:01 ` [PATCH 0/4] net/sfc: support KEEP_CRC offload Ferruh Yigit
2023-06-22  3:47 ` [PATCH v2 " Denis Pryazhennikov
2023-06-22  3:47   ` [PATCH v2 1/4] common/sfc_efx/base: discover NIC partitioning mode Denis Pryazhennikov
2023-06-22  9:48     ` Andrew Rybchenko
2023-06-22  3:47   ` [PATCH v2 2/4] common/sfc_efx/base: detect and report FCS include support Denis Pryazhennikov
2023-06-22  3:47   ` [PATCH v2 3/4] common/sfc_efx/base: add support for configure MAC to keep FCS Denis Pryazhennikov
2023-06-22  3:47   ` [PATCH v2 4/4] net/sfc: add configurable Rx CRC stripping Denis Pryazhennikov
2023-06-22  9:53     ` Andrew Rybchenko
2023-06-22 11:38 ` [PATCH v3 0/4] net/sfc: support KEEP_CRC offload Denis Pryazhennikov
2023-06-22 11:38   ` [PATCH v3 1/4] common/sfc_efx/base: discover NIC partitioning mode Denis Pryazhennikov
2023-06-22 11:38   ` [PATCH v3 2/4] common/sfc_efx/base: detect and report FCS include support Denis Pryazhennikov
2023-06-22 11:38   ` [PATCH v3 3/4] common/sfc_efx/base: add support for configure MAC to keep FCS Denis Pryazhennikov
2023-06-22 11:38   ` [PATCH v3 4/4] net/sfc: add configurable Rx CRC stripping Denis Pryazhennikov
2023-06-22 11:47 ` [PATCH v4 0/4] net/sfc: support KEEP_CRC offload Denis Pryazhennikov
2023-06-22 11:47   ` [PATCH v4 1/4] common/sfc_efx/base: discover NIC partitioning mode Denis Pryazhennikov
2023-06-22 11:47   ` [PATCH v4 2/4] common/sfc_efx/base: detect and report FCS include support Denis Pryazhennikov
2023-06-22 11:47   ` [PATCH v4 3/4] common/sfc_efx/base: add support for configure MAC to keep FCS Denis Pryazhennikov
2023-06-22 11:47   ` [PATCH v4 4/4] net/sfc: add configurable Rx CRC stripping Denis Pryazhennikov
2023-06-22 13:09   ` [PATCH v4 0/4] net/sfc: support KEEP_CRC offload 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=7ed9e133-4296-126d-8acc-c37b04c781fc@oktetlabs.ru \
    --to=andrew.rybchenko@oktetlabs.ru \
    --cc=amoreton@xilinx.com \
    --cc=denis.pryazhennikov@arknetworks.am \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=roman.zhukov@arknetworks.am \
    --cc=viacheslav.galaktionov@arknetworks.am \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.