From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D98EA0577; Tue, 7 Apr 2020 18:27:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E66562B96; Tue, 7 Apr 2020 18:27:45 +0200 (CEST) Received: from mail-il1-f193.google.com (mail-il1-f193.google.com [209.85.166.193]) by dpdk.org (Postfix) with ESMTP id 7A0F42B86 for ; Tue, 7 Apr 2020 18:27:44 +0200 (CEST) Received: by mail-il1-f193.google.com with SMTP id r5so3809668ilq.6 for ; Tue, 07 Apr 2020 09:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HsgQrAmIMmtUZyquYChmNmjz8X3N+x4U3ITVZfj/LOA=; b=XtB54YuQSOdKU0EBDx7UxzmWyZXrWlPmZEhXfxAyIYlODHBakwh09T0VgQvxja5KNt wmPHJMvVq074D59DDMln+lf4/Eysa3JNvn9z7YP82TR1sNwQRIrE7Cq9wx8bu26mfpCb TCedXV6Oh7Sf+HN711C/f15Z+B8kz8L34LCO2X721+Tx14nmFFB9QbMqzkHsGGSa+tmE A8OLj9MukpNZn1Pg1kX0YrPmPOdM65kO5ZP5IKP36ewXQviYnFowpwTcKRnZjEFc/6cL 6S05CanCqNar9Ulpl34lcouURxMhYmHrZWMW0TZNatc6byoOLgoUdGL3G/IfDLIgxMLW wsvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HsgQrAmIMmtUZyquYChmNmjz8X3N+x4U3ITVZfj/LOA=; b=Y5xVA61AJDjsJtKvcbI7HSQ5fNDWcLj4zNYLVu4piJDVMbMDzwqLZccp/4D57TVVJC 79LI07JN4o4kjxPDQDhIQPe3Kzw+rs06eKmL1/6EG1A3DkIP5Da1/VS4dWAxVly/SIAu Rh9rEAhK2S2oj5XWw/6p9PuRjCAreqxS/V5XsyGne4GrRseYmYX5kcBSZMnTZRGZRji5 m3bRXvqVhFVor8GKjeWx4fexo4ZThysEkhkT1vaT+EMhyYAN4GJaVYxppzP+KOyARPfM jtzCe2lht1sKAt/N2Sce/8HFIqAfCCB6qy4EDrnCN4eR3OJ8oW1Q1SB6gCVA/MJWHPmu pOqA== X-Gm-Message-State: AGi0Pua4wb110kKjHrlJP0RQno/GWhIa+CDJpobrEgZRmYAqKkY+6SsA 5qxQeQ7GTBKxb8CXYRNRctNiKacKpsEb/GWPLgo= X-Google-Smtp-Source: APiQypLY5SR0YGdbpvXA33XWqdiSJKTvol8hCYlfc9IZkqJCxYORuIgz+++LFc4HvuV10Q/zeSTfWw/yHXs4QqX8Rns= X-Received: by 2002:a92:a192:: with SMTP id b18mr2974671ill.294.1586276863770; Tue, 07 Apr 2020 09:27:43 -0700 (PDT) MIME-Version: 1.0 References: <1585464438-111285-1-git-send-email-orika@mellanox.com> <1585464438-111285-3-git-send-email-orika@mellanox.com> In-Reply-To: From: Jerin Jacob Date: Tue, 7 Apr 2020 21:57:27 +0530 Message-ID: To: Ori Kam Cc: Guy Kaneti , Jerin Jacob Kollanukkaran , "xiang.w.wang@intel.com" , "dev@dpdk.org" , Pavan Nikhilesh Bhagavatula , Shahaf Shuler , "hemant.agrawal@nxp.com" , Opher Reviv , Alex Rosenbaum , Dovrat Zifroni , Prasun Kapoor , "nipun.gupta@nxp.com" , "bruce.richardson@intel.com" , "yang.a.hong@intel.com" , "harry.chang@intel.com" , "gu.jian1@zte.com.cn" , "shanjiangh@chinatelecom.cn" , "zhangy.yun@chinatelecom.cn" , "lixingfu@huachentel.com" , "wushuai@inspur.com" , "yuyingxia@yxlink.com" , "fanchenggang@sunyainfo.com" , "davidfgao@tencent.com" , "liuzhong1@chinaunicom.cn" , "zhaoyong11@huawei.com" , "oc@yunify.com" , "jim@netgate.com" , "hongjun.ni@intel.com" , "j.bromhead@titan-ic.com" , "deri@ntop.org" , "fc@napatech.com" , "arthur.su@lionic.com" , Thomas Monjalon , Parav Pandit Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v1 2/4] regexdev: add regex core h file 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" On Tue, Apr 7, 2020 at 9:46 PM Ori Kam wrote: > Hi Guy, > > > -----Original Message----- > > From: dev On Behalf Of Guy Kaneti > > Sent: Tuesday, April 7, 2020 11:54 AM > > To: Ori Kam ; Jerin Jacob Kollanukkaran > > ; xiang.w.wang@intel.com > > Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula > > ; Shahaf Shuler ; > > hemant.agrawal@nxp.com; Opher Reviv ; Alex > > Rosenbaum ; Dovrat Zifroni ; > > Prasun Kapoor ; nipun.gupta@nxp.com; > > bruce.richardson@intel.com; yang.a.hong@intel.com; harry.chang@intel.co= m > ; > > gu.jian1@zte.com.cn; shanjiangh@chinatelecom.cn; > > zhangy.yun@chinatelecom.cn; lixingfu@huachentel.com; wushuai@inspur.com= ; > > yuyingxia@yxlink.com; fanchenggang@sunyainfo.com; > > davidfgao@tencent.com; liuzhong1@chinaunicom.cn; > > zhaoyong11@huawei.com; oc@yunify.com; jim@netgate.com; > > hongjun.ni@intel.com; j.bromhead@titan-ic.com; deri@ntop.org; > > fc@napatech.com; arthur.su@lionic.com; Thomas Monjalon > > ; Parav Pandit > > Subject: Re: [dpdk-dev] [PATCH v1 2/4] regexdev: add regex core h file > > > > > + > > > +/** > > > + * @internal > > > + * The generic data structure associated with each RegEx device. > > > + * > > > + * Pointers to burst-oriented packet receive and transmit functions > are > > > + * located at the beginning of the structure, along with the pointer > to > > > + * where all the data elements for the particular device are stored = in > > > +shared > > > + * memory. This split allows the function pointer and driver data to > be > > > +per- > > > + * process, while the actual configuration data for the device is > shared. > > > + */ > > > +struct rte_regexdev { > > > + regexdev_enqueue_t enqueue; > > > + regexdev_dequeue_t dequeue; > > > + const struct rte_regexdev_ops *dev_ops; > > > + /**< Functions exported by PMD */ > > > + struct rte_device *device; /**< Backing device */ } > > > +__rte_cache_aligned; > > > + > > > > What about a handle for the PMD private data such as > > struct rte_eventdev_data *data; > > /**< Pointer to device data */ > > > > struct rte_cryptodev_data *data; > > /**< Pointer to device data */ > > I was thinking about new approach. To use container of. > Meaning each PMD will create like normal its priv structure. > In this structure there will be a regex_dev member. > For example: > struct mlx5_regex_priv { > struct rte_regex_dev regex_dev; > The rte_regex_dev which has enqueue() and dequeue() function pointer should not be NOT allocated from hugepage as per process it will have different enqueue() and dequeue() function pointer value. Making it hugepage, another process overwrites it. > //private fields > ... > ... > } > On registration the PMD will give the rte_regexdev the reference to the > regex_dev. > The PMD will use container_of > > This approach hides the private data from the application, > saves malloc, a bit faster, and saves the use of references. > > So a better approach =F0=9F=98=8A also this approach is in use by the rte= _device. > > >