hyperv-next for 5.14
-----BEGIN PGP SIGNATURE----- iQFHBAABCAAxFiEEIbPD0id6easf0xsudhRwX5BBoF4FAmDa/58THHdlaS5saXVA a2VybmVsLm9yZwAKCRB2FHBfkEGgXufBB/sGVIp1OhrtRFXeLJGJtbPPJzbh1w+K hlDxthpN8uW7W7jyQRShiNUVwGX1QUiKBUH5g9oVKYBm0/srup4TivT2PiXPp4mC 7rPM9jcOD0ei9W2Z1/fjQvyorz37pQzq9GMF37FGqPM2mVuCl16QhdF5EqYjipCU k34MyvjUPudmYot3gdiURyxrUljzw3KLfVXeg1Tpk0mXLZvm6OnyRn9ywgNJb+Pz wn2+Om3hZCtccF2CUUS1LbMPFF97xy/CdAObyDuJyyXfyY7JFZ/guWBkQpi0tejQ /+yJFYYZSo1lXV8xxB0t8LR9Vf6OxZNexn+0El4IUO4TZuAJcr4Q6fYp =yOAz -----END PGP SIGNATURE----- Merge tag 'hyperv-next-signed-20210629' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv updates from Wei Liu: "Just a few minor enhancement patches and bug fixes" * tag 'hyperv-next-signed-20210629' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: PCI: hv: Add check for hyperv_initialized in init_hv_pci_drv() Drivers: hv: Move Hyper-V extended capability check to arch neutral code drivers: hv: Fix missing error code in vmbus_connect() x86/hyperv: fix logical processor creation hv_utils: Fix passing zero to 'PTR_ERR' warning scsi: storvsc: Use blk_mq_unique_tag() to generate requestIDs Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer hv_balloon: Remove redundant assignment to region_start
This commit is contained in:
commit
b694011a4a
20 changed files with 317 additions and 127 deletions
|
|
@ -181,6 +181,10 @@ 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;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -790,7 +794,11 @@ struct vmbus_requestor {
|
|||
|
||||
#define VMBUS_NO_RQSTOR U64_MAX
|
||||
#define VMBUS_RQST_ERROR (U64_MAX - 1)
|
||||
/* NetVSC-specific */
|
||||
#define VMBUS_RQST_ID_NO_RESPONSE (U64_MAX - 2)
|
||||
/* StorVSC-specific */
|
||||
#define VMBUS_RQST_INIT (U64_MAX - 2)
|
||||
#define VMBUS_RQST_RESET (U64_MAX - 3)
|
||||
|
||||
struct vmbus_device {
|
||||
u16 dev_type;
|
||||
|
|
@ -799,6 +807,8 @@ struct vmbus_device {
|
|||
bool allowed_in_isolated;
|
||||
};
|
||||
|
||||
#define VMBUS_DEFAULT_MAX_PKT_SIZE 4096
|
||||
|
||||
struct vmbus_channel {
|
||||
struct list_head listentry;
|
||||
|
||||
|
|
@ -1018,13 +1028,21 @@ struct vmbus_channel {
|
|||
u32 fuzz_testing_interrupt_delay;
|
||||
u32 fuzz_testing_message_delay;
|
||||
|
||||
/* callback to generate a request ID from a request address */
|
||||
u64 (*next_request_id_callback)(struct vmbus_channel *channel, u64 rqst_addr);
|
||||
/* callback to retrieve a request address from a request ID */
|
||||
u64 (*request_addr_callback)(struct vmbus_channel *channel, u64 rqst_id);
|
||||
|
||||
/* 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);
|
||||
u64 vmbus_request_addr(struct vmbus_requestor *rqstor, u64 trans_id);
|
||||
u64 vmbus_next_request_id(struct vmbus_channel *channel, u64 rqst_addr);
|
||||
u64 vmbus_request_addr(struct vmbus_channel *channel, u64 trans_id);
|
||||
|
||||
static inline bool is_hvsock_channel(const struct vmbus_channel *c)
|
||||
{
|
||||
|
|
@ -1662,15 +1680,44 @@ 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);
|
||||
const struct vmpacket_descriptor *pkt,
|
||||
bool copy);
|
||||
|
||||
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.
|
||||
|
|
@ -1679,13 +1726,7 @@ static inline struct vmpacket_descriptor *
|
|||
hv_pkt_iter_next(struct vmbus_channel *channel,
|
||||
const struct vmpacket_descriptor *pkt)
|
||||
{
|
||||
struct vmpacket_descriptor *nxt;
|
||||
|
||||
nxt = __hv_pkt_iter_next(channel, pkt);
|
||||
if (!nxt)
|
||||
hv_pkt_iter_close(channel);
|
||||
|
||||
return nxt;
|
||||
return hv_pkt_iter_next_pkt(channel, pkt, true);
|
||||
}
|
||||
|
||||
#define foreach_vmbus_pkt(pkt, channel) \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue