Skip to content

Commit 5bbc644

Browse files
mhklinuxkuba-moo
authored andcommitted
hv_netvsc: Remove rmsg_pgcnt
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: <stable@vger.kernel.org> # 6.1.x Signed-off-by: Michael Kelley <mhklinux@outlook.com> Link: https://patch.msgid.link/20250513000604.1396-5-mhklinux@outlook.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 41a6328 commit 5bbc644

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
@@ -953,8 +953,7 @@ static void netvsc_copy_to_send_buf(struct netvsc_device *net_device,
953953
+ pend_size;
954954
int i;
955955
u32 padding = 0;
956-
u32 page_count = packet->cp_partial ? packet->rmsg_pgcnt :
957-
packet->page_buf_cnt;
956+
u32 page_count = packet->cp_partial ? 1 : packet->page_buf_cnt;
958957
u32 remain;
959958

960959
/* Add padding */
@@ -1137,7 +1136,7 @@ static inline int netvsc_send_pkt(
11371136
u32 desc_size;
11381137

11391138
if (packet->cp_partial)
1140-
pb += packet->rmsg_pgcnt;
1139+
pb++;
11411140

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

13011300
if (packet->cp_partial) {
1302-
packet->page_buf_cnt -= packet->rmsg_pgcnt;
1301+
packet->page_buf_cnt--;
13031302
packet->total_data_buflen = msd_len + packet->rmsg_size;
13041303
} else {
13051304
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
@@ -343,7 +343,6 @@ static u32 init_page_array(void *hdr, u32 len, struct sk_buff *skb,
343343
pb[0].len = len;
344344
pb[0].pfn = virt_to_hvpfn(hdr);
345345
packet->rmsg_size = len;
346-
packet->rmsg_pgcnt = 1;
347346

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

0 commit comments

Comments
 (0)