summaryrefslogtreecommitdiff
path: root/include/linux/hyperv.h
diff options
context:
space:
mode:
authorWei Liu <wei.liu@kernel.org>2021-02-15 10:44:58 +0000
committerWei Liu <wei.liu@kernel.org>2021-02-15 10:49:11 +0000
commit3019270282a175defc02c8331786c73e082cd2a8 (patch)
tree13a9b1c1be5030db044227dc12ff0b074443326d /include/linux/hyperv.h
parentfb5ef35165a37ca63ef0227657eabd06f0a39cf9 (diff)
Revert "Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer"
This reverts commit a8c3209998afb5c4941b49e35b513cea9050cb4a. It is reported that the said commit caused regression in netvsc. Reported-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com> Signed-off-by: Wei Liu <wei.liu@kernel.org>
Diffstat (limited to 'include/linux/hyperv.h')
-rw-r--r--include/linux/hyperv.h48
1 files changed, 8 insertions, 40 deletions
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 9dd22af1b7f6..f1d74dcf0353 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -181,10 +181,6 @@ struct hv_ring_buffer_info {
* being freed while the ring buffer is being accessed.
*/
struct mutex ring_buffer_mutex;
-
- /* Buffer that holds a copy of an incoming host packet */
- void *pkt_buffer;
- u32 pkt_buffer_size;
};
@@ -792,8 +788,6 @@ struct vmbus_device {
bool allowed_in_isolated;
};
-#define VMBUS_DEFAULT_MAX_PKT_SIZE 4096
-
struct vmbus_channel {
struct list_head listentry;
@@ -1016,9 +1010,6 @@ struct vmbus_channel {
/* request/transaction ids for VMBus */
struct vmbus_requestor requestor;
u32 rqstor_size;
-
- /* The max size of a packet on this channel */
- u32 max_pkt_size;
};
u64 vmbus_next_request_id(struct vmbus_requestor *rqstor, u64 rqst_addr);
@@ -1661,43 +1652,14 @@ static inline u32 hv_pkt_datalen(const struct vmpacket_descriptor *desc)
struct vmpacket_descriptor *
-hv_pkt_iter_first_raw(struct vmbus_channel *channel);
-
-struct vmpacket_descriptor *
hv_pkt_iter_first(struct vmbus_channel *channel);
struct vmpacket_descriptor *
__hv_pkt_iter_next(struct vmbus_channel *channel,
- const struct vmpacket_descriptor *pkt,
- bool copy);
+ const struct vmpacket_descriptor *pkt);
void hv_pkt_iter_close(struct vmbus_channel *channel);
-static inline struct vmpacket_descriptor *
-hv_pkt_iter_next_pkt(struct vmbus_channel *channel,
- const struct vmpacket_descriptor *pkt,
- bool copy)
-{
- struct vmpacket_descriptor *nxt;
-
- nxt = __hv_pkt_iter_next(channel, pkt, copy);
- if (!nxt)
- hv_pkt_iter_close(channel);
-
- return nxt;
-}
-
-/*
- * Get next packet descriptor without copying it out of the ring buffer
- * If at end of list, return NULL and update host.
- */
-static inline struct vmpacket_descriptor *
-hv_pkt_iter_next_raw(struct vmbus_channel *channel,
- const struct vmpacket_descriptor *pkt)
-{
- return hv_pkt_iter_next_pkt(channel, pkt, false);
-}
-
/*
* Get next packet descriptor from iterator
* If at end of list, return NULL and update host.
@@ -1706,7 +1668,13 @@ static inline struct vmpacket_descriptor *
hv_pkt_iter_next(struct vmbus_channel *channel,
const struct vmpacket_descriptor *pkt)
{
- return hv_pkt_iter_next_pkt(channel, pkt, true);
+ struct vmpacket_descriptor *nxt;
+
+ nxt = __hv_pkt_iter_next(channel, pkt);
+ if (!nxt)
+ hv_pkt_iter_close(channel);
+
+ return nxt;
}
#define foreach_vmbus_pkt(pkt, channel) \