aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>2018-12-19 13:03:32 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2019-01-15 15:02:27 -0500
commitcf909e19acf373a2e1d9bd877846a11bc8e20a54 (patch)
tree6830f207d013dd9aed2f288b61299e6f78c75912
parenta8939784a17a54566e8d8ab26e9a9c36e4598281 (diff)
ice: Offload SCTP checksum
This patch adds the ability to offload SCTP checksum calculations to the NIC. Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/ice/ice.h1
-rw-r--r--drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h1
-rw-r--r--drivers/net/ethernet/intel/ice/ice_main.c1
-rw-r--r--drivers/net/ethernet/intel/ice/ice_txrx.c6
4 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
index ac8bf7491d08..55944e089558 100644
--- a/drivers/net/ethernet/intel/ice/ice.h
+++ b/drivers/net/ethernet/intel/ice/ice.h
@@ -26,6 +26,7 @@
26#include <linux/bitmap.h> 26#include <linux/bitmap.h>
27#include <linux/log2.h> 27#include <linux/log2.h>
28#include <linux/ip.h> 28#include <linux/ip.h>
29#include <linux/sctp.h>
29#include <linux/ipv6.h> 30#include <linux/ipv6.h>
30#include <linux/if_bridge.h> 31#include <linux/if_bridge.h>
31#include <linux/avf/virtchnl.h> 32#include <linux/avf/virtchnl.h>
diff --git a/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h b/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
index bb51dd7defb5..bd7c01db8c63 100644
--- a/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
+++ b/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
@@ -346,6 +346,7 @@ enum ice_tx_desc_cmd_bits {
346 ICE_TX_DESC_CMD_IIPT_IPV4 = 0x0040, /* 2 BITS */ 346 ICE_TX_DESC_CMD_IIPT_IPV4 = 0x0040, /* 2 BITS */
347 ICE_TX_DESC_CMD_IIPT_IPV4_CSUM = 0x0060, /* 2 BITS */ 347 ICE_TX_DESC_CMD_IIPT_IPV4_CSUM = 0x0060, /* 2 BITS */
348 ICE_TX_DESC_CMD_L4T_EOFT_TCP = 0x0100, /* 2 BITS */ 348 ICE_TX_DESC_CMD_L4T_EOFT_TCP = 0x0100, /* 2 BITS */
349 ICE_TX_DESC_CMD_L4T_EOFT_SCTP = 0x0200, /* 2 BITS */
349 ICE_TX_DESC_CMD_L4T_EOFT_UDP = 0x0300, /* 2 BITS */ 350 ICE_TX_DESC_CMD_L4T_EOFT_UDP = 0x0300, /* 2 BITS */
350}; 351};
351 352
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index e59f8b29af49..f4bf6bda32a9 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -1528,6 +1528,7 @@ static int ice_cfg_netdev(struct ice_vsi *vsi)
1528 1528
1529 csumo_features = NETIF_F_RXCSUM | 1529 csumo_features = NETIF_F_RXCSUM |
1530 NETIF_F_IP_CSUM | 1530 NETIF_F_IP_CSUM |
1531 NETIF_F_SCTP_CRC |
1531 NETIF_F_IPV6_CSUM; 1532 NETIF_F_IPV6_CSUM;
1532 1533
1533 vlano_features = NETIF_F_HW_VLAN_CTAG_FILTER | 1534 vlano_features = NETIF_F_HW_VLAN_CTAG_FILTER |
diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index 384ac5c82e00..2357fcac996b 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -1465,6 +1465,12 @@ int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off)
1465 offset |= l4_len << ICE_TX_DESC_LEN_L4_LEN_S; 1465 offset |= l4_len << ICE_TX_DESC_LEN_L4_LEN_S;
1466 break; 1466 break;
1467 case IPPROTO_SCTP: 1467 case IPPROTO_SCTP:
1468 /* enable SCTP checksum offload */
1469 cmd |= ICE_TX_DESC_CMD_L4T_EOFT_SCTP;
1470 l4_len = sizeof(struct sctphdr) >> 2;
1471 offset |= l4_len << ICE_TX_DESC_LEN_L4_LEN_S;
1472 break;
1473
1468 default: 1474 default:
1469 if (first->tx_flags & ICE_TX_FLAGS_TSO) 1475 if (first->tx_flags & ICE_TX_FLAGS_TSO)
1470 return -1; 1476 return -1;