svn commit: r304253 - head/sys/dev/hyperv/netvsc
Sepherosa Ziehau
sephe at FreeBSD.org
Wed Aug 17 05:25:48 UTC 2016
Author: sephe
Date: Wed Aug 17 05:25:47 2016
New Revision: 304253
URL: https://svnweb.freebsd.org/changeset/base/304253
Log:
hyperv/hn: Simplify RNDIS RX packets acknowledgement.
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7515
Modified:
head/sys/dev/hyperv/netvsc/hv_net_vsc.c
head/sys/dev/hyperv/netvsc/if_hnreg.h
Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:14:26 2016 (r304252)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:25:47 2016 (r304253)
@@ -902,20 +902,17 @@ static void
hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid,
uint32_t status)
{
- nvsp_msg rx_comp_msg;
+ struct hn_nvs_rndis_ack ack;
int retries = 0;
int ret = 0;
- rx_comp_msg.hdr.msg_type = nvsp_msg_1_type_send_rndis_pkt_complete;
-
- /* Pass in the status */
- rx_comp_msg.msgs.vers_1_msgs.send_rndis_pkt_complete.status =
- status;
+ ack.nvs_type = HN_NVS_TYPE_RNDIS_ACK;
+ ack.nvs_status = status;
retry_send_cmplt:
/* Send the completion */
- ret = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_COMP, 0,
- &rx_comp_msg, sizeof(nvsp_msg), tid);
+ ret = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_COMP,
+ VMBUS_CHANPKT_FLAG_NONE, &ack, sizeof(ack), tid);
if (ret == 0) {
/* success */
/* no-op */
Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h
==============================================================================
--- head/sys/dev/hyperv/netvsc/if_hnreg.h Wed Aug 17 05:14:26 2016 (r304252)
+++ head/sys/dev/hyperv/netvsc/if_hnreg.h Wed Aug 17 05:25:47 2016 (r304253)
@@ -44,6 +44,7 @@
* NVS message transacion status codes.
*/
#define HN_NVS_STATUS_OK 1
+#define HN_NVS_STATUS_FAILED 2
/*
* NVS request/response message types.
@@ -58,6 +59,7 @@
#define HN_NVS_TYPE_CHIM_CONNRESP 105
#define HN_NVS_TYPE_CHIM_DISCONN 106
#define HN_NVS_TYPE_RNDIS 107
+#define HN_NVS_TYPE_RNDIS_ACK 108
#define HN_NVS_TYPE_NDIS_CONF 125
#define HN_NVS_TYPE_VFASSOC_NOTE 128 /* notification */
#define HN_NVS_TYPE_SET_DATAPATH 129
@@ -199,4 +201,11 @@ struct hn_nvs_rndis {
} __packed;
CTASSERT(sizeof(struct hn_nvs_rndis) >= HN_NVS_REQSIZE_MIN);
+struct hn_nvs_rndis_ack {
+ uint32_t nvs_type; /* HN_NVS_TYPE_RNDIS_ACK */
+ uint32_t nvs_status; /* HN_NVS_STATUS_ */
+ uint8_t nvs_rsvd[24];
+} __packed;
+CTASSERT(sizeof(struct hn_nvs_rndis_ack) >= HN_NVS_REQSIZE_MIN);
+
#endif /* !_IF_HNREG_H_ */
More information about the svn-src-head
mailing list