Skip to content

Commit

Permalink
Merge branch 'netvsc-minor-fixes-and-optimization'
Browse files Browse the repository at this point in the history
Stephen Hemminger says:

====================
netvsc: minor fixes and optimization

This is a subset of earlier submission with a few more fixes
found during testing. The are two small optimizations, one is to
better manage the receive completion ring, and the other is removing
one unneeded level of indirection.

Will submit the improved VF support and buffer sizing in a later
patch so they get more review.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed Jul 29, 2017
2 parents a847135 + f4e4036 commit fe21b26
Show file tree
Hide file tree
Showing 4 changed files with 208 additions and 248 deletions.
19 changes: 8 additions & 11 deletions drivers/net/hyperv/hyperv_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,12 @@ struct net_device_context;

struct netvsc_device *netvsc_device_add(struct hv_device *device,
const struct netvsc_device_info *info);
int netvsc_alloc_recv_comp_ring(struct netvsc_device *net_device, u32 q_idx);
void netvsc_device_remove(struct hv_device *device);
int netvsc_send(struct net_device_context *ndc,
struct hv_netvsc_packet *packet,
struct rndis_message *rndis_msg,
struct hv_page_buffer **page_buffer,
struct hv_page_buffer *page_buffer,
struct sk_buff *skb);
void netvsc_linkstatus_callback(struct hv_device *device_obj,
struct rndis_message *resp);
Expand All @@ -217,7 +218,8 @@ int rndis_filter_receive(struct net_device *ndev,
struct vmbus_channel *channel,
void *data, u32 buflen);

int rndis_filter_set_device_mac(struct net_device *ndev, char *mac);
int rndis_filter_set_device_mac(struct netvsc_device *ndev,
const char *mac);

void netvsc_switch_datapath(struct net_device *nv_dev, bool vf);

Expand Down Expand Up @@ -656,13 +658,10 @@ struct recv_comp_data {
u32 status;
};

/* Netvsc Receive Slots Max */
#define NETVSC_RECVSLOT_MAX (NETVSC_RECEIVE_BUFFER_SIZE / ETH_DATA_LEN + 1)

struct multi_recv_comp {
void *buf; /* queued receive completions */
u32 first; /* first data entry */
u32 next; /* next entry for writing */
struct recv_comp_data *slots;
u32 first; /* first data entry */
u32 next; /* next entry for writing */
};

struct netvsc_stats {
Expand Down Expand Up @@ -749,7 +748,7 @@ struct netvsc_device {
u32 recv_buf_size;
u32 recv_buf_gpadl_handle;
u32 recv_section_cnt;
struct nvsp_1_receive_buffer_section *recv_section;
u32 recv_completion_cnt;

/* Send buffer allocated by us */
void *send_buf;
Expand Down Expand Up @@ -777,8 +776,6 @@ struct netvsc_device {
u32 max_pkt; /* max number of pkt in one send, e.g. 8 */
u32 pkt_align; /* alignment bytes, e.g. 8 */

atomic_t num_outstanding_recvs;

atomic_t open_cnt;

struct netvsc_channel chan_table[VRSS_CHANNEL_MAX];
Expand Down
Loading

0 comments on commit fe21b26

Please sign in to comment.