From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 853F6A0559;
	Sun, 15 Mar 2020 11:05:58 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id A7FED25D9;
	Sun, 15 Mar 2020 11:05:57 +0100 (CET)
Received: from EUR04-DB3-obe.outbound.protection.outlook.com
 (mail-eopbgr60083.outbound.protection.outlook.com [40.107.6.83])
 by dpdk.org (Postfix) with ESMTP id 8FFF83B5
 for <dev@dpdk.org>; Sun, 15 Mar 2020 11:05:55 +0100 (CET)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=Ej5DD6mUnSZJzc0NmztkNPEYFjbdt7xovE87jKmU461z0uosohaolKhG6O4pKJ/7lAdZIf4lJ7roTmxXG1GuMAQIwebWRMJZS5/r/al+Eisvq5Kav2Cncn9xa0zOdYIDtrgs5HhKReW/x5PGsTgyzTn1IgPnvTXuyu9WiIEXU2YEyRLJi9YS0GHgDLyQT225xTOxz4kAPY39CiGP/gNFgfziEWxOyASD8MS1P/axpJ+Wb4Ph8Cn4Fkb01OFHSzJvJtCn8aMshMyHd37zKEVrQrm/ulFFmaYK3w8Da8ZLzNeA1g/5OVaywgaBlrhOZX/B0tYL+Re/ShyY1wuvuI5mWQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ueIzQCX31S8jQvLzVN3UNKWp61lVjiMzI3HsB0BH69g=;
 b=hr2kh1dgZTc6OmuvnDrC/a727xPAVhAnk1jjAnUbxGDNUVY0H0wjppQmPIJjTgh8zcktW0zjcukR1Rcnmaa5nuBVqr9i5jJTpwArB/KD1Iac/yaWA+Uk2mcajEK+cqP0QDzrYXHPdV3zEoelltXo7Xtp7FHGb9vJ659S9RlTmrNHeyd5VkGjvQcb0MxZZeIx/gfhHFa6HjHv30NLAGhMt7l87xfE/suUE+R1+UeC/HFWH3SjF9r7+8BdL2CR5fElhll0OiFKSb6Xj335F7sY6lVeNE4VmPA/XXRl5cJDSLucJQCcMvD/CRP1dz7jHJXTA2V5sThf65mvF4lE+wld4w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com;
 dkim=pass header.d=mellanox.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ueIzQCX31S8jQvLzVN3UNKWp61lVjiMzI3HsB0BH69g=;
 b=BVw0uSpOrmpcG79QXNL4RxRw1lwc2tEdxjrceH37XbzlH6Ab0EHgA8GYC15XRul/xMpxaTZ4E7yPOU663RQ5StmBtbmaMVy5X8NUp5P75GH8a6cId7LuIhQbhXukyQ1CES0BQatSGiHCsRL91k+HaGXabmGdhNzMMirj68NuyAw=
Received: from AM0PR05MB5172.eurprd05.prod.outlook.com (20.178.19.10) by
 AM0PR05MB6724.eurprd05.prod.outlook.com (10.186.175.14) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.2814.18; Sun, 15 Mar 2020 10:05:54 +0000
Received: from AM0PR05MB5172.eurprd05.prod.outlook.com
 ([fe80::5d2a:1894:58f4:afbf]) by AM0PR05MB5172.eurprd05.prod.outlook.com
 ([fe80::5d2a:1894:58f4:afbf%3]) with mapi id 15.20.2814.016; Sun, 15 Mar 2020
 10:05:54 +0000
