From patchwork Wed Sep 23 18:06:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Dumitrescu X-Patchwork-Id: 78607 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.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 ; 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Added SWX instruction set reference table. Signed-off-by: Cristian Dumitrescu --- 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: + * + *
+-----+---------------------------+------------------+-----+-----+
+ *
|     | Description               | Format           | DST | SRC |
+ *
+-----+---------------------------+------------------+-----+-----+
+ *
| hdr | Header                    | h.header         |     |     |
+ *
+-----+---------------------------+------------------+-----+-----+
+ *
| act | Action                    | ACTION           |     |     |
+ *
+-----+---------------------------+------------------+-----+-----+
+ *
| tbl | Table                     | TABLE            |     |     |
+ *
+-----+---------------------------+------------------+-----+-----+
+ *
| H   | Header field              | h.header.field   | YES | YES |
+ *
+-----+---------------------------+------------------+-----+-----+
+ *
| M   | Meta-data field           | m.field          | YES | YES |
+ *
+-----+---------------------------+------------------+-----+-----+
+ *
| E   | Extern obj mailbox field  | e.ext_obj.field  | YES | YES |
+ *
+-----+---------------------------+------------------+-----+-----+
+ *
| F   | Extern func mailbox field | f.ext_func.field | YES | YES |
+ *
+-----+---------------------------+------------------+-----+-----+
+ *
| T   | Table action data field   | t.header.field   | NO  | YES |
+ *
+-----+---------------------------+------------------+-----+-----+
+ *
| I   | Immediate value (32-bit)  | h.header.field   | NO  | YES |
+ *
+-----+---------------------------+------------------+-----+-----+
+ * + * Instruction set: + * + *
+------------+----------------------+-------------------+------+--------+
+ *
| Instr.     | Instruction          | Instruction       | 1st  | 2nd    |
+ *
| Name       | Description          | Format            | opnd.| opnd.  |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| rx         | Receive one pkt      | rx m.port_in      | M    |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| tx         | Transmit one pkt     | tx m.port_out     | M    |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| extract    | Extract one hdr      | extract h.hdr     | hdr  |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| emit       | Emit one hdr         | emit h.hdr        | hdr  |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| validate   | Validate one hdr     | validate h.hdr    | hdr  |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| invalidate | Invalidate one hdr   | invalidate h.hdr  | hdr  |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| mov        | dst = src            | mov dst src       | HMEF | HMEFTI |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| dma        | memcpy(h.hdr,        | dma h.hdr t.field | hdr  | T      |
+ *
|            |    &t.field,         |                   |      |        |
+ *
|            |    sizeof(h.hdr)     |                   |      |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| add        | dst += src           | add dst src       | HMEF | HMEFTI |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| sub        | dst -= src           | add dst src       | HMEF | HMEFTI |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| ckadd      | Checksum add: dst =  | add dst src       | HMEF | HMEFTI |
+ *
|            | dst '+ src[0:1] '+   |                   |      | or hdr |
+ *
|            | src[2:3] '+ ...      |                   |      |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| cksub      | Checksum subtract:   | add dst src       | HMEF | HMEFTI |
+ *
|            | dst = dst '- src     |                   |      |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| and        | dst &= src           | and dst src       | HMEF | HMEFTI |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| or         | dst |= src           | or  dst src       | HMEF | HMEFTI |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| xor        | dst ^= src           | xor dst src       | HMEF | HMEFTI |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| shl        | dst <<= src          | shl dst src       | HMEF | HMEFTI |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| shr        | dst >>= src          | shr dst src       | HMEF | HMEFTI |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| table      | Table lookup         | table TABLE       | tbl  |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| extern     | Ext obj member func  | extern e.obj.mfunc| ext  |        |
+ *
|            | call or ext func call| extern f.func     |      |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| jmp        | Unconditional jump   | jmp LABEL         |      |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| jmpv       | Jump if hdr is valid | jmpv LABEL h.hdr  | hdr  |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| jmpnv      | Jump if hdr is inval | jmpnv LABEL h.hdr | hdr  |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| jmph       | Jump if tbl lkp hit  | jmph LABEL        |      |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| jmpnh      | Jump if tbl lkp miss | jmpnh LABEL       |      |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| jmpa       | Jump if action run   | jmpa LABEL ACTION | act  |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| jmpna      | Jump if act not run  | jmpna LABEL ACTION| act  |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| jmpeq      | Jump if (a == b)     | jmpeq LABEL a b   | HMEFT| HMEFTI |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| jmpneq     | Jump if (a != b)     | jmpneq LABEL a b  | HMEFT| HMEFTI |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| jmplt      | Jump if (a < b)      | jmplt LABEL a b   | HMEFT| HMEFTI |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| jmpgt      | Jump if (a > b)      | jmpgt LABEL a b   | HMEFT| HMEFTI |
+ *
+------------+----------------------+-------------------+------+--------+
+ *
| return     | Return from action   | return            |      |        |
+ *
+------------+----------------------+-------------------+------+--------+
+ * + * 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 */