<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Webdings;
        panose-1:5 3 1 2 1 5 9 6 7 3;}
@font-face
        {font-family:gothic;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        color:black;}
span.ng-binding
        {mso-style-name:ng-binding;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:772283941;
        mso-list-type:hybrid;
        mso-list-template-ids:-12050680 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">We run DPDK 19.11.3 with multi processes.<o:p></o:p></p>
<p class="MsoNormal">When using external memory for DPDK (instead of huge pages), we are unable to receive traffic in the secondary processes.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">We have external physical memory regions (excluded from Linux):<o:p></o:p></li></ul>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Courier New"">[ULP-NG]# cat /proc/cmdline<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Courier New"">console=ttyS0,19200 isolcpus=1-127 smp_affinity=1 root=/dev/ram0 rwmode=r net.ifnames=0 biosdevname=0 systemd.show_status=0<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Courier New"">memmap=0x1000000!0x60000000
<b><span style="color:#00B050">memmap=0x90000000!0x800000000 memmap=0x90000000!0x1800000000</span></b><span style="color:#00B050">
</span>quiet cloud-init=disabled</span></i><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">We make all DPDK initializations in the primary process, including mapping the mentioned memory regions via “/dev/mem”.<o:p></o:p></li></ul>
<p class="MsoListParagraph">After these memory mapping, we register the external memory, as described in
<a href="http://doc.dpdk.org/guides/prog_guide/env_abstraction_layer.html#support-for-externally-allocated-memory">
http://doc.dpdk.org/guides/prog_guide/env_abstraction_layer.html#support-for-externally-allocated-memory</a>, and allocate memory pools:<o:p></o:p></p>
<p class="MsoListParagraph"><o:p> </o:p></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">...<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">/* Map physical to virtual */<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">int memFd = open("/dev/mem", O_RDWR);<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">extMemInfo[i].pageSize   = pPagesInfo->maxPageSize;<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">extMemInfo[i].memRegSize = 0x0000000080000000;<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">extMemInfo[i].memRegAddr = mmap(NULL, extMemInfo[i].memRegSize, PROT_READ | PROT_WRITE,<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">                             MAP_SHARED, memFd, memRegPhysAddr[i]);<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New""><o:p> </o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">/* Create heap */<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">sprintf(extMemInfo[i].heapName, "extMemHeapSocket_%u", i);<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">rv = rte_malloc_heap_create(extMemInfo[i].heapName);<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New""><o:p> </o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">/* Save heap socket ID */<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">rv = rte_malloc_heap_get_socket(extMemInfo[i].heapName);<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">extMemInfo[i].socketId = rv;<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New""><o:p> </o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">/* Add memory region to heap */<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">rv = rte_malloc_heap_memory_add(extMemInfo[i].heapName, extMemInfo[i].memRegAddr,<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">                                extMemInfo[i].memRegSize, NULL, 0, extMemInfo[i].pageSize);<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">...<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">/* Allocate memory pool */<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">memPool = rte_mempool_create(poolName, nbufs, DPDK_MBUF_SIZE, poolCacheSize,<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">                             sizeof(struct rte_pktmbuf_pool_private),<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">                             rte_pktmbuf_pool_init, NULL,<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">                             und_pktmbuf_init, NULL, extMemInfo[i].socketId, DPDK_NO_FLAGS);<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><i><span style="font-family:"Courier New"">...<o:p></o:p></span></i></p>
<p class="MsoListParagraph"><o:p> </o:p></p>
<p class="MsoListParagraph">Please note, that during calls to “<i><span style="font-family:"Courier New"">rte_malloc_heap_memory_add</span></i>”, we see the following warnings:<o:p></o:p></p>
<p class="MsoListParagraph"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><b><i><span style="font-family:"Courier New";color:red">EAL: WARNING! Base virtual address hint (0x2101005000 != 0x7ffff4627000) not respected!<o:p></o:p></span></i></b></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Courier New"">EAL:    This may cause issues with mapping memory into secondary processes<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><b><i><span style="font-family:"Courier New";color:red">EAL: WARNING! Base virtual address hint (0x210100b000 != 0x7ffff4619000) not respected!<o:p></o:p></span></i></b></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Courier New"">EAL:    This may cause issues with mapping memory into secondary processes</span></i><o:p></o:p></p>
<p class="MsoListParagraph"><o:p> </o:p></p>
<p class="MsoListParagraph">And after executing “<i><span style="font-family:"Courier New"">rte_mempool_create</span></i>”, physical addresses of the allocated memory zones are bad:<o:p></o:p></p>
<p class="MsoListParagraph"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><i>[Jul 12 12:02:17] [1875] extMemConfig: heapName=extMemHeapSocket_0, socketId=256, memRegAddr=0x7fff58000000, memRegSize=2415919104, pageSize=2097152<o:p></o:p></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i>[Jul 12 12:02:18] [1875] memZone: name=MP_ndPool_0, socket_id=256, vaddr=0x7fffe7e7bec0-0x7fffe7ffffc0,
<b><span style="color:red">paddr=0xffffffffffffffff-0x1840ff</span></b>, len=1589504, hugepage_sz=2MB</i><o:p></o:p></p>
<p class="MsoListParagraph"><o:p> </o:p></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">In the next step, we spawn the secondary processes from the primary one, using fork().<o:p></o:p></li></ul>
<p class="MsoListParagraph">This way, all DPDK data and memory mappings are the same on all processes. For example:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><u>Mapping in primary process:<o:p></o:p></u></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Courier New"">cat /proc/1875/maps<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Courier New"">...<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><b><i><span style="font-family:"Courier New";color:#0070C0">7ffec8000000-7fff58000000 rw-s 1800000000 00:06 5                        /dev/mem<o:p></o:p></span></i></b></p>
<p class="MsoNormal" style="margin-left:.5in"><b><i><span style="font-family:"Courier New";color:#7030A0">7fff58000000-7fffe8000000 rw-s 800000000 00:06 5                         /dev/mem<o:p></o:p></span></i></b></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Courier New"">...<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><u>Mapping in secondary process:<o:p></o:p></u></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Courier New"">cat /proc/2676/maps<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Courier New"">...<o:p></o:p></span></i></p>
<p class="MsoNormal" style="margin-left:.5in"><b><i><span style="font-family:"Courier New";color:#0070C0">7ffec8000000-7fff58000000 rw-s 1800000000 00:06 5                        /dev/mem<o:p></o:p></span></i></b></p>
<p class="MsoNormal" style="margin-left:.5in"><b><i><span style="font-family:"Courier New";color:#7030A0">7fff58000000-7fffe8000000 rw-s 800000000 00:06 5                         /dev/mem<o:p></o:p></span></i></b></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-family:"Courier New"">...<o:p></o:p></span></i></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">Unfortunately, when traffic is received by the secondary processes, we see the following printout on the primary process:<o:p></o:p></li></ul>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-indent:.5in"><b><i><span style="color:red">i40e_dev_alarm_handler(): ICR0: malicious programming detected</span><o:p></o:p></i></b></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">Additionally, we saw no example of using external physical shared memory on secondary processes.<o:p></o:p></li></ul>
<p class="MsoListParagraph">DPDK test applications show usage of anonymous private memory on the primary process only.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">What are we missing?<o:p></o:p></p>
<p class="MsoNormal">Can you please advise?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Asaf<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="656" style="width:492.0pt">
<tbody>
<tr>
<td width="191" style="width:143.05pt;border:none;border-right:solid #B8C8D8 1.0pt;padding:0in 0in 0in 0in">
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:8.5pt;font-family:"Verdana",sans-serif"><img border="0" width="177" height="32" style="width:1.8416in;height:.3333in" id="_x0000_i1030" src="https://www.radware.com/images/signature/sig_logo.jpg" alt="Radware"></span><span style="font-size:8.5pt;font-family:"Verdana",sans-serif"><o:p></o:p></span></p>
</td>
<td width="321" valign="top" style="width:240.9pt;border:none;border-right:solid #B8C8D8 1.0pt;padding:0in 12.0pt 0in 12.0pt">
<p class="MsoNormal" style="line-height:13.5pt"><span class="ng-binding"><span style="font-size:8.5pt;font-family:"Verdana",sans-serif;color:black">Asaf Sinai</span></span><span style="font-size:8.5pt;font-family:"Verdana",sans-serif;color:black"><br>
<span class="ng-binding">ND SW Engineer</span><br>
Email: <a href="mailto:asafsi@radware.com">asafsi@radware.com</a> <o:p></o:p></span></p>
</td>
<td width="144" valign="top" style="width:108.05pt;padding:0in 0in 0in 12.0pt">
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:8.5pt;font-family:"Verdana",sans-serif">T:<span class="ng-binding">+972-72-3917050</span><br>
M:<span class="ng-binding">+972-50-6518541</span><br>
F:<span class="ng-binding">+972-3-6488662</span> <o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0in 0in 0in 0in"></td>
<td style="padding:0in 0in 0in 0in"></td>
<td style="padding:0in 0in 0in 0in"></td>
</tr>
<tr>
<td colspan="3" style="padding:5.25pt 0in 5.25pt 0in">
<div style="border:solid #F1F0F0 4.5pt;padding:0in 0in 0in 0in">
<p class="MsoNormal" align="center" style="text-align:center;line-height:13.5pt;background:#F1F0F0">
<span style="color:black"><a href="https://www.radware.com/Resources/CampaignRedirector.html"><span style="font-size:8.5pt;font-family:"Verdana",sans-serif;color:blue;text-decoration:none"><img border="0" width="640" height="76" style="width:6.6666in;height:.7916in" id="_x0000_i1029" src="https://d3vlk452dxjc85.cloudfront.net/cdn/images/signaturefooter.jpg" alt="Check out the latest and greatest from Radware"></span></a></span><span style="font-size:8.5pt;font-family:"Verdana",sans-serif"><o:p></o:p></span></p>
</div>
</td>
</tr>
<tr>
<td colspan="3" style="padding:0in 0in 0in 0in">
<div style="border:none;border-top:solid #FEB317 3.0pt;padding:0in 0in 0in 0in;margin-top:1.5pt;margin-bottom:1.5pt">
<p class="MsoNormal" style="line-height:0%"><span style="font-size:1.0pt;font-family:"Verdana",sans-serif"> <o:p></o:p></span></p>
</div>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="656" style="width:492.0pt">
<tbody>
<tr>
<td valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal"><strong><span style="font-family:"Calibri",sans-serif"><a href="https://www.radware.com"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">www.radware.com</span></a></span></strong><o:p></o:p></p>
</td>
<td style="padding:0in 0in 0in 0in">
<p class="MsoNormal"> <o:p></o:p></p>
</td>
<td valign="bottom" style="padding:0in 0in .75pt 0in">
<p class="MsoNormal" align="right" style="text-align:right"><a href="https://blog.radware.com/"><span style="color:blue;text-decoration:none"><img border="0" width="53" height="18" style="width:.55in;height:.1916in" id="_x0000_i1028" src="https://d3vlk452dxjc85.cloudfront.net/cdn/images/Community/radware_blog_img2.png" alt="Blog"></span></a> 
<a href="https://www.linkedin.com/companies/165642"><span style="color:blue;text-decoration:none"><img border="0" width="19" height="18" style="width:.2in;height:.1916in" id="_x0000_i1027" src="https://www.radware.com/images/signature/linkedin.jpg"></span></a><a href="file://twitter.com/radware"><span style="color:blue;text-decoration:none"><img border="0" width="19" height="18" style="width:.2in;height:.1916in" id="_x0000_i1026" src="https://www.radware.com/images/signature/twitter.jpg"></span></a> 
<a href="https://www.youtube.com/user/radwareinc"><span style="color:blue;text-decoration:none"><img border="0" width="43" height="18" style="width:.45in;height:.1916in" id="_x0000_i1025" src="https://www.radware.com/images/signature/youtube.jpg" alt="youtube"></span></a><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="3" style="padding:15.0pt 0in 0in 0in">
<p class="MsoNormal" style="line-height:13.5pt"><span style="font-size:7.0pt;font-family:"Verdana",sans-serif">Confidentiality note: This message, and any attachments to it, contains privileged/confidential information of RADWARE Ltd./RADWARE Inc. and may not
 be disclosed, used, copied, or transmitted in any form or by any means without prior written permission from RADWARE. If you are not the intended recipient, delete the message and any attachments from your system without reading or copying it, and kindly notify
 the sender by e-mail. Thank you. <o:p></o:p></span></p>
</td>
</tr>
<tr>
<td colspan="3" style="padding:11.25pt 0in 0in 0in">
<p class="MsoNormal" style="line-height:13.5pt"><b><span style="font-size:10.0pt;font-family:Webdings;color:green">P</span></b><b><span style="font-size:8.5pt;font-family:"Verdana",sans-serif">
</span></b><b><span style="font-size:10.0pt;font-family:gothic;color:green">Please consider your environmental responsibility before printing this e-mail</span></b><b><span style="font-size:8.5pt;font-family:"Verdana",sans-serif">
</span></b><span style="font-size:8.5pt;font-family:"Verdana",sans-serif"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>