summaryrefslogtreecommitdiff
path: root/drivers/net/sfc/sfc_rx.c
diff options
context:
space:
mode:
authorAndrew Rybchenko <arybchenko@solarflare.com>2018-07-15 10:56:15 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2018-07-23 23:55:26 +0200
commit4a61f16444541c2fa13e345af0a3c3532434a93a (patch)
treecc6d8d1bcd5eaa718a6a193354e31eb6a463834b /drivers/net/sfc/sfc_rx.c
parentb7294d8808fd0591a29edc33c70794acd378db84 (diff)
downloaddpdk-4a61f16444541c2fa13e345af0a3c3532434a93a.zip
dpdk-4a61f16444541c2fa13e345af0a3c3532434a93a.tar.gz
dpdk-4a61f16444541c2fa13e345af0a3c3532434a93a.tar.xz
net/sfc: prepare to support Rx datapath without checksum
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Diffstat (limited to 'drivers/net/sfc/sfc_rx.c')
-rw-r--r--drivers/net/sfc/sfc_rx.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index 6ff9227..d8503e2 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;
}