<div dir="ltr">Sorry to interrupt the conversation - obviously the CI testing fail is a false failure and should be ignored by the maintainer here. <div><br></div><div>For those curious, it failed like this, which I have seen previously in a similar case:</div><div>tester: Pkt number not matched,2000 sent and 1999 received<br></div><div><br></div><div>I'm removing this legacy DTS testsuite from our CI testing as it cannot be trusted and also the testsuite has been rewritten recently (and we are switching to the new version).</div><div><br></div><div>Sorry to be a bother!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 16, 2024 at 4:22 AM Chaoyong He <<a href="mailto:chaoyong.he@corigine.com">chaoyong.he@corigine.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Long Wu <<a href="mailto:long.wu@corigine.com" target="_blank">long.wu@corigine.com</a>><br>
<br>
The previous code used a macro as the data size for mbuf<br>
to create the mempool and users cannot modify the size.<br>
<br>
Now modify the code to support setting the data size of<br>
mbuf by '--mbuf-size' parameter. If user does not add the<br>
parameter in start command line, the default size is still<br>
'RTE_MBUF_DEFAULT_BUF_SIZE'.<br>
<br>
Examples:<br>
dpdk-l3fwd -l 0-3 -- -p 0x03 --mbuf-size=4096<br>
<br>
Signed-off-by: Long Wu <<a href="mailto:long.wu@corigine.com" target="_blank">long.wu@corigine.com</a>><br>
Reviewed-by: Chaoyong He <<a href="mailto:chaoyong.he@corigine.com" target="_blank">chaoyong.he@corigine.com</a>><br>
---<br>
 examples/l3fwd/main.c | 17 ++++++++++++++---<br>
 1 file changed, 14 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c<br>
index 01b763e5ba..ccce16c6bb 100644<br>
--- a/examples/l3fwd/main.c<br>
+++ b/examples/l3fwd/main.c<br>
@@ -140,6 +140,7 @@ uint32_t max_pkt_len;<br>
 #ifdef RTE_LIB_EVENTDEV<br>
 static struct rte_mempool *vector_pool[RTE_MAX_ETHPORTS];<br>
 #endif<br>
+static uint16_t mbuf_seg_size = RTE_MBUF_DEFAULT_BUF_SIZE;<br>
 static struct rte_mempool *pktmbuf_pool[RTE_MAX_ETHPORTS][NB_SOCKETS];<br>
 static uint8_t lkp_per_socket[NB_SOCKETS];<br>
<br>
@@ -448,7 +449,8 @@ print_usage(const char *prgname)<br>
                "                    One is ACL entry at while line leads with character '%c',\n"<br>
                "                    another is route entry at while line leads with character '%c'.\n"<br>
                "  --rule_ipv6=FILE: Specify the ipv6 rules entries file.\n"<br>
-               "  --alg: ACL classify method to use, one of: %s.\n\n",<br>
+               "  --alg: ACL classify method to use, one of: %s.\n"<br>
+               "  --mbuf-size=N: Set the data size of mbuf to N bytes.\n\n",<br>
                prgname, RX_DESC_DEFAULT, TX_DESC_DEFAULT,<br>
                ACL_LEAD_CHAR, ROUTE_LEAD_CHAR, alg);<br>
 }<br>
@@ -698,6 +700,7 @@ static const char short_options[] =<br>
 #define CMD_LINE_OPT_RULE_IPV4 "rule_ipv4"<br>
 #define CMD_LINE_OPT_RULE_IPV6 "rule_ipv6"<br>
 #define CMD_LINE_OPT_ALG "alg"<br>
+#define CMD_LINE_OPT_MBUF_SIZE "mbuf-size"<br>
<br>
 enum {<br>
        /* long options mapped to a short option */<br>
@@ -726,7 +729,8 @@ enum {<br>
        CMD_LINE_OPT_LOOKUP_NUM,<br>
        CMD_LINE_OPT_ENABLE_VECTOR_NUM,<br>
        CMD_LINE_OPT_VECTOR_SIZE_NUM,<br>
-       CMD_LINE_OPT_VECTOR_TMO_NS_NUM<br>
+       CMD_LINE_OPT_VECTOR_TMO_NS_NUM,<br>
+       CMD_LINE_OPT_MBUF_SIZE_NUM,<br>
 };<br>
<br>
 static const struct option lgopts[] = {<br>
@@ -753,6 +757,7 @@ static const struct option lgopts[] = {<br>
        {CMD_LINE_OPT_RULE_IPV4,   1, 0, CMD_LINE_OPT_RULE_IPV4_NUM},<br>
        {CMD_LINE_OPT_RULE_IPV6,   1, 0, CMD_LINE_OPT_RULE_IPV6_NUM},<br>
        {CMD_LINE_OPT_ALG,   1, 0, CMD_LINE_OPT_ALG_NUM},<br>
+       {CMD_LINE_OPT_MBUF_SIZE, 1, 0, CMD_LINE_OPT_MBUF_SIZE_NUM},<br>
        {NULL, 0, 0, 0}<br>
 };<br>
<br>
@@ -934,6 +939,12 @@ parse_args(int argc, char **argv)<br>
                case CMD_LINE_OPT_ALG_NUM:<br>
                        l3fwd_set_alg(optarg);<br>
                        break;<br>
+               case CMD_LINE_OPT_MBUF_SIZE_NUM:<br>
+                       mbuf_seg_size = strtoul(optarg, NULL, 10) + RTE_PKTMBUF_HEADROOM;<br>
+                       if (mbuf_seg_size <= 0 || mbuf_seg_size > 0xFFFF)<br>
+                               rte_exit(EXIT_FAILURE,<br>
+                                               "mbuf-size should be > 0 and < 65536\n");<br>
+                       break;<br>
                default:<br>
                        print_usage(prgname);<br>
                        return -1;<br>
@@ -1034,7 +1045,7 @@ init_mem(uint16_t portid, unsigned int nb_mbuf)<br>
                        pktmbuf_pool[portid][socketid] =<br>
                                rte_pktmbuf_pool_create(s, nb_mbuf,<br>
                                        MEMPOOL_CACHE_SIZE, 0,<br>
-                                       RTE_MBUF_DEFAULT_BUF_SIZE, socketid);<br>
+                                       mbuf_seg_size, socketid);<br>
                        if (pktmbuf_pool[portid][socketid] == NULL)<br>
                                rte_exit(EXIT_FAILURE,<br>
                                        "Cannot init mbuf pool on socket %d\n",<br>
-- <br>
2.39.1<br>
<br>
</blockquote></div>