DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wang Xiang <xiang.w.wang@intel.com>
To: Ori Kam <orika@mellanox.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>
Subject: Re: [dpdk-dev] [RFC v6] regexdev: introduce regexdev subsystem
Date: Mon, 16 Mar 2020 16:48:23 -0400	[thread overview]
Message-ID: <20200316204823.GA16186@hs1> (raw)
In-Reply-To: <AM6PR05MB5176021F8CA8D4876A4857B7DBF90@AM6PR05MB5176.eurprd05.prod.outlook.com>

Hi Ori,

On Mon, Mar 16, 2020 at 09:09:06AM +0000, Ori Kam wrote:
> Hi Xiang,
> 
> > -----Original Message-----
> > From: Wang Xiang <xiang.w.wang@intel.com>
> > Sent: Monday, March 16, 2020 3:26 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
> > 
> > On Sun, Mar 15, 2020 at 10:05:53AM +0000, Ori Kam wrote:
> > Hi Ori,
> > 
> > > 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
> > > >
> > > > Hi Ori,
> > > >
> > > > Sorry for the late response as I am occupied by other works.
> > > > Two comments below to make the definitions compatible to Hyperscan.
> > > >
> > > > Thanks,
> > > > Xiang
> > > >
> > > > 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
> > compiled
> > > > > + * 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
> > > RTE_REGEX_DEV_CFG_MATCH_ALL, and add
> > RTE_REGEX_DEV_CAPA_SUPP_MATCH_ALL
> > >
> > Ack, thanks.
> > >
> > > > > + */
> > > > > +__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 size
> > > > > + * 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 result
> > 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 based on
> > > 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
> > > in the current buffer then you will return also the flag of
> > RTE_REGEX_OPS_RSP_PMI_TOJ_F
> > > For my general knowledge, in your system if we have the following regex:
> > ABC
> > > 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 previous
> > buffer?
> > >
> > Hyperscan guarantees the same matching result regardless of the data is in a
> > single
> > block or scattered to multiple blocks. So we'll return end offset 6 in this case
> > without giving any flag indicating whether the match is started in previous
> > buffer
> > or current buffer.
> 
> What will happen if the match was only in the second buffer? For example
> Like before the regex is ABC but now the first buffer is xxxx and the second buffer
> is ABCx will the result be end offset 3 or 7?
> If the answer is 3 than I think the flag is important, in order to let the user know
> that he should count from previous buffer.
> If the answer is 7, since only Hyperscan works with end offset if could be defined
> that when working with end offset and cross buffer scan is supported then the
> result is always true result.
> 
> So I think that RTE_REGEX_DEV_CFG_CROSS_BUFFER_SCAN_FULL_F is not relevant in any
> case but the flag should be used if the offset returned is 3.
>
Hyperscan returns 7 in this case, so these flags aren't necessary. 

Hyperscan works in two modes:
1) return start and end offset
2) return end offset

Since only Hyperscan supports RTE_REGEX_DEV_CFG_MATCH_ALL, we can define
the result always true if match all and cross buffer scan are
configured. Having the scan full flag will make users better aware of
the difference from HW solutions. If you really don't want keep this flag, 
please make this definition clear to users.
> 
> In other related question, how do Hyperscan marks that 2 buffers should be treated as one?
> I think you are missing the cross_buf_id that was introduced in V3 but was removed due to 
> lack of usage. This variable was designed to be used in order to let the RegEx engine a place
> to save the engine state.
>
I agree, we need to have the cross_buf_id back to support cross buffer
scan.
> > >
> > > Best,
> > > Ori
> > >
> > 
> > Best,
> > Xiang

