<!--[if app]><style media="(max-width: 490px)">.list_placeholder_blank {display: none;}</style><![endif]--><!--[if mso]><style>.qyreadmail-list .list_placeholder_blank, >div .list_placeholder_blank {display: none;}</style><![endif]--><div style="font-size: 14.6667px; font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei";" data-mail-from="wemail-pc"><div id="wemail_placeholder_space"><div><h2 style="margin: 1.75rem 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 1.125rem; line-height: 1.25; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC"; background-color: rgb(255, 255, 255);">Problem Statement</h2><p style="margin: 0px 0px 0.75rem; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 15px; line-height: 1.6; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC"; overflow-wrap: break-word; white-space-collapse: break-spaces; background-color: rgb(255, 255, 255);">Hello DPDK community,</p><p style="margin: 0px 0px 0.75rem; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 15px; line-height: 1.6; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC"; overflow-wrap: break-word; white-space-collapse: break-spaces; background-color: rgb(255, 255, 255);">We've been using DPDK's ACL library in a long-running network application and observed a concerning issue regarding memory fragmentation. The <code class="hyc-common-markdown__code__inline" style="margin: 0px; padding: 0px; font-size: 0.875rem; line-height: 1.8; word-break: break-word; font-family: Consolas, monospace, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;">rte_acl_build()</code>function internally uses <code class="hyc-common-markdown__code__inline" style="margin: 0px; padding: 0px; font-size: 0.875rem; line-height: 1.8; word-break: break-word; font-family: Consolas, monospace, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;">rte_zmalloc_socket()</code>for dynamic memory allocation during ACL rule compilation.</p><p style="margin: 0px 0px 0.75rem; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 15px; line-height: 1.6; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC"; overflow-wrap: break-word; white-space-collapse: break-spaces; background-color: rgb(255, 255, 255);">While this design works well for short-lived processes, it creates challenges for long-running applications (days/weeks) where memory fragmentation becomes a critical concern. Each ACL rebuild (due to rule updates, configuration changes, etc.) allocates variable-sized memory blocks for the trie structures and transition tables, which are then freed when the ACL context is destroyed or rebuilt.</p><p style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 15px; line-height: 1.6; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC"; overflow-wrap: break-word; white-space-collapse: break-spaces; background-color: rgb(255, 255, 255);">This pattern leads to:</p><div class="ybc-ol-component ybc-ol-component_1 qymail-list-div" style="margin:0.75rem 0px 0.75rem 1.25rem;padding:0px;font-size:15px;font-family:"Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC";list-style:none;background-color:rgb(255, 255, 255);ww-list:l1" data-editing-info="{"orderedStyleType":[1,10,17],"unorderedStyleType":[1,7,3]}" data-list-style-type="1" data-list-checked="true" data-list-indent="true" qymail-original-tag="ol"><div class="ybc-li-component ybc-li-component_ol qymail-list-div" style="margin: 0px 0px 0.75rem 24px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; font-size: 11.25pt; line-height: 1.6; word-break: break-word; overflow-wrap: break-word; box-sizing: border-box; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", 苹方-简; color: rgb(0, 0, 0); position: relative; text-indent: -24px;" data-list-style-type="1" qymail-original-tag="li"><b class="qymail-list-symbol" contenteditable="false" style="user-select: none; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", 苹方-简; font-size: 11.25pt; top: 0px; left: 0px; padding-right: 9px; display: inline-flex; align-items: center; text-indent: 0px; min-width: 24px; box-sizing: border-box; font-weight: normal;"><span>1.</span><span> </span></b><!--[if mso]><span class="list_placeholder_blank" style="font-family: -apple-system, "system-ui", "PingFang SC", "Microsoft YaHei";"> </span><![endif]--><span class="ybc-li-component_content" style="margin:0px;padding:0px;min-width:0px"><span style="margin-right: 0px; margin-left: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 0.9375rem; line-height: 1.6; overflow-wrap: break-word; white-space-collapse: break-spaces;" qymail-original-tag="p"><span style="margin:0px;padding:0px;font-weight:600">Memory fragmentation</span>​ over time, as the heap accumulates "holes" of varying sizes</span></span></div><div class="ybc-li-component ybc-li-component_ol qymail-list-div" style="margin: 0px 0px 0.75rem 24px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; font-size: 11.25pt; line-height: 1.6; word-break: break-word; overflow-wrap: break-word; box-sizing: border-box; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", 苹方-简; color: rgb(0, 0, 0); position: relative; text-indent: -24px;" data-list-style-type="1" qymail-original-tag="li"><b class="qymail-list-symbol" contenteditable="false" style="user-select: none; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", 苹方-简; font-size: 11.25pt; top: 0px; left: 0px; padding-right: 9px; display: inline-flex; align-items: center; text-indent: 0px; min-width: 24px; box-sizing: border-box; font-weight: normal;"><span>2.</span><span> </span></b><!--[if mso]><span class="list_placeholder_blank" style="font-family: -apple-system, "system-ui", "PingFang SC", "Microsoft YaHei";"> </span><![endif]--><span class="ybc-li-component_content" style="margin:0px;padding:0px;min-width:0px"><span style="margin-right: 0px; margin-left: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 0.9375rem; line-height: 1.6; overflow-wrap: break-word; white-space-collapse: break-spaces;" qymail-original-tag="p"><span style="margin:0px;padding:0px;font-weight:600">Potential allocation failures</span>​ even when total free memory appears sufficient</span></span></div><div class="ybc-li-component ybc-li-component_ol qymail-list-div" style="margin: 0px 0px 0px 24px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; font-size: 11.25pt; line-height: 1.6; word-break: break-word; overflow-wrap: break-word; box-sizing: border-box; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", 苹方-简; color: rgb(0, 0, 0); position: relative; text-indent: -24px;" data-list-style-type="1" qymail-original-tag="li"><b class="qymail-list-symbol" contenteditable="false" style="user-select: none; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", 苹方-简; font-size: 11.25pt; top: 0px; left: 0px; padding-right: 9px; display: inline-flex; align-items: center; text-indent: 0px; min-width: 24px; box-sizing: border-box; font-weight: normal;"><span>3.</span><span> </span></b><!--[if mso]><span class="list_placeholder_blank" style="font-family: -apple-system, "system-ui", "PingFang SC", "Microsoft YaHei";"> </span><![endif]--><span class="ybc-li-component_content" style="margin:0px;padding:0px;min-width:0px"><span style="margin-right: 0px; margin-left: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 0.9375rem; line-height: 1.6; overflow-wrap: break-word; white-space-collapse: break-spaces;" qymail-original-tag="p"><span style="margin:0px;padding:0px;font-weight:600">Difficulty in memory budgeting</span> for deterministic systems</span></span></div></div><h2 style="margin: 1.75rem 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 1.125rem; line-height: 1.25; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC"; background-color: rgb(255, 255, 255);">Current Limitation</h2><p style="margin: 0px 0px 0.75rem; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 15px; line-height: 1.6; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC"; overflow-wrap: break-word; white-space-collapse: break-spaces; background-color: rgb(255, 255, 255);">The current API doesn't allow applications to provide pre-allocated memory for ACL construction, forcing dynamic allocations that contribute to heap fragmentation. This is particularly problematic for applications that prioritize long-term stability and predictable memory usage.</p><h2 style="margin: 1.75rem 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 1.125rem; line-height: 1.25; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC"; background-color: rgb(255, 255, 255);">Proposed Solution</h2><p style="margin: 0px 0px 0.75rem; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-size-adjust: none; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-variant-position: normal; font-stretch: normal; font-size: 15px; line-height: 1.6; font-family: "Segoe UI", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", 微软雅黑, sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC"; overflow-wrap: break-word; white-space-collapse: break-spaces; background-color: rgb(255, 255, 255);">We propose extending the ACL API to support external memory buffers for the build process. This would allow applications to manage memory allocation strategies according to their specific requirements (pool-based, static allocation, etc.).</p></div></div><div><br></div><div class="qqmail_sign" id="wemailsigcontent" signid="501"><span id="default_wemail_sig_line_wrap"><hr class="default_wemail_sig_line" width="100" style="margin: 7px 0px; border-width: 0px 0px 1px; border-top-color: initial; border-right-color: initial; border-left-color: initial; border-image: initial; border-bottom-style: solid; border-bottom-color: rgb(230, 232, 235); height: 0px; line-height: unset; font-size: 0px; padding: 0px; width: 40px !important;" align="left" contenteditable="false"></span><div id="wemailsigcontent_pre"></div><a style="color: rgb(38, 126, 240);text-decoration: none; outline: none;text-decoration:none; outline:none; color:#267EF0" class="cursor-pointer default-sig ignore-dark" contenteditable="false" href="https://work.weixin.qq.com/wework_admin/user/h5/qqmail_user_card/vc879305fe5b6b5af3?from=myprofile" target="_blank">发自我的企业微信</a><br><div><br></div><div><br></div></div></div>