From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 12860A0C4D; Thu, 19 Aug 2021 18:08:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B7FEF4013F; Thu, 19 Aug 2021 18:08:58 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id E6AA94003D for ; Thu, 19 Aug 2021 18:08:56 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10081"; a="216623551" X-IronPort-AV: E=Sophos;i="5.84,335,1620716400"; d="scan'208";a="216623551" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Aug 2021 09:08:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,335,1620716400"; d="scan'208";a="532569121" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga002.fm.intel.com with ESMTP; 19 Aug 2021 09:08:54 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Thu, 19 Aug 2021 09:08:54 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Thu, 19 Aug 2021 09:08:54 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.108) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Thu, 19 Aug 2021 09:08:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nqDkhY3b9BnLGjaHU+rrZ0Mcmv2Be3TGN/J2/twGBL6P1atbIfExuW0WsPmCYXYQ9Pu8q/L5Bfx1hZY3KkG0BK5xMxogoMtRpvQMk2h2Fk/OmQJ9vqJrzYrB1z6W3PZfa2SGtiliAFM+5gN3WMuNfdkrKJN3L3mryCmGi9wJJRr4hkcWUw9EbWHETsHeLaxA0oDjEujqNngbDqYl9J+y3NWFl8B06N42WWfFf4Ss753Cursq+s6V4bxJX8yalyAro4P8/aopkWpsBPkx0pu+OMwV53P4Ks8rnNLCG01NPHT3CxqBAuJVpZ6qIfP2/j7ICNIrfaVSM5OvHpufq0vq2w== 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=kdHk27AY4YCUggC7TbqGhXDX3bZj9PpxpBI/PngP1yA=; b=VQk+RGVioaMxZ2O64wVVv3V3HSyJWIb/q+elDSXG+KUhS+3TkgZ3haL2rJdO5wnOyvhUPNt6gLjIgnO5Q/Z2mo0z/sP2wWOtcCtZ5uBjcNwiTYlemD9T8NniZChaNw2Xnes+9N/mYbQ2lBLIPaIA173dEG6Qtj11cGMOZuYp9ahJHyZKvigsMM2jvNWBcTt4gDjfmHE0dv0AjhcX5qndbhKuRvrNNbDbABnnoogy4mhJY1JZu6wMdWee4sJIaCw7sbne9a9D5YOAf46UKYoZpwsWyTVIgdkKWX5BucSCb/9aXGrXJZB6jK6i0uVFLXvXJ5Q4KAaqqhWYfw6eRLGbiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kdHk27AY4YCUggC7TbqGhXDX3bZj9PpxpBI/PngP1yA=; b=nxJT1ixHNAIzyeHvu3uKLsWCnbCY94wMuN8G8fYtqCNLr+Ox53mBtWEWXusoFryZnRvsWojhp52ecMD2MwXN4EdGg24sdSO3axJ+DjD62N6/5dEwmc0lP9joYnb/LiCnZp1iY9DXVBA8dmc7zMhsEnDZCDcx5gOs528Kab9qsWg= Received: from DM6PR11MB2890.namprd11.prod.outlook.com (2603:10b6:5:63::20) by DM8PR11MB5750.namprd11.prod.outlook.com (2603:10b6:8:11::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16; Thu, 19 Aug 2021 16:08:53 +0000 Received: from DM6PR11MB2890.namprd11.prod.outlook.com ([fe80::867:8350:9cce:66e0]) by DM6PR11MB2890.namprd11.prod.outlook.com ([fe80::867:8350:9cce:66e0%7]) with mapi id 15.20.4415.024; Thu, 19 Aug 2021 16:08:53 +0000 From: "Iremonger, Bernard" To: Sowmini Varadhan , "sowmini05@gmail.com" , "dev@dpdk.org" CC: "thomas@monjalon.net" Thread-Topic: [PATCH v2 1/2] examples/flow_classify: hooks for filters on tcp flags Thread-Index: AQHXlEH0j+JS4Zo7x0K0lCVkznpokKt6734w Date: Thu, 19 Aug 2021 16:08:53 +0000 Message-ID: References: <473f5de149a87eef20a916e0b164d03e4f5d9f53.1629287046.git.sovaradh@linux.microsoft.com> In-Reply-To: <473f5de149a87eef20a916e0b164d03e4f5d9f53.1629287046.git.sovaradh@linux.microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: linux.microsoft.com; dkim=none (message not signed) header.d=none;linux.microsoft.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6b4b6de8-4561-4330-6625-08d9632ba3c3 x-ms-traffictypediagnostic: DM8PR11MB5750: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: BOo26KXqIIVVTk7pvLXV0wpcGekwBObXyJZge4TgTAd9jk13ITkkt8/RWQeG1fQu+PGmPpWsIqESmYSbtV/f+3L8LNFgnY7xpsetD0DNJAa1hUOCFqC979bu6Vk/CiGt1+rr10Bl+na5LZ9udrWHXB8nCxZJNzWnxDmhKhQcOAmzZ7t7UkttGAVJ6Rvsrgy4d8uBG4sIDtaHTXuBuUpsHKs74ja3mDOC028eAjf88x0LuVwMA/NkKLfDNvsc+urVnACU8uOm9nTYGP3gJuKcHTzrg9TuAXGUwu0pGO0v3HVY0LyjSouIq0F1nLxJlZqw7ULsaWmrXV+EraS9IQ08TVUQVHLnJVyaUHWgvXfhYDnMwKD1Gwqfs+r89fmcqp594mOSiprvzKuUZXs9j0PtnTOg3rzzIDzHZftt4DUVpMM/VwZzuM0soQZb+yo8dnmItnvk6D21dYceRxLgvYb53rkrXxqfNBR8Uz22+KYoiwNmKQgAwP3JPZU35t9FMdZB/W9pqfjEVrrXPVs4RXHnW/jdnXvSxTIxwzFv/y30e4AJkJhaQL1JdEIT6VSS31E4hjM6IiOUWsPlKYC9/MuuY+TfzzPItKv/BRekf5xzqmWolRguXmKBJcnggjVWLKT6KC62hDebvTyB3YeyUIBhQk24HTkGmloYjwPmJ4aF+u2pnq3PMWs9kvRmcx5caXWgj1HjfHLfZ5OztteeWKMt7QeYC/W1IMckIDl6938Aau00DJfq0I4jqGc3LYJutQ9/7vhk8ycaQWgLua1c0L408/PLDOFlEZWRGvivKvy6XtyjO2ZUkwTZN2ih4GYoM/Fd x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB2890.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(110136005)(83380400001)(33656002)(66556008)(26005)(71200400001)(52536014)(2906002)(508600001)(6506007)(66946007)(186003)(86362001)(966005)(7696005)(38070700005)(76116006)(9686003)(316002)(66476007)(122000001)(8936002)(5660300002)(64756008)(55016002)(66446008)(8676002)(53546011)(38100700002)(4326008)(21314003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?E4Seo2zulYni09ImdxQO5MGqEmdA2yFf9M7+TM9LnAzaMOEcXxj5ZfXajLXq?= =?us-ascii?Q?3P4DWn6frLn8ONURx9qcEEfGIOeJPz+T/Yzdls2lRdmBcuZjh0x6QonrvsO7?= =?us-ascii?Q?a0o0KMbixRSE3R/Ejmy4q+dSW/CIn+ybS2zHHuVj323GyLf7LmzYBrFditUy?= =?us-ascii?Q?ekLdNlLI91kCuaYEhZla29YDDDLO27TI9fpQdzYSs9dkLxfx6r923VM5sx0Y?= =?us-ascii?Q?HOHbBjzovn/3yIJUZ5aQ4pPcV5fMhsXq4X+M2PdwU0U6CACttGksNJfnVR/r?= =?us-ascii?Q?XHJc4Jcc9C/EkQS5vJcGe2FOzRJEA1I869vjwOzlu+7w/HCTtqxcKy0zJpLd?= =?us-ascii?Q?NHwI48IczBdyw2o3K/7ThXRwr7F2k2MAOYYPqW8nZhndgW8eL1dvEaGSiDfr?= =?us-ascii?Q?8zzJeJ4AXopSAczPy2by7oqpYKKnG0RvUCcO5EcDG8qvG9WA5PZ/1gdMg5W0?= =?us-ascii?Q?oipCcYHZU1MJF1m4psuam6m4snJXoi2IdiZa6n7WnhSb02x+CzLW8FHa/hKh?= =?us-ascii?Q?Za3Bs2wLUmOp8dGtmi0Cn9/V4Lhcvxi+Grq0tjVa7dpBz9l+JQZVsZZKg+jq?= =?us-ascii?Q?it66P1s+vjSChGboaZYwcPBpmpr8EoL6TB19q7KXyNvcUaUIV4GsyUyUL0CB?= =?us-ascii?Q?A2EGl8ikvAKzmpYpNcmpvwJRv+rdFDEZVFd+4oaXM/BcfJLbWYMgoRCSPALB?= =?us-ascii?Q?Z18lNuI5ebgFh3uDWrW6Mp/3pYQ91fQh1BmijFZErIzt9awm0pukEUrVQuaj?= =?us-ascii?Q?BRuWWjQxds7jAFhKFeBqqeve5phc42nJ/TQkScszVcVikIztFsFrKtMJ3/sc?= =?us-ascii?Q?wts1Fx0hLGgOU/WjZVaZrdIabFnyGz6tJIlbCLrf831BkQM0mUlB+efm1XV3?= =?us-ascii?Q?AKrdl+X8v9d9YQEjuus44pCiXG6jz/8CMozawMSBYUwRDcAIhUKR6LH/v0ry?= =?us-ascii?Q?3oxlfGxENefW4KzGbwk0xmZAjJS9kn/eCTVQRsCNwz10V9sT+H2ymo7k8bgI?= =?us-ascii?Q?el+9lpii86qbmT9fhYXSEOxW6lfLRW8V3B7h3Jb2al2664jl+0p/JxO6y9ik?= =?us-ascii?Q?hznh4Urc3JW7UUO88f8rDJ8Ws+P5gYT0wtWcnz9HrYV3y7+6LCY1m9yZxIpF?= =?us-ascii?Q?PL4AQF+iJe/ZO0013XvqU869IKlA7brIVtJANaAZ53dhq0emnuLRwDD+cOp+?= =?us-ascii?Q?p2/FfuFqAubSR40nhefoia1XFg0zEdAmFvLpjCdhXEtiT11QqjDL9//wjtPv?= =?us-ascii?Q?grEBq+cd904AFl8lqf40Ux2l81YL7Emt+dS/ig+0HOSkzmmcC41+GYJ/1oX2?= =?us-ascii?Q?RS2ndiLYze2CAz+M23qWr2AA?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB2890.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b4b6de8-4561-4330-6625-08d9632ba3c3 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Aug 2021 16:08:53.1491 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TW/kDxPxCNlkxR5N6ky1jS89c4oArCCixuEPmMSgFvr1LLsR0FBumljcVCkvujFV7n5Kgh2g+Fy7VhA5gkuLhHPchlASyGveTJEUzqPwG3Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5750 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 1/2] examples/flow_classify: hooks for filters on tcp flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" HI Sowmini, > -----Original Message----- > From: Sowmini Varadhan > Sent: Wednesday, August 18, 2021 4:01 PM > To: sowmini05@gmail.com; Iremonger, Bernard > ; dev@dpdk.org; > sovaradh@linux.microsoft.com > Cc: thomas@monjalon.net > Subject: [PATCH v2 1/2] examples/flow_classify: hooks for filters on tcp = flags >=20 > v2 fixes: typo fixes, get_tcp_flags returns -EINVAL The above line should not be added to the commit message. ~/dpdk/devtools/check-git-log.sh -1 Wrong tag: v2 fixes: typo fixes, get_tcp_flags returns -EINVAL The check-git-log.sh script is in your dpdk checkout, best to run this scr= ipt before sending patches >=20 > The rte_eth_ntuple_filter allows tcp_flags which can check for things lik= e > #define RTE_TCP_CWR_FLAG 0x80 /**< Congestion Window Reduced */ > #define RTE_TCP_ECE_FLAG 0x40 /**< ECN-Echo */ > #define RTE_TCP_URG_FLAG 0x20 /**< Urgent Pointer field significant *= / > #define RTE_TCP_ACK_FLAG 0x10 /**< Acknowledgment field significant > */ > #define RTE_TCP_PSH_FLAG 0x08 /**< Push Function */ > #define RTE_TCP_RST_FLAG 0x04 /**< Reset the connection */ > #define RTE_TCP_SYN_FLAG 0x02 /**< Synchronize sequence numbers */ > #define RTE_TCP_FIN_FLAG 0x01 /**< No more data from sender */ but > there are no existing examples that demonstrate how to use this feature. >=20 > This patch extends the existing classification support to allow an option= al > flags in the input file. The flags string can be any concatenation of cha= racters > from {C, E, U, A, P, R, S, F} and "*" indicates "don't care". These flags= are set > in the ntuple_filter and are used to construct the tcp_spec and tcp_mask > sent to the driver >=20 > The rte_acl_field_def is updated to use the (u8) tcp flag as lookup key. > Note that, as per > https://doc.dpdk.org/guides/prog_guide/packet_classif_access_ctrl.html > this field MUST be allocated for 4 bytes, thus it has sizeof(uint32_t). >=20 > However, also note the XXX in this commit: additional updates are needed = to > the rte_flow_classify_table_entry_add() so that it does not ignore any ke= y > fields other than the 5-tuple. >=20 > Signed-off-by: Sowmini Varadhan > --- If you want comment on the patch updates (optional), it can be added here a= fter the --- line > examples/flow_classify/flow_classify.c | 87 ++++++++++++++++++++-- > examples/flow_classify/ipv4_rules_file.txt | 22 +++--- > 2 files changed, 91 insertions(+), 18 deletions(-) >=20 > diff --git a/examples/flow_classify/flow_classify.c > b/examples/flow_classify/flow_classify.c > index db71f5aa04..ff4c8bc2f5 100644 > --- a/examples/flow_classify/flow_classify.c > +++ b/examples/flow_classify/flow_classify.c > @@ -51,6 +51,7 @@ enum { > CB_FLD_DST_PORT_MASK, > CB_FLD_PROTO, > CB_FLD_PRIORITY, > + CB_FLD_TCP_FLAGS, > CB_FLD_NUM, > }; >=20 > @@ -86,6 +87,7 @@ enum { > DST_FIELD_IPV4, > SRCP_FIELD_IPV4, > DSTP_FIELD_IPV4, > + TCP_FLAGS_FIELD, I think it would be better to rename TCP_FLAGS_FIELD to TCP_FLAGS_FIELD_IPV= 4 inline with the other values. > NUM_FIELDS_IPV4 > }; >=20 > @@ -93,7 +95,8 @@ enum { > PROTO_INPUT_IPV4, > SRC_INPUT_IPV4, > DST_INPUT_IPV4, > - SRCP_DESTP_INPUT_IPV4 > + SRCP_DESTP_INPUT_IPV4, > + TCP_FLAGS_INDEX, I think it would be better to rename TCP_FLAGS_INDEX to TCP_FLAGS_INPUT_IP= V4 inline with the other values. > }; >=20 > static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] =3D { @@ -150= ,6 > +153,17 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] =3D= { > sizeof(struct rte_ipv4_hdr) + > offsetof(struct rte_tcp_hdr, dst_port), > }, > + /* next field must be 4 bytes, even though flags is only 1 byte */ > + { > + /* rte_flags */ > + .type =3D RTE_ACL_FIELD_TYPE_BITMASK, > + .size =3D sizeof(uint32_t), > + .field_index =3D TCP_FLAGS_FIELD, > + .input_index =3D TCP_FLAGS_INDEX, > + .offset =3D sizeof(struct rte_ether_hdr) + > + sizeof(struct rte_ipv4_hdr) + > + offsetof(struct rte_tcp_hdr, tcp_flags), > + }, > }; > /* >8 End of creation of ACL table. */ >=20 > @@ -285,12 +299,14 @@ lcore_main(struct flow_classifier *cls_app) > int ret; > int i =3D 0; >=20 > - ret =3D rte_flow_classify_table_entry_delete(cls_app->cls, > - rules[7]); > - if (ret) > - printf("table_entry_delete failed [7] %d\n\n", ret); > - else > - printf("table_entry_delete succeeded [7]\n\n"); > + if (rules[7]) { > + ret =3D rte_flow_classify_table_entry_delete(cls_app->cls, > + rules[7]); > + if (ret) > + printf("table_entry_delete failed [7] %d\n\n", ret); > + else > + printf("table_entry_delete succeeded [7]\n\n"); > + } >=20 > /* > * Check that the port is on the same NUMA node as the polling > thread @@ -410,6 +426,53 @@ parse_ipv4_net(char *in, uint32_t *addr, > uint32_t *mask_len) > return 0; > } >=20 > +static int > +get_tcp_flags(char *in, struct rte_eth_ntuple_filter *ntuple_filter) { > + int len =3D strlen(in); > + int i; > + uint8_t flags =3D 0; > + > + if (strcmp(in, "*") =3D=3D 0) { > + ntuple_filter->tcp_flags =3D 0; > + return 0; > + } > + > + for (i =3D 0; i < len; i++) { > + switch (in[i]) { > + case 'S': > + flags |=3D RTE_TCP_SYN_FLAG; > + break; > + case 'F': > + flags |=3D RTE_TCP_FIN_FLAG; > + break; > + case 'R': > + flags |=3D RTE_TCP_RST_FLAG; > + break; > + case 'P': > + flags |=3D RTE_TCP_PSH_FLAG; > + break; > + case 'A': > + flags |=3D RTE_TCP_ACK_FLAG; > + break; > + case 'U': > + flags |=3D RTE_TCP_URG_FLAG; > + break; > + case 'E': > + flags |=3D RTE_TCP_ECE_FLAG; > + break; > + case 'C': > + flags |=3D RTE_TCP_CWR_FLAG; > + break; > + default: > + fprintf(stderr, "unknown flag %c\n", in[i]); > + return -EINVAL; > + } > + } > + ntuple_filter->tcp_flags =3D flags; > + return 0; > +} > + > static int > parse_ipv4_5tuple_rule(char *str, struct rte_eth_ntuple_filter > *ntuple_filter) { @@ -481,6 +544,8 @@ parse_ipv4_5tuple_rule(char *str, > struct rte_eth_ntuple_filter *ntuple_filter) > ntuple_filter->priority =3D (uint16_t)temp; > if (ntuple_filter->priority > FLOW_CLASSIFY_MAX_PRIORITY) > ret =3D -EINVAL; > + if (get_tcp_flags(in[CB_FLD_TCP_FLAGS], ntuple_filter)) > + return -EINVAL; >=20 > return ret; > } > @@ -597,10 +662,13 @@ add_classify_rule(struct rte_eth_ntuple_filter > *ntuple_filter, > memset(&tcp_spec, 0, sizeof(tcp_spec)); > tcp_spec.hdr.src_port =3D ntuple_filter->src_port; > tcp_spec.hdr.dst_port =3D ntuple_filter->dst_port; > + tcp_spec.hdr.tcp_flags =3D ntuple_filter->tcp_flags; >=20 > memset(&tcp_mask, 0, sizeof(tcp_mask)); > tcp_mask.hdr.src_port =3D ntuple_filter->src_port_mask; > tcp_mask.hdr.dst_port =3D ntuple_filter->dst_port_mask; > + if (tcp_spec.hdr.tcp_flags !=3D 0) > + tcp_mask.hdr.tcp_flags =3D 0xff; >=20 > tcp_item.type =3D RTE_FLOW_ITEM_TYPE_TCP; > tcp_item.spec =3D &tcp_spec; > @@ -655,6 +723,11 @@ add_classify_rule(struct rte_eth_ntuple_filter > *ntuple_filter, > return ret; > } >=20 > + /* XXX but this only adds table_type of > + * RTE_FLOW_CLASSIFY_TABLE_ACL_IP4_5TUPLE > + * i.e., it only ever does allocate_acl_ipv4_5tuple_rule() > + * so the tcp_flags is ignored! > + */ > rule =3D rte_flow_classify_table_entry_add( > cls_app->cls, &attr, pattern_ipv4_5tuple, > actions, &key_found, &error); > diff --git a/examples/flow_classify/ipv4_rules_file.txt > b/examples/flow_classify/ipv4_rules_file.txt > index dfa0631fcc..415573732a 100644 > --- a/examples/flow_classify/ipv4_rules_file.txt > +++ b/examples/flow_classify/ipv4_rules_file.txt > @@ -1,14 +1,14 @@ > #file format: > -#src_ip/masklen dst_ip/masklen src_port : mask dst_port : mask > proto/mask priority > +#src_ip/masklen dst_ip/masklen src_port : mask dst_port : mask > +proto/mask priority tcp_flags > # > -2.2.2.3/24 2.2.2.7/24 32 : 0xffff 33 : 0xffff 17/0xff 0 > -9.9.9.3/24 9.9.9.7/24 32 : 0xffff 33 : 0xffff 17/0xff 1 > -9.9.9.3/24 9.9.9.7/24 32 : 0xffff 33 : 0xffff 6/0xff 2 > -9.9.8.3/24 9.9.8.7/24 32 : 0xffff 33 : 0xffff 6/0xff 3 > -6.7.8.9/24 2.3.4.5/24 32 : 0x0000 33 : 0x0000 132/0xff 4 > -6.7.8.9/32 192.168.0.36/32 10 : 0xffff 11 : 0xffff 6/0xfe 5 > -6.7.8.9/24 192.168.0.36/24 10 : 0xffff 11 : 0xffff 6/0xfe 6 > -6.7.8.9/16 192.168.0.36/16 10 : 0xffff 11 : 0xffff 6/0xfe 7 > -6.7.8.9/8 192.168.0.36/8 10 : 0xffff 11 : 0xffff 6/0xfe 8 > +2.2.2.3/24 2.2.2.7/24 32 : 0xffff 33 : 0xffff 17/0xff 0 * > +9.9.9.3/24 9.9.9.7/24 32 : 0xffff 33 : 0xffff 17/0xff 1 * > +9.9.9.3/24 9.9.9.7/24 32 : 0xffff 33 : 0xffff 6/0xff 2 * > +9.9.8.3/24 9.9.8.7/24 32 : 0xffff 33 : 0xffff 6/0xff 3 * > +6.7.8.9/24 2.3.4.5/24 32 : 0x0000 33 : 0x0000 132/0xff 4 * > +6.7.8.9/32 192.168.0.36/32 10 : 0xffff 11 : 0xffff 6/0xfe 5 * > +6.7.8.9/24 192.168.0.36/24 10 : 0xffff 11 : 0xffff 6/0xfe 6 * > +6.7.8.9/16 192.168.0.36/16 10 : 0xffff 11 : 0xffff 6/0xfe 7 * > +6.7.8.9/8 192.168.0.36/8 10 : 0xffff 11 : 0xffff 6/0xfe 8 * > #error rules > -#9.8.7.6/8 192.168.0.36/8 10 : 0xffff 11 : 0xffff 6/0xfe 9 \ No newline = at end > of file > +#9.8.7.6/8 192.168.0.36/8 10 : 0xffff 11 : 0xffff 6/0xfe 9 * > -- > 2.17.1 Regards, Bernard.