From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0043.outbound.protection.outlook.com [104.47.40.43]) by dpdk.org (Postfix) with ESMTP id C5712239 for ; Sat, 16 Dec 2017 11:14:56 +0100 (CET) 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=nqS2iFuEl1vYBl7pE5h2WjRUq+kWffCMvLVa+rwsruI=; b=Zm5Cs45WLjEk4JEWKh3mCpCKsoiliuyPcJdi28FrSfjjK3nS2TstcSetGD+5x7DoTdRb+/XSdepit96jyoxU6m3fdKjePotL89LDVZsYcXSwTjxYez73QZX1910aGG5Px1b2pl4mbsQxO09q2me+M+3RYGrDB9w3duc7Clwyyj4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (106.200.203.28) by CO2PR07MB2519.namprd07.prod.outlook.com (10.166.201.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Sat, 16 Dec 2017 10:14:50 +0000 Date: Sat, 16 Dec 2017 15:44:34 +0530 From: Jerin Jacob To: Liang Ma Cc: dev@dpdk.org, harry.van.haaren@intel.com, bruce.richardson@intel.com, deepak.k.jain@intel.com, john.geary@intel.com, peter.mccarthy@intel.com, seanbh@gmail.com Message-ID: <20171216101432.GA7422@jerin> References: <1513337189-137661-1-git-send-email-liang.j.ma@intel.com> <1513337189-137661-2-git-send-email-liang.j.ma@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1513337189-137661-2-git-send-email-liang.j.ma@intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [106.200.203.28] X-ClientProxiedBy: MA1PR01CA0101.INDPRD01.PROD.OUTLOOK.COM (10.174.56.145) To CO2PR07MB2519.namprd07.prod.outlook.com (10.166.201.6) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc9c1f79-0c4b-457c-8e42-08d5446dd962 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:CO2PR07MB2519; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2519; 3:2HaqEXPOPlo/b04/p+q7N8AkIhntYYk9zo6Wk0J6MABCVlFwaffZJXP1u1xnBSNNAozE8U2plxe+b5J5JQ0rpd591AOl+DQfMnXrLx0NhNL878KYRFYY81TD8h+3F1fouaAUVSoT/YY6WAGLF6Bzppj56+fCoPCOnjifYUGHlsxXBMVR4rBVvLF+eQ4bqV5I4tlNKtDAgsFY6lLldpWR5TGKdtUDLVDYUi953PayLhE51cGP4PF7k/m9RZL7y1b1; 25:Aud5c9F/czszDnCMaO5OL4l8MQHmX9sBKKpjhZeN8W7lENYDyxPSGAK3BIxVRyLSy1HUN/wSRqdskamCxmtg9E7Ya/ULQ2Bg6gOjYfE9EO73nkXDwHA9UKwTXBNhEuxq9Q9chDZfAaHwoTEuPHCIl4g1q9kPQtAlr+/MbOISvjkhE9DCvkl4RP5U8qeH0tX9w/obm+QvtOVcc9FQTOUptzP7MYlgTpJlXT6dNhrLhdfoU0PMCVujh9bJPce3hcKhr75LJSUs1X2qHhr/H8tN+w8PXjWSpw3Wou6Q6OU/pWpoIhkC8fXugWjus5V4bPN0rxy4STpsVxmvbFa0lCYQ8jyU+di8YeLVTJrYaGL8mdM=; 31:rRSWvae3pEgl6TkN51pn28ZFn6wyy3ti+HMfuBm/H18QZZCKzHxshWlIDqzuYfE8k3mTtixzGkJq533+bHnWMoltCY2+AghGysTwBEIODXP+mlSzpj8gEdMfhwdKQOAj/ZyrUHJuxvy8CRnimxXo3q/XbWY3VSs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bp X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231023)(93006095)(6041248)(20161123560025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(6072148)(201708071742011); SRVR:CO2PR07MB2519; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CO2PR07MB2519; X-Forefront-PRVS: 0523CF0711 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(396003)(376002)(39860400002)(346002)(199004)(189003)(13464003)(316002)(55016002)(6916009)(478600001)(81166006)(53936002)(52146003)(6246003)(66066001)(81156014)(42882006)(229853002)(6666003)(1076002)(16526018)(2870700001)(23676004)(9686003)(83506002)(58126008)(2906002)(72206003)(4326008)(8936002)(2950100002)(68736007)(3846002)(50466002)(25786009)(105586002)(305945005)(6496006)(33716001)(7736002)(33656002)(39060400002)(106356001)(5009440100003)(8676002)(47776003)(5890100001)(52116002)(6116002)(59450400001)(33896004)(76176011)(5660300001)(97736004)(386003)(2486003)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB2519; H:jerin; 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: =?utf-8?B?MTtDTzJQUjA3TUIyNTE5OzIzOmt5UzNNbjBIMEh2b0J1dHEvUFFwblkvU2Ra?= =?utf-8?B?YWNETTVON1N2OVNuQ2pRR1ZJY09wSjF6a25pUEs0eXY1S0FDTWFnRDhrcDQ3?= =?utf-8?B?bzZKMy9zS2hqRk9JMm9GS29ocDRtS2hkYndSaFcxL2ZTbE1kUmxmQ3BKMWlG?= =?utf-8?B?cWRmd1lZS1plS0pyTmhZY295SEo2Sk5rVXJYUi9pVWJ2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e+XjquSvpDIrx3R6Qo7+lsUjrPnTIdmvmVMi4QcEy6oR0jNESy57fSxZGuFiz7BzchHjU/AYtpFjD9QKrKYNY4oIDijOkVnMXlegmz050VnmRhthlH7NtwbNMbn2MwYRe0fFxNvY2YPGnE+vHcPTubAj5sS7NXmUk+IlSA36waE3/r6wedZiy2YERhVQBR1BU5XQHWv2q3m0lWZUuh+/mrPP6WZVjCn57+AEjUcvmwCrCevNNqq+2yw5g+g5mCWPqpM8j3QHgD2jViE24vWLuovWWmEr+M=; 5:K14tjKlq2oOTbF9FeTCBx/zp7XlCpmQg4MBFdnKj1y0cr6UtqXcXJdeOfVjH7mJ4GTdTOtlt+3lDt1F7PUdOh1/sTpSTQ4qWOxPqtQdip094VN1DVapsDmjzGdtLsX5kUL3PdcOht7ZPO9OqGanpODjL58UPCo7hVN3HfdqGAP0=; 24:uStrY4Ruc7KUx3cXH/ry1DMg12fYAwHXNBd/JHLE7Kux/p0SAserymBtbLThM3Zq7K1EVSYznqnd1TutdN3YTrtu12tVHubg+iBcz5qGObQ=; 7:mcMr/eT/jFVU5+ZqEDgcTtnkgH9dZmh9wJLYV09nORq6yNCtX+VtY6RQ2btMrwUDePuyx72Vneem2AHYcwRfuUbOGfUCZxxO5lQDExUyDeKO92F4irqFM+ejybzQjgR7OU59/LwbtUSwmJ9YGFZAzlahGHUmAXNEPvaQS7YqCH9nPlBm+vyHIcdHeJ7TcHEL+QJFgK11krgpqcPc7RFrpq6olCkaAEoAJH/QWOwA13PFyWz3uVfEd7HeUjcQFuXR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Dec 2017 10:14:50.9375 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc9c1f79-0c4b-457c-8e42-08d5446dd962 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2519 Subject: Re: [dpdk-dev] [PATCH v2 1/8] event/opdl: add the opdl ring infrastructure library 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: Sat, 16 Dec 2017 10:14:57 -0000 -----Original Message----- > Date: Fri, 15 Dec 2017 11:26:22 +0000 > From: Liang Ma > To: jerin.jacob@caviumnetworks.com > CC: dev@dpdk.org, harry.van.haaren@intel.com, bruce.richardson@intel.com, > deepak.k.jain@intel.com, john.geary@intel.com, peter.mccarthy@intel.com, > seanbh@gmail.com > Subject: [PATCH v2 1/8] event/opdl: add the opdl ring infrastructure > library > X-Mailer: git-send-email 2.7.5 > > OPDL ring is the core infrastructure of OPDL PMD. OPDL ring library > provide the core data structure and core helper function set. The Ring > implements a single ring multi-port/stage pipelined packet distribution > mechanism. This mechanism has the following characteristics: > > • No multiple queue cost, therefore, latency is significant reduced. > • Fixed dependencies between queue/ports is more suitable for complex. > fixed pipelines of stateless packet processing (static pipeline). > • Has decentralized distribution (no scheduling core). > • Packets remain in order (no reorder core(s)). > > Signed-off-by: Liang Ma > Signed-off-by: Peter, Mccarthy 1) Invalid Signed-off-by format. "," after first name. 2) There are some compilation issues with series /export/dpdk-next-eventdev/drivers/event/opdl/opdl_evdev_init.c: In function ‘create_queues_and_rings’: /export/dpdk-next-eventdev/drivers/event/opdl/opdl_evdev_init.c:570:17: error: ‘%s’ directive writing up to 63 bytes into a region of size 32 [-Werror=format-overflow=] sprintf(name, "%s_%u", device->service_name, device->nb_opdls); ^~ /export/dpdk-next-eventdev/drivers/event/opdl/opdl_evdev_init.c:570:2: note: ‘sprintf’ output between 3 and 75 bytes into a destination of size 32 sprintf(name, "%s_%u", device->service_name, device->nb_opdls); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /export/dpdk-next-eventdev/drivers/event/opdl/opdl_evdev_init.c:570:17: error: ‘%s’ directive writing up to 63 bytes into a region of size 32 [-Werror=format-overflow=] sprintf(name, "%s_%u", device->service_name, device->nb_opdls); ^~ /export/dpdk-next-eventdev/drivers/event/opdl/opdl_evdev_init.c:570:2: note: ‘sprintf’ output between 3 and 75 bytes into a destination of size 32 sprintf(name, "%s_%u", device->service_name, device->nb_opdls); 3) Please rebase to next-eventdev tree. Gage already added a new capability flag > --- > + > +# library name > +LIB = librte_pmd_opdl_event.a > + > +# build flags > +CFLAGS += -O3 > +CFLAGS += $(WERROR_FLAGS) > +# for older GCC versions, allow us to initialize an event using > +# designated initializers. > +ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) > +ifeq ($(shell test $(GCC_VERSION) -le 50 && echo 1), 1) > +CFLAGS += -Wno-missing-field-initializers > +endif > +endif > + > +LDLIBS += -lrte_eal -lrte_eventdev -lrte_kvargs -lrte_ring Does it have -lrte_ring dependency? > +LDLIBS += -lrte_bus_vdev -lrte_mbuf -lrte_mempool > + > +# library version > +LIBABIVER := 1 > + > +# versioning export map > +EXPORT_MAP := rte_pmd_evdev_opdl_version.map > + > +# library source files > +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OPDL_EVENTDEV) += opdl_evdev.c > +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OPDL_EVENTDEV) += opdl_evdev_init.c > +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OPDL_EVENTDEV) += opdl_ring.c > +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OPDL_EVENTDEV) += opdl_evdev_xstats.c > +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OPDL_EVENTDEV) += opdl_test.c Each patch should be build able, Add the files when you really add the source code. > + > +# export include files > +SYMLINK-y-include += > + > +include $(RTE_SDK)/mk/rte.lib.mk > diff --git a/drivers/event/opdl/opdl_ring.c b/drivers/event/opdl/opdl_ring.c > new file mode 100644 > index 0000000..5120fbe > --- /dev/null > +++ b/drivers/event/opdl/opdl_ring.c > @@ -0,0 +1,1232 @@ > +/*- > + * ?? > + */ > + > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "opdl_ring.h" > + > +#define LIB_NAME "opdl_ring" > + > +#define OPDL_NAME_SIZE 64 > + > +#define RTE_LOGTYPE_OPDL RTE_LOGTYPE_USER8 > +#define log(level, fmt, ...) \ > + RTE_LOG(level, OPDL, LIB_NAME": " fmt "\n", ##__VA_ARGS__) > + > +#ifdef OPDL_DEBUG > +#define log_debug(...) log(DEBUG, __VA_ARGS__) > +#else > +#define log_debug(...) > +#endif For new PMDs, Use dynamic logging > + > +#define POWER_OF_2(n) ((n) && !((n) & ((n) - 1))) I guess, it is available as standard DPDK macro in common area. If not, create new one. > + > +#define RTE_EVENT_MASK (0xFFFF0000000FFFFFULL) Please don't use RTE_ for PMD specific marcos. > + > +/* Types of dependency between stages */ > +enum dep_type { > + DEP_NONE = 0, /* no dependency */ > + DEP_DIRECT, /* stage has direct dependency */ > + DEP_INDIRECT, /* in-direct dependency through other stage(s) */ > + DEP_SELF, /* stage dependency on itself, used to detect loops */ > +}; > + > +/* Shared section of stage state. > + * Care is needed when accessing and the layout is important, especially to > + * limit the adjacent cache-line HW prefetcher from impacting performance. > + */ > +struct shared_state { > + /* Last known minimum sequence number of dependencies, used for multi > + * thread operation > + */ > + uint32_t available_seq; > + char _pad1[RTE_CACHE_LINE_SIZE * 3]; > + uint32_t head; /* Head sequence number (for multi thread operation) */ > + char _pad2[RTE_CACHE_LINE_SIZE * 3]; > + struct opdl_stage *stage; /* back pointer */ > + uint32_t tail; /* Tail sequence number */ > + char _pad3[RTE_CACHE_LINE_SIZE * 2]; > +} __rte_cache_aligned; > + > +/* A structure to keep track of "unfinished" claims. This is only used for > + * stages that are threadsafe. Each lcore accesses its own instance of this > + * structure to record the entries it has claimed. This allows one lcore to make > + * multiple claims without being blocked by another. When disclaiming it moves > + * forward the shared tail when the shared tail matches the tail value recorded > + * here. > + */ > +struct claim_manager { > + uint32_t num_to_disclaim; > + uint32_t num_claimed; > + uint32_t mgr_head; > + uint32_t mgr_tail; > + struct { > + uint32_t head; > + uint32_t tail; > + } claims[OPDL_DISCLAIMS_PER_LCORE]; > +} __rte_cache_aligned; > + > +/* Context for each stage of opdl_ring. > + * Calculations on sequence numbers need to be done with other uint32_t values > + * so that results are modulus 2^32, and not undefined. > + */ > +struct opdl_stage { > + struct opdl_ring *t; /* back pointer, set at init */ > + uint32_t num_slots; /* Number of slots for entries, set at init */ > + uint32_t index; /* ID for this stage, set at init */ > + bool threadsafe; /* Set to 1 if this stage supports threadsafe use */ > + /* Last known min seq number of dependencies for used for single thread > + * operation > + */ > + uint32_t available_seq; > + uint32_t head; /* Current head for single-thread operation */ > + uint32_t shadow_head; /* Shadow head for single-thread operation */ > + uint32_t nb_instance; /* Number of instances */ > + uint32_t instance_id; /* ID of this stage instance */ > + uint16_t num_claimed; /* Number of slots claimed */ > + uint16_t num_event; /* Number of events */ > + uint32_t seq; /* sequence number */ > + uint32_t num_deps; /* Number of direct dependencies */ > + /* Keep track of all dependencies, used during init only */ > + enum dep_type *dep_tracking; > + /* Direct dependencies of this stage */ > + struct shared_state **deps; > + /* Other stages read this! */ > + struct shared_state shared __rte_cache_aligned; > + /* For managing disclaims in multi-threaded processing stages */ > + struct claim_manager pending_disclaims[RTE_MAX_LCORE] > + __rte_cache_aligned; > +} __rte_cache_aligned; > + > +/* Context for opdl_ring */ > +struct opdl_ring { > + char name[OPDL_NAME_SIZE]; /* OPDL queue instance name */ > + int socket; /* NUMA socket that memory is allocated on */ > + uint32_t num_slots; /* Number of slots for entries */ > + uint32_t mask; /* Mask for sequence numbers (num_slots - 1) */ > + uint32_t slot_size; /* Size of each slot in bytes */ > + uint32_t num_stages; /* Number of stages that have been added */ > + uint32_t max_num_stages; /* Max number of stages */ > + /* Stages indexed by ID */ > + struct opdl_stage *stages; > + /* Memory for storing slot data */ > + uint8_t slots[0] __rte_cache_aligned; > +}; > + > + > +/* Return input stage of a opdl_ring */ > +static inline struct opdl_stage *__attribute__((always_inline)) Change to __rte_always_inline everywhere in the driver. > +input_stage(const struct opdl_ring *t) > +{ > + return &t->stages[0]; > +} > + > +} > + > +/* Move head atomically, returning number of entries available to process and > + * the original value of head. For non-input stages, the claim is recorded > + * so that the tail can be updated later by opdl_stage_disclaim(). > + */ > +static inline void __attribute__((always_inline)) > +move_head_atomically(struct opdl_stage *s, uint32_t *num_entries, > + uint32_t *old_head, bool block, bool claim_func) > +{ > + uint32_t orig_num_entries = *num_entries; > + uint32_t ret; > + struct claim_manager *disclaims = &s->pending_disclaims[rte_lcore_id()]; > + > + /* Attempt to disclaim any outstanding claims */ > + opdl_stage_disclaim_multithread_n(s, disclaims->num_to_disclaim, > + false); > + > + *old_head = __atomic_load_n(&s->shared.head, __ATOMIC_ACQUIRE); I guess __atomic introduced after gcc 4.7. Make sure the PMD does not build if __atomic_* not available. See CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD file in mk/toolchain/icc/rte.toolchain-compat.mk > diff --git a/drivers/event/opdl/opdl_ring.h b/drivers/event/opdl/opdl_ring.h > new file mode 100644 > index 0000000..cc37bd1 > --- /dev/null > +++ b/drivers/event/opdl/opdl_ring.h > @@ -0,0 +1,601 @@ > +/*-te > + * > + * ?? > + */ > + > +#ifndef _OPDL_H_ > +#define _OPDL_H_ > + > +/** > + * @file > + * The "opdl_ring" is a data structure that contains a fixed number of slots, > + * with each slot having the same, but configurable, size. Entries are input > + * into the opdl_ring by copying into available slots. Once in the opdl_ring, > + * an entry is processed by a number of stages, with the ordering of stage > + * processing controlled by making stages dependent on one or more other stages. > + * An entry is not available for a stage to process until it has been processed > + * by that stages dependencies. Entries are always made available for > + * processing in the same order that they were input in to the opdl_ring. > + * Inputting is considered as a stage that depends on all other stages, > + * and is also a dependency of all stages. > + * > + * Inputting and processing in a stage can support multi-threading. Note that > + * multi-thread processing can also be done by making stages co-operate e.g. two > + * stages where one processes the even packets and the other processes odd > + * packets. > + * > + * A opdl_ring can be used as the basis for pipeline based applications. Instead > + * of each stage in a pipeline dequeueing from a ring, processing and enqueueing > + * to another ring, it can process entries in-place on the ring. If stages do > + * not depend on each other, they can run in parallel. > + * > + * The opdl_ring works with entries of configurable size, these could be > + * pointers to mbufs, pointers to mbufs with application specific meta-data, > + * tasks etc. > + */ > + > +#include > +#include > +#include > + > +#include > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +#ifndef OPDL_DISCLAIMS_PER_LCORE Move this configuration to base/config or even better to expose as devargs > +/** Multi-threaded processing allows one thread to process multiple batches in a > + * stage, while another thread is processing a single large batch. This number > + * controls how many non-contiguous batches one stage can process before being > + * blocked by the other stage. > + */ > +#define OPDL_DISCLAIMS_PER_LCORE 8 > +#endif > + > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* _OPDL_H_ */ > diff --git a/drivers/event/opdl/rte_pmd_evdev_opdl_version.map b/drivers/event/opdl/rte_pmd_evdev_opdl_version.map > new file mode 100644 > index 0000000..5352e7e > --- /dev/null > +++ b/drivers/event/opdl/rte_pmd_evdev_opdl_version.map > @@ -0,0 +1,3 @@ > +DPDK_17.05 { DPDK_18.02 > + local: *; > +}; > -- > 2.7.5 > > -------------------------------------------------------------- > Intel Research and Development Ireland Limited > Registered in Ireland > Registered Office: Collinstown Industrial Park, Leixlip, County Kildare > Registered Number: 308263 > > > This e-mail and any attachments may contain confidential material for the sole > use of the intended recipient(s). Any review or distribution by others is > strictly prohibited. If you are not the intended recipient, please contact the > sender and delete all copies. Remove such notice from public mailing lists.