]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
hv_netvsc: Remove rmsg_pgcnt
authorMichael Kelley <mhklinux@outlook.com>
Tue, 13 May 2025 00:06:03 +0000 (17:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 May 2025 12:12:21 +0000 (14:12 +0200)
commit 5bbc644bbf4e97a05bc0cb052189004588ff8a09 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/hyperv/hyperv_net.h
drivers/net/hyperv/netvsc.c
drivers/net/hyperv/netvsc_drv.c

index 6151e56dbaa054b0fd3a0029096e46c82c7cfe55..4c12067b07f05ee678bc4c9eff6c53cda4ac2bd9 100644 (file)
@@ -158,7 +158,6 @@ struct hv_netvsc_packet {
        u8 cp_partial; /* partial copy into send buffer */
 
        u8 rmsg_size; /* RNDIS header and PPI size */
-       u8 rmsg_pgcnt; /* page count of RNDIS header and PPI */
        u8 page_buf_cnt;
 
        u16 q_idx;
index 5936e9fb675e3132aaf381306584efd21d4484b1..61584b40cb0386a06a9a48e924a323e69789ccfe 100644 (file)
@@ -945,8 +945,7 @@ static void netvsc_copy_to_send_buf(struct netvsc_device *net_device,
                     + pend_size;
        int i;
        u32 padding = 0;
-       u32 page_count = packet->cp_partial ? packet->rmsg_pgcnt :
-               packet->page_buf_cnt;
+       u32 page_count = packet->cp_partial ? 1 : packet->page_buf_cnt;
        u32 remain;
 
        /* Add padding */
@@ -1129,7 +1128,7 @@ static inline int netvsc_send_pkt(
                u32 desc_size;
 
                if (packet->cp_partial)
-                       pb += packet->rmsg_pgcnt;
+                       pb++;
 
                ret = netvsc_dma_map(ndev_ctx->device_ctx, packet, pb);
                if (ret) {
@@ -1291,7 +1290,7 @@ int netvsc_send(struct net_device *ndev,
                packet->send_buf_index = section_index;
 
                if (packet->cp_partial) {
-                       packet->page_buf_cnt -= packet->rmsg_pgcnt;
+                       packet->page_buf_cnt--;
                        packet->total_data_buflen = msd_len + packet->rmsg_size;
                } else {
                        packet->page_buf_cnt = 0;
index 3e74fac10d0c5193dad3326e6f3f109446139181..ce6ac26131b347c4735239720736240fe9440376 100644 (file)
@@ -342,7 +342,6 @@ static u32 init_page_array(void *hdr, u32 len, struct sk_buff *skb,
        pb[0].len = len;
        pb[0].pfn = virt_to_hvpfn(hdr);
        packet->rmsg_size = len;
-       packet->rmsg_pgcnt = 1;
 
        pb[1].offset = offset_in_hvpage(skb->data);
        pb[1].len = skb_headlen(skb);