From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0080.outbound.protection.outlook.com [104.47.41.80]) by dpdk.org (Postfix) with ESMTP id 477501B74E for ; Tue, 17 Oct 2017 10:53:31 +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=y07Ohm4k3Gd4YsusS93h2IKzMmLlOY6kWarrPAWQyaE=; b=XKb+v6HFIYmp+W0tQAMeE5GBmG9MwBHnUjJQuGMpP6JuIcLUxtknpsRj7VdEmb5AadNEJlAeTDD+BPJV99ErGRymfKgLs6arXV2S1JJSE75biLZcknJMav9+JJUX+JHZBXZrKWsJrbzxGBT3jJlk4khKQA+G122n0rasqYdwplo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT.caveonetworks.com (111.93.218.67) by MWHPR07MB3470.namprd07.prod.outlook.com (10.164.192.21) 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 08:53:27 +0000 From: Pavan Nikhilesh To: santosh.shukla@caviumnetworks.com, jerin.jacob@caviumnetworks.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Tue, 17 Oct 2017 14:23:11 +0530 Message-Id: <1508230393-27018-1-git-send-email-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR12CA0029.namprd12.prod.outlook.com (10.172.49.15) To MWHPR07MB3470.namprd07.prod.outlook.com (10.164.192.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 58e83aa3-979c-456e-0213-08d5153c897c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:MWHPR07MB3470; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 3:ni6Qrm6WDgowHRPrgzUfAO8HweweAlMbt3Nn84r2rrbcLpp4E9q13QdwJRb0hnsVLl+RqIVC22snyUkrlDA+SfbXUt9m/DnMfRc0O1p/jXRz8ZpTqwpY3RPVfxZPwcLDMUxeMC9MTtcmTOJ+z1d422/xSV9rlD3MdEhjpf8ayG8pkCoez7eLnch92Sf1ik80qR8VT0nZ6pbeov/t+6RRJgy0FMP3W0ZG2YT74gmshjRNNaqSYwcA+CL34wjtpgpd; 25:nUTdO5UfBUyUYBSE0tdMkYwH0YWmQRNFDFgGbGpvVQEh97jlB4RiiVVX9DvKPFN1GzBFL37Wh58L8jlu0dsDY5nQvtV699mtbRBLYq1arKt9ujonRTY1xfAYNriF3IE/hwOdfIaP5zBmoQUK6PbYIDwZJeko+l+ApzKIJf3dsR6MH4hwIcaKPNM5speTBY28+n1Lgwz5QwBqUC/xkWZlUlCMGebM0bkoQ9N5pBSJKpxKYcifvec4mukpcTVoWkVjKBasPetYKqjWN4Y9ndbe6zoV5Zn4CnTk/MEfJj7NL0MujqQgLCIX88NJT4QndpgaGiOmIPSpXZ0CWhHb3uruOg==; 31:/WoPeIURNZhISwZCKECdZPaUkg98pIaJnauBrhIq0dZaKxK4K+FOYICmFgU/VrAdrT4FUaOvH+iHnQ2np141SM29OEvE0XKKmjWHKlrKYhWchpPjpjQ3g6PxYJEWM6hT8MEWexRP9E5DBlvmuuXVx0AHj1jMAA+f4f+X5hUkz7b5OHlUZ3Ridsq1ggu7MoA24ixfJlHb1I8WcoPPS5u7CasZ6K2YVYGp7Ukob7mm/ho= X-MS-TrafficTypeDiagnostic: MWHPR07MB3470: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 20:m8auDnZwUZFW/P2ZyAv+MWQTEH9JmcMdeShBQl2pJ+yrqIL857ge4hnNkloCjE2bdjQWK5KyGvRpAIvCijBtr5FzCNdu/2W/eN5rimZohuuBKu4wOLzFxuC28pWJt40Cdp+WrZOD7rG2h9GMAMpHGSMoI2JgNRYjPQzwBsXgC8lWI9ZAJI+wJlLiGoXpWBH2g92JC3j5HDARU3zv3cHaQTgMd6rlW2C1NZxwi6pkkpEsXh8odYp1a1c8+QlxpHqUb0zHGV95Mg4SJeMRqhyBvzosfxw2WBknuArmIGIMOMDHhq2l6NLU24sWt/BCiuhLDlEGw/naZua2nlcl5vTPBddXkkKKG/uYIDlsf/OPzgArNCh+V+WtluOBCM7MJNZFC296MdINXptHf4Q+yMntFZwBnY9loyKTsFMdddyEyX+AIzPAfgPJ7Guq0PTWTPNdsKJ9SbB7cHdMXiuMXwfn38jqlKaoefVRRzuxCCMhyb1JGTWh8i6lzUQ8sgyhSVjXo5PEZtc3YpF70TL8KbMK4HMM5xB0lgAUFM0hgspfbeisC0eQ+HQwMUQVbUmCkAlCUI8gftkvc6A8SmrW6wn+A3fT2hnyX4wlxf0bYZu8FHk=; 4:E/rUfGyrtwqLi1MVYirkm+WiUGzNWMoQgxh2lZ+o3gL8ZoPskkCpTsQATt47WEXejA+PV4ehUfwd3ijK+GquhEj4FV7qhe5Ls1YbvCo3suhNrmnZT0HA2BEsfPzw3JyDucn0F5Nmg7QiLByizPkei+BBUKfpdKSO55cTwe24Xj/E6mneOV87O8JVZSUSSvw54tCVblvEab1dkKuAgUqN4b8oYJ95Dgw9UA7bGHzVfarqkMzf9KRW4NmmAVXz3ysQ 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)(93006095)(10201501046)(3002001)(100000703101)(100105400095)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR07MB3470; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR07MB3470; X-Forefront-PRVS: 04631F8F77 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(199003)(189002)(50466002)(68736007)(5009440100003)(3846002)(48376002)(16586007)(2906002)(105586002)(53416004)(101416001)(8936002)(106356001)(6116002)(5660300001)(81166006)(305945005)(81156014)(50226002)(5003940100001)(69596002)(33646002)(8676002)(7736002)(6306002)(25786009)(6512007)(107886003)(6506006)(4326008)(53376002)(53936002)(42882006)(36756003)(189998001)(6486002)(966005)(478600001)(6666003)(47776003)(50986999)(316002)(66066001)(97736004)(6636002)(85306007)(16526018)(72206003)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3470; H:PBHAGAVATULA-LT.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR07MB3470; 23:7Jr1ZWugdbyysZwYBAowreZFrYNJC+/0y6AQw2c4y?= =?us-ascii?Q?gbT37fWm4gqm9ZkYKZ7bRXQUJkQRUjMZQngo41LaNJY64d6Ho2jpq3bTO0/C?= =?us-ascii?Q?hn0zUGrmP7vGJnQ9HCEL0c4OTYSMGDDWkY3Z0U8SRBBAZSrG2bHCc2I66eJA?= =?us-ascii?Q?nYr+R9vFXW5J3aZlWicJCBaFCYLmZZUw1dY7nBAUihLhAZH5+VhfhO76pf+A?= =?us-ascii?Q?no30dqv4rLtSb6Snhp4aC2XactTpj2Qb7WXORefzzJDJ4C5T18V8plq8xU7U?= =?us-ascii?Q?Af76Png00SbOkU/ffHRJT4sBxQ3jSUPD54URNSAdy7jeNglboqlEFQCZZYOu?= =?us-ascii?Q?go01Oisu27Pqus1BSUN6fofgZ7VYnGZpfKpJFP2bwhIaA02qDOcRMb5bYIdh?= =?us-ascii?Q?jiuIlme2gez/Bnk49xRtV2v3/FQxbSeKYflvBVTAOqd/pdAUDNrGc8SxKW9P?= =?us-ascii?Q?7BxndcAHIA3JArp2CZQ1WsypAA/pUt3RYUHakwgQm3zdBpf9U2zaCRp5bnHD?= =?us-ascii?Q?gQg/ZrF2M+Y92DP/Z1jd/KvpiWFWbXyPxt4/TAbPxpE9berLAfpQe0f8Srcg?= =?us-ascii?Q?cHoDgsochA3I2uD2Iwge0hd119J5reCl3B9/La6PBs0PlK6lOEpugy/dzE+8?= =?us-ascii?Q?IgBwKAen6K2EA7K6XbsvivRDwJcAU3L4i/f2A+dgZzCBhOkUj7NGfDaKYvK4?= =?us-ascii?Q?Ev7tRS9VMxCWDVsxIHrMtFQXCikuAtaoe5Vw0vJ5A12sJqyAxP8FiP/2FKAJ?= =?us-ascii?Q?2y+PLPn9jCfjEfKAACmD07enRRawGA3Imq6vjSqEidDRagmalS4385kMHGjE?= =?us-ascii?Q?0PmNxA4VmiuBRJ4EGS3RvGZJ8qFJhN/niZsek11uV5hYJr8IRtj5rtKwP9it?= =?us-ascii?Q?ELUa9/SxKLj5+lEy+LzBTDQIfgV/159PSDTwUa+baLj51pknNxlg0SqrYA7R?= =?us-ascii?Q?79IzPvD1LQW/Hdk7nm2jDs7w0QLJIFwg1Gk6o12f75+W37VDrcXMTSiYMv5v?= =?us-ascii?Q?BMdv1woFxBiWqLdtRN4A6ASmTL/xW6HmbSN2i2qmtYNVq9iKIAiWkA9RP5xK?= =?us-ascii?Q?mEtUSZLbe4oF3ZiVgFl4MhredjnbSEFvwLuoX7ft/UG442huRzQQPselX2yy?= =?us-ascii?Q?g1O4Vx0TA6gPLo1nPlrt+drn07EF0yTiCmC2c6ItOwICc6ooCkQNVTF810tD?= =?us-ascii?Q?dJoM8kQiJIdjxHRBx4mO6LUpm2sJOSTXu5V8a5OsPWCCdaNBZNp7I/utA=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 6:KMky7C0bFmop5fdB2Bp4EmRTMXQh0G/CkC+X0jZYNBMKBlOffKw9RBYast9wCk8V7zGFHjAtidfFDV2FMvEbP09oEr2G4LVoEx1pQyKsTPMrGvbrOGW3+bNmjFi/EUGl11sVKHsWRMCkQQabkmsKq8LsS3M6mVgwyc9RKfQMUPmi2u5Tb84aSFZk2Q9KM2p9m+VfG2ap8HRgF1J7njroCx0EPnw9DsIN/bWdSjxN4JILPXc90tZf6JO8BoTaoQ7O7GHLfmIzq5N7oOBN9PDK1i/tZTTT/awrkZoTnUKjBUwWYoCtByeHaEB+4XkuwWFASxWrH0J43ADv4nxsD8m78g==; 5:yFfC8KNXUSIh3vCBzAFIcKQa4DboK9r4BxfLmvVC2gQ8N24GCVD+EbX1RHW6mfJxsKq+sJJRnlVz0k7U18ZxvXMLjcJL8mfj0YVpAI3BqveUv5j98ely5qn6pfL3detJELU2rPaOAb+zREHuGagf4w==; 24:s7wYI+SysEADjhl4nUhiOLmZdqFmeVVeFHPHEcWHxBXDcAMfTqtfw1+Q7rOGnWHtzS+WDKz6LIPtHxzODnl5wlZy/mhNc8QM4hE4n2RzYGQ=; 7:y/OQ+vGSEXC9Cf45Jq/wWoj9wWN4f+Tzcf9GdRfmjGimrCHkCWHxmWhh/xompNuid6v7Dpc+R2suZ4gkoVi2xCT7ti5cV28FPTJCJfQSwzIGtTp5eMzJAc1LZnDJwy5lYCF2yKtbiE2g9mOPaCAthPZsUl6E7oAM9y+pSqP2sBahzA6I/hhqMk2U04HfQzaICUv8rIJ8dLxRZ4u2vSthSFc1lWKX8OcGZrTQFN76foE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2017 08:53:27.8650 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3470 Subject: [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 08:53:31 -0000 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/30430/ 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/octeontx/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 = sizeof(mbox_pki_port_t); - memset(&ptype, 0, len); - ptype.port_type = OCTTX_PORT_TYPE_NET; - - hdr.coproc = OCTEONTX_PKI_COPROC; - hdr.msg = MBOX_PKI_PORT_CLOSE; - hdr.vfid = port; - - res = 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 = sizeof(mbox_pki_port_t); - memset(&ptype, 0, len); - ptype.port_type = OCTTX_PORT_TYPE_NET; - - hdr.coproc = OCTEONTX_PKI_COPROC; - hdr.msg = MBOX_PKI_PORT_START; - hdr.vfid = port; - - res = 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 = sizeof(mbox_pki_port_t); - memset(&ptype, 0, len); - ptype.port_type = OCTTX_PORT_TYPE_NET; - - hdr.coproc = OCTEONTX_PKI_COPROC; - hdr.msg = MBOX_PKI_PORT_STOP; - hdr.vfid = port; - - res = 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/octeontx/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 = *(mbox_pki_mod_qos_t *)qos_cfg; + int len = sizeof(mbox_pki_mod_qos_t); + + hdr.coproc = OCTEONTX_PKI_COPROC; + hdr.msg = MBOX_PKI_PORT_MODIFY_QOS; + hdr.vfid = port; + + res = 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 = *(mbox_pki_del_qos_t *)qos_cfg; + int len = sizeof(mbox_pki_del_qos_t); + + hdr.coproc = OCTEONTX_PKI_COPROC; + hdr.msg = MBOX_PKI_PORT_DELETE_QOS; + hdr.vfid = port; + + res = 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 = sizeof(mbox_pki_port_t); + memset(&ptype, 0, len); + ptype.port_type = OCTTX_PORT_TYPE_NET; + + hdr.coproc = OCTEONTX_PKI_COPROC; + hdr.msg = MBOX_PKI_PORT_CLOSE; + hdr.vfid = port; + + res = 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 = sizeof(mbox_pki_port_t); + memset(&ptype, 0, len); + ptype.port_type = OCTTX_PORT_TYPE_NET; + + hdr.coproc = OCTEONTX_PKI_COPROC; + hdr.msg = MBOX_PKI_PORT_START; + hdr.vfid = port; + + res = 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 = sizeof(mbox_pki_port_t); + memset(&ptype, 0, len); + ptype.port_type = OCTTX_PORT_TYPE_NET; + + hdr.coproc = OCTEONTX_PKI_COPROC; + hdr.msg = MBOX_PKI_PORT_STOP; + hdr.vfid = port; + + res = 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, uint16_t qidx, pki_hash.tag_slc = 1; pki_hash.tag_dlf = 1; pki_hash.tag_slf = 1; + pki_hash.tag_prt = 1; octeontx_pki_port_hash_config(port, &pki_hash); } @@ -941,7 +942,7 @@ octeontx_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx, pki_qos.qpg_qos = PKI_QPG_QOS_NONE; pki_qos.num_entry = 1; pki_qos.drop_policy = 0; - pki_qos.tag_type = 2L; + pki_qos.tag_type = 0L; pki_qos.qos_entry[0].port_add = 0; pki_qos.qos_entry[0].gaura = gaura; pki_qos.qos_entry[0].ggrp_ok = ev_queues; diff --git a/drivers/net/octeontx/octeontx_rxtx.c b/drivers/net/octeontx/octeontx_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] = { - [LC_NONE][LE_NONE][LF_NONE] = RTE_PTYPE_UNKNOWN, - [LC_NONE][LE_NONE][LF_IPSEC_ESP] = RTE_PTYPE_UNKNOWN, - [LC_NONE][LE_NONE][LF_IPFRAG] = RTE_PTYPE_L4_FRAG, - [LC_NONE][LE_NONE][LF_IPCOMP] = RTE_PTYPE_UNKNOWN, - [LC_NONE][LE_NONE][LF_TCP] = RTE_PTYPE_L4_TCP, - [LC_NONE][LE_NONE][LF_UDP] = RTE_PTYPE_L4_UDP, - [LC_NONE][LE_NONE][LF_GRE] = RTE_PTYPE_TUNNEL_GRE, - [LC_NONE][LE_NONE][LF_UDP_GENEVE] = RTE_PTYPE_TUNNEL_GENEVE, - [LC_NONE][LE_NONE][LF_UDP_VXLAN] = RTE_PTYPE_TUNNEL_VXLAN, - [LC_NONE][LE_NONE][LF_NVGRE] = RTE_PTYPE_TUNNEL_NVGRE, - - [LC_IPV4][LE_NONE][LF_NONE] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_UNKNOWN, - [LC_IPV4][LE_NONE][LF_IPSEC_ESP] = - RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L3_IPV4, - [LC_IPV4][LE_NONE][LF_IPFRAG] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_FRAG, - [LC_IPV4][LE_NONE][LF_IPCOMP] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_UNKNOWN, - [LC_IPV4][LE_NONE][LF_TCP] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_TCP, - [LC_IPV4][LE_NONE][LF_UDP] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_UDP, - [LC_IPV4][LE_NONE][LF_GRE] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_GRE, - [LC_IPV4][LE_NONE][LF_UDP_GENEVE] = - RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_GENEVE, - [LC_IPV4][LE_NONE][LF_UDP_VXLAN] = - RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_VXLAN, - [LC_IPV4][LE_NONE][LF_NVGRE] = - RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_NVGRE, - - [LC_IPV4_OPT][LE_NONE][LF_NONE] = - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_UNKNOWN, - [LC_IPV4_OPT][LE_NONE][LF_IPSEC_ESP] = - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L3_IPV4, - [LC_IPV4_OPT][LE_NONE][LF_IPFRAG] = - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_FRAG, - [LC_IPV4_OPT][LE_NONE][LF_IPCOMP] = - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_UNKNOWN, - [LC_IPV4_OPT][LE_NONE][LF_TCP] = - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_TCP, - [LC_IPV4_OPT][LE_NONE][LF_UDP] = - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_UDP, - [LC_IPV4_OPT][LE_NONE][LF_GRE] = - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_GRE, - [LC_IPV4_OPT][LE_NONE][LF_UDP_GENEVE] = - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_GENEVE, - [LC_IPV4_OPT][LE_NONE][LF_UDP_VXLAN] = - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_VXLAN, - [LC_IPV4_OPT][LE_NONE][LF_NVGRE] = - RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_NVGRE, - - [LC_IPV6][LE_NONE][LF_NONE] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_UNKNOWN, - [LC_IPV6][LE_NONE][LF_IPSEC_ESP] = - RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L3_IPV4, - [LC_IPV6][LE_NONE][LF_IPFRAG] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_FRAG, - [LC_IPV6][LE_NONE][LF_IPCOMP] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_UNKNOWN, - [LC_IPV6][LE_NONE][LF_TCP] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_TCP, - [LC_IPV6][LE_NONE][LF_UDP] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP, - [LC_IPV6][LE_NONE][LF_GRE] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_TUNNEL_GRE, - [LC_IPV6][LE_NONE][LF_UDP_GENEVE] = - RTE_PTYPE_L3_IPV6 | RTE_PTYPE_TUNNEL_GENEVE, - [LC_IPV6][LE_NONE][LF_UDP_VXLAN] = - RTE_PTYPE_L3_IPV6 | RTE_PTYPE_TUNNEL_VXLAN, - [LC_IPV6][LE_NONE][LF_NVGRE] = - RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_NVGRE, - [LC_IPV6_OPT][LE_NONE][LF_NONE] = - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_UNKNOWN, - [LC_IPV6_OPT][LE_NONE][LF_IPSEC_ESP] = - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L3_IPV4, - [LC_IPV6_OPT][LE_NONE][LF_IPFRAG] = - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L4_FRAG, - [LC_IPV6_OPT][LE_NONE][LF_IPCOMP] = - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_UNKNOWN, - [LC_IPV6_OPT][LE_NONE][LF_TCP] = - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L4_TCP, - [LC_IPV6_OPT][LE_NONE][LF_UDP] = - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L4_UDP, - [LC_IPV6_OPT][LE_NONE][LF_GRE] = - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_GRE, - [LC_IPV6_OPT][LE_NONE][LF_UDP_GENEVE] = - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_GENEVE, - [LC_IPV6_OPT][LE_NONE][LF_UDP_VXLAN] = - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_VXLAN, - [LC_IPV6_OPT][LE_NONE][LF_NVGRE] = - RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_NVGRE, - -}; 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 **tx_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 **rx_pkts, uint16_t nb_pkts) 1, 0); if (!valid_event) break; - - wqe = (octtx_wqe_t *)(uintptr_t)ev.u64; - rte_prefetch_non_temporal(wqe); - - /* Get mbuf from wqe */ - mbuf = (struct rte_mbuf *)((uintptr_t)wqe - - OCTTX_PACKET_WQE_SKIP); - mbuf->packet_type = - ptype_table[wqe->s.w2.lcty][wqe->s.w2.lety][wqe->s.w2.lfty]; - mbuf->data_off = RTE_PTR_DIFF(wqe->s.w3.addr, mbuf->buf_addr); - mbuf->pkt_len = wqe->s.w1.len; - mbuf->data_len = mbuf->pkt_len; - mbuf->nb_segs = 1; - mbuf->ol_flags = 0; - mbuf->port = rxq->port_id; - rte_mbuf_refcnt_set(mbuf, 1); - rx_pkts[count++] = mbuf; + rx_pkts[count++] = (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/octeontx_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] = { + [LC_NONE][LE_NONE][LF_NONE] = RTE_PTYPE_UNKNOWN, + [LC_NONE][LE_NONE][LF_IPSEC_ESP] = RTE_PTYPE_UNKNOWN, + [LC_NONE][LE_NONE][LF_IPFRAG] = RTE_PTYPE_L4_FRAG, + [LC_NONE][LE_NONE][LF_IPCOMP] = RTE_PTYPE_UNKNOWN, + [LC_NONE][LE_NONE][LF_TCP] = RTE_PTYPE_L4_TCP, + [LC_NONE][LE_NONE][LF_UDP] = RTE_PTYPE_L4_UDP, + [LC_NONE][LE_NONE][LF_GRE] = RTE_PTYPE_TUNNEL_GRE, + [LC_NONE][LE_NONE][LF_UDP_GENEVE] = RTE_PTYPE_TUNNEL_GENEVE, + [LC_NONE][LE_NONE][LF_UDP_VXLAN] = RTE_PTYPE_TUNNEL_VXLAN, + [LC_NONE][LE_NONE][LF_NVGRE] = RTE_PTYPE_TUNNEL_NVGRE, + + [LC_IPV4][LE_NONE][LF_NONE] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_UNKNOWN, + [LC_IPV4][LE_NONE][LF_IPSEC_ESP] = + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L3_IPV4, + [LC_IPV4][LE_NONE][LF_IPFRAG] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_FRAG, + [LC_IPV4][LE_NONE][LF_IPCOMP] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_UNKNOWN, + [LC_IPV4][LE_NONE][LF_TCP] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_TCP, + [LC_IPV4][LE_NONE][LF_UDP] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_UDP, + [LC_IPV4][LE_NONE][LF_GRE] = RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_GRE, + [LC_IPV4][LE_NONE][LF_UDP_GENEVE] = + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_GENEVE, + [LC_IPV4][LE_NONE][LF_UDP_VXLAN] = + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_VXLAN, + [LC_IPV4][LE_NONE][LF_NVGRE] = + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_NVGRE, + + [LC_IPV4_OPT][LE_NONE][LF_NONE] = + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_UNKNOWN, + [LC_IPV4_OPT][LE_NONE][LF_IPSEC_ESP] = + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L3_IPV4, + [LC_IPV4_OPT][LE_NONE][LF_IPFRAG] = + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_FRAG, + [LC_IPV4_OPT][LE_NONE][LF_IPCOMP] = + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_UNKNOWN, + [LC_IPV4_OPT][LE_NONE][LF_TCP] = + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_TCP, + [LC_IPV4_OPT][LE_NONE][LF_UDP] = + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_UDP, + [LC_IPV4_OPT][LE_NONE][LF_GRE] = + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_GRE, + [LC_IPV4_OPT][LE_NONE][LF_UDP_GENEVE] = + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_GENEVE, + [LC_IPV4_OPT][LE_NONE][LF_UDP_VXLAN] = + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_VXLAN, + [LC_IPV4_OPT][LE_NONE][LF_NVGRE] = + RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_TUNNEL_NVGRE, + + [LC_IPV6][LE_NONE][LF_NONE] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_UNKNOWN, + [LC_IPV6][LE_NONE][LF_IPSEC_ESP] = + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L3_IPV4, + [LC_IPV6][LE_NONE][LF_IPFRAG] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_FRAG, + [LC_IPV6][LE_NONE][LF_IPCOMP] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_UNKNOWN, + [LC_IPV6][LE_NONE][LF_TCP] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_TCP, + [LC_IPV6][LE_NONE][LF_UDP] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP, + [LC_IPV6][LE_NONE][LF_GRE] = RTE_PTYPE_L3_IPV6 | RTE_PTYPE_TUNNEL_GRE, + [LC_IPV6][LE_NONE][LF_UDP_GENEVE] = + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_TUNNEL_GENEVE, + [LC_IPV6][LE_NONE][LF_UDP_VXLAN] = + RTE_PTYPE_L3_IPV6 | RTE_PTYPE_TUNNEL_VXLAN, + [LC_IPV6][LE_NONE][LF_NVGRE] = + RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_NVGRE, + [LC_IPV6_OPT][LE_NONE][LF_NONE] = + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_UNKNOWN, + [LC_IPV6_OPT][LE_NONE][LF_IPSEC_ESP] = + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L3_IPV4, + [LC_IPV6_OPT][LE_NONE][LF_IPFRAG] = + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L4_FRAG, + [LC_IPV6_OPT][LE_NONE][LF_IPCOMP] = + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_UNKNOWN, + [LC_IPV6_OPT][LE_NONE][LF_TCP] = + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L4_TCP, + [LC_IPV6_OPT][LE_NONE][LF_UDP] = + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_L4_UDP, + [LC_IPV6_OPT][LE_NONE][LF_GRE] = + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_GRE, + [LC_IPV6_OPT][LE_NONE][LF_UDP_GENEVE] = + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_GENEVE, + [LC_IPV6_OPT][LE_NONE][LF_UDP_VXLAN] = + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_VXLAN, + [LC_IPV6_OPT][LE_NONE][LF_NVGRE] = + RTE_PTYPE_L3_IPV6_EXT | RTE_PTYPE_TUNNEL_NVGRE, + +}; + uint16_t octeontx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); -- 2.7.4