From: Ori Kam <orika@mellanox.com>
To: Wang Xiang <xiang.w.wang@intel.com>
CC: "jerinj@marvell.com" <jerinj@marvell.com>, "dev@dpdk.org" <dev@dpdk.org>, 
 "pbhagavatula@marvell.com" <pbhagavatula@marvell.com>, Shahaf Shuler
 <shahafs@mellanox.com>, "hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>,
 Opher Reviv <opher@mellanox.com>, Alex Rosenbaum <alexr@mellanox.com>,
 "dovrat@marvell.com" <dovrat@marvell.com>, "pkapoor@marvell.com"
 <pkapoor@marvell.com>, "nipun.gupta@nxp.com" <nipun.gupta@nxp.com>,
 "bruce.richardson@intel.com" <bruce.richardson@intel.com>,
 "yang.a.hong@intel.com" <yang.a.hong@intel.com>, "harry.chang@intel.com"
 <harry.chang@intel.com>, "gu.jian1@zte.com.cn" <gu.jian1@zte.com.cn>,
 "shanjiangh@chinatelecom.cn" <shanjiangh@chinatelecom.cn>,
 "zhangy.yun@chinatelecom.cn" <zhangy.yun@chinatelecom.cn>,
 "lixingfu@huachentel.com" <lixingfu@huachentel.com>, "wushuai@inspur.com"
 <wushuai@inspur.com>, "yuyingxia@yxlink.com" <yuyingxia@yxlink.com>,
 "fanchenggang@sunyainfo.com" <fanchenggang@sunyainfo.com>,
 "davidfgao@tencent.com" <davidfgao@tencent.com>, "liuzhong1@chinaunicom.cn"
 <liuzhong1@chinaunicom.cn>, "zhaoyong11@huawei.com" <zhaoyong11@huawei.com>,
 "oc@yunify.com" <oc@yunify.com>, "jim@netgate.com" <jim@netgate.com>,
 "hongjun.ni@intel.com" <hongjun.ni@intel.com>, "j.bromhead@titan-ic.com"
 <j.bromhead@titan-ic.com>, "deri@ntop.org" <deri@ntop.org>, "fc@napatech.com"
 <fc@napatech.com>, "arthur.su@lionic.com" <arthur.su@lionic.com>, Thomas
 Monjalon <thomas@monjalon.net>
Thread-Topic: [RFC v6] regexdev: introduce regexdev subsystem
Thread-Index: AQHV+NWNYfm2dVQnR0mFBaqxQW35zqhJXPxQ
Date: Sun, 15 Mar 2020 10:05:53 +0000
Message-ID: <AM0PR05MB51721F1C1A9C25E6CEC01AA1DBF80@AM0PR05MB5172.eurprd05.prod.outlook.com>
References: <20190627155036.56940-1-jerinj@marvell.com>
 <1583836353-42867-1-git-send-email-orika@mellanox.com>
 <20200313012027.GA25215@hyperscan>
In-Reply-To: <20200313012027.GA25215@hyperscan>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
authentication-results: spf=none (sender IP is )
 smtp.mailfrom=orika@mellanox.com; 
x-originating-ip: [185.175.35.255]
x-ms-publictraffictype: Email
x-ms-office365-filtering-ht: Tenant
x-ms-office365-filtering-correlation-id: 2f26cd4d-9143-4972-55fe-08d7c8c872d8
x-ms-traffictypediagnostic: AM0PR05MB6724:|AM0PR05MB6724:
x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <AM0PR05MB67242A1F7C03352997FB643DDBF80@AM0PR05MB6724.eurprd05.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:8882;
x-forefront-prvs: 0343AC1D30
x-forefront-antispam-report: SFV:NSPM;
 SFS:(10009020)(4636009)(366004)(346002)(396003)(39860400002)(136003)(376002)(199004)(71200400001)(55016002)(9686003)(6916009)(86362001)(26005)(2906002)(81156014)(8936002)(33656002)(81166006)(4326008)(6506007)(7696005)(53546011)(76116006)(52536014)(5660300002)(478600001)(7416002)(8676002)(186003)(54906003)(316002)(66476007)(66446008)(64756008)(66946007)(66556008);
 DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB6724;
 H:AM0PR05MB5172.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en;
 PTR:InfoNoRecords; A:1; 
received-spf: None (protection.outlook.com: mellanox.com does not designate
 permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: JbHbUYIPo6G+LpAhlMoB0jgG673cerbpryo3eQt70l9OrpyflLb0pVEj4Lh4ivR7xqX84mQw1dvIJWno5bqryX7aWDmV1RfuEP7Y2Hw1JVshLN0Yh0iVOX6oMopATaYfkeNVW4vkr2B/4pBmNeqta6Jg580EhSdab7DYeh0/A1uGxMIQFmdMyIqefx/BqmX2xVw7Ut/Brs2xCrITJlMYZCVfRB30IniTua8/6BPMAOzvYziXUPMs28aSkIoJr9kR+FXRq+EcOdMI8qUo9Zf7bLZaGu3X1zn7gUgyDLlMqvuqmrzq3n2nwRUUMYJAmXNFW63lwhWoe8vumStk8gSw1TslfBTQq28CMJGPdNrvDLJ79Pfj68imYMGt7izG+Vl1cztLSujS95kxsqSCNqNz7EYhplmDZv1VwGtLIGwPkBJjfB4uTw3LaMYhtVdQJMDl
x-ms-exchange-antispam-messagedata: j0JL8pnTpHXe/MQv4/3I9g2wFiwqYG/6fHQ30e1Hr1waOjKCdiYf0tBT91ILvuDcfg3n4QNvRKYZtJYr5tE0SzjiNJMtF+V7WGbMUp4h2zQKDKhZghfzQAW0uHKuUdGAVDAEEKfcp3ASEmb73XU5/g==
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: Mellanox.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2f26cd4d-9143-4972-55fe-08d7c8c872d8
X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Mar 2020 10:05:54.0120 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: xqf6kKseS1ljU5oe0EiMcWPoghE5fMOb43QQdTKJsCIboEtPmHeAwKRXnZ9FDz7rdcKee6/WbRUxyPLa9PL2qw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6724
Subject: Re: [dpdk-dev] [RFC v6] regexdev: introduce regexdev subsystem
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Hi Xiang,


> -----Original Message-----
> From: Wang Xiang <xiang.w.wang@intel.com>
> Sent: Friday, March 13, 2020 3:20 AM
> To: Ori Kam <orika@mellanox.com>
> Cc: jerinj@marvell.com; dev@dpdk.org; pbhagavatula@marvell.com; Shahaf
> Shuler <shahafs@mellanox.com>; hemant.agrawal@nxp.com; Opher Reviv
> <opher@mellanox.com>; Alex Rosenbaum <alexr@mellanox.com>;
> dovrat@marvell.com; pkapoor@marvell.com; 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
> <thomas@monjalon.net>
> Subject: Re: [RFC v6] regexdev: introduce regexdev subsystem
>=20
> Hi Ori,
>=20
> Sorry for the late response as I am occupied by other works.
> Two comments below to make the definitions compatible to Hyperscan.
>=20
> Thanks,
> Xiang
>=20
> On Tue, Mar 10, 2020 at 10:32:33AM +0000, Ori Kam wrote:
> > +#define RTE_REGEX_PCRE_RULE_MATCH_ALL_F (1ULL << 13)
> > +/**< This flag marks that the results for the pattern that is being co=
mpiled
> > + * should include all possible matches.
> > + * @see struct rte_regex_dev_info::rule_flags, struct
> rte_regex_rule::rule_flags
> > + */
> > +
> Can we change this flag to RTE_REGEX_DEV_CFG_MATCH_ALL since Hyperscan
> only supports
> match all mode and users don't have to specify this flag per rule?
>

Sure, we can replace the RTE_REGEX_PCRE_RULE_MATCH_ALL_F with=20
RTE_REGEX_DEV_CFG_MATCH_ALL, and add RTE_REGEX_DEV_CAPA_SUPP_MATCH_ALL

=20
> > + */
> > +__rte_experimental
> > +int
> > +rte_regex_dev_info_get(uint8_t dev_id, struct rte_regex_dev_info
> *dev_info);
> > +
> > +/* Enumerates RegEx device configuration flags */
> > +#define RTE_REGEX_DEV_CFG_CROSS_BUFFER_SCAN_F (1ULL << 0)
> > +/**< Cross buffer scan refers to the ability to be able to detect
> > + * matches that occur across buffer boundaries, where the buffers are
> related
> > + * to each other in some way. Enable this flag when to scan payload si=
ze
> > + * greater than struct rte_regex_dev_info::max_payload_size and/or
> > + * matches can present across scan buffer boundaries.
> > + *
> > + * @see struct rte_regex_dev_info::max_payload_size
> > + * @see struct rte_regex_dev_config::dev_cfg_flags,
> rte_regex_dev_configure()
> > + * @see RTE_REGEX_OPS_RSP_PMI_SOJ_F
> > + * @see RTE_REGEX_OPS_RSP_PMI_EOJ_F
> > + * @see RTE_REGEX_OPS_RSP_PMI_TOJ_F
> > + */
> > +
> Can we add another flag
> RTE_REGEX_DEV_CFG_CROSS_BUFFER_SCAN_FULL_F? In this case,
> we only return full match for cross buffer scan without any partial resul=
t and
> without returning response flags such as RTE_REGEX_OPS_RSP_PMI_*.

I think that it is good in any case to return a flag if the detection was b=
ased on=20
more than one buffer.
So I don't really see the advantage of adding such a flag.
As far as I understand in your case if the match started in previous buffer=
 and ended=20
in the current buffer then you will return also the flag of RTE_REGEX_OPS_R=
SP_PMI_TOJ_F
For my general knowledge, in your system if we have the following regex: AB=
C
In the first buffer we have xxxA size 4 and the second buffer is BCxx
If I understand correctly for first buffer you will return no match found.
For the second buffer you will return found and end offset will be equal to=
  2
Am I correct?
Or you are going to return end offset 6 because it started from the previou=
s buffer?=20


Best,
Ori