<div dir="ltr">I found there is no way to achieve it from the prompt line, so I began to write some code.<div><br></div><div>But got a flow validate error then:  <b>IPV4 ihl offload not supported</b></div><div><b><br></b></div><div>Looking for some help...<br><div><br></div><div><div style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:"JetBrains Mono",monospace;font-size:11.3pt;white-space:pre"><span style="color:rgb(204,120,50)">struct </span><span style="color:rgb(181,182,227)">rte_flow_attr </span>attr = { <span style="color:rgb(147,115,165)">.ingress </span>= <span style="color:rgb(104,151,187)">1 </span>}<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">struct </span><span style="color:rgb(181,182,227)">rte_flow_item </span>pattern[<span style="color:rgb(104,151,187)">2</span>]<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">struct </span><span style="color:rgb(181,182,227)">rte_flow_action </span>actions[<span style="color:rgb(104,151,187)">2</span>]<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">struct </span><span style="color:rgb(181,182,227)">rte_flow_item_ipv4 </span>ipv4<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">struct </span><span style="color:rgb(181,182,227)">rte_flow </span>*flow<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">struct </span><span style="color:rgb(181,182,227)">rte_flow_error </span>error<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"><br></span><span style="color:rgb(204,120,50)">struct </span><span style="color:rgb(181,182,227)">in_addr </span>addr<span style="color:rgb(204,120,50)">;<br></span>inet_aton(<span style="color:rgb(106,135,89)">"11.158.251.10"</span><span style="color:rgb(204,120,50)">, </span>&addr)<span style="color:rgb(204,120,50)">;<br></span>ipv4.<span style="color:rgb(147,115,165)">hdr</span>.<span style="color:rgb(147,115,165)">dst_addr </span>= <span style="color:rgb(144,139,37)">htonl</span>(addr.<span style="color:rgb(147,115,165)">s_addr</span>)<span style="color:rgb(204,120,50)">;<br></span>pattern[<span style="color:rgb(104,151,187)">0</span>].<span style="color:rgb(147,115,165)">type </span>= <span style="color:rgb(152,118,170);font-style:italic">RTE_FLOW_ITEM_TYPE_IPV4</span><span style="color:rgb(204,120,50)">;<br></span>pattern[<span style="color:rgb(104,151,187)">0</span>].<span style="color:rgb(147,115,165)">spec </span>= &ipv4<span style="color:rgb(204,120,50)">;<br></span>pattern[<span style="color:rgb(104,151,187)">1</span>].<span style="color:rgb(147,115,165)">type </span>= <span style="color:rgb(152,118,170);font-style:italic">RTE_FLOW_ITEM_TYPE_END</span><span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"><br></span>actions[<span style="color:rgb(104,151,187)">0</span>].<span style="color:rgb(147,115,165)">type </span>= <span style="color:rgb(152,118,170);font-style:italic">RTE_FLOW_ACTION_TYPE_DROP</span><span style="color:rgb(204,120,50)">;<br></span>actions[<span style="color:rgb(104,151,187)">1</span>].<span style="color:rgb(147,115,165)">type </span>= <span style="color:rgb(152,118,170);font-style:italic">RTE_FLOW_ACTION_TYPE_END</span><span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"><br></span><span style="color:rgb(204,120,50)"><br></span><span style="color:rgb(204,120,50)">int </span>validate = rte_flow_validate(<span style="color:rgb(104,151,187)">0</span><span style="color:rgb(204,120,50)">, </span>&attr<span style="color:rgb(204,120,50)">, </span>pattern<span style="color:rgb(204,120,50)">, </span>actions<span style="color:rgb(204,120,50)">, </span>&error)<span style="color:rgb(204,120,50)">;<br></span>printf(<span style="color:rgb(106,135,89)">"validate flow: %d, msg %s</span><span style="color:rgb(204,120,50)">\n</span><span style="color:rgb(106,135,89)">"</span><span style="color:rgb(204,120,50)">, </span>validate<span style="color:rgb(204,120,50)">, </span>error.<span style="color:rgb(147,115,165)">message</span>)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)">if </span>(!validate)<br>    flow = rte_flow_create(<span style="color:rgb(104,151,187)">0</span><span style="color:rgb(204,120,50)">, </span>&attr<span style="color:rgb(204,120,50)">, </span>pattern<span style="color:rgb(204,120,50)">, </span>actions<span style="color:rgb(204,120,50)">, </span>&error)<span style="color:rgb(204,120,50)">;</span></div></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Bob Chen <<a href="mailto:a175818323@gmail.com">a175818323@gmail.com</a>> 于2023年4月6日周四 16:53写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><span style="color:rgb(23,43,77);font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,Consolas,Courier,monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(244,245,247)">testpmd> flow create </span><span style="font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,Consolas,Courier,monospace;font-feature-settings:unset;font-kerning:unset;font-size:14px;font-stretch:unset;font-synthesis:unset;font-variant-alternates:unset;font-variant-east-asian:unset;font-variant-numeric:unset;text-orientation:unset;writing-mode:unset;zoom:unset;background-blend-mode:unset;background-clip:unset;background-color:rgb(244,245,247);background-image:unset;background-origin:unset;background-position:unset;background-repeat:unset;background-size:unset;border:unset;border-radius:unset;border-collapse:unset;box-sizing:unset;break-after:unset;break-before:unset;break-inside:unset;caption-side:unset;clear:unset;columns:unset;column-fill:unset;column-rule:unset;column-span:unset;display:unset;empty-cells:unset;float:unset;height:unset;image-orientation:unset;isolation:unset;line-break:unset;line-height:unset;list-style:unset;margin:unset;max-height:unset;max-width:unset;min-height:unset;min-width:unset;mix-blend-mode:unset;object-fit:unset;object-position:unset;opacity:unset;outline:unset;overflow:unset;padding:unset;quotes:unset;speak:unset;table-layout:unset;text-align-last:unset;text-combine-upright:unset;text-decoration-line:unset;text-emphasis:unset;text-overflow:unset;text-underline-position:unset;vertical-align:unset;border-spacing:unset;white-space:pre-wrap;width:unset;word-break:unset">0</span><span style="color:rgb(23,43,77);font-family:SFMono-Medium,"SF Mono","Segoe UI Mono","Roboto Mono","Ubuntu Mono",Menlo,Consolas,Courier,monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(244,245,247)"> ingress pattern ipv4 ... ?</span><br></div>
</blockquote></div>