<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Sziasztok!</p>
    <p>  A mai megbeszélés alapján elkezdtem válaszolni (lásd lent).
      Kérlek esetleg egészítsétek ki/pontosítsátok. Főleg a 4. és 6.
      pontra lehetne kicsit bőbeszédűbb a válasz... Ha lehet péntek
      délután továbbküldeném Cristian felé...</p>
    <p>  Köszi!<br>
    </p>
    <p>         M.<br>
    </p>
    <br>
    <div class="moz-cite-prefix">2017-11-09 13:36 keltezéssel, Tejfel
      Máté írta:<br>
    </div>
    <blockquote type="cite"
      cite="mid:1de49d0a-fcc3-27ff-bdfd-cb5c311fd4d9@caesar.elte.hu">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <p><br>
      </p>
      <div class="moz-forward-container"><br>
        <br>
        -------- Továbbított üzenet --------
        <table class="moz-email-headers-table" cellspacing="0"
          cellpadding="0" border="0">
          <tbody>
            <tr>
              <th valign="BASELINE" align="RIGHT" nowrap="nowrap">Tárgy:
              </th>
              <td>Actions in P4-16</td>
            </tr>
            <tr>
              <th valign="BASELINE" align="RIGHT" nowrap="nowrap">Dátum:
              </th>
              <td>Tue, 7 Nov 2017 17:16:50 +0000</td>
            </tr>
            <tr>
              <th valign="BASELINE" align="RIGHT" nowrap="nowrap">Feladó:
              </th>
              <td>Dumitrescu, Cristian <a class="moz-txt-link-rfc2396E"
                  href="mailto:cristian.dumitrescu@intel.com"
                  moz-do-not-send="true"><cristian.dumitrescu@intel.com></a></td>
            </tr>
            <tr>
              <th valign="BASELINE" align="RIGHT" nowrap="nowrap">Címzett:
              </th>
              <td>Sándor Laki <a class="moz-txt-link-rfc2396E"
                  href="mailto:lakis@inf.elte.hu" moz-do-not-send="true"><lakis@inf.elte.hu></a>,
                Tejfel Máté <a class="moz-txt-link-rfc2396E"
                  href="mailto:matej@caesar.elte.hu"
                  moz-do-not-send="true"><matej@caesar.elte.hu></a>,
                'Horpácsi Dániel' <a class="moz-txt-link-rfc2396E"
                  href="mailto:daniel-h@elte.hu" moz-do-not-send="true"><daniel-h@elte.hu></a></td>
            </tr>
            <tr>
              <th valign="BASELINE" align="RIGHT" nowrap="nowrap">CC: </th>
              <td><a class="moz-txt-link-abbreviated"
                  href="mailto:Gergely.Pongracz@Ericsson.com"
                  moz-do-not-send="true">Gergely.Pongracz@Ericsson.com</a>
                <a class="moz-txt-link-rfc2396E"
                  href="mailto:Gergely.Pongracz@Ericsson.com"
                  moz-do-not-send="true"><Gergely.Pongracz@Ericsson.com></a>,
                Kinsella, Ray <a class="moz-txt-link-rfc2396E"
                  href="mailto:ray.kinsella@intel.com"
                  moz-do-not-send="true"><ray.kinsella@intel.com></a>,
                Ferriter, Cian <a class="moz-txt-link-rfc2396E"
                  href="mailto:cian.ferriter@intel.com"
                  moz-do-not-send="true"><cian.ferriter@intel.com></a>,
                Zhu, Heqing <a class="moz-txt-link-rfc2396E"
                  href="mailto:heqing.zhu@intel.com"
                  moz-do-not-send="true"><heqing.zhu@intel.com></a></td>
            </tr>
          </tbody>
        </table>
        <br>
        <br>
        <meta http-equiv="Content-Type" content="text/html;
          charset=UTF-8">
        <meta name="Generator" content="Microsoft Word 15 (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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:536892058;
        mso-list-type:hybrid;
        mso-list-template-ids:-2002247160 403243023 403243033 403243035 403243023 403243033 403243035 403243023 403243033 403243035;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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]-->
        <div class="WordSection1">
          <p class="MsoNormal"><span lang="EN-US">Hi guys,<o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
          <p class="MsoNormal"><span lang="EN-US">I have read the P4-16
              spec and I have some questions on actions, it would be
              great to have your input:<o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
          <p class="MsoListParagraph"
            style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span
              lang="EN-US"><span style="mso-list:Ignore">1.<span
                  style="font:7.0pt "Times New Roman"">      </span></span></span><!--[endif]--><span
              lang="EN-US">Action implementations. My takeaway is that
              actions are implemented using the two mechanisms below,
              did I miss any other mechanism?<o:p></o:p></span></p>
          <p class="MsoListParagraph"
            style="margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0
            level2 lfo1">
            <!--[if !supportLists]--><span lang="EN-US"><span
                style="mso-list:Ignore">a.<span style="font:7.0pt
                  "Times New Roman"">      </span></span></span><!--[endif]--><span
              lang="EN-US">Statements and expressions. Similar to
              writing a C function. Departure from P4-14, where actions
              could only be built using a (small) predefined set of
              primitive actions.<o:p></o:p></span></p>
          <p class="MsoListParagraph"
style="margin-left:108.0pt;text-indent:-108.0pt;mso-text-indent-alt:-9.0pt;mso-list:l0
            level3 lfo1">
            <!--[if !supportLists]--><span lang="EN-US"><span
                style="mso-list:Ignore"><span style="font:7.0pt
                  "Times New Roman"">                                                   
                </span>i.<span style="font:7.0pt "Times New
                  Roman"">     </span></span></span><!--[endif]--><span
              lang="EN-US">Inputs: packet headers, packet meta-data,
              table entry data<o:p></o:p></span></p>
          <p class="MsoListParagraph"
style="margin-left:108.0pt;text-indent:-108.0pt;mso-text-indent-alt:-9.0pt;mso-list:l0
            level3 lfo1">
            <!--[if !supportLists]--><span lang="EN-US"><span
                style="mso-list:Ignore"><span style="font:7.0pt
                  "Times New Roman"">                                                  
                </span>ii.<span style="font:7.0pt "Times New
                  Roman"">     </span></span></span><!--[endif]--><span
              lang="EN-US">Outputs: packet headers, packet meta-data,
              (table entry data?)<o:p></o:p></span></p>
          <p class="MsoListParagraph"
            style="margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0
            level2 lfo1">
            <!--[if !supportLists]--><span lang="EN-US"><span
                style="mso-list:Ignore">b.<span style="font:7.0pt
                  "Times New Roman"">      </span></span></span><!--[endif]--><span
              lang="EN-US">Extern object instantiations and extern
              functions. This allows pushing out of the language some
              P4-14 objects such as: meters, registers, counters.</span></p>
        </div>
      </div>
    </blockquote>
    Basically this s right but probably not this is the best
    classification, because calling extern function will be also a
    statement, so you can create block like this:<br>
        action actionA(){<br>
            externFun();<br>
            hdr.ethernet.srcAddr = hdr.ethernet.dstAddr;<br>
        }<br>
     As well as you can call an other action inside an action. For
    example:<br>
        action actionB<span class="pl-c1">(macAddr_t</span> <span
      class="pl-c1">dstAddr)</span>{<br>
            actionA();<br>
            <span class="pl-c1">hdr</span>.<span class="pl-c1">ethernet</span>.<span
      class="pl-c1">dstAddr</span> = <span class="pl-c1">dstAddr</span>;<br>
         }  <br>
               <br>
    <blockquote type="cite"
      cite="mid:1de49d0a-fcc3-27ff-bdfd-cb5c311fd4d9@caesar.elte.hu">
      <div class="moz-forward-container">
        <div class="WordSection1">
          <p class="MsoListParagraph"
            style="margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0
            level2 lfo1"><span lang="EN-US"><o:p></o:p></span></p>
          <p class="MsoListParagraph"
            style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span
              lang="EN-US"><span style="mso-list:Ignore">2.<span
                  style="font:7.0pt "Times New Roman"">      </span></span></span><!--[endif]--><span
              lang="EN-US">For a given table, several actions can be
              defined; each table entry (including the default entry)
              has exactly one action from the action list of the table,
              right?</span></p>
        </div>
      </div>
    </blockquote>
    Right. For one entry you can have one action with a given parameter
    list.<br>
    <br>
    <blockquote type="cite"
      cite="mid:1de49d0a-fcc3-27ff-bdfd-cb5c311fd4d9@caesar.elte.hu">
      <div class="moz-forward-container">
        <div class="WordSection1">
          <p class="MsoListParagraph"
            style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><span
              lang="EN-US"><o:p></o:p></span></p>
          <p class="MsoListParagraph"
            style="margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0
            level2 lfo1">
            <!--[if !supportLists]--><span lang="EN-US"><span
                style="mso-list:Ignore">a.<span style="font:7.0pt
                  "Times New Roman"">      </span></span></span><!--[endif]--><span
              lang="EN-US">If entry X does operations {A, B, C, D, E}
              and entry Y does operations {A, B, C, D, F}, we need to
              implement actionX (doing A, B, C, D,E) and actionY (doing
              A, B, C, D, F) explicitly and map them to entries X and Y,
              as opposed to saying: entry X executes actions A, B, C, D,
              E and entry Y executes actions A, B, C, D, F, right?</span></p>
        </div>
      </div>
    </blockquote>
    Technically you can create a common part: commonXY (doing A,B,C,D)
    and call it from actionX and actionY, but basically right, you need
    two different action.  <br>
    <blockquote type="cite"
      cite="mid:1de49d0a-fcc3-27ff-bdfd-cb5c311fd4d9@caesar.elte.hu">
      <div class="moz-forward-container">
        <div class="WordSection1">
          <p class="MsoListParagraph"
            style="margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0
            level2 lfo1"><span lang="EN-US"><o:p></o:p></span></p>
          <p class="MsoListParagraph"
            style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span
              lang="EN-US"><span style="mso-list:Ignore">3.<span
                  style="font:7.0pt "Times New Roman"">      </span></span></span><!--[endif]--><span
              lang="EN-US">Action portability. If we use extern objects
              and functions, the actions are not that portable anymore,
              right? They become target specific and P4 program can only
              work for that target.</span></p>
        </div>
      </div>
    </blockquote>
    You have to define the possible externs in the architecture file. So
    the concept is, the program will be portable between targets
    supporting the same architecture file. <br>
    <blockquote type="cite"
      cite="mid:1de49d0a-fcc3-27ff-bdfd-cb5c311fd4d9@caesar.elte.hu">
      <div class="moz-forward-container">
        <div class="WordSection1">
          <p class="MsoListParagraph"
            style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><span
              lang="EN-US"><o:p></o:p></span></p>
          <p class="MsoListParagraph"
            style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span
              lang="EN-US"><span style="mso-list:Ignore">4.<span
                  style="font:7.0pt "Times New Roman"">      </span></span></span><!--[endif]--><span
              lang="EN-US">Can an action modify the table entry data or
              is table entry data read-only?</span></p>
        </div>
      </div>
    </blockquote>
    Only the controller can modify table entry data. In an action you
    can generate a digest to the controller "asking it" to modify the
    data... <br>
    <blockquote type="cite"
      cite="mid:1de49d0a-fcc3-27ff-bdfd-cb5c311fd4d9@caesar.elte.hu">
      <div class="moz-forward-container">
        <div class="WordSection1">
          <p class="MsoListParagraph"
            style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><span
              lang="EN-US"><o:p></o:p></span></p>
          <p class="MsoListParagraph"
            style="margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0
            level2 lfo1">
            <!--[if !supportLists]--><span lang="EN-US"><span
                style="mso-list:Ignore">a.<span style="font:7.0pt
                  "Times New Roman"">      </span></span></span><!--[endif]--><span
              lang="EN-US">Example: implement a packet counter per flow;
              pkt hits table entry, a counter stored in the entry gets
              incremented. Is this possible in P4-16?</span></p>
        </div>
      </div>
    </blockquote>
    You can do something similar with the counter method, but in that
    case the counter will not stored in the entry...<br>
    <blockquote type="cite"
      cite="mid:1de49d0a-fcc3-27ff-bdfd-cb5c311fd4d9@caesar.elte.hu">
      <div class="moz-forward-container">
        <div class="WordSection1">
          <p class="MsoListParagraph"
            style="margin-left:72.0pt;text-indent:-18.0pt;mso-list:l0
            level2 lfo1"><span lang="EN-US"><o:p></o:p></span></p>
          <p class="MsoListParagraph"
            style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span
              lang="EN-US"><span style="mso-list:Ignore">5.<span
                  style="font:7.0pt "Times New Roman"">      </span></span></span><!--[endif]--><span
              lang="EN-US">Do you have examples of P4-16 actions that
              you could share? The more examples the better.</span></p>
        </div>
      </div>
    </blockquote>
    For example you can find examples as exercises solutions of P4
    tutorials (in 2017). See <a class="moz-txt-link-freetext" href="https://github.com/p4lang/tutorials">https://github.com/p4lang/tutorials</a><br>
    <blockquote type="cite"
      cite="mid:1de49d0a-fcc3-27ff-bdfd-cb5c311fd4d9@caesar.elte.hu">
      <div class="moz-forward-container">
        <div class="WordSection1">
          <p class="MsoListParagraph"
            style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><span
              lang="EN-US"><o:p></o:p></span></p>
          <p class="MsoListParagraph"
            style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span
              lang="EN-US"><span style="mso-list:Ignore">6.<span
                  style="font:7.0pt "Times New Roman"">      </span></span></span><!--[endif]--><span
              lang="EN-US">Can somebody give me an example for the
              “implementation” key word from section 12.2.1.5 Additional
              properties and the associated concept of action profile,
              please ?</span></p>
        </div>
      </div>
    </blockquote>
    We have no real example, but if we understand well in this case you
    can define the action list for a table as a list of external
    function calls. <br>
    Here you don not need to define precisely the external functions
    only the maximum number of possible functions. Probably you can see
    P4_14 action_profile<br>
    construct for more detail.     <br>
    <blockquote type="cite"
      cite="mid:1de49d0a-fcc3-27ff-bdfd-cb5c311fd4d9@caesar.elte.hu">
      <div class="moz-forward-container">
        <div class="WordSection1">
          <p class="MsoListParagraph"
            style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><span
              lang="EN-US"><o:p></o:p></span></p>
          <p class="MsoListParagraph"
            style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span
              lang="EN-US"><span style="mso-list:Ignore">7.<span
                  style="font:7.0pt "Times New Roman"">      </span></span></span><!--[endif]--><span
              lang="EN-US">When should we expect P4-16 support in the
              T4P4S compiler?</span></p>
        </div>
      </div>
    </blockquote>
    We like to create a T4P4S version supporting v1 model until end of
    January 2018.  <br>
    <blockquote type="cite"
      cite="mid:1de49d0a-fcc3-27ff-bdfd-cb5c311fd4d9@caesar.elte.hu">
      <div class="moz-forward-container">
        <div class="WordSection1">
          <p class="MsoListParagraph"
            style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><span
              lang="EN-US"><o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
          <p class="MsoNormal"><span lang="EN-US">Thanks very much for
              your help!<o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
          <p class="MsoNormal"><span lang="EN-US">Regards,<o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-US">Cristian<o:p></o:p></span></p>
          <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
P4 mailing list
<a class="moz-txt-link-abbreviated" href="mailto:P4@plc.inf.elte.hu">P4@plc.inf.elte.hu</a>
<a class="moz-txt-link-freetext" href="https://plc.inf.elte.hu/mailman/listinfo/p4">https://plc.inf.elte.hu/mailman/listinfo/p4</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>