提交 e0b0e4c7 编写于 作者: C Chiqijun 提交者: Yang Yingliang

net/hinic: Disable the CSUM offload capability of TUNNEL in SDI mode

driver inclusion
category: bugfix
bugzilla: 4472

-----------------------------------------------------------------------

OVS does not support the csum offload capability of tunnel packet. If the
protocol stack does the csum offloading of tunnel packet, it will cause
the packet'csum error; therefore, the csum offload capability of tunnel
packet needs to be disabled in SDI mode.
Signed-off-by: NChiqijun <chiqijun@huawei.com>
Reviewed-by: NLuoshaokai <luoshaokai@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 982e52ff
...@@ -325,6 +325,8 @@ enum hinic_func_cap { ...@@ -325,6 +325,8 @@ enum hinic_func_cap {
HINIC_FUNC_SUPP_CHANGE_MAC = 1 << 9, HINIC_FUNC_SUPP_CHANGE_MAC = 1 << 9,
/* OVS don't support SCTP_CRC/HW_VLAN/LRO */ /* OVS don't support SCTP_CRC/HW_VLAN/LRO */
HINIC_FUNC_OFFLOAD_OVS_UNSUPP = 1 << 10, HINIC_FUNC_OFFLOAD_OVS_UNSUPP = 1 << 10,
/* OVS don't support encap-tso/encap-csum */
HINIC_FUNC_SUPP_ENCAP_TSO_CSUM = 1 << 11,
}; };
#define FUNC_SUPPORT_MGMT(hwdev) \ #define FUNC_SUPPORT_MGMT(hwdev) \
...@@ -363,6 +365,9 @@ enum hinic_func_cap { ...@@ -363,6 +365,9 @@ enum hinic_func_cap {
#define FUNC_SUPPORT_LRO(hwdev) \ #define FUNC_SUPPORT_LRO(hwdev) \
(!(hinic_get_func_feature_cap(hwdev) & \ (!(hinic_get_func_feature_cap(hwdev) & \
HINIC_FUNC_OFFLOAD_OVS_UNSUPP)) HINIC_FUNC_OFFLOAD_OVS_UNSUPP))
#define FUNC_SUPPORT_ENCAP_TSO_CSUM(hwdev) \
(!!(hinic_get_func_feature_cap(hwdev) & \
HINIC_FUNC_SUPP_ENCAP_TSO_CSUM))
int hinic_init_hwdev(struct hinic_init_para *para); int hinic_init_hwdev(struct hinic_init_para *para);
int hinic_set_vf_dev_cap(void *hwdev); int hinic_set_vf_dev_cap(void *hwdev);
......
...@@ -198,7 +198,8 @@ struct hinic_heartbeat_enhanced { ...@@ -198,7 +198,8 @@ struct hinic_heartbeat_enhanced {
HINIC_FUNC_SUPP_DFX_REG | \ HINIC_FUNC_SUPP_DFX_REG | \
HINIC_FUNC_SUPP_RX_MODE | \ HINIC_FUNC_SUPP_RX_MODE | \
HINIC_FUNC_SUPP_SET_VF_MAC_VLAN | \ HINIC_FUNC_SUPP_SET_VF_MAC_VLAN | \
HINIC_FUNC_SUPP_CHANGE_MAC) HINIC_FUNC_SUPP_CHANGE_MAC | \
HINIC_FUNC_SUPP_ENCAP_TSO_CSUM)
#define HINIC_MULTI_BM_MASTER (HINIC_FUNC_MGMT | HINIC_FUNC_PORT | \ #define HINIC_MULTI_BM_MASTER (HINIC_FUNC_MGMT | HINIC_FUNC_PORT | \
HINIC_FUNC_SUPP_DFX_REG | \ HINIC_FUNC_SUPP_DFX_REG | \
HINIC_FUNC_SUPP_RX_MODE | \ HINIC_FUNC_SUPP_RX_MODE | \
......
...@@ -2243,10 +2243,12 @@ static void netdev_feature_init(struct net_device *netdev) ...@@ -2243,10 +2243,12 @@ static void netdev_feature_init(struct net_device *netdev)
netdev->vlan_features = netdev->features; netdev->vlan_features = netdev->features;
if (FUNC_SUPPORT_ENCAP_TSO_CSUM(nic_dev->hwdev)) {
#ifdef HAVE_ENCAPSULATION_TSO #ifdef HAVE_ENCAPSULATION_TSO
netdev->features |= NETIF_F_GSO_UDP_TUNNEL | netdev->features |= NETIF_F_GSO_UDP_TUNNEL |
NETIF_F_GSO_UDP_TUNNEL_CSUM; NETIF_F_GSO_UDP_TUNNEL_CSUM;
#endif /* HAVE_ENCAPSULATION_TSO */ #endif /* HAVE_ENCAPSULATION_TSO */
}
if (FUNC_SUPPORT_HW_VLAN(nic_dev->hwdev)) { if (FUNC_SUPPORT_HW_VLAN(nic_dev->hwdev)) {
#if defined(NETIF_F_HW_VLAN_CTAG_TX) #if defined(NETIF_F_HW_VLAN_CTAG_TX)
...@@ -2300,16 +2302,18 @@ static void netdev_feature_init(struct net_device *netdev) ...@@ -2300,16 +2302,18 @@ static void netdev_feature_init(struct net_device *netdev)
netdev->priv_flags |= IFF_UNICAST_FLT; netdev->priv_flags |= IFF_UNICAST_FLT;
#endif #endif
if (FUNC_SUPPORT_ENCAP_TSO_CSUM(nic_dev->hwdev)) {
#ifdef HAVE_ENCAPSULATION_CSUM #ifdef HAVE_ENCAPSULATION_CSUM
netdev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM netdev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
| NETIF_F_SCTP_CRC | NETIF_F_SG | NETIF_F_SCTP_CRC | NETIF_F_SG;
#ifdef HAVE_ENCAPSULATION_TSO #ifdef HAVE_ENCAPSULATION_TSO
| NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN netdev->hw_enc_features |= NETIF_F_TSO | NETIF_F_TSO6
| NETIF_F_TSO_ECN
| NETIF_F_GSO_UDP_TUNNEL_CSUM | NETIF_F_GSO_UDP_TUNNEL_CSUM
| NETIF_F_GSO_UDP_TUNNEL; | NETIF_F_GSO_UDP_TUNNEL;
#endif /* HAVE_ENCAPSULATION_TSO */ #endif /* HAVE_ENCAPSULATION_TSO */
#endif /* HAVE_ENCAPSULATION_CSUM */ #endif /* HAVE_ENCAPSULATION_CSUM */
}
} }
#define MOD_PARA_VALIDATE_NUM_QPS(nic_dev, num_qps, out_qps) { \ #define MOD_PARA_VALIDATE_NUM_QPS(nic_dev, num_qps, out_qps) { \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册