Thanks,
Xiang

  reply	other threads:[~2020-03-16 13:32 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27 15:50 [dpdk-dev] [RFC PATCH v1] " jerinj
2019-07-15  4:26 ` Jerin Jacob Kollanukkaran
2019-08-15  9:35 ` Thomas Monjalon
2019-08-15 11:34   ` Thomas Monjalon
2019-08-19  3:09     ` Jerin Jacob Kollanukkaran
2019-08-20  1:54       ` Wang, Xiang W
2019-09-10  8:05         ` Jerin Jacob Kollanukkaran
2019-09-19 13:58           ` Wang Xiang
2019-09-27 14:35             ` Jerin Jacob Kollanukkaran
2019-10-14 13:59               ` Wang Xiang
2020-01-26 11:55                 ` Ori Kam
2019-08-21  5:32     ` Shahaf Shuler
2019-08-21 15:12       ` John Bromhead
2019-09-10 10:31       ` Jerin Jacob Kollanukkaran
2019-09-10 11:02       ` Jerin Jacob Kollanukkaran
2019-09-27 14:45         ` Jerin Jacob Kollanukkaran
2019-10-02  5:53           ` Shahaf Shuler
2019-10-02  8:31             ` Jerin Jacob Kollanukkaran
2019-10-02  8:52               ` Shahaf Shuler
2019-10-02  9:34                 ` Jerin Jacob Kollanukkaran
2020-01-27 21:19 ` [dpdk-dev] [PATCH v2] net/regexdev: " Ori Kam
2020-01-28  9:00 ` [dpdk-dev] [PATCH v3] regexdev: " Ori Kam
2020-02-22 16:52   ` Jerin Jacob
2020-02-23  8:41     ` Ori Kam
2020-02-23  9:53       ` Jerin Jacob
2020-02-23 12:33         ` Ori Kam
2020-02-25  5:57           ` Jerin Jacob
2020-02-25  7:48             ` Ori Kam
2020-02-26  9:03               ` Wang Xiang
2020-02-26  8:36                 ` Ori Kam
2020-02-27  9:25                   ` Wang Xiang
2020-02-27  7:31                     ` Ori Kam
2020-02-27  9:16                       ` Wang Xiang
2020-02-27 14:40 ` [dpdk-dev] [RFC v4] " Ori Kam
2020-02-27 14:55   ` Jerin Jacob
2020-02-27 15:08 ` [dpdk-dev] [RFC v5] " Ori Kam
2020-03-01  6:13   ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2020-03-01  7:31     ` Ori Kam
2020-03-01 13:23       ` Pavan Nikhilesh Bhagavatula
2020-03-01 14:10         ` Ori Kam
2020-03-01 14:38           ` Pavan Nikhilesh Bhagavatula
2020-03-01 15:41             ` Ori Kam
2020-03-01 15:57               ` Pavan Nikhilesh Bhagavatula
2020-03-02  7:18                 ` Jerin Jacob
2020-03-03  7:06                   ` Ori Kam
2020-03-02  7:05   ` [dpdk-dev] " Wang Xiang
2020-03-03  7:44     ` Ori Kam
2020-03-03  7:54       ` Jerin Jacob
2020-03-10 10:32 ` [dpdk-dev] [RFC v6] " Ori Kam
2020-03-10 13:42   ` Pavan Nikhilesh Bhagavatula
2020-03-10 16:23     ` Ori Kam
2020-03-10 16:36       ` Pavan Nikhilesh Bhagavatula
2020-03-10 17:00         ` Ori Kam
2020-03-12 12:13           ` Ori Kam
2020-03-13  1:20   ` Wang Xiang
2020-03-15 10:05     ` Ori Kam
2020-03-16  1:25       ` Wang Xiang
2020-03-16  9:09         ` Ori Kam
2020-03-16 20:48           ` Wang Xiang [this message]
2020-03-16 13:49             ` Ori Kam
2020-03-16 21:10               ` Wang Xiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200316204823.GA16186@hs1 \
    --to=xiang.w.wang@intel.com \
    --cc=alexr@mellanox.com \
    --cc=arthur.su@lionic.com \
    --cc=bruce.richardson@intel.com \
    --cc=davidfgao@tencent.com \
    --cc=deri@ntop.org \
    --cc=dev@dpdk.org \
    --cc=dovrat@marvell.com \
    --cc=fanchenggang@sunyainfo.com \
    --cc=fc@napatech.com \
    --cc=gu.jian1@zte.com.cn \
    --cc=harry.chang@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=hongjun.ni@intel.com \
    --cc=j.bromhead@titan-ic.com \
    --cc=jerinj@marvell.com \
    --cc=jim@netgate.com \
    --cc=liuzhong1@chinaunicom.cn \
    --cc=lixingfu@huachentel.com \
    --cc=nipun.gupta@nxp.com \
    --cc=oc@yunify.com \
    --cc=opher@mellanox.com \
    --cc=orika@mellanox.com \
    --cc=pbhagavatula@marvell.com \
    --cc=pkapoor@marvell.com \
    --cc=shahafs@mellanox.com \
    --cc=shanjiangh@chinatelecom.cn \
    --cc=thomas@monjalon.net \
    --cc=wushuai@inspur.com \
    --cc=yang.a.hong@intel.com \
    --cc=yuyingxia@yxlink.com \
    --cc=zhangy.yun@chinatelecom.cn \
    --cc=zhaoyong11@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).