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 36D8EA0562; Tue, 31 Mar 2020 11:34:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D55FB1BFC6; Tue, 31 Mar 2020 11:33:59 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 6F1CB1BFC4 for ; Tue, 31 Mar 2020 11:33:57 +0200 (CEST) IronPort-SDR: nuYXF0GwBWDZF5tbhZfGcnJWHSKqax1DdB3mjNVVvHoC4S+Nyzh6NAGJFk91YgFW4cnU2kzhdO x43IyOsexFJw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2020 02:33:56 -0700 IronPort-SDR: BNkHD8HYDarZ9Mz/iSCbmla0bzbwUmHuxH0D17Cn8nv5R2Y4tELFV5y+XUemwLMtiAGUc7U8QP poMIcb6kMkfQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="283934888" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by fmsmga002.fm.intel.com with ESMTP; 31 Mar 2020 02:33:55 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 31 Mar 2020 02:33:55 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 31 Mar 2020 02:33:55 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 31 Mar 2020 02:33:55 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.104) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 31 Mar 2020 02:33:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FMArEniou4TrX7ZXfVV3Ac6SsjgOU715vsTSMs4iDOpPbfFPYU8WyDu/Z5KyYSFQObr+1B+FlTjLNn2IQtP/CpcfUS4JZj3ERGhUliae4ahfvIcs1XQkZ0nP89zdu/Wfygiqh3PYTXc2YUBCQME72e8GlMcb5SF77Gkl74y/+eG9gQR9NLWjKWH6W205z+/BNxvNF8io9WKVXqQA2fttoAFfOmtRqrSmoD9/5URkju0KitHrMNq2VHWT8ZMlvG2qCha0kttOrGb+DxfOYBD3LF5Y3foVPJUUIbxNSx9QM5m13wEufEAVatyv/6Nv4QypacijAQfDwWHBIkhJjOt67w== 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=K5pj2jKntYSjbivjOmJ3Bga4WWn5EuCFVp7gdoql78M=; b=NctUpIi17cQ2t75h2MTpacXC8V6yMobHlHkr8q+tXb/eZyNZPpVoi0JMpHUjlJGbi/YojcuOoSzhXxbknyTtsWvVEFjpqarQ7KWPvOB6XbOeysOgdA2e4V5PZ411aejocHgXuJSflaUsm5deUjWI/c0N7EPwsdhurRCAQHqyz1rGgUimRcar7SXJaBA3rUFlLymYRDW+xo0KTSQyYVRZej7D8FKCwBPZ5st504FG6wzJDsAEu/y17ups+aRjChutSpDtK5A6ayEx13gy7ItsWGTCv/n6Xqr5h8i1tjmyVlaAhrpCYH4utvNES2xATUytnsbWRPoNFYDJY7hvCSgYvA== 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=K5pj2jKntYSjbivjOmJ3Bga4WWn5EuCFVp7gdoql78M=; b=VDn4gUukgkqHCDmfNMlbfZKtBSDnXojZpxeEOjG/mStja2Yzysvh+NIz0daNFuNlHQB30NhL1cLbpEG/B8K8j/VbugUglUc4xPG32wCSQo+BxsU1ahkpIdXmbHlNumQwjKUgrkIxBg75qIeLOeXYdxq+pkyEYXKXeP7sWBqE+s4= Received: from BYAPR11MB3541.namprd11.prod.outlook.com (2603:10b6:a03:f5::16) by BYAPR11MB3623.namprd11.prod.outlook.com (2603:10b6:a03:b5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Tue, 31 Mar 2020 09:33:52 +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.2856.019; Tue, 31 Mar 2020 09:33:52 +0000 From: "Xing, Beilei" To: "Cui, LunyuanX" , "dev@dpdk.org" CC: "Yang, Qiming" , "Wu, Jingjing" Thread-Topic: [PATCH v3] net/i40e: enable MAC address as FDIR input set Thread-Index: AQHWBnT4gP/Bjki8AU+IRkDUwL+lNahicLwg Date: Tue, 31 Mar 2020 09:33:52 +0000 Message-ID: References: <20200316004722.5323-1-lunyuanx.cui@intel.com> <20200330090548.129575-1-lunyuanx.cui@intel.com> In-Reply-To: <20200330090548.129575-1-lunyuanx.cui@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmYwM2M4YzMtZmVmMi00NmJlLWE5NDItNjFiMjk0YjE2ODY0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiajVYbnhLZHNaTGp0XC9wTVlUczYyR0drSjJEQ2tFRWRXXC9EeFlmbW9jcXo3emZ4VGRBQXdnWG5iMjltTHV6SnhPIn0= dlp-version: 11.2.0.6 dlp-product: dlpe-windows x-ctpclassification: CTP_NT dlp-reaction: no-action authentication-results: spf=none (sender IP is ) smtp.mailfrom=beilei.xing@intel.com; x-originating-ip: [192.55.52.221] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 56cba24d-09c2-4ca4-c5d9-08d7d556a004 x-ms-traffictypediagnostic: BYAPR11MB3623: 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:1923; x-forefront-prvs: 0359162B6D 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)(366004)(346002)(376002)(396003)(39860400002)(26005)(81156014)(53546011)(186003)(7696005)(86362001)(6506007)(5660300002)(4326008)(71200400001)(316002)(66446008)(110136005)(64756008)(66556008)(66476007)(2906002)(8676002)(478600001)(52536014)(81166006)(107886003)(8936002)(76116006)(55016002)(9686003)(33656002)(54906003)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LpPChOG2yud3KkDTEj/bK0pa6ZbBAbfw7+BcDnY6jba5W21/F9ktDoB28WsFcTfdcziZe/pbt+P8T4XfZOJdiBEepNvoBEwh+JNYnCiGtOnHV1hLg/gwI1i5Y+r3zCmgXSMrwEHhyt/04i4/s1D8Wi14SDRuAOUYUW9gd5LQ9k3rQgLlB/PrR6i2HcejQU7MHVpTWF/u41PzavYWN+qNBgsAi7zWjCAFaqRhbicvW8vrU5AdigKlx5cMAVOqnKD9smtpsyhK51A1I+EBea2nng2f22xwo/iABJVYjohnrchcyJhcL08YJZDNIyMkzCWt3wjR6hSGmFTkgNGDgo/WfAssLMOufziA121CZONHMLr+thql+UenDkXhxvkwANdmBD3IjRZhBgcYoy5Uoa5yvikx+gtqHcozNeMuj+rzVUvsPJXBfd9dwG8mNeRJyYQ9 x-ms-exchange-antispam-messagedata: ZurpF2TrJuR8t32rG/7TmnB6i5A5RgSD55yvY6TG2pfQh72hT46KJQE2unRXIreNfcnpA6EXy8peiWN3nPJQ+uy1Ibycl+26WlO+xLyyK5w/Ls7xIJ3RsXb5iC2fRS1XxHvr/ZqJpi2nX3OVgKuwSA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 56cba24d-09c2-4ca4-c5d9-08d7d556a004 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Mar 2020 09:33:52.2906 (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: J26LbfclMnuDNeQ5TAtVZGVL4rtn2ikcCMvKqDCvTkruGlKAnB65rbnPpAMCDdK9K/0oCgrFQBdWgqBrTVTHDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3623 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3] 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 =20 Sent: Monday, March 30, 2020 5:06 PM To: dev@dpdk.org Cc: Xing, Beilei ; Yang, Qiming ; Wu, Jingjing ; Cui, LunyuanX Subject: [PATCH v3] net/i40e: enable MAC address as FDIR input set FVL enable src MAC address and dst MAC address as FDIR's input set for ipv4= -other. 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. A= nd FVL FDIR supports to change input set with MAC address. Signed-off-by: Lunyuan Cui --- 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 | 1 + drivers/net/i40e/i40e_ethdev.h | 9 +++- drivers/net/i40e/i40e_fdir.c | 6 +++ drivers/net/i40e/i40e_flow.c | 65 +++++++++++++++++++------- 5 files changed, 68 insertions(+), 19 deletions(-) diff --git a/doc/guides/rel_notes/release_20_05.rst b/doc/guides/rel_notes/= release_20_05.rst index 000bbf501..7139288d6 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. + =20 Removed Items ------------- diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.= c index 9539b0470..041627ef5 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -9373,6 +9373,7 @@ i40e_get_valid_input_set(enum i40e_filter_pctype pcty= pe, 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/i= 40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index aac89de91..dbb5d59= 4a 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=20 +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 in= dex 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)); 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/i40= e_flow.c b/drivers/net/i40e/i40e_flow.c index d877ac250..65922b39c 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, 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) { What's the purpose here? if (eth_mask->type !=3D RTE_BE16(0xffff)) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, @@ -2750,21 +2767,33 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *de= v, 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."); + return -rte_errno; + } I don't think it must be exclusive between src mac/dst mac and other IPv4 f= ields. + } 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 -- 2.17.1