<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=utf-8"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><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:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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=blue vlink=purple><div class=WordSection1><p class=MsoNormal><a name="_MailEndCompose"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>There where there already.<o:p></o:p></span></a></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The patch only changes the size of some local variables.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Venlig hilsen / Kind regards,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>-Morten Brørup<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Stephen Hemminger [mailto:stephen@networkplumber.org] <br><b>Sent:</b> Wednesday, 9 September 2026 19.16<br><b>To:</b> Randy L Tice<br><b>Cc:</b> dev; stable; Thomas Monjalon; Pavan Nikhilesh; Shijith Thotton; Nithin Dabilpuram; Kiran Kumar K; Sunil Kumar Kori; Satha Rao; Harman Kalra; rbhansali@marvell.com<br><b>Subject:</b> Re: [PATCH 1/1] drivers: fix CN20K mbuf size truncation<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>stop "cargo culting" use of always inline attribute. that attribute should only be used in special cases where code breaks compilation without it. it is not a go faster flag<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Wed, Sep 9, 2026, 09:06 Randy L Tice <<a href="mailto:rtice@cisco.com">rtice@cisco.com</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal style='margin-bottom:12.0pt'>CN20K inline security receive paths recover the packet mbuf by<br>subtracting sizeof(struct rte_mbuf) from a pointer stored in<br>completion metadata.<br><br>The size is currently kept in a uint8_t local variable before<br>that subtraction. This truncates the value when the mbuf structure<br>grows beyond 255 bytes, and can recover the wrong mbuf address.<br><br>Use a uint32_t local value for the mbuf byte size so larger mbuf<br>layouts are handled correctly.<br><br>Fixes: 5856f23129bb ("net/cnxk: support CN20K inline IPsec Rx")<br>Fixes: edd0d5f3c299 ("event/cnxk: support CN20K inline IPsec Rx")<br>Cc: <a href="mailto:stable@dpdk.org" target="_blank">stable@dpdk.org</a><br><br>Signed-off-by: Randy L Tice <<a href="mailto:rtice@cisco.com" target="_blank">rtice@cisco.com</a>><br>---<br> .mailmap | 1 +<br> drivers/event/cnxk/cn20k_worker.h | 4 ++--<br> drivers/net/cnxk/cn20k_rx.h | 4 ++--<br> 3 files changed, 5 insertions(+), 4 deletions(-)<br><br>diff --git a/.mailmap b/.mailmap<br>index fcb3d1bb3f..2a8b54ea23 100644<br>--- a/.mailmap<br>+++ b/.mailmap<br>@@ -1379,6 +1379,7 @@ Rakesh Kudurumalla <<a href="mailto:rkudurumalla@marvell.com" target="_blank">rkudurumalla@marvell.com</a>> <<a href="mailto:rkudurumalla@caviumnetworks.com" target="_blank">rkudurumalla@caviumnetworks.com</a>><br> Ralf Hoffmann <<a href="mailto:ralf.hoffmann@allegro-packets.com" target="_blank">ralf.hoffmann@allegro-packets.com</a>><br> Rami Rosen <<a href="mailto:ramirose@gmail.com" target="_blank">ramirose@gmail.com</a>> <<a href="mailto:rami.rosen@intel.com" target="_blank">rami.rosen@intel.com</a>><br> Rami Rosen <<a href="mailto:ramirose@gmail.com" target="_blank">ramirose@gmail.com</a>> <<a href="mailto:roszenrami@gmail.com" target="_blank">roszenrami@gmail.com</a>><br>+Randy L Tice <<a href="mailto:rtice@cisco.com" target="_blank">rtice@cisco.com</a>><br> Randy Schacher <<a href="mailto:stuart.schacher@broadcom.com" target="_blank">stuart.schacher@broadcom.com</a>><br> Rani Sharoni <<a href="mailto:ranish@nvidia.com" target="_blank">ranish@nvidia.com</a>><br> Ranjit Menon <<a href="mailto:ranjit.menon@intel.com" target="_blank">ranjit.menon@intel.com</a>><br>diff --git a/drivers/event/cnxk/cn20k_worker.h b/drivers/event/cnxk/cn20k_worker.h<br>index 6442113e09..5723a6eabb 100644<br>--- a/drivers/event/cnxk/cn20k_worker.h<br>+++ b/drivers/event/cnxk/cn20k_worker.h<br>@@ -48,7 +48,7 @@ cn20k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags, struc<br> {<br> uint64_t mbuf_init = 0x100010000ULL | RTE_PKTMBUF_HEADROOM;<br> struct cnxk_timesync_info *tstamp = ws->tstamp[port_id];<br>- uint8_t m_sz = sizeof(struct rte_mbuf);<br>+ const uint32_t m_sz = sizeof(struct rte_mbuf);<br> void *lookup_mem = ws->lookup_mem;<br> uint64_t meta_aura = 0, laddr = 0;<br> uintptr_t lbase = ws->lmt_base;<br>@@ -165,7 +165,7 @@ cn20k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags, struc<br> static __rte_always_inline void<br> cn20k_sso_hws_post_process(struct cn20k_sso_hws *ws, uint64_t *u64, const uint32_t flags)<br> {<br>- uint8_t m_sz = sizeof(struct rte_mbuf);<br>+ const uint32_t m_sz = sizeof(struct rte_mbuf);<br> uintptr_t sa_base = 0;<br><br> u64[0] = (u64[0] & (0x3ull << 32)) << 6 | (u64[0] & (0x3FFull << 36)) << 4 |<br>diff --git a/drivers/net/cnxk/cn20k_rx.h b/drivers/net/cnxk/cn20k_rx.h<br>index f8fa6de2b9..b544868c03 100644<br>--- a/drivers/net/cnxk/cn20k_rx.h<br>+++ b/drivers/net/cnxk/cn20k_rx.h<br>@@ -702,7 +702,7 @@ cn20k_nix_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t pkts, co<br> uint64_t mbuf_init = rxq->mbuf_initializer;<br> const void *lookup_mem = rxq->lookup_mem;<br> const uint64_t data_off = rxq->data_off;<br>- uint8_t m_sz = sizeof(struct rte_mbuf);<br>+ const uint32_t m_sz = sizeof(struct rte_mbuf);<br> const uint64_t wdata = rxq->wdata;<br> const uint32_t qmask = rxq->qmask;<br> const uintptr_t desc = rxq->desc;<br>@@ -815,7 +815,7 @@ cn20k_nix_flush_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t pk<br> uint64_t mbuf_init = rxq->mbuf_initializer;<br> const void *lookup_mem = rxq->lookup_mem;<br> const uint64_t data_off = rxq->data_off;<br>- uint8_t m_sz = sizeof(struct rte_mbuf);<br>+ const uint32_t m_sz = sizeof(struct rte_mbuf);<br> const uint64_t wdata = rxq->wdata;<br> const uint32_t qmask = rxq->qmask;<br> const uintptr_t desc = rxq->desc;<br>-- <br>2.35.6<o:p></o:p></p></blockquote></div></div></div></body></html>