Skip to content

Commit 2c0f97f

Browse files
shreeya-patel98PlaidCat
authored andcommitted
hv_netvsc: Remove rmsg_pgcnt
jira LE-3555 commit-author Michael Kelley <[email protected]> commit 5bbc644 init_page_array() now always creates a single page buffer array entry for the rndis message, even if the rndis message crosses a page boundary. As such, the number of page buffer array entries used for the rndis message must no longer be tracked -- it is always just 1. Remove the rmsg_pgcnt field and use "1" where the value is needed. Cc: <[email protected]> # 6.1.x Signed-off-by: Michael Kelley <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit 5bbc644) Signed-off-by: Shreeya Patel <[email protected]> Signed-off-by: Jonathan Maple <[email protected]>
1 parent ab6358b commit 2c0f97f

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

drivers/net/hyperv/hyperv_net.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ struct hv_netvsc_packet {
158158
u8 cp_partial; /* partial copy into send buffer */
159159

160160
u8 rmsg_size; /* RNDIS header and PPI size */
161-
u8 rmsg_pgcnt; /* page count of RNDIS header and PPI */
162161
u8 page_buf_cnt;
163162

164163
u16 q_idx;

drivers/net/hyperv/netvsc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -952,8 +952,7 @@ static void netvsc_copy_to_send_buf(struct netvsc_device *net_device,
952952
+ pend_size;
953953
int i;
954954
u32 padding = 0;
955-
u32 page_count = packet->cp_partial ? packet->rmsg_pgcnt :
956-
packet->page_buf_cnt;
955+
u32 page_count = packet->cp_partial ? 1 : packet->page_buf_cnt;
957956
u32 remain;
958957

959958
/* Add padding */
@@ -1136,7 +1135,7 @@ static inline int netvsc_send_pkt(
11361135
u32 desc_size;
11371136

11381137
if (packet->cp_partial)
1139-
pb += packet->rmsg_pgcnt;
1138+
pb++;
11401139

11411140
ret = netvsc_dma_map(ndev_ctx->device_ctx, packet, pb);
11421141
if (ret) {
@@ -1298,7 +1297,7 @@ int netvsc_send(struct net_device *ndev,
12981297
packet->send_buf_index = section_index;
12991298

13001299
if (packet->cp_partial) {
1301-
packet->page_buf_cnt -= packet->rmsg_pgcnt;
1300+
packet->page_buf_cnt--;
13021301
packet->total_data_buflen = msd_len + packet->rmsg_size;
13031302
} else {
13041303
packet->page_buf_cnt = 0;

drivers/net/hyperv/netvsc_drv.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ static u32 init_page_array(void *hdr, u32 len, struct sk_buff *skb,
342342
pb[0].len = len;
343343
pb[0].pfn = virt_to_hvpfn(hdr);
344344
packet->rmsg_size = len;
345-
packet->rmsg_pgcnt = 1;
346345

347346
pb[1].offset = offset_in_hvpage(skb->data);
348347
pb[1].len = skb_headlen(skb);

0 commit comments

Comments
 (0)