iavf: add support for UDP Segmentation Offload
Add code to support UDP segmentation offload (USO) for hardware that supports it. Suggested-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Brett Creeley <brett.creeley@intel.com> Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
Родитель
142da08c4d
Коммит
c91a4f9feb
|
@ -3542,6 +3542,8 @@ int iavf_process_config(struct iavf_adapter *adapter)
|
||||||
/* Enable cloud filter if ADQ is supported */
|
/* Enable cloud filter if ADQ is supported */
|
||||||
if (vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ)
|
if (vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ)
|
||||||
hw_features |= NETIF_F_HW_TC;
|
hw_features |= NETIF_F_HW_TC;
|
||||||
|
if (vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_USO)
|
||||||
|
hw_features |= NETIF_F_GSO_UDP_L4;
|
||||||
|
|
||||||
netdev->hw_features |= hw_features;
|
netdev->hw_features |= hw_features;
|
||||||
|
|
||||||
|
|
|
@ -1905,13 +1905,20 @@ static int iavf_tso(struct iavf_tx_buffer *first, u8 *hdr_len,
|
||||||
|
|
||||||
/* determine offset of inner transport header */
|
/* determine offset of inner transport header */
|
||||||
l4_offset = l4.hdr - skb->data;
|
l4_offset = l4.hdr - skb->data;
|
||||||
|
|
||||||
/* remove payload length from inner checksum */
|
/* remove payload length from inner checksum */
|
||||||
paylen = skb->len - l4_offset;
|
paylen = skb->len - l4_offset;
|
||||||
csum_replace_by_diff(&l4.tcp->check, (__force __wsum)htonl(paylen));
|
|
||||||
|
|
||||||
/* compute length of segmentation header */
|
if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) {
|
||||||
*hdr_len = (l4.tcp->doff * 4) + l4_offset;
|
csum_replace_by_diff(&l4.udp->check,
|
||||||
|
(__force __wsum)htonl(paylen));
|
||||||
|
/* compute length of UDP segmentation header */
|
||||||
|
*hdr_len = (u8)sizeof(l4.udp) + l4_offset;
|
||||||
|
} else {
|
||||||
|
csum_replace_by_diff(&l4.tcp->check,
|
||||||
|
(__force __wsum)htonl(paylen));
|
||||||
|
/* compute length of TCP segmentation header */
|
||||||
|
*hdr_len = (u8)((l4.tcp->doff * 4) + l4_offset);
|
||||||
|
}
|
||||||
|
|
||||||
/* pull values out of skb_shinfo */
|
/* pull values out of skb_shinfo */
|
||||||
gso_size = skb_shinfo(skb)->gso_size;
|
gso_size = skb_shinfo(skb)->gso_size;
|
||||||
|
|
|
@ -140,6 +140,7 @@ int iavf_send_vf_config_msg(struct iavf_adapter *adapter)
|
||||||
VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM |
|
VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM |
|
||||||
VIRTCHNL_VF_OFFLOAD_REQ_QUEUES |
|
VIRTCHNL_VF_OFFLOAD_REQ_QUEUES |
|
||||||
VIRTCHNL_VF_OFFLOAD_ADQ |
|
VIRTCHNL_VF_OFFLOAD_ADQ |
|
||||||
|
VIRTCHNL_VF_OFFLOAD_USO |
|
||||||
VIRTCHNL_VF_OFFLOAD_FDIR_PF |
|
VIRTCHNL_VF_OFFLOAD_FDIR_PF |
|
||||||
VIRTCHNL_VF_CAP_ADV_LINK_SPEED;
|
VIRTCHNL_VF_CAP_ADV_LINK_SPEED;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче