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 D5302A057B; Thu, 2 Apr 2020 03:08:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 46D431BEBA; Thu, 2 Apr 2020 03:08:23 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 759811BEB3 for ; Thu, 2 Apr 2020 03:08:21 +0200 (CEST) IronPort-SDR: pewg2ZoLtum3WvNei69jjN/fIVgQvPDfO1bVKSPJHIgWeEb3+aDBD2CI2ulPx+T3NZpdPPL2Cn cLiB8Ecu5Xtw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2020 18:08:20 -0700 IronPort-SDR: Tgf/T+6MydjxbNt47sfHM93/qAdStn1h2qBICgR+wVfBQd1GzhcXxjmue39UgIhHPnnLDJtv/n msMrqigTyjkQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,333,1580803200"; d="scan'208";a="396182899" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by orsmga004.jf.intel.com with ESMTP; 01 Apr 2020 18:08:19 -0700 Received: from orsmsx124.amr.corp.intel.com (10.22.240.120) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 1 Apr 2020 18:08:19 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX124.amr.corp.intel.com (10.22.240.120) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 1 Apr 2020 18:08:19 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.177) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 1 Apr 2020 18:08:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fBBizyQnZBr62LXbNUrOwY/L3gPFd3WIHtzPls/5nUU5aepAxRKEPh8Wdc25qww3r62SGb5Imn6Cbu4IzRQUvCMY5DwJOKccvTdNl1YEpY5HBCgBikqkC7pbrBP4dXijDICTxobOVEZy64XLuAU26qaVGhCNA5LpfWlekjGu2xI0cFMvVKB8LSVKS/saeUHdz6VsQSk9kVQL2beTlbh3FoChgSgKBOcrXDvkWvpz1qi0JOwzxsCWCZ7whUh+XrFYcFRU9aM1Ewtv03GssAX5Nt2t4YaZPbY0beRp6ejyi6PDlZyVCJjjycM/OahByB/ILvKk75PKXdvlHrMrby/FOA== 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=htWXBXWycB2kojodXi0pX2akbTicHRkft4eeek9FNps=; b=aD4EHhjG9yzV9ULYmj8XeUBHlLXRdMQ3HdJKJaOSZVyBEkxYl/mGzxOiw1iBRrrzR88mpkPc6awhOIrzTe8aQIRjcWETzdPhuIL3pGPe/PDZ55mOc8fRcnCAfOw3e56NN1CHdAb6UvuyuwDrDjVYo55dttK9iL8e4tApyHi9JRT3GWGtZvtX1Hwb0rsrGdbCW0v1QRhij/sQATNlqo5I+Tk+pCzeWNVBBUmxPXjhbihJDEU8loWv2yo0d4MjqmxX0mfUTkTXZEUEmshEwWWACCd36uAp08o4MDUx18K5o6j9mu4GY0w2AYjsb21dgS2uX+CV1dzXGcQq3x+k/7H1cg== 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=htWXBXWycB2kojodXi0pX2akbTicHRkft4eeek9FNps=; b=xryNDmV46DLRRLW6796otW3XDq+igiJPSnuD5iMB7xQLuDy2g4xMALLbr2jeMjHOIjR42xeYdImsG9sv4WrhH5iK+7GH9K1ZH/RUDyb/brmX7MQn911vwJLicFKYL4oE/tTtmCOhKOoA86Vzu8E3JClFHZEy3aj4EBbbVuo9oCY= Received: from BYAPR11MB3541.namprd11.prod.outlook.com (2603:10b6:a03:f5::16) by BYAPR11MB3077.namprd11.prod.outlook.com (2603:10b6:a03:90::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.19; Thu, 2 Apr 2020 01:08:17 +0000 Received: from BYAPR11MB3541.namprd11.prod.outlook.com ([fe80::e8ad:5730:3ad0:87c6]) by BYAPR11MB3541.namprd11.prod.outlook.com ([fe80::e8ad:5730:3ad0:87c6%7]) with mapi id 15.20.2878.014; Thu, 2 Apr 2020 01:08:17 +0000 From: "Xing, Beilei" To: "Cui, LunyuanX" , "dev@dpdk.org" CC: "Yang, Qiming" , "Wu, Jingjing" Thread-Topic: [PATCH v4] net/i40e: enable MAC address as FDIR input set Thread-Index: AQHWB/ze3WH0Lek9d06FITiu57ibHqhlBEmg Date: Thu, 2 Apr 2020 01:08:16 +0000 Message-ID: References: <20200316004722.5323-1-lunyuanx.cui@intel.com> <20200401075052.109796-1-lunyuanx.cui@intel.com> In-Reply-To: <20200401075052.109796-1-lunyuanx.cui@intel.com> 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=beilei.xing@intel.com; x-originating-ip: [192.102.204.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 78d2ad06-0606-4aa0-4ef5-08d7d6a25387 x-ms-traffictypediagnostic: BYAPR11MB3077: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2657; x-forefront-prvs: 0361212EA8 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3541.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(136003)(396003)(376002)(366004)(39860400002)(346002)(4326008)(9686003)(81166006)(71200400001)(66946007)(8936002)(107886003)(55016002)(66556008)(66446008)(76116006)(81156014)(8676002)(33656002)(64756008)(66476007)(2906002)(7696005)(26005)(110136005)(316002)(54906003)(478600001)(5660300002)(6506007)(86362001)(52536014)(53546011)(186003)(30864003); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7xkTw28sZHe1/2fQ0Wk10DFa7NTka6fDpUULfLk1Lv8xm0L6R3sq8usQfQTfeqTx8msmm7zB/fGbzkWmfZ3GUbFq7wwXQ8oNgtp3EKIpa1P84X+L+gpNNlMbfo2D4muGXO4HXKYp0xR5nitFyIwy+ywpedIJlHQeWfOtQs6lq3DBE1BQvl+wOv7PB/3xi+nffE5Qak/bmXK82BRSJgcje11KXjdt/I2mYiHOU2QD0+JCVW313Ha61QkhzH3eOfT5/0r6mmkKdlrgrYizp9c8e0XwU2RA9dxfDPhFaoj6+e96JyTft0aEQiS3Ydi/4cFK5p+PLlksrzQuS9H0+prFdIJ27tZ9+q+8zxipqh2wPdgE9c4K9lUuIpExgt4ihe5pSmlPCo6NlSsxvKkbDiRcj8akg9eyEAhVm1hm0B7nM8lQOnFNr40zVRmj+e4sxj0p x-ms-exchange-antispam-messagedata: T6ZmqmVN8xlYQbINNO9VPsT38Pozo53gcFauZmKBPA3+l/+Tr/3mXFHuTr89hArXktiHDvhRuPcURVhAjP08TAg6FwPhnYiE1cqmVjjfUyskhguL9Np8TVHgsXTrPT+mAVYW11+cguqiKRJh8/vUbg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 78d2ad06-0606-4aa0-4ef5-08d7d6a25387 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Apr 2020 01:08:16.9407 (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: sfk4qk4DeNDnhBTcZDVfL22huFODhxwxXY9ydcU9X2Aids7cebH20v1XplVZpYRRSL051dv35luGGZwrvdYCew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3077 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v4] net/i40e: enable MAC address as FDIR input set 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" > -----Original Message----- > From: Cui, LunyuanX > Sent: Wednesday, April 1, 2020 3:51 PM > To: dev@dpdk.org > Cc: Xing, Beilei ; Yang, Qiming > ; Wu, Jingjing ; Cui, > LunyuanX > Subject: [PATCH v4] net/i40e: enable MAC address as FDIR input set >=20 > FVL enable src MAC address and dst MAC address as FDIR's input set for > ipv4-other, ipv4-udp and ipv4-tcp. When OVS-DPDK is working as a pure L2 > switch, enable MAC address as FDIR input set with Mark+RSS action would > help the performance speed up. And FVL FDIR supports to change input set > with MAC address. >=20 > Signed-off-by: Lunyuan Cui >=20 > --- > v4: > - Enable MAC address as FDIR's input set for ipv4-udp and ipv4-tcp > v3: > - Enable MAC address as FDIR's input set > v2: > - Enable src MAC address as FDIR's input set > --- > doc/guides/rel_notes/release_20_05.rst | 6 ++ > drivers/net/i40e/i40e_ethdev.c | 3 + > drivers/net/i40e/i40e_ethdev.h | 9 +- > drivers/net/i40e/i40e_fdir.c | 6 ++ > drivers/net/i40e/i40e_flow.c | 131 +++++++++++++++++-------- > 5 files changed, 114 insertions(+), 41 deletions(-) >=20 > diff --git a/doc/guides/rel_notes/release_20_05.rst > b/doc/guides/rel_notes/release_20_05.rst > index 000bbf501..9e55955c4 100644 > --- a/doc/guides/rel_notes/release_20_05.rst > +++ b/doc/guides/rel_notes/release_20_05.rst > @@ -62,6 +62,12 @@ New Features >=20 > * Added support for matching on IPv4 Time To Live and IPv6 Hop Limit. >=20 > +* **Updated Intel i40e driver.** > + > + Updated i40e PMD with new features and improvements, including: > + > + * enable MAC address as FDIR input set for ipv4-other, ipv4-udp and ip= v4- > tcp. > + >=20 > Removed Items > ------------- > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 9539b0470..530908b0e 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -9342,6 +9342,7 @@ i40e_get_valid_input_set(enum i40e_filter_pctype > pctype, > I40E_INSET_IPV4_TOS | I40E_INSET_IPV4_PROTO | > I40E_INSET_IPV4_TTL, > [I40E_FILTER_PCTYPE_NONF_IPV4_UDP] =3D > + I40E_INSET_DMAC | I40E_INSET_SMAC | > I40E_INSET_VLAN_OUTER | I40E_INSET_VLAN_INNER | > I40E_INSET_IPV4_SRC | I40E_INSET_IPV4_DST | > I40E_INSET_IPV4_TOS | I40E_INSET_IPV4_TTL | @@ -9357,6 > +9358,7 @@ i40e_get_valid_input_set(enum i40e_filter_pctype pctype, > I40E_INSET_IPV4_TOS | I40E_INSET_IPV4_TTL | > I40E_INSET_SRC_PORT | I40E_INSET_DST_PORT, > [I40E_FILTER_PCTYPE_NONF_IPV4_TCP] =3D > + I40E_INSET_DMAC | I40E_INSET_SMAC | > I40E_INSET_VLAN_OUTER | I40E_INSET_VLAN_INNER | > I40E_INSET_IPV4_SRC | I40E_INSET_IPV4_DST | > I40E_INSET_IPV4_TOS | I40E_INSET_IPV4_TTL | @@ -9373,6 > +9375,7 @@ i40e_get_valid_input_set(enum i40e_filter_pctype pctype, > I40E_INSET_SRC_PORT | I40E_INSET_DST_PORT | > I40E_INSET_SCTP_VT, > [I40E_FILTER_PCTYPE_NONF_IPV4_OTHER] =3D > + I40E_INSET_DMAC | I40E_INSET_SMAC | > I40E_INSET_VLAN_OUTER | I40E_INSET_VLAN_INNER | > I40E_INSET_IPV4_SRC | I40E_INSET_IPV4_DST | > I40E_INSET_IPV4_TOS | I40E_INSET_IPV4_PROTO | diff --git > a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index > aac89de91..dbb5d594a 100644 > --- a/drivers/net/i40e/i40e_ethdev.h > +++ b/drivers/net/i40e/i40e_ethdev.h > @@ -544,12 +544,19 @@ struct i40e_ipv6_l2tpv3oip_flow { > uint32_t session_id; /* Session ID in big endian. */ }; >=20 > +/* A structure used to define the input for l2 dst type flow */ struct > +i40e_l2_flow { > + struct rte_ether_addr dst; > + struct rte_ether_addr src; > + uint16_t ether_type; /**< Ether type in big endian */ > +}; > + > /* > * A union contains the inputs for all types of flow > * items in flows need to be in big endian > */ > union i40e_fdir_flow { > - struct rte_eth_l2_flow l2_flow; > + struct i40e_l2_flow l2_flow; > struct rte_eth_udpv4_flow udp4_flow; > struct rte_eth_tcpv4_flow tcp4_flow; > struct rte_eth_sctpv4_flow sctp4_flow; > diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c = index > 931f25976..2f24615b6 100644 > --- a/drivers/net/i40e/i40e_fdir.c > +++ b/drivers/net/i40e/i40e_fdir.c > @@ -1062,7 +1062,13 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf > *pf, > [I40E_FILTER_PCTYPE_NONF_IPV6_OTHER] =3D IPPROTO_NONE, > }; >=20 > + rte_memcpy(raw_pkt, &fdir_input->flow.l2_flow.dst, > + sizeof(struct rte_ether_addr)); > + rte_memcpy(raw_pkt + sizeof(struct rte_ether_addr), > + &fdir_input->flow.l2_flow.src, > + sizeof(struct rte_ether_addr)); Please help to double check if the dst and src need to be swapped refer to = the datasheet: The "source" and "destination" fields in the transmitted packet are presented in a reversed order with respect to the expected received packets. > raw_pkt +=3D 2 * sizeof(struct rte_ether_addr); > + > if (vlan && fdir_input->flow_ext.vlan_tci) { > rte_memcpy(raw_pkt, vlan_frame, sizeof(vlan_frame)); > rte_memcpy(raw_pkt + sizeof(uint16_t), diff --git > a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index > d877ac250..42324b208 100644 > --- a/drivers/net/i40e/i40e_flow.c > +++ b/drivers/net/i40e/i40e_flow.c > @@ -2626,8 +2626,24 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev > *dev, > } >=20 > if (eth_spec && eth_mask) { > - if (!rte_is_zero_ether_addr(ð_mask->src) > || > - !rte_is_zero_ether_addr(ð_mask->dst)) > { > + if (rte_is_broadcast_ether_addr(ð_mask- > >dst) && > + rte_is_zero_ether_addr(ð_mask- > >src)) { > + filter->input.flow.l2_flow.dst =3D > + eth_spec->dst; > + input_set |=3D I40E_INSET_DMAC; > + } else if (rte_is_zero_ether_addr(ð_mask- > >dst) && > + > rte_is_broadcast_ether_addr(ð_mask->src)) { > + filter->input.flow.l2_flow.src =3D > + eth_spec->src; > + input_set |=3D I40E_INSET_SMAC; > + } else if > (rte_is_broadcast_ether_addr(ð_mask->dst) && > + > rte_is_broadcast_ether_addr(ð_mask->src)) { > + filter->input.flow.l2_flow.dst =3D > + eth_spec->dst; > + filter->input.flow.l2_flow.src =3D > + eth_spec->src; > + input_set |=3D (I40E_INSET_DMAC | > I40E_INSET_SMAC); > + } else { > rte_flow_error_set(error, EINVAL, >=20 > RTE_FLOW_ERROR_TYPE_ITEM, > item, > @@ -2635,7 +2651,8 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev > *dev, > return -rte_errno; > } > } > - if (eth_spec && eth_mask && eth_mask->type) { > + if (eth_spec && eth_mask && > + next_type =3D=3D RTE_FLOW_ITEM_TYPE_END) { > if (eth_mask->type !=3D RTE_BE16(0xffff)) { > rte_flow_error_set(error, EINVAL, >=20 > RTE_FLOW_ERROR_TYPE_ITEM, > @@ -2750,21 +2767,33 @@ i40e_flow_parse_fdir_pattern(struct > rte_eth_dev *dev, > frag_off & RTE_IPV4_HDR_MF_FLAG) > pctype =3D > I40E_FILTER_PCTYPE_FRAG_IPV4; >=20 > - /* Get the filter info */ > - filter->input.flow.ip4_flow.proto =3D > - ipv4_spec->hdr.next_proto_id; > - filter->input.flow.ip4_flow.tos =3D > - ipv4_spec->hdr.type_of_service; > - filter->input.flow.ip4_flow.ttl =3D > - ipv4_spec->hdr.time_to_live; > - filter->input.flow.ip4_flow.src_ip =3D > - ipv4_spec->hdr.src_addr; > - filter->input.flow.ip4_flow.dst_ip =3D > - ipv4_spec->hdr.dst_addr; > - > - filter->input.flow_ext.inner_ip =3D false; > - filter->input.flow_ext.oip_type =3D > - I40E_FDIR_IPTYPE_IPV4; > + if (input_set & (I40E_INSET_DMAC | > I40E_INSET_SMAC)) { > + if (input_set & (I40E_INSET_IPV4_SRC > | > + I40E_INSET_IPV4_DST | > I40E_INSET_IPV4_TOS | > + I40E_INSET_IPV4_TTL | > I40E_INSET_IPV4_PROTO)) { > + rte_flow_error_set(error, > EINVAL, > + > RTE_FLOW_ERROR_TYPE_ITEM, > + item, > + "Invalid MAC_addr > mask."); The error info is not correct. This logic means L2 input set are exclusive = with L3 input set, right? > + return -rte_errno; > + } > + } else { > + /* Get the filter info */ > + filter->input.flow.ip4_flow.proto =3D > + ipv4_spec- > >hdr.next_proto_id; > + filter->input.flow.ip4_flow.tos =3D > + ipv4_spec- > >hdr.type_of_service; > + filter->input.flow.ip4_flow.ttl =3D > + ipv4_spec->hdr.time_to_live; > + filter->input.flow.ip4_flow.src_ip =3D > + ipv4_spec->hdr.src_addr; > + filter->input.flow.ip4_flow.dst_ip =3D > + ipv4_spec->hdr.dst_addr; > + > + filter->input.flow_ext.inner_ip =3D false; > + filter->input.flow_ext.oip_type =3D > + I40E_FDIR_IPTYPE_IPV4; > + } > } else if (!ipv4_spec && !ipv4_mask && !outer_ip) { > filter->input.flow_ext.inner_ip =3D true; > filter->input.flow_ext.iip_type =3D > @@ -2894,17 +2923,28 @@ i40e_flow_parse_fdir_pattern(struct > rte_eth_dev *dev, > if (tcp_mask->hdr.dst_port =3D=3D UINT16_MAX) > input_set |=3D I40E_INSET_DST_PORT; >=20 > - /* Get filter info */ > - if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV4) { > - filter->input.flow.tcp4_flow.src_port > =3D > - tcp_spec->hdr.src_port; > - filter->input.flow.tcp4_flow.dst_port > =3D > - tcp_spec->hdr.dst_port; > - } else if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV6) { > - filter->input.flow.tcp6_flow.src_port > =3D > - tcp_spec->hdr.src_port; > - filter->input.flow.tcp6_flow.dst_port > =3D > - tcp_spec->hdr.dst_port; > + if (input_set & (I40E_INSET_DMAC | > I40E_INSET_SMAC)) { > + if (input_set & > + (I40E_INSET_SRC_PORT | > I40E_INSET_DST_PORT)) { > + rte_flow_error_set(error, > EINVAL, > + > RTE_FLOW_ERROR_TYPE_ITEM, > + item, > + "Invalid MAC_addr > mask."); Same comment. > + return -rte_errno; > + } > + } else { > + /* Get filter info */ > + if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV4) > { > + filter- > >input.flow.tcp4_flow.src_port =3D > + tcp_spec- > >hdr.src_port; > + filter- > >input.flow.tcp4_flow.dst_port =3D > + tcp_spec- > >hdr.dst_port; > + } else if (l3 =3D=3D > RTE_FLOW_ITEM_TYPE_IPV6) { > + filter- > >input.flow.tcp6_flow.src_port =3D > + tcp_spec- > >hdr.src_port; > + filter- > >input.flow.tcp6_flow.dst_port =3D > + tcp_spec- > >hdr.dst_port; > + } > } > } >=20 > @@ -2938,17 +2978,28 @@ i40e_flow_parse_fdir_pattern(struct > rte_eth_dev *dev, > if (udp_mask->hdr.dst_port =3D=3D UINT16_MAX) > input_set |=3D I40E_INSET_DST_PORT; >=20 > - /* Get filter info */ > - if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV4) { > - filter->input.flow.udp4_flow.src_port > =3D > - udp_spec->hdr.src_port; > - filter->input.flow.udp4_flow.dst_port > =3D > - udp_spec->hdr.dst_port; > - } else if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV6) { > - filter->input.flow.udp6_flow.src_port > =3D > - udp_spec->hdr.src_port; > - filter->input.flow.udp6_flow.dst_port > =3D > - udp_spec->hdr.dst_port; > + if (input_set & (I40E_INSET_DMAC | > I40E_INSET_SMAC)) { > + if (input_set & > + (I40E_INSET_SRC_PORT | > I40E_INSET_DST_PORT)) { > + rte_flow_error_set(error, > EINVAL, > + > RTE_FLOW_ERROR_TYPE_ITEM, > + item, > + "Invalid MAC_addr > mask."); Same comment. > + return -rte_errno; > + } > + } else { > + /* Get filter info */ > + if (l3 =3D=3D RTE_FLOW_ITEM_TYPE_IPV4) > { > + filter- > >input.flow.udp4_flow.src_port =3D > + udp_spec- > >hdr.src_port; > + filter- > >input.flow.udp4_flow.dst_port =3D > + udp_spec- > >hdr.dst_port; > + } else if (l3 =3D=3D > RTE_FLOW_ITEM_TYPE_IPV6) { > + filter- > >input.flow.udp6_flow.src_port =3D > + udp_spec- > >hdr.src_port; > + filter- > >input.flow.udp6_flow.dst_port =3D > + udp_spec- > >hdr.dst_port; > + } > } > } > filter->input.flow_ext.is_udp =3D true; > -- > 2.17.1