From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id AB764A04B1;
	Wed, 23 Sep 2020 20:11:18 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 7E38A1DD30;
	Wed, 23 Sep 2020 20:08:16 +0200 (CEST)
Received: from mga05.intel.com (mga05.intel.com [192.55.52.43])
 by dpdk.org (Postfix) with ESMTP id 404EC1DC5D
 for <dev@dpdk.org>; Wed, 23 Sep 2020 20:07:20 +0200 (CEST)
IronPort-SDR: +MTIPTq2lbGRc2vvVJU/rr70r6GgdcvnSxfd2Ul/ojDb3uZmpoSbCHIA0VhqS/ZQCOoTzPSbUu
 BvjSSlBgQefQ==
X-IronPort-AV: E=McAfee;i="6000,8403,9753"; a="245809562"
X-IronPort-AV: E=Sophos;i="5.77,293,1596524400"; d="scan'208";a="245809562"
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga003.jf.intel.com ([10.7.209.27])
 by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 23 Sep 2020 11:07:19 -0700
IronPort-SDR: D53qMSD4B6PeBbiVokRJyByKY+qOTe7/LyvTSPqF31qqLg8kkF0bCcLmfgqYOdmiHCJ2rGgabA
 sxdUqtF1keJA==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.77,293,1596524400"; d="scan'208";a="305477936"
Received: from silpixa00400573.ir.intel.com (HELO
 silpixa00400573.ger.corp.intel.com) ([10.237.223.107])
 by orsmga003.jf.intel.com with ESMTP; 23 Sep 2020 11:07:18 -0700
From: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net,
	david.marchand@redhat.com
Date: Wed, 23 Sep 2020 19:06:30 +0100
Message-Id: <20200923180645.55852-27-cristian.dumitrescu@intel.com>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20200923180645.55852-1-cristian.dumitrescu@intel.com>
References: <20200910152645.9342-2-cristian.dumitrescu@intel.com>
 <20200923180645.55852-1-cristian.dumitrescu@intel.com>
Subject: [dpdk-dev] [PATCH v5 26/41] pipeline: add SWX instruction
	description
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Added SWX instruction set reference table.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 lib/librte_pipeline/rte_swx_pipeline.h | 109 +++++++++++++++++++++++++
 1 file changed, 109 insertions(+)

diff --git a/lib/librte_pipeline/rte_swx_pipeline.h b/lib/librte_pipeline/rte_swx_pipeline.h
index fb83a8820..d6c086e27 100644
--- a/lib/librte_pipeline/rte_swx_pipeline.h
+++ b/lib/librte_pipeline/rte_swx_pipeline.h
@@ -345,6 +345,115 @@ int
 rte_swx_pipeline_packet_metadata_register(struct rte_swx_pipeline *p,
 					  const char *struct_type_name);
 
+/*
+ * Instructions
+ */
+
+/**
+ * Instruction operands:
+ *
+ *<pre>+-----+---------------------------+------------------+-----+-----+</pre>
+ *<pre>|     | Description               | Format           | DST | SRC |</pre>
+ *<pre>+-----+---------------------------+------------------+-----+-----+</pre>
+ *<pre>| hdr | Header                    | h.header         |     |     |</pre>
+ *<pre>+-----+---------------------------+------------------+-----+-----+</pre>
+ *<pre>| act | Action                    | ACTION           |     |     |</pre>
+ *<pre>+-----+---------------------------+------------------+-----+-----+</pre>
+ *<pre>| tbl | Table                     | TABLE            |     |     |</pre>
+ *<pre>+-----+---------------------------+------------------+-----+-----+</pre>
+ *<pre>| H   | Header field              | h.header.field   | YES | YES |</pre>
+ *<pre>+-----+---------------------------+------------------+-----+-----+</pre>
+ *<pre>| M   | Meta-data field           | m.field          | YES | YES |</pre>
+ *<pre>+-----+---------------------------+------------------+-----+-----+</pre>
+ *<pre>| E   | Extern obj mailbox field  | e.ext_obj.field  | YES | YES |</pre>
+ *<pre>+-----+---------------------------+------------------+-----+-----+</pre>
+ *<pre>| F   | Extern func mailbox field | f.ext_func.field | YES | YES |</pre>
+ *<pre>+-----+---------------------------+------------------+-----+-----+</pre>
+ *<pre>| T   | Table action data field   | t.header.field   | NO  | YES |</pre>
+ *<pre>+-----+---------------------------+------------------+-----+-----+</pre>
+ *<pre>| I   | Immediate value (32-bit)  | h.header.field   | NO  | YES |</pre>
+ *<pre>+-----+---------------------------+------------------+-----+-----+</pre>
+ *
+ * Instruction set:
+ *
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| Instr.     | Instruction          | Instruction       | 1st  | 2nd    |</pre>
+ *<pre>| Name       | Description          | Format            | opnd.| opnd.  |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| rx         | Receive one pkt      | rx m.port_in      | M    |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| tx         | Transmit one pkt     | tx m.port_out     | M    |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| extract    | Extract one hdr      | extract h.hdr     | hdr  |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| emit       | Emit one hdr         | emit h.hdr        | hdr  |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| validate   | Validate one hdr     | validate h.hdr    | hdr  |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| invalidate | Invalidate one hdr   | invalidate h.hdr  | hdr  |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| mov        | dst = src            | mov dst src       | HMEF | HMEFTI |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| dma        | memcpy(h.hdr,        | dma h.hdr t.field | hdr  | T      |</pre>
+ *<pre>|            |    &t.field,         |                   |      |        |</pre>
+ *<pre>|            |    sizeof(h.hdr)     |                   |      |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| add        | dst += src           | add dst src       | HMEF | HMEFTI |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| sub        | dst -= src           | add dst src       | HMEF | HMEFTI |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| ckadd      | Checksum add: dst =  | add dst src       | HMEF | HMEFTI |</pre>
+ *<pre>|            | dst '+ src[0:1] '+   |                   |      | or hdr |</pre>
+ *<pre>|            | src[2:3] '+ ...      |                   |      |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| cksub      | Checksum subtract:   | add dst src       | HMEF | HMEFTI |</pre>
+ *<pre>|            | dst = dst '- src     |                   |      |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| and        | dst &= src           | and dst src       | HMEF | HMEFTI |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| or         | dst |= src           | or  dst src       | HMEF | HMEFTI |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| xor        | dst ^= src           | xor dst src       | HMEF | HMEFTI |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| shl        | dst <<= src          | shl dst src       | HMEF | HMEFTI |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| shr        | dst >>= src          | shr dst src       | HMEF | HMEFTI |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| table      | Table lookup         | table TABLE       | tbl  |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| extern     | Ext obj member func  | extern e.obj.mfunc| ext  |        |</pre>
+ *<pre>|            | call or ext func call| extern f.func     |      |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| jmp        | Unconditional jump   | jmp LABEL         |      |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| jmpv       | Jump if hdr is valid | jmpv LABEL h.hdr  | hdr  |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| jmpnv      | Jump if hdr is inval | jmpnv LABEL h.hdr | hdr  |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| jmph       | Jump if tbl lkp hit  | jmph LABEL        |      |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| jmpnh      | Jump if tbl lkp miss | jmpnh LABEL       |      |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| jmpa       | Jump if action run   | jmpa LABEL ACTION | act  |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| jmpna      | Jump if act not run  | jmpna LABEL ACTION| act  |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| jmpeq      | Jump if (a == b)     | jmpeq LABEL a b   | HMEFT| HMEFTI |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| jmpneq     | Jump if (a != b)     | jmpneq LABEL a b  | HMEFT| HMEFTI |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| jmplt      | Jump if (a < b)      | jmplt LABEL a b   | HMEFT| HMEFTI |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| jmpgt      | Jump if (a > b)      | jmpgt LABEL a b   | HMEFT| HMEFTI |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *<pre>| return     | Return from action   | return            |      |        |</pre>
+ *<pre>+------------+----------------------+-------------------+------+--------+</pre>
+ *
+ * At initialization time, the pipeline and action instructions (including the
+ * symbolic name operands) are translated to internal data structures that are
+ * used at run-time.
+ */
+
 /*
  * Pipeline action
  */
-- 
2.17.1