From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0044.outbound.protection.outlook.com [104.47.33.44]) by dpdk.org (Postfix) with ESMTP id 6CDFC1B7DA for ; Tue, 17 Oct 2017 11:29:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=l4puK5XupBrdz1u28PB43rpYRbuNNorxk4GpkaNpYKs=; b=QmNLBsPWwX/cUXkhZSwgBwxF6oidtcw+CNVOdClsalT6JYkCG5rFsWfBOcDGuyJKdS6Aa3i/XhmMnkud2tyZ3SEFCLVD/zvLXfkAZn5cmNHGqm6ZqmUc8jyUnTVhfLLqwl3v6QziZ7kbqZP6TRqwhxIooNgTXHJB7Y8jt7Wucxg= Received: from CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) by CY4PR07MB3094.namprd07.prod.outlook.com (10.172.115.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 17 Oct 2017 09:29:46 +0000 Received: from CY4PR07MB3464.namprd07.prod.outlook.com ([10.171.252.145]) by CY4PR07MB3464.namprd07.prod.outlook.com ([10.171.252.145]) with mapi id 15.20.0077.022; Tue, 17 Oct 2017 09:29:45 +0000 From: "Bhagavatula, Pavan" To: "Shukla, Santosh" , "Jacob, Jerin" , "nikhil.rao@intel.com" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/3] net/octeontx: add support for event Rx adapter Thread-Index: AQHTRyVoVD0f1edyDE2RWw+o0LqaX6LnxnVg Date: Tue, 17 Oct 2017 09:29:45 +0000 Message-ID: References: <1508230393-27018-1-git-send-email-pbhagavatula@caviumnetworks.com> In-Reply-To: <1508230393-27018-1-git-send-email-pbhagavatula@caviumnetworks.com> Accept-Language: en-IN, en-US Content-Language: en-IN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; x-originating-ip: [111.93.218.67] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR07MB3094; 6:ufwFWkqonNC7AwskXBGsx1bMZW4RWXyKWPu64cvb5XeLNlZ0CqkCrKaB16lgsl9kvN8jn5kjkObItdnkBQvJbxllMveQwPYzvcdb70yK6kgCOlTu5Tep5NaG2tei5kSHKw+HAan/00G8foPzJH8UU0zid45h2Ing6Knzdf7OX51Pm3sRCpsM91lNqhHSLFN48HSdJAX8PcwkS4e3a5TXHLBP/tQ8wP1cFJ9ch8ABJ/RwQpDJrCYCkE70ZDwArWJMbTTFu4U3cHqdNaDG7uHY4gDUf9ysVDq8SEzJgKV08w47IfhBKiijUmQBm8bq9k12Y9yAg2+tzOnelNWC0s34kw==; 5:b/Qfw3B1Lv5JSSyA0qk/aIdStiausGSEuYuXkiMAsLkb0+Ju5nrTIc66zDv3QZeuqDIzLGHcjaGHRqAn83wMcif/QV+iW4spsEL4J34sb1xezDBP0ne8+uJnBEYrhcMKTLx+P5b1YB7jUYspjoQyiw==; 24:awxN8d+n4RguVOqQKyx6HJaVkk4EHXOqf4a5MmbNocG5uQGSDzeZe+nQ6Q7rgirx3dJxnlypps2fr05E639EBps3myfAUV1O7vGwAgA7nvQ=; 7:mh4FmjB9VZXABPm5lPOD2buBNimo7/hwIgaBtNf60aL9m+gLU5LoGIyKxquymlWw2/J9hy4ZVRc85d6MKlyj0Lu08irvoyJhx9uA+E7aKaTf8txIj3uRhXOKW6e771TQUpl8mjzfW3NoewDnn9XoIglVl9c+v907xxscHASuKAkE+Gog8GLdkDbJN9M8p6K4EsuLrJieQ0xLzCGD40gsxe55vOUGoPy55Kq6evLHNVQ= x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(376002)(346002)(189002)(199003)(99286003)(102836003)(105586002)(66066001)(2906002)(3846002)(6116002)(106356001)(6436002)(9686003)(6606003)(54896002)(189998001)(2501003)(6306002)(53946003)(6246003)(966005)(606006)(19627405001)(53376002)(316002)(101416001)(53546010)(72206003)(110136005)(76176999)(50986999)(54356999)(99946001)(478600001)(8936002)(7696004)(33656002)(86362001)(5660300001)(14454004)(8676002)(81166006)(97736004)(81156014)(77096006)(6506006)(4326008)(55016002)(25786009)(229853002)(16297215004)(53936002)(7736002)(2950100002)(2900100001)(68736007)(3280700002)(236005)(74316002)(3660700001)(579004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3094; H:CY4PR07MB3464.namprd07.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; x-ms-office365-filtering-correlation-id: 559aac31-164e-440f-15ab-08d515419ab8 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY4PR07MB3094; x-ms-traffictypediagnostic: CY4PR07MB3094: x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR07MB3094; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR07MB3094; x-forefront-prvs: 04631F8F77 received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Oct 2017 09:29:45.3574 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3094 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 1/3] net/octeontx: add support for event Rx adapter 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: , X-List-Received-Date: Tue, 17 Oct 2017 09:29:49 -0000 ++ Nikhil Rao ________________________________ From: Bhagavatula, Pavan Sent: 17 October 2017 14:23 To: Shukla, Santosh; Jacob, Jerin Cc: dev@dpdk.org; Bhagavatula, Pavan Subject: [dpdk-dev] [PATCH 1/3] net/octeontx: add support for event Rx adap= ter Add functions to modify and delete qos responsible for mapping eth queues to event queues used for configuring event Rx adapter. The mbox functions have been moved from octeontx_pkivf.c to octeontx_pkivf.h to allow event_octeontx to access them. Signed-off-by: Pavan Nikhilesh --- This patch set depends on the series http://dpdk.org/dev/patchwork/patch/30= 430/ drivers/net/octeontx/base/octeontx_pkivf.c | 65 --------------- drivers/net/octeontx/base/octeontx_pkivf.h | 126 +++++++++++++++++++++++++= +++- drivers/net/octeontx/octeontx_ethdev.c | 3 +- drivers/net/octeontx/octeontx_rxtx.c | 108 +------------------------ drivers/net/octeontx/octeontx_rxtx.h | 89 ++++++++++++++++++++ 5 files changed, 216 insertions(+), 175 deletions(-) diff --git a/drivers/net/octeontx/base/octeontx_pkivf.c b/drivers/net/octeo= ntx/base/octeontx_pkivf.c index afae6a3..f9e4053 100644 --- a/drivers/net/octeontx/base/octeontx_pkivf.c +++ b/drivers/net/octeontx/base/octeontx_pkivf.c @@ -111,71 +111,6 @@ octeontx_pki_port_create_qos(int port, pki_qos_cfg_t *= qos_cfg) return res; } -int -octeontx_pki_port_close(int port) -{ - struct octeontx_mbox_hdr hdr; - int res; - - mbox_pki_port_t ptype; - int len =3D sizeof(mbox_pki_port_t); - memset(&ptype, 0, len); - ptype.port_type =3D OCTTX_PORT_TYPE_NET; - - hdr.coproc =3D OCTEONTX_PKI_COPROC; - hdr.msg =3D MBOX_PKI_PORT_CLOSE; - hdr.vfid =3D port; - - res =3D octeontx_ssovf_mbox_send(&hdr, &ptype, len, NULL, 0); - if (res < 0) - return -EACCES; - - return res; -} - -int -octeontx_pki_port_start(int port) -{ - struct octeontx_mbox_hdr hdr; - int res; - - mbox_pki_port_t ptype; - int len =3D sizeof(mbox_pki_port_t); - memset(&ptype, 0, len); - ptype.port_type =3D OCTTX_PORT_TYPE_NET; - - hdr.coproc =3D OCTEONTX_PKI_COPROC; - hdr.msg =3D MBOX_PKI_PORT_START; - hdr.vfid =3D port; - - res =3D octeontx_ssovf_mbox_send(&hdr, &ptype, len, NULL, 0); - if (res < 0) - return -EACCES; - - return res; -} - -int -octeontx_pki_port_stop(int port) -{ - struct octeontx_mbox_hdr hdr; - int res; - - mbox_pki_port_t ptype; - int len =3D sizeof(mbox_pki_port_t); - memset(&ptype, 0, len); - ptype.port_type =3D OCTTX_PORT_TYPE_NET; - - hdr.coproc =3D OCTEONTX_PKI_COPROC; - hdr.msg =3D MBOX_PKI_PORT_STOP; - hdr.vfid =3D port; - - res =3D octeontx_ssovf_mbox_send(&hdr, &ptype, len, NULL, 0); - if (res < 0) - return -EACCES; - - return res; -} int octeontx_pki_port_errchk_config(int port, pki_errchk_cfg_t *cfg) diff --git a/drivers/net/octeontx/base/octeontx_pkivf.h b/drivers/net/octeo= ntx/base/octeontx_pkivf.h index 7cf8332..004dedc 100644 --- a/drivers/net/octeontx/base/octeontx_pkivf.h +++ b/drivers/net/octeontx/base/octeontx_pkivf.h @@ -240,10 +240,18 @@ typedef struct mbox_pki_port_modify_qos_entry { uint8_t f_gaura:1; uint8_t f_grptag_ok:1; uint8_t f_grptag_bad:1; + uint8_t f_tag_type:1; } mmask; + uint8_t tag_type; struct mbox_pki_qos_entry qos_entry; } mbox_pki_mod_qos_t; +/* pki flow/style enable qos */ +typedef struct mbox_pki_port_delete_qos_entry { + uint8_t port_type; + uint16_t index; +} mbox_pki_del_qos_t; + /* PKI maximum constants */ #define PKI_VF_MAX (1) #define PKI_MAX_PKTLEN (32768) @@ -407,6 +415,12 @@ typedef struct pki_port_create_qos { } pki_qos_cfg_t; /* pki flow/style enable qos */ +typedef struct pki_port_delete_qos_entry { + uint8_t port_type; + uint16_t index; +} pki_del_qos_t; + +/* pki flow/style enable qos */ typedef struct pki_port_modify_qos_entry { uint8_t port_type; uint16_t index; @@ -415,17 +429,125 @@ typedef struct pki_port_modify_qos_entry { uint8_t f_grp_ok:1; uint8_t f_grp_bad:1; uint8_t f_gaura:1; + uint8_t f_grptag_ok:1; + uint8_t f_grptag_bad:1; + uint8_t f_tag_type:1; } mmask; + uint8_t tag_type; struct pki_qos_entry qos_entry; } pki_mod_qos_t; +static inline int +octeontx_pki_port_modify_qos(int port, pki_mod_qos_t *qos_cfg) +{ + struct octeontx_mbox_hdr hdr; + int res; + + mbox_pki_mod_qos_t q_cfg =3D *(mbox_pki_mod_qos_t *)qos_cfg; + int len =3D sizeof(mbox_pki_mod_qos_t); + + hdr.coproc =3D OCTEONTX_PKI_COPROC; + hdr.msg =3D MBOX_PKI_PORT_MODIFY_QOS; + hdr.vfid =3D port; + + res =3D octeontx_ssovf_mbox_send(&hdr, &q_cfg, len, NULL, 0); + if (res < 0) + return -EACCES; + + return res; +} + +static inline int +octeontx_pki_port_delete_qos(int port, pki_del_qos_t *qos_cfg) +{ + struct octeontx_mbox_hdr hdr; + int res; + + mbox_pki_del_qos_t q_cfg =3D *(mbox_pki_del_qos_t *)qos_cfg; + int len =3D sizeof(mbox_pki_del_qos_t); + + hdr.coproc =3D OCTEONTX_PKI_COPROC; + hdr.msg =3D MBOX_PKI_PORT_DELETE_QOS; + hdr.vfid =3D port; + + res =3D octeontx_ssovf_mbox_send(&hdr, &q_cfg, len, NULL, 0); + if (res < 0) + return -EACCES; + + return res; +} + +static inline int +octeontx_pki_port_close(int port) +{ + struct octeontx_mbox_hdr hdr; + int res; + + mbox_pki_port_t ptype; + int len =3D sizeof(mbox_pki_port_t); + memset(&ptype, 0, len); + ptype.port_type =3D OCTTX_PORT_TYPE_NET; + + hdr.coproc =3D OCTEONTX_PKI_COPROC; + hdr.msg =3D MBOX_PKI_PORT_CLOSE; + hdr.vfid =3D port; + + res =3D octeontx_ssovf_mbox_send(&hdr, &ptype, len, NULL, 0); + if (res < 0) + return -EACCES; + + return res; +} + +static inline int +octeontx_pki_port_start(int port) +{ + struct octeontx_mbox_hdr hdr; + int res; + + mbox_pki_port_t ptype; + int len =3D sizeof(mbox_pki_port_t); + memset(&ptype, 0, len); + ptype.port_type =3D OCTTX_PORT_TYPE_NET; + + hdr.coproc =3D OCTEONTX_PKI_COPROC; + hdr.msg =3D MBOX_PKI_PORT_START; + hdr.vfid =3D port; + + res =3D octeontx_ssovf_mbox_send(&hdr, &ptype, len, NULL, 0); + if (res < 0) + return -EACCES; + + return res; +} + +static inline int +octeontx_pki_port_stop(int port) +{ + struct octeontx_mbox_hdr hdr; + int res; + + mbox_pki_port_t ptype; + int len =3D sizeof(mbox_pki_port_t); + memset(&ptype, 0, len); + ptype.port_type =3D OCTTX_PORT_TYPE_NET; + + hdr.coproc =3D OCTEONTX_PKI_COPROC; + hdr.msg =3D MBOX_PKI_PORT_STOP; + hdr.vfid =3D port; + + res =3D octeontx_ssovf_mbox_send(&hdr, &ptype, len, NULL, 0); + if (res < 0) + return -EACCES; + + return res; +} + int octeontx_pki_port_open(int port); int octeontx_pki_port_hash_config(int port, pki_hash_cfg_t *hash_cfg); int octeontx_pki_port_pktbuf_config(int port, pki_pktbuf_cfg_t *buf_cfg); int octeontx_pki_port_create_qos(int port, pki_qos_cfg_t *qos_cfg); int octeontx_pki_port_close(int port); -int octeontx_pki_port_start(int port); -int octeontx_pki_port_stop(int port); int octeontx_pki_port_errchk_config(int port, pki_errchk_cfg_t *cfg); #endif /* __OCTEONTX_PKI_H__ */ diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/= octeontx_ethdev.c index 82e38c2..86de5d1 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -930,6 +930,7 @@ octeontx_dev_rx_queue_setup(struct rte_eth_dev *dev, ui= nt16_t qidx, pki_hash.tag_slc =3D 1; pki_hash.tag_dlf =3D 1; pki_hash.tag_slf =3D 1; + pki_hash.tag_prt =3D 1; octeontx_pki_port_hash_config(port, &pki_hash); } @@ -941,7 +942,7 @@ octeontx_dev_rx_queue_setup(struct rte_eth_dev *dev, ui= nt16_t qidx, pki_qos.qpg_qos =3D PKI_QPG_QOS_NONE; pki_qos.num_entry =3D 1; pki_qos.drop_policy =3D 0; - pki_qos.tag_type =3D 2L; + pki_qos.tag_type =3D 0L; pki_qos.qos_entry[0].port_add =3D 0; pki_qos.qos_entry[0].gaura =3D gaura; pki_qos.qos_entry[0].ggrp_ok =3D ev_queues; diff --git a/drivers/net/octeontx/octeontx_rxtx.c b/drivers/net/octeontx/oc= teontx_rxtx.c index 0b15833..99531cd 100644 --- a/drivers/net/octeontx/octeontx_rxtx.c +++ b/drivers/net/octeontx/octeontx_rxtx.c @@ -47,94 +47,6 @@ #include "octeontx_rxtx.h" #include "octeontx_logs.h" -/* Packet type table */ -#define PTYPE_SIZE OCCTX_PKI_LTYPE_LAST - -static const uint32_t __rte_cache_aligned -ptype_table[PTYPE_SIZE][PTYPE_SIZE][PTYPE_SIZE] =3D { - [LC_NONE][LE_NONE][LF_NONE] =3D RTE_PTYPE_UNKNOWN, - [LC_NONE][LE_NONE][LF_IPSEC_ESP] =3D RTE_PTYPE_UNKNOWN, - [LC_NONE][LE_NONE][LF_IPFRAG] =3D RTE_PTYPE_L4_FRAG, - [LC_NONE][LE_NONE][LF_IPCOMP] =3D RTE_PTYPE_UNKNOWN, - [LC_NONE][LE_NONE][LF_TCP] =3D RTE_PTYPE_L4_TCP, - [LC_NONE][LE_NONE][LF_UDP] =3D RTE_PTYPE_L4_UDP, - [LC_NONE][LE_NONE][LF_GRE] =3D RTE_PTYPE_TUNNEL_GRE, - [LC_NONE][LE_NONE][LF_UDP_GENEVE] =3D RTE_PTYPE_TUNNEL_GENEVE, - [LC_NONE][LE_NONE][LF_UDP_VXLAN] =3D RTE_PTYPE_TUNNEL_VXLAN, - [LC_NONE][LE_NONE][LF_NVGRE] =3D RTE_PTYPE_TUNNEL_NVGRE, - - [LC_IPV4][LE_NONE][LF_NONE] =3D RTE_PTYPE_L3_IPV4 | RTE_PTYPE_UNKNO= WN, - [LC_IPV4][LE_NONE][LF_IPSEC_ESP] =3D - RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L3_IPV4, - [LC_IPV4][LE_NONE][LF_IPFRAG] =3D RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_= FRAG, - [LC_IPV4][LE_NONE][LF_IPCOMP] =3D RTE_PTYPE_L3_IPV4 | RTE_PTYPE_UNK= NOWN, - [LC_IPV4][LE_NONE][LF_TCP] =3D RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_TCP= , - [LC_IPV4][LE_NONE][LF_UDP] =3D RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_UDP= , - [LC_IPV4][LE_NONE][LF_GRE] =3D RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL= _GRE, - [LC_IPV4][LE_NONE][LF_UDP_GENEVE] =3D - RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_GENEVE= , - [LC_IPV4][LE_NONE][LF_UDP_VXLAN] =3D - RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_VXLAN, - [LC_IPV4][LE_NONE][LF_NVGRE] =3D - RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_NVGRE, - - [LC_IPV4_OPT][LE_NONE][LF_NONE] =3D - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_UNKNOWN, - [LC_IPV4_OPT][LE_NONE][LF_IPSEC_ESP] =3D - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L3_IPV4, - [LC_IPV4_OPT][LE_NONE][LF_IPFRAG] =3D - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_FRAG, - [LC_IPV4_OPT][LE_NONE][LF_IPCOMP] =3D - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_UNKNOWN, - [LC_IPV4_OPT][LE_NONE][LF_TCP] =3D - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_TCP, - [LC_IPV4_OPT][LE_NONE][LF_UDP] =3D - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_UDP, - [LC_IPV4_OPT][LE_NONE][LF_GRE] =3D - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_GR= E, - [LC_IPV4_OPT][LE_NONE][LF_UDP_GENEVE] =3D - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_GE= NEVE, - [LC_IPV4_OPT][LE_NONE][LF_UDP_VXLAN] =3D - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_VX= LAN, - [LC_IPV4_OPT][LE_NONE][LF_NVGRE] =3D - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_NV= GRE, - - [LC_IPV6][LE_NONE][LF_NONE] =3D RTE_PTYPE_L3_IPV6 | RTE_PTYPE_UNKNO= WN, - [LC_IPV6][LE_NONE][LF_IPSEC_ESP] =3D - RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L3_IPV4, - [LC_IPV6][LE_NONE][LF_IPFRAG] =3D RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_= FRAG, - [LC_IPV6][LE_NONE][LF_IPCOMP] =3D RTE_PTYPE_L3_IPV6 | RTE_PTYPE_UNK= NOWN, - [LC_IPV6][LE_NONE][LF_TCP] =3D RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_TCP= , - [LC_IPV6][LE_NONE][LF_UDP] =3D RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP= , - [LC_IPV6][LE_NONE][LF_GRE] =3D RTE_PTYPE_L3_IPV6 | RTE_PTYPE_TUNNEL= _GRE, - [LC_IPV6][LE_NONE][LF_UDP_GENEVE] =3D - RTE_PTYPE_L3_IPV6 | RTE_PTYPE_TUNNEL_GENEVE= , - [LC_IPV6][LE_NONE][LF_UDP_VXLAN] =3D - RTE_PTYPE_L3_IPV6 | RTE_PTYPE_TUNNEL_VXLAN, - [LC_IPV6][LE_NONE][LF_NVGRE] =3D - RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_NVGRE, - [LC_IPV6_OPT][LE_NONE][LF_NONE] =3D - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_UNKNOWN, - [LC_IPV6_OPT][LE_NONE][LF_IPSEC_ESP] =3D - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L3_IPV4, - [LC_IPV6_OPT][LE_NONE][LF_IPFRAG] =3D - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L4_FRAG, - [LC_IPV6_OPT][LE_NONE][LF_IPCOMP] =3D - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_UNKNOWN, - [LC_IPV6_OPT][LE_NONE][LF_TCP] =3D - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L4_TCP, - [LC_IPV6_OPT][LE_NONE][LF_UDP] =3D - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L4_UDP, - [LC_IPV6_OPT][LE_NONE][LF_GRE] =3D - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_GR= E, - [LC_IPV6_OPT][LE_NONE][LF_UDP_GENEVE] =3D - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_GE= NEVE, - [LC_IPV6_OPT][LE_NONE][LF_UDP_VXLAN] =3D - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_VX= LAN, - [LC_IPV6_OPT][LE_NONE][LF_NVGRE] =3D - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_NV= GRE, - -}; static __rte_always_inline uint16_t __hot __octeontx_xmit_pkts(void *lmtline_va, void *ioreg_va, int64_t *fc_status_= va, @@ -195,10 +107,8 @@ octeontx_xmit_pkts(void *tx_queue, struct rte_mbuf **t= x_pkts, uint16_t nb_pkts) uint16_t __hot octeontx_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_= pkts) { - struct rte_mbuf *mbuf; struct octeontx_rxq *rxq; struct rte_event ev; - octtx_wqe_t *wqe; size_t count; uint16_t valid_event; @@ -210,23 +120,7 @@ octeontx_recv_pkts(void *rx_queue, struct rte_mbuf **r= x_pkts, uint16_t nb_pkts) 1, 0); if (!valid_event) break; - - wqe =3D (octtx_wqe_t *)(uintptr_t)ev.u64; - rte_prefetch_non_temporal(wqe); - - /* Get mbuf from wqe */ - mbuf =3D (struct rte_mbuf *)((uintptr_t)wqe - - OCTTX_PACKET_WQE_SKIP); - mbuf->packet_type =3D - ptype_table[wqe->s.w2.lcty][wqe->s.w2.lety][wqe->s.w2.lfty]= ; - mbuf->data_off =3D RTE_PTR_DIFF(wqe->s.w3.addr, mbuf->buf_a= ddr); - mbuf->pkt_len =3D wqe->s.w1.len; - mbuf->data_len =3D mbuf->pkt_len; - mbuf->nb_segs =3D 1; - mbuf->ol_flags =3D 0; - mbuf->port =3D rxq->port_id; - rte_mbuf_refcnt_set(mbuf, 1); - rx_pkts[count++] =3D mbuf; + rx_pkts[count++] =3D (struct rte_mbuf *)ev.u64; } return count; /* return number of pkts received */ diff --git a/drivers/net/octeontx/octeontx_rxtx.h b/drivers/net/octeontx/oc= teontx_rxtx.h index 1f91532..382ff2b 100644 --- a/drivers/net/octeontx/octeontx_rxtx.h +++ b/drivers/net/octeontx/octeontx_rxtx.h @@ -39,6 +39,95 @@ #define __hot __attribute__((hot)) #endif +/* Packet type table */ +#define PTYPE_SIZE OCCTX_PKI_LTYPE_LAST + +static const uint32_t __rte_cache_aligned +ptype_table[PTYPE_SIZE][PTYPE_SIZE][PTYPE_SIZE] =3D { + [LC_NONE][LE_NONE][LF_NONE] =3D RTE_PTYPE_UNKNOWN, + [LC_NONE][LE_NONE][LF_IPSEC_ESP] =3D RTE_PTYPE_UNKNOWN, + [LC_NONE][LE_NONE][LF_IPFRAG] =3D RTE_PTYPE_L4_FRAG, + [LC_NONE][LE_NONE][LF_IPCOMP] =3D RTE_PTYPE_UNKNOWN, + [LC_NONE][LE_NONE][LF_TCP] =3D RTE_PTYPE_L4_TCP, + [LC_NONE][LE_NONE][LF_UDP] =3D RTE_PTYPE_L4_UDP, + [LC_NONE][LE_NONE][LF_GRE] =3D RTE_PTYPE_TUNNEL_GRE, + [LC_NONE][LE_NONE][LF_UDP_GENEVE] =3D RTE_PTYPE_TUNNEL_GENEVE, + [LC_NONE][LE_NONE][LF_UDP_VXLAN] =3D RTE_PTYPE_TUNNEL_VXLAN, + [LC_NONE][LE_NONE][LF_NVGRE] =3D RTE_PTYPE_TUNNEL_NVGRE, + + [LC_IPV4][LE_NONE][LF_NONE] =3D RTE_PTYPE_L3_IPV4 | RTE_PTYPE_UNKNO= WN, + [LC_IPV4][LE_NONE][LF_IPSEC_ESP] =3D + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L3_IPV4, + [LC_IPV4][LE_NONE][LF_IPFRAG] =3D RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_= FRAG, + [LC_IPV4][LE_NONE][LF_IPCOMP] =3D RTE_PTYPE_L3_IPV4 | RTE_PTYPE_UNK= NOWN, + [LC_IPV4][LE_NONE][LF_TCP] =3D RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_TCP= , + [LC_IPV4][LE_NONE][LF_UDP] =3D RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_UDP= , + [LC_IPV4][LE_NONE][LF_GRE] =3D RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL= _GRE, + [LC_IPV4][LE_NONE][LF_UDP_GENEVE] =3D + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_GENEVE= , + [LC_IPV4][LE_NONE][LF_UDP_VXLAN] =3D + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_VXLAN, + [LC_IPV4][LE_NONE][LF_NVGRE] =3D + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_NVGRE, + + [LC_IPV4_OPT][LE_NONE][LF_NONE] =3D + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_UNKNOWN, + [LC_IPV4_OPT][LE_NONE][LF_IPSEC_ESP] =3D + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L3_IPV4, + [LC_IPV4_OPT][LE_NONE][LF_IPFRAG] =3D + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_FRAG, + [LC_IPV4_OPT][LE_NONE][LF_IPCOMP] =3D + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_UNKNOWN, + [LC_IPV4_OPT][LE_NONE][LF_TCP] =3D + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_TCP, + [LC_IPV4_OPT][LE_NONE][LF_UDP] =3D + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_UDP, + [LC_IPV4_OPT][LE_NONE][LF_GRE] =3D + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_GR= E, + [LC_IPV4_OPT][LE_NONE][LF_UDP_GENEVE] =3D + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_GE= NEVE, + [LC_IPV4_OPT][LE_NONE][LF_UDP_VXLAN] =3D + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_VX= LAN, + [LC_IPV4_OPT][LE_NONE][LF_NVGRE] =3D + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_NV= GRE, + + [LC_IPV6][LE_NONE][LF_NONE] =3D RTE_PTYPE_L3_IPV6 | RTE_PTYPE_UNKNO= WN, + [LC_IPV6][LE_NONE][LF_IPSEC_ESP] =3D + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L3_IPV4, + [LC_IPV6][LE_NONE][LF_IPFRAG] =3D RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_= FRAG, + [LC_IPV6][LE_NONE][LF_IPCOMP] =3D RTE_PTYPE_L3_IPV6 | RTE_PTYPE_UNK= NOWN, + [LC_IPV6][LE_NONE][LF_TCP] =3D RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_TCP= , + [LC_IPV6][LE_NONE][LF_UDP] =3D RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP= , + [LC_IPV6][LE_NONE][LF_GRE] =3D RTE_PTYPE_L3_IPV6 | RTE_PTYPE_TUNNEL= _GRE, + [LC_IPV6][LE_NONE][LF_UDP_GENEVE] =3D + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_TUNNEL_GENEVE= , + [LC_IPV6][LE_NONE][LF_UDP_VXLAN] =3D + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_TUNNEL_VXLAN, + [LC_IPV6][LE_NONE][LF_NVGRE] =3D + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_NVGRE, + [LC_IPV6_OPT][LE_NONE][LF_NONE] =3D + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_UNKNOWN, + [LC_IPV6_OPT][LE_NONE][LF_IPSEC_ESP] =3D + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L3_IPV4, + [LC_IPV6_OPT][LE_NONE][LF_IPFRAG] =3D + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L4_FRAG, + [LC_IPV6_OPT][LE_NONE][LF_IPCOMP] =3D + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_UNKNOWN, + [LC_IPV6_OPT][LE_NONE][LF_TCP] =3D + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L4_TCP, + [LC_IPV6_OPT][LE_NONE][LF_UDP] =3D + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L4_UDP, + [LC_IPV6_OPT][LE_NONE][LF_GRE] =3D + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_GR= E, + [LC_IPV6_OPT][LE_NONE][LF_UDP_GENEVE] =3D + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_GE= NEVE, + [LC_IPV6_OPT][LE_NONE][LF_UDP_VXLAN] =3D + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_VX= LAN, + [LC_IPV6_OPT][LE_NONE][LF_NVGRE] =3D + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_NV= GRE, + +}; + uint16_t octeontx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_= pkts); -- 2.7.4