Skip to content

Commit

Permalink
Drivers: hv: vmbus: Add a helper function is_sub_channel()
Browse files Browse the repository at this point in the history
The existing method of telling if a channel is sub-channel in
vmbus_process_offer() is cumbersome. This new simple helper function
is preferred in future.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Dexuan Cui authored and Sasha Levin committed Sep 6, 2019
1 parent 63ecc6d commit ed56ef6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion include/linux/hyperv.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ struct vmbus_channel_offer {
} pipe;
} u;
/*
* The sub_channel_index is defined in win8.
* The sub_channel_index is defined in Win8: a value of zero means a
* primary channel and a value of non-zero means a sub-channel.
*
* Before Win8, the field is reserved, meaning it's always zero.
*/
u16 sub_channel_index;
u16 reserved3;
Expand Down Expand Up @@ -934,6 +937,11 @@ static inline bool is_hvsock_channel(const struct vmbus_channel *c)
VMBUS_CHANNEL_TLNPI_PROVIDER_OFFER);
}

static inline bool is_sub_channel(const struct vmbus_channel *c)
{
return c->offermsg.offer.sub_channel_index != 0;
}

static inline void set_channel_affinity_state(struct vmbus_channel *c,
enum hv_numa_policy policy)
{
Expand Down

0 comments on commit ed56ef6

Please sign in to comment.