Skip to content

Commit

Permalink
Improve SAL for RSS APIs (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
nigriMSFT authored Dec 2, 2023
1 parent 6640806 commit f3194d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions published/external/xdpapi_experimental.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ typedef
HRESULT
XDP_RSS_GET_CAPABILITIES_FN(
_In_ HANDLE InterfaceHandle,
_Out_opt_ XDP_RSS_CAPABILITIES *RssCapabilities,
_Out_writes_bytes_opt_(*RssCapabilitiesSize) XDP_RSS_CAPABILITIES *RssCapabilities,
_Inout_ UINT32 *RssCapabilitiesSize
);

Expand Down Expand Up @@ -213,7 +213,7 @@ typedef
HRESULT
XDP_RSS_GET_FN(
_In_ HANDLE InterfaceHandle,
_Out_opt_ XDP_RSS_CONFIGURATION *RssConfiguration,
_Out_writes_bytes_opt_(*RssConfigurationSize) XDP_RSS_CONFIGURATION *RssConfiguration,
_Inout_ UINT32 *RssConfigurationSize
);

Expand Down
4 changes: 2 additions & 2 deletions src/xdpapi/xdpapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ XdpInterfaceOpen(
HRESULT
XdpRssGetCapabilities(
_In_ HANDLE InterfaceHandle,
_Out_opt_ XDP_RSS_CAPABILITIES *RssCapabilities,
_Out_writes_bytes_opt_(*RssCapabilitiesSize) XDP_RSS_CAPABILITIES *RssCapabilities,
_Inout_ UINT32 *RssCapabilitiesSize
)
{
Expand Down Expand Up @@ -210,7 +210,7 @@ XdpRssSet(
HRESULT
XdpRssGet(
_In_ HANDLE InterfaceHandle,
_Out_opt_ XDP_RSS_CONFIGURATION *RssConfiguration,
_Out_writes_bytes_opt_(*RssConfigurationSize) XDP_RSS_CONFIGURATION *RssConfiguration,
_Inout_ UINT32 *RssConfigurationSize
)
{
Expand Down
3 changes: 1 addition & 2 deletions test/rssconfig/rssconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ ProcessCommandGet(

RssConfigSize = 0;
Result = XdpRssGet(InterfaceHandle, RssConfig, &RssConfigSize);
if (SUCCEEDED(Result) || RssConfigSize < sizeof(*RssConfig)) {
if (SUCCEEDED(Result)) {
printf(
"Error: Failed to get RSS configuration size on IfIndex=%u Result=%d RssConfigSize=%d\n",
IfIndex, Result, RssConfigSize);
Expand All @@ -215,7 +215,6 @@ ProcessCommandGet(
goto Exit;
}

_Analysis_assume_(RssConfigSize >= sizeof(*RssConfig));
Result = XdpRssGet(InterfaceHandle, RssConfig, &RssConfigSize);
if (FAILED(Result)) {
printf("Error: Failed to get RSS configuration on IfIndex=%u Result=%d\n", IfIndex, Result);
Expand Down

0 comments on commit f3194d3

Please sign in to comment.