DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support
@ 2018-07-15  9:56 Andrew Rybchenko
  2018-07-15  9:56 ` [dpdk-dev] [PATCH 1/3] net/sfc: move Rx checksum offload check to device level Andrew Rybchenko
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Andrew Rybchenko @ 2018-07-15  9:56 UTC (permalink / raw)
  To: dev

Andrew Rybchenko (3):
  net/sfc: move Rx checksum offload check to device level
  net/sfc: fix Rx queue offloads reporting in queue info
  net/sfc: prepare to support Rx datapath without checksum

 drivers/net/sfc/sfc_dp_rx.h        |  1 +
 drivers/net/sfc/sfc_ef10_essb_rx.c |  3 ++-
 drivers/net/sfc/sfc_ef10_rx.c      |  3 ++-
 drivers/net/sfc/sfc_ethdev.c       |  4 +--
 drivers/net/sfc/sfc_rx.c           | 43 +++++++++++++++++++-----------
 5 files changed, 34 insertions(+), 20 deletions(-)

-- 
2.17.1

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

* [dpdk-dev] [PATCH 1/3] net/sfc: move Rx checksum offload check to device level
  2018-07-15  9:56 [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support Andrew Rybchenko
@ 2018-07-15  9:56 ` Andrew Rybchenko
  2018-07-15  9:56 ` [dpdk-dev] [PATCH 2/3] net/sfc: fix Rx queue offloads reporting in queue info Andrew Rybchenko
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Andrew Rybchenko @ 2018-07-15  9:56 UTC (permalink / raw)
  To: dev; +Cc: stable

Rx checksum offloads are on device level and should be checked and
enforced on device level.

Avoid logging of Rx checksum offloads enforced for each Rx queue.

Fixes: ff6a1197c3b1 ("net/sfc: convert to new Rx offload API")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
---
 drivers/net/sfc/sfc_rx.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index 158c8e94b..6ff922770 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -817,10 +817,8 @@ sfc_rx_get_queue_offload_caps(struct sfc_adapter *sa)
 static int
 sfc_rx_qcheck_conf(struct sfc_adapter *sa, unsigned int rxq_max_fill_level,
 		   const struct rte_eth_rxconf *rx_conf,
-		   uint64_t offloads)
+		   __rte_unused uint64_t offloads)
 {
-	uint64_t offloads_supported = sfc_rx_get_dev_offload_caps(sa) |
-				      sfc_rx_get_queue_offload_caps(sa);
 	int rc = 0;
 
 	if (rx_conf->rx_thresh.pthresh != 0 ||
@@ -842,14 +840,6 @@ sfc_rx_qcheck_conf(struct sfc_adapter *sa, unsigned int rxq_max_fill_level,
 		rc = EINVAL;
 	}
 
-	if ((offloads & DEV_RX_OFFLOAD_CHECKSUM) !=
-	    DEV_RX_OFFLOAD_CHECKSUM)
-		sfc_warn(sa, "Rx checksum offloads cannot be disabled - always on (IPv4/TCP/UDP)");
-
-	if ((offloads_supported & DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM) &&
-	    (~offloads & DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM))
-		sfc_warn(sa, "Rx outer IPv4 checksum offload cannot be disabled - always on");
-
 	return rc;
 }
 
@@ -1424,6 +1414,8 @@ sfc_rx_qinit_info(struct sfc_adapter *sa, unsigned int sw_index)
 static int
 sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
 {
+	uint64_t offloads_supported = sfc_rx_get_dev_offload_caps(sa) |
+				      sfc_rx_get_queue_offload_caps(sa);
 	struct sfc_rss *rss = &sa->rss;
 	int rc = 0;
 
@@ -1451,6 +1443,18 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
 		rxmode->offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
 	}
 
+	if ((rxmode->offloads & DEV_RX_OFFLOAD_CHECKSUM) !=
+	    DEV_RX_OFFLOAD_CHECKSUM) {
+		sfc_warn(sa, "Rx checksum offloads cannot be disabled - always on (IPv4/TCP/UDP)");
+		rxmode->offloads |= DEV_RX_OFFLOAD_CHECKSUM;
+	}
+
+	if ((offloads_supported & DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM) &&
+	    (~rxmode->offloads & DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM)) {
+		sfc_warn(sa, "Rx outer IPv4 checksum offload cannot be disabled - always on");
+		rxmode->offloads |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
+	}
+
 	return rc;
 }
 
-- 
2.17.1

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

* [dpdk-dev] [PATCH 2/3] net/sfc: fix Rx queue offloads reporting in queue info
  2018-07-15  9:56 [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support Andrew Rybchenko
  2018-07-15  9:56 ` [dpdk-dev] [PATCH 1/3] net/sfc: move Rx checksum offload check to device level Andrew Rybchenko
@ 2018-07-15  9:56 ` Andrew Rybchenko
  2018-07-15  9:56 ` [dpdk-dev] [PATCH 3/3] net/sfc: prepare to support Rx datapath without checksum Andrew Rybchenko
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Andrew Rybchenko @ 2018-07-15  9:56 UTC (permalink / raw)
  To: dev; +Cc: stable

CRC_STRIP offload is always enabled, but lost here.

It is more robust to use device level offloads directly to
compose returned value.

Fixes: ff6a1197c3b1 ("net/sfc: convert to new Rx offload API")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
---
 drivers/net/sfc/sfc_ethdev.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index fc39851fb..36a807730 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -1055,9 +1055,7 @@ sfc_rx_queue_info_get(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 	qinfo->conf.rx_free_thresh = rxq->refill_threshold;
 	qinfo->conf.rx_drop_en = 1;
 	qinfo->conf.rx_deferred_start = rxq_info->deferred_start;
-	qinfo->conf.offloads = DEV_RX_OFFLOAD_IPV4_CKSUM |
-			       DEV_RX_OFFLOAD_UDP_CKSUM |
-			       DEV_RX_OFFLOAD_TCP_CKSUM;
+	qinfo->conf.offloads = dev->data->dev_conf.rxmode.offloads;
 	if (rxq_info->type_flags & EFX_RXQ_FLAG_SCATTER) {
 		qinfo->conf.offloads |= DEV_RX_OFFLOAD_SCATTER;
 		qinfo->scattered_rx = 1;
-- 
2.17.1

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

* [dpdk-dev] [PATCH 3/3] net/sfc: prepare to support Rx datapath without checksum
  2018-07-15  9:56 [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support Andrew Rybchenko
  2018-07-15  9:56 ` [dpdk-dev] [PATCH 1/3] net/sfc: move Rx checksum offload check to device level Andrew Rybchenko
  2018-07-15  9:56 ` [dpdk-dev] [PATCH 2/3] net/sfc: fix Rx queue offloads reporting in queue info Andrew Rybchenko
@ 2018-07-15  9:56 ` Andrew Rybchenko
  2018-07-19 10:56 ` [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support Ferruh Yigit
  2018-07-20  8:56 ` Ferruh Yigit
  4 siblings, 0 replies; 9+ messages in thread
From: Andrew Rybchenko @ 2018-07-15  9:56 UTC (permalink / raw)
  To: dev

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
---
 drivers/net/sfc/sfc_dp_rx.h        |  1 +
 drivers/net/sfc/sfc_ef10_essb_rx.c |  3 ++-
 drivers/net/sfc/sfc_ef10_rx.c      |  3 ++-
 drivers/net/sfc/sfc_rx.c           | 19 ++++++++++++++-----
 4 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/drivers/net/sfc/sfc_dp_rx.h b/drivers/net/sfc/sfc_dp_rx.h
index 83faad160..ce96e83f6 100644
--- a/drivers/net/sfc/sfc_dp_rx.h
+++ b/drivers/net/sfc/sfc_dp_rx.h
@@ -195,6 +195,7 @@ struct sfc_dp_rx {
 #define SFC_DP_RX_FEAT_TUNNELS			0x4
 #define SFC_DP_RX_FEAT_FLOW_FLAG		0x8
 #define SFC_DP_RX_FEAT_FLOW_MARK		0x10
+#define SFC_DP_RX_FEAT_CHECKSUM			0x20
 	sfc_dp_rx_get_dev_info_t		*get_dev_info;
 	sfc_dp_rx_pool_ops_supported_t		*pool_ops_supported;
 	sfc_dp_rx_qsize_up_rings_t		*qsize_up_rings;
diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c
index 3e0c7fd94..81c8f7fbd 100644
--- a/drivers/net/sfc/sfc_ef10_essb_rx.c
+++ b/drivers/net/sfc/sfc_ef10_essb_rx.c
@@ -705,7 +705,8 @@ struct sfc_dp_rx sfc_ef10_essb_rx = {
 				  SFC_DP_HW_FW_CAP_RX_ES_SUPER_BUFFER,
 	},
 	.features		= SFC_DP_RX_FEAT_FLOW_FLAG |
-				  SFC_DP_RX_FEAT_FLOW_MARK,
+				  SFC_DP_RX_FEAT_FLOW_MARK |
+				  SFC_DP_RX_FEAT_CHECKSUM,
 	.get_dev_info		= sfc_ef10_essb_rx_get_dev_info,
 	.pool_ops_supported	= sfc_ef10_essb_rx_pool_ops_supported,
 	.qsize_up_rings		= sfc_ef10_essb_rx_qsize_up_rings,
diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c
index 42b35b9b2..6a5052b93 100644
--- a/drivers/net/sfc/sfc_ef10_rx.c
+++ b/drivers/net/sfc/sfc_ef10_rx.c
@@ -658,7 +658,8 @@ struct sfc_dp_rx sfc_ef10_rx = {
 		.hw_fw_caps	= SFC_DP_HW_FW_CAP_EF10,
 	},
 	.features		= SFC_DP_RX_FEAT_MULTI_PROCESS |
-				  SFC_DP_RX_FEAT_TUNNELS,
+				  SFC_DP_RX_FEAT_TUNNELS |
+				  SFC_DP_RX_FEAT_CHECKSUM,
 	.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_rx.c b/drivers/net/sfc/sfc_rx.c
index 6ff922770..d8503e201 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -517,7 +517,8 @@ struct sfc_dp_rx sfc_efx_rx = {
 		.type		= SFC_DP_RX,
 		.hw_fw_caps	= 0,
 	},
-	.features		= SFC_DP_RX_FEAT_SCATTER,
+	.features		= SFC_DP_RX_FEAT_SCATTER |
+				  SFC_DP_RX_FEAT_CHECKSUM,
 	.qsize_up_rings		= sfc_efx_rx_qsize_up_rings,
 	.qcreate		= sfc_efx_rx_qcreate,
 	.qdestroy		= sfc_efx_rx_qdestroy,
@@ -792,9 +793,12 @@ sfc_rx_get_dev_offload_caps(struct sfc_adapter *sa)
 
 	caps |= DEV_RX_OFFLOAD_JUMBO_FRAME;
 	caps |= DEV_RX_OFFLOAD_CRC_STRIP;
-	caps |= DEV_RX_OFFLOAD_IPV4_CKSUM;
-	caps |= DEV_RX_OFFLOAD_UDP_CKSUM;
-	caps |= DEV_RX_OFFLOAD_TCP_CKSUM;
+
+	if (sa->dp_rx->features & SFC_DP_RX_FEAT_CHECKSUM) {
+		caps |= DEV_RX_OFFLOAD_IPV4_CKSUM;
+		caps |= DEV_RX_OFFLOAD_UDP_CKSUM;
+		caps |= DEV_RX_OFFLOAD_TCP_CKSUM;
+	}
 
 	if (encp->enc_tunnel_encapsulations_supported &&
 	    (sa->dp_rx->features & SFC_DP_RX_FEAT_TUNNELS))
@@ -1443,8 +1447,13 @@ sfc_rx_check_mode(struct sfc_adapter *sa, struct rte_eth_rxmode *rxmode)
 		rxmode->offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
 	}
 
+	/*
+	 * Requested offloads are validated against supported by ethdev,
+	 * so unsupported offloads cannot be added as the result of
+	 * below check.
+	 */
 	if ((rxmode->offloads & DEV_RX_OFFLOAD_CHECKSUM) !=
-	    DEV_RX_OFFLOAD_CHECKSUM) {
+	    (offloads_supported & DEV_RX_OFFLOAD_CHECKSUM)) {
 		sfc_warn(sa, "Rx checksum offloads cannot be disabled - always on (IPv4/TCP/UDP)");
 		rxmode->offloads |= DEV_RX_OFFLOAD_CHECKSUM;
 	}
-- 
2.17.1

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

* Re: [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support
  2018-07-15  9:56 [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support Andrew Rybchenko
                   ` (2 preceding siblings ...)
  2018-07-15  9:56 ` [dpdk-dev] [PATCH 3/3] net/sfc: prepare to support Rx datapath without checksum Andrew Rybchenko
@ 2018-07-19 10:56 ` Ferruh Yigit
  2018-07-19 16:07   ` Andrew Rybchenko
  2018-07-20  8:56 ` Ferruh Yigit
  4 siblings, 1 reply; 9+ messages in thread
From: Ferruh Yigit @ 2018-07-19 10:56 UTC (permalink / raw)
  To: Andrew Rybchenko, dev

On 7/15/2018 10:56 AM, Andrew Rybchenko wrote:
> Andrew Rybchenko (3):
>   net/sfc: move Rx checksum offload check to device level
>   net/sfc: fix Rx queue offloads reporting in queue info
>   net/sfc: prepare to support Rx datapath without checksum

Hi Andrew,

These conflict with another sfc patchset already applied, would you mind
rebasing the set on top of latest next-net?

Thanks,
ferruh

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

* Re: [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support
  2018-07-19 10:56 ` [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support Ferruh Yigit
@ 2018-07-19 16:07   ` Andrew Rybchenko
  2018-07-19 16:28     ` Andrew Rybchenko
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Rybchenko @ 2018-07-19 16:07 UTC (permalink / raw)
  To: Ferruh Yigit, dev

On 19.07.2018 13:56, Ferruh Yigit wrote:
> On 7/15/2018 10:56 AM, Andrew Rybchenko wrote:
>> Andrew Rybchenko (3):
>>    net/sfc: move Rx checksum offload check to device level
>>    net/sfc: fix Rx queue offloads reporting in queue info
>>    net/sfc: prepare to support Rx datapath without checksum
> Hi Andrew,
>
> These conflict with another sfc patchset already applied, would you mind
> rebasing the set on top of latest next-net?

Hi Ferruh,

yes, of course.

Thanks,
Andrew.

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

* Re: [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support
  2018-07-19 16:07   ` Andrew Rybchenko
@ 2018-07-19 16:28     ` Andrew Rybchenko
  2018-07-20  8:55       ` Ferruh Yigit
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Rybchenko @ 2018-07-19 16:28 UTC (permalink / raw)
  To: Ferruh Yigit, dev

On 19.07.2018 19:07, Andrew Rybchenko wrote:
> On 19.07.2018 13:56, Ferruh Yigit wrote:
>> On 7/15/2018 10:56 AM, Andrew Rybchenko wrote:
>>> Andrew Rybchenko (3):
>>>    net/sfc: move Rx checksum offload check to device level
>>>    net/sfc: fix Rx queue offloads reporting in queue info
>>>    net/sfc: prepare to support Rx datapath without checksum
>> Hi Andrew,
>>
>> These conflict with another sfc patchset already applied, would you mind
>> rebasing the set on top of latest next-net?
>
> Hi Ferruh,
>
> yes, of course.

It looks like it is already applied and pushed to next-net:
http://git.dpdk.org/next/dpdk-next-net/commit/?id=bd3c7e3f7eb54325aeffefe91c269a58dc63de9a
http://git.dpdk.org/next/dpdk-next-net/commit/?id=607b9ecf2354aeeacb52121c4f3b4f9ad1cc907c
http://git.dpdk.org/next/dpdk-next-net/commit/?id=b0cd127737030859fca09c68a366f6a1c43ba6d1

If so, I'm not sure that I understand the request.

Andrew.

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

* Re: [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support
  2018-07-19 16:28     ` Andrew Rybchenko
@ 2018-07-20  8:55       ` Ferruh Yigit
  0 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2018-07-20  8:55 UTC (permalink / raw)
  To: Andrew Rybchenko, dev

On 7/19/2018 5:28 PM, Andrew Rybchenko wrote:
> On 19.07.2018 19:07, Andrew Rybchenko wrote:
>> On 19.07.2018 13:56, Ferruh Yigit wrote:
>>> On 7/15/2018 10:56 AM, Andrew Rybchenko wrote:
>>>> Andrew Rybchenko (3):
>>>>    net/sfc: move Rx checksum offload check to device level
>>>>    net/sfc: fix Rx queue offloads reporting in queue info
>>>>    net/sfc: prepare to support Rx datapath without checksum
>>> Hi Andrew,
>>>
>>> These conflict with another sfc patchset already applied, would you mind
>>> rebasing the set on top of latest next-net?
>>
>> Hi Ferruh,
>>
>> yes, of course.
> 
> It looks like it is already applied and pushed to next-net:
> http://git.dpdk.org/next/dpdk-next-net/commit/?id=bd3c7e3f7eb54325aeffefe91c269a58dc63de9a
> http://git.dpdk.org/next/dpdk-next-net/commit/?id=607b9ecf2354aeeacb52121c4f3b4f9ad1cc907c
> http://git.dpdk.org/next/dpdk-next-net/commit/?id=b0cd127737030859fca09c68a366f6a1c43ba6d1
> 
> If so, I'm not sure that I understand the request.

My bad, pathset is OK and applied, thanks.

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

* Re: [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support
  2018-07-15  9:56 [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support Andrew Rybchenko
                   ` (3 preceding siblings ...)
  2018-07-19 10:56 ` [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support Ferruh Yigit
@ 2018-07-20  8:56 ` Ferruh Yigit
  4 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2018-07-20  8:56 UTC (permalink / raw)
  To: Andrew Rybchenko, dev

On 7/15/2018 10:56 AM, Andrew Rybchenko wrote:
> Andrew Rybchenko (3):
>   net/sfc: move Rx checksum offload check to device level
>   net/sfc: fix Rx queue offloads reporting in queue info
>   net/sfc: prepare to support Rx datapath without checksum

Series applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2018-07-20  8:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-15  9:56 [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support Andrew Rybchenko
2018-07-15  9:56 ` [dpdk-dev] [PATCH 1/3] net/sfc: move Rx checksum offload check to device level Andrew Rybchenko
2018-07-15  9:56 ` [dpdk-dev] [PATCH 2/3] net/sfc: fix Rx queue offloads reporting in queue info Andrew Rybchenko
2018-07-15  9:56 ` [dpdk-dev] [PATCH 3/3] net/sfc: prepare to support Rx datapath without checksum Andrew Rybchenko
2018-07-19 10:56 ` [dpdk-dev] [PATCH 0/3] net/sfc: improve Rx checksumming support Ferruh Yigit
2018-07-19 16:07   ` Andrew Rybchenko
2018-07-19 16:28     ` Andrew Rybchenko
2018-07-20  8:55       ` Ferruh Yigit
2018-07-20  8:56 ` Ferruh Yigit

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