<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:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></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">Dear dpdk dev,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m using dpdk 21.11 LTS, when compile my program with CPP flag “-std=c++20”, the compiler report below errors. After checking file rte_spinlock.h, I think the error report by compiler is valid, there should be a potential issue when using
functions rte_spinlock_recursive_lock, rte_spinlock_recursive_unlock and rte_spinlock_recursive_trylock in multi-thread, we could either remove “volatile” definition to ask users to handle the multi-thread issue, or using atomic operatings instead of self-increment
and self-decrement.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="background:silver;mso-highlight:silver">/home/dpdk/lib/eal/include/generic/rte_spinlock.h:221:12: error: increment of object of volatile-qualified type 'volatile int' is deprecated [-Werror,-Wdeprecated-volatile]<o:p></o:p></span></p>
<p class="MsoNormal"><span style="background:silver;mso-highlight:silver"> slr->count++;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="background:silver;mso-highlight:silver"> ^<o:p></o:p></span></p>
<p class="MsoNormal"><span style="background:silver;mso-highlight:silver">/home/dpdk/lib/eal/include/generic/rte_spinlock.h:231:6: error: decrement of object of volatile-qualified type 'volatile int' is deprecated [-Werror,-Wdeprecated-volatile]<o:p></o:p></span></p>
<p class="MsoNormal"><span style="background:silver;mso-highlight:silver"> if (--(slr->count) == 0) {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="background:silver;mso-highlight:silver"> ^<o:p></o:p></span></p>
<p class="MsoNormal"><span style="background:silver;mso-highlight:silver">/home/dpdk/lib/eal/include/generic/rte_spinlock.h:255:12: error: increment of object of volatile-qualified type 'volatile int' is deprecated [-Werror,-Wdeprecated-volatile]<o:p></o:p></span></p>
<p class="MsoNormal"><span style="background:silver;mso-highlight:silver"> slr->count++;</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">BR, <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="line-height:140%;text-autospace:none"><b><span style="font-family:"Arial",sans-serif;color:#6D6D6D"><img width="127" height="54" style="width:1.325in;height:.5666in" id="Picture_x0020_2" src="cid:image001.png@01D90EFA.E6B82160" alt="A close up of a sign
Description automatically generated"><o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height:140%;text-autospace:none"><b><span style="font-family:"Arial",sans-serif;color:#6D6D6D"><o:p> </o:p></span></b></p>
<p class="MsoNormal" style="line-height:150%;text-autospace:none"><b><span style="font-family:"Arial",sans-serif;color:#6D6D6D">Xiangyun Zhou<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height:150%;text-autospace:none"><span style="font-family:"Arial",sans-serif;color:#6D6D6D">NPG SWE SWA
<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:150%"><b><span style="font-family:"Arial",sans-serif;color:#6D6D6D">Intel Corporation</span></b><span style="font-family:"Arial",sans-serif;color:#6D6D6D"> |</span><span style="font-family:"Arial",sans-serif;color:#5A5B5F">
</span><b><span style="font-family:"Arial",sans-serif;color:#0C59B8">intel.com<o:p></o:p></span></b></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>