microsoft/msquic

mismatch value for datapath_epoll CXPLAT_DATAPATH_FEATURE_SEND_SEGMENTATION

開放

#5,215 建立於 2025年7月2日

 (3 則留言) (0 個反應) (0 位負責人)C (686 個分叉)github user discovery
Bug: PlatformTriagedexternalhelp wanted

倉庫指標

星標
 (4,764 顆星)
PR 合併指標
 (平均合併 6天) (30 天內合併 40 個 PR)

描述

Describe the bug

The code snippet shows two different initialization approaches for SendDataSize and SendIoVecCount based on whether send segmentation is supported: datapath_epoll.c 311-320

if (Datapath->Features & CXPLAT_DATAPATH_FEATURE_SEND_SEGMENTATION) {
        Datapath->SendDataSize = sizeof(CXPLAT_SEND_DATA);
        Datapath->SendIoVecCount = 1;
    } else {
        const uint32_t SendDataSize =
            sizeof(CXPLAT_SEND_DATA) + (CXPLAT_MAX_IO_BATCH_SIZE - 1) * sizeof(struct iovec);
        Datapath->SendDataSize = SendDataSize;
        Datapath->SendIoVecCount = CXPLAT_MAX_IO_BATCH_SIZE;
    }

These parameters are initialized by DataPathInitialize. However, when CxPlatSendDataSend encounters an EIO error, the code disables the segmentation feature but doesn't reinitialize SendDataSize and SendIoVecCount:

if (Status == EIO &&
                SocketContext->Binding->Datapath->Features & CXPLAT_DATAPATH_FEATURE_SEND_SEGMENTATION) {
                //
                // EIO generally indicates the GSO isn't supported by the NIC,
                // so disable segmentation on the datapath globally.
                //
                QuicTraceEvent(
                    LibraryError,
                    "[ lib] ERROR, %s.",
                    "Disabling segmentation support globally");
                SocketContext->Binding->Datapath->Features &=
                    ~CXPLAT_DATAPATH_FEATURE_SEND_SEGMENTATION;
            }

Affected OS

  • Windows
  • Linux
  • macOS
  • Other (specify below)

Additional OS information

No response

MsQuic version

main

Steps taken to reproduce bug

find by code reading.

Expected behavior

should have correct value

Actual outcome

find by code reading

Additional details

No response

貢獻者指南