aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2009-04-27 18:36:35 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-28 04:53:15 -0400
commit45a5ead0220cc7cc70f6961879decffbd0a54cc0 (patch)
treeb9e038ea11b3fbfe0d5ed7ca4f38fc0fc1b7f0b2
parentb9473560c6d882e0fbd3a8817e906c847b11c722 (diff)
ixgbe: enable hardware offload for sctp
Inspired by: Vlad Yasevich <vladislav.yasevich@hp.com> This is the code to enable ixgbe for hardware offload support of CRC32c on both transmit and receive of SCTP traffic. only 82599 supports this offload, not 82598. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c11
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c9
2 files changed, 18 insertions, 2 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index f0a20facc650..a499b6b31ca2 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -311,10 +311,17 @@ static u32 ixgbe_get_tx_csum(struct net_device *netdev)
311 311
312static int ixgbe_set_tx_csum(struct net_device *netdev, u32 data) 312static int ixgbe_set_tx_csum(struct net_device *netdev, u32 data)
313{ 313{
314 if (data) 314 struct ixgbe_adapter *adapter = netdev_priv(netdev);
315
316 if (data) {
315 netdev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM); 317 netdev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
316 else 318 if (adapter->hw.mac.type == ixgbe_mac_82599EB)
319 netdev->features |= NETIF_F_SCTP_CSUM;
320 } else {
317 netdev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM); 321 netdev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
322 if (adapter->hw.mac.type == ixgbe_mac_82599EB)
323 netdev->features &= ~NETIF_F_SCTP_CSUM;
324 }
318 325
319 return 0; 326 return 0;
320} 327}
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 42b803d5cfd3..c3dff8f02e33 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -4189,12 +4189,18 @@ static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter,
4189 if (ip_hdr(skb)->protocol == IPPROTO_TCP) 4189 if (ip_hdr(skb)->protocol == IPPROTO_TCP)
4190 type_tucmd_mlhl |= 4190 type_tucmd_mlhl |=
4191 IXGBE_ADVTXD_TUCMD_L4T_TCP; 4191 IXGBE_ADVTXD_TUCMD_L4T_TCP;
4192 else if (ip_hdr(skb)->protocol == IPPROTO_SCTP)
4193 type_tucmd_mlhl |=
4194 IXGBE_ADVTXD_TUCMD_L4T_SCTP;
4192 break; 4195 break;
4193 case cpu_to_be16(ETH_P_IPV6): 4196 case cpu_to_be16(ETH_P_IPV6):
4194 /* XXX what about other V6 headers?? */ 4197 /* XXX what about other V6 headers?? */
4195 if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) 4198 if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP)
4196 type_tucmd_mlhl |= 4199 type_tucmd_mlhl |=
4197 IXGBE_ADVTXD_TUCMD_L4T_TCP; 4200 IXGBE_ADVTXD_TUCMD_L4T_TCP;
4201 else if (ipv6_hdr(skb)->nexthdr == IPPROTO_SCTP)
4202 type_tucmd_mlhl |=
4203 IXGBE_ADVTXD_TUCMD_L4T_SCTP;
4198 break; 4204 break;
4199 default: 4205 default:
4200 if (unlikely(net_ratelimit())) { 4206 if (unlikely(net_ratelimit())) {
@@ -4718,6 +4724,9 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
4718 netdev->features |= NETIF_F_TSO6; 4724 netdev->features |= NETIF_F_TSO6;
4719 netdev->features |= NETIF_F_GRO; 4725 netdev->features |= NETIF_F_GRO;
4720 4726
4727 if (adapter->hw.mac.type == ixgbe_mac_82599EB)
4728 netdev->features |= NETIF_F_SCTP_CSUM;
4729
4721 netdev->vlan_features |= NETIF_F_TSO; 4730 netdev->vlan_features |= NETIF_F_TSO;
4722 netdev->vlan_features |= NETIF_F_TSO6; 4731 netdev->vlan_features |= NETIF_F_TSO6;
4723 netdev->vlan_features |= NETIF_F_IP_CSUM; 4732 netdev->vlan_features |= NETIF_F_IP_CSUM;