patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/3] net/sfc: move Rx checksum offload check to device level
       [not found] <1531648575-7568-1-git-send-email-arybchenko@solarflare.com>
@ 2018-07-15  9:56 ` Andrew Rybchenko
  2018-07-15  9:56 ` [dpdk-stable] [PATCH 2/3] net/sfc: fix Rx queue offloads reporting in queue info Andrew Rybchenko
  1 sibling, 0 replies; 2+ 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] 2+ messages in thread

* [dpdk-stable] [PATCH 2/3] net/sfc: fix Rx queue offloads reporting in queue info
       [not found] <1531648575-7568-1-git-send-email-arybchenko@solarflare.com>
  2018-07-15  9:56 ` [dpdk-stable] [PATCH 1/3] net/sfc: move Rx checksum offload check to device level Andrew Rybchenko
@ 2018-07-15  9:56 ` Andrew Rybchenko
  1 sibling, 0 replies; 2+ 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] 2+ messages in thread

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1531648575-7568-1-git-send-email-arybchenko@solarflare.com>
2018-07-15  9:56 ` [dpdk-stable] [PATCH 1/3] net/sfc: move Rx checksum offload check to device level Andrew Rybchenko
2018-07-15  9:56 ` [dpdk-stable] [PATCH 2/3] net/sfc: fix Rx queue offloads reporting in queue info Andrew Rybchenko

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