<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 3, 2020 at 8:27 PM Miroslav Kubiczek <<a href="mailto:miroslav.kubiczek@adaptivemobile.com">miroslav.kubiczek@adaptivemobile.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">
  
    
  
  <div>
    <p><br>
    </p>
    <div>On 29. 05. 20 12:51, Numan Siddique
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div><span style="color:rgb(255,0,0)"><span style="background-color:inherit">This email was sent from
            an external sender. Do not click links or open attachments
            unless you recognize the sender and know the content is
            safe.</span></span><br>
      </div>
      <div><br>
      </div>
      <div dir="ltr">
        <div dir="ltr"><br>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Fri, May 29, 2020 at 3:41
            PM Miroslav Kubiczek <<a href="mailto:miroslav.kubiczek@adaptivemobile.com" target="_blank">miroslav.kubiczek@adaptivemobile.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">
            <div>
              <p><br>
              </p>
              <div>On 29. 05. 20 11:29, Numan Siddique wrote:<br>
              </div>
              <blockquote type="cite">
                <div dir="ltr">
                  <div class="gmail_quote">
                    <div dir="ltr" class="gmail_attr">On Fri, May 29,
                      2020 at 2:25 PM Miroslav Kubiczek <<a href="mailto:miroslav.kubiczek@adaptivemobile.com" target="_blank">miroslav.kubiczek@adaptivemobile.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">
                      <div>
                        <pre><tt>Hi,

I have finally implemented flows with check_pkt_larger action. Partial flow dump is here:</tt><tt>

table=0, priority=100 actions=check_pkt_larger(60)->NXM_NX_REG0[0],resubmit(,1)
table=1, priority=1000,reg0=0x1 actions=resubmit(,2)
table=1, priority=100,reg0=0 actions=resubmit(,3)

I run a test which sends UDP packets (with VLAN) with size: 58, 59, 62, 63 and 69 in a loop. Only the packet with 69 match the action (1st line in table=1).

In 2nd test </tt><tt>I set check_pkt_larger</tt> just by one byte less to 59 and then all the above packets match. So the precision seems to be rounded to 8 bytes or something like that.
Can this be fixed to be more precise ideally to exact 1 byte?</pre>
                      </div>
                    </blockquote>
                    <div><br>
                    </div>
                    <div>Can you try without VLAN and see the accuracy ?</div>
                  </div>
                </div>
              </blockquote>
              <p>I tried without VLAN, it's not accurate.</p>
            </div>
          </blockquote>
          <div><br>
          </div>
          <div>This is how the pkt length comparison is done</div>
          <div><br>
          </div>
          <div>in vswitchd - <a href="https://github.com/openvswitch/ovs/blob/master/ofproto/ofproto-dpif-xlate.c#L6265" target="_blank">https://github.com/openvswitch/ovs/blob/master/ofproto/ofproto-dpif-xlate.c#L6265</a></div>
          <div>in kernel datapath - <a href="https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux/+/refs/heads/master/net/openvswitch/actions.c#1183" target="_blank">https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux/+/refs/heads/master/net/openvswitch/actions.c#1183</a></div>
        </div>
      </div>
    </blockquote>
    <p>I can see the problem only when using DPDK. Does it use the same
      code?<br></p></div></blockquote><div>For flow translation the same code is hit.</div><div>I think for ovs-dpdk datapath flows, the code here [1] should get hit.</div><div><br></div><div>[1] - <a href="https://github.com/openvswitch/ovs/blob/master/lib/odp-execute.c#L766">https://github.com/openvswitch/ovs/blob/master/lib/odp-execute.c#L766</a></div><div><br></div><div>I never tested with ovs-dpdk when I worked on it.</div><div><br></div><div>Thanks</div><div>Numan</div><div><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><p>
      When tested with non DPDK then it's working fine. Both versions
      are:<br>
      $ ovs-ofctl --version<br>
      ovs-ofctl (Open vSwitch) 2.13.0<br>
      OpenFlow versions 0x1:0x6</p>
    <p>Thanks,<br>
      Miro<br>
    </p>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_quote">
          <div><br>
          </div>
          <div>Thanks</div>
          <div>Numan</div>
          <div> </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div>
              <p> </p>
            </div>
          </blockquote>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div>
              <p> </p>
              <blockquote type="cite">
                <div dir="ltr">
                  <div class="gmail_quote">
                    <div><br>
                    </div>
                    <div>man ovs-actions for check_pkt_larger says</div>
                    <div><br>
                    </div>
                    <div>****</div>
                    Syntax:<br>
                           check_pkt_larger(pkt_len)->dst<br>
                    <br>
                           Checks if the packet is larger than the
                    specified length in pkt_len. If so, stores 1 in dst,
                    which should be a 1-bit field; if not, stores 0.<br>
                    <br>
                           The packet length to check againt the
                    argument pkt_len includes the L2 header and L2
                    payload of the packet, but not the VLAN tag (if
                    present).<br>
                    <br>
                           Examples:<br>
                                  ·    
                     check_pkt_larger(1500)->reg0[0]<br>
                    <div>              ·    
                       check_pkt_larger(8000)->reg9[10] </div>
                    <div><br>
                    </div>
                    <div>******</div>
                    <div><br>
                    </div>
                    <div>Thanks</div>
                    <div>Numan</div>
                    <div><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>
                        <pre>Thanks,
Miro



</pre>
                      </div>
                    </blockquote>
                  </div>
                </div>
              </blockquote>
            </div>
            _______________________________________________<br>
            discuss mailing list<br>
            <a href="mailto:discuss@openvswitch.org" target="_blank">discuss@openvswitch.org</a><br>
            <a href="https://mail.openvswitch.org/mailman/listinfo/ovs-discuss" rel="noreferrer" target="_blank">https://mail.openvswitch.org/mailman/listinfo/ovs-discuss</a><br>
          </blockquote>
        </div>
      </div>
    </blockquote>
  </div>

_______________________________________________<br>
discuss mailing list<br>
<a href="mailto:discuss@openvswitch.org" target="_blank">discuss@openvswitch.org</a><br>
<a href="https://mail.openvswitch.org/mailman/listinfo/ovs-discuss" rel="noreferrer" target="_blank">https://mail.openvswitch.org/mailman/listinfo/ovs-discuss</a><br>
</blockquote></div></div>