Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* It looks like offset 0 of buf is reserved to hold the softc pointer. | * It looks like offset 0 of buf is reserved to hold the softc pointer. | ||||
* The sc pointer evidently not needed, and is not presently populated. | * The sc pointer evidently not needed, and is not presently populated. | ||||
* The packet offset is where the netvsc_packet starts in the buffer. | * The packet offset is where the netvsc_packet starts in the buffer. | ||||
*/ | */ | ||||
#define HV_NV_SC_PTR_OFFSET_IN_BUF 0 | #define HV_NV_SC_PTR_OFFSET_IN_BUF 0 | ||||
#define HV_NV_PACKET_OFFSET_IN_BUF 16 | #define HV_NV_PACKET_OFFSET_IN_BUF 16 | ||||
#define CSUM_FOR_OUTBOUND \ | |||||
(CSUM_IP|CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP|CSUM_IP_TSO|CSUM_IP_ISCSI| \ | |||||
CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP|CSUM_IP6_TSO|CSUM_IP6_ISCSI) | |||||
/* | /* | ||||
* Data types | * Data types | ||||
*/ | */ | ||||
struct hv_netvsc_driver_context { | struct hv_netvsc_driver_context { | ||||
uint32_t drv_inited; | uint32_t drv_inited; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 426 Lines • ▼ Show 20 Lines | if (m_head->m_flags & M_VLANTAG) { | ||||
/* VLAN info immediately follows rppi struct */ | /* VLAN info immediately follows rppi struct */ | ||||
rppi_vlan_info = (ndis_8021q_info *)((char*)rppi + | rppi_vlan_info = (ndis_8021q_info *)((char*)rppi + | ||||
rppi->per_packet_info_offset); | rppi->per_packet_info_offset); | ||||
/* FreeBSD does not support CFI or priority */ | /* FreeBSD does not support CFI or priority */ | ||||
rppi_vlan_info->u1.s1.vlan_id = | rppi_vlan_info->u1.s1.vlan_id = | ||||
packet->vlan_tci & 0xfff; | packet->vlan_tci & 0xfff; | ||||
} | } | ||||
if (0 == m_head->m_pkthdr.csum_flags) { | /* Ignore flags for checksum already calculated or valid */ | ||||
whu: Can you put a little more detailed comment here, say to only check for out bound flags and… | |||||
if (0 == (m_head->m_pkthdr.csum_flags & CSUM_FOR_OUTBOUND)) { | |||||
goto pre_send; | goto pre_send; | ||||
} | } | ||||
eh = mtod(m_head, struct ether_vlan_header*); | eh = mtod(m_head, struct ether_vlan_header*); | ||||
if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { | if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { | ||||
ether_len = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; | ether_len = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; | ||||
} else { | } else { | ||||
ether_len = ETHER_HDR_LEN; | ether_len = ETHER_HDR_LEN; | ||||
▲ Show 20 Lines • Show All 727 Lines • Show Last 20 Lines |
Can you put a little more detailed comment here, say to only check for out bound flags and ignore the inbound ones?