diff options
-rw-r--r-- | drivers/net/ethernet/ibm/ibmvnic.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 51cfe95f3e24..3dfb2d131eb7 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c | |||
@@ -3762,6 +3762,7 @@ static void handle_query_ip_offload_rsp(struct ibmvnic_adapter *adapter) | |||
3762 | { | 3762 | { |
3763 | struct device *dev = &adapter->vdev->dev; | 3763 | struct device *dev = &adapter->vdev->dev; |
3764 | struct ibmvnic_query_ip_offload_buffer *buf = &adapter->ip_offload_buf; | 3764 | struct ibmvnic_query_ip_offload_buffer *buf = &adapter->ip_offload_buf; |
3765 | netdev_features_t old_hw_features = 0; | ||
3765 | union ibmvnic_crq crq; | 3766 | union ibmvnic_crq crq; |
3766 | int i; | 3767 | int i; |
3767 | 3768 | ||
@@ -3837,24 +3838,41 @@ static void handle_query_ip_offload_rsp(struct ibmvnic_adapter *adapter) | |||
3837 | adapter->ip_offload_ctrl.large_rx_ipv4 = 0; | 3838 | adapter->ip_offload_ctrl.large_rx_ipv4 = 0; |
3838 | adapter->ip_offload_ctrl.large_rx_ipv6 = 0; | 3839 | adapter->ip_offload_ctrl.large_rx_ipv6 = 0; |
3839 | 3840 | ||
3840 | adapter->netdev->features = NETIF_F_SG | NETIF_F_GSO; | 3841 | if (adapter->state != VNIC_PROBING) { |
3842 | old_hw_features = adapter->netdev->hw_features; | ||
3843 | adapter->netdev->hw_features = 0; | ||
3844 | } | ||
3845 | |||
3846 | adapter->netdev->hw_features = NETIF_F_SG | NETIF_F_GSO | NETIF_F_GRO; | ||
3841 | 3847 | ||
3842 | if (buf->tcp_ipv4_chksum || buf->udp_ipv4_chksum) | 3848 | if (buf->tcp_ipv4_chksum || buf->udp_ipv4_chksum) |
3843 | adapter->netdev->features |= NETIF_F_IP_CSUM; | 3849 | adapter->netdev->hw_features |= NETIF_F_IP_CSUM; |
3844 | 3850 | ||
3845 | if (buf->tcp_ipv6_chksum || buf->udp_ipv6_chksum) | 3851 | if (buf->tcp_ipv6_chksum || buf->udp_ipv6_chksum) |
3846 | adapter->netdev->features |= NETIF_F_IPV6_CSUM; | 3852 | adapter->netdev->hw_features |= NETIF_F_IPV6_CSUM; |
3847 | 3853 | ||
3848 | if ((adapter->netdev->features & | 3854 | if ((adapter->netdev->features & |
3849 | (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM))) | 3855 | (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM))) |
3850 | adapter->netdev->features |= NETIF_F_RXCSUM; | 3856 | adapter->netdev->hw_features |= NETIF_F_RXCSUM; |
3851 | 3857 | ||
3852 | if (buf->large_tx_ipv4) | 3858 | if (buf->large_tx_ipv4) |
3853 | adapter->netdev->features |= NETIF_F_TSO; | 3859 | adapter->netdev->hw_features |= NETIF_F_TSO; |
3854 | if (buf->large_tx_ipv6) | 3860 | if (buf->large_tx_ipv6) |
3855 | adapter->netdev->features |= NETIF_F_TSO6; | 3861 | adapter->netdev->hw_features |= NETIF_F_TSO6; |
3856 | 3862 | ||
3857 | adapter->netdev->hw_features |= adapter->netdev->features; | 3863 | if (adapter->state == VNIC_PROBING) { |
3864 | adapter->netdev->features |= adapter->netdev->hw_features; | ||
3865 | } else if (old_hw_features != adapter->netdev->hw_features) { | ||
3866 | netdev_features_t tmp = 0; | ||
3867 | |||
3868 | /* disable features no longer supported */ | ||
3869 | adapter->netdev->features &= adapter->netdev->hw_features; | ||
3870 | /* turn on features now supported if previously enabled */ | ||
3871 | tmp = (old_hw_features ^ adapter->netdev->hw_features) & | ||
3872 | adapter->netdev->hw_features; | ||
3873 | adapter->netdev->features |= | ||
3874 | tmp & adapter->netdev->wanted_features; | ||
3875 | } | ||
3858 | 3876 | ||
3859 | memset(&crq, 0, sizeof(crq)); | 3877 | memset(&crq, 0, sizeof(crq)); |
3860 | crq.control_ip_offload.first = IBMVNIC_CRQ_CMD; | 3878 | crq.control_ip_offload.first = IBMVNIC_CRQ_CMD; |