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 E6DC9A04B8; Tue, 5 May 2020 13:37:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CA4E41D5BF; Tue, 5 May 2020 13:37:23 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70040.outbound.protection.outlook.com [40.107.7.40]) by dpdk.org (Postfix) with ESMTP id 711BF1D146; Tue, 5 May 2020 13:37:22 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RwxpK53xopYJrP+GGXt6zvyAQwlHfpBiiYEqdTrUINTqKErdvYHPbLTt4GIBBfmhNf072SOGWqMBOeslJ+w0orMRHQd8W05WIeDfU2zpgJ+ZE0Hdw9RJBZnbDdxm7pQPewk8qHbUTYZH4xBijRWOtj1vzigI6AV0FDgahfUgpN4Jw2vf5Caju7fQOTAjDIeE2+jRbyxYqJsEx8j58I4ACOx2vS5pRArrae4qI5Lj6pqBeNS7P6dX42MBx1V3WfL75xKK9pCHJE/DSUqqN/DYuPy1R46wQOmul8Pd9LEh6In1Bh+9kb33qg7+6I9bGxxx8EcHj7zke3oZbL2AJfwa2Q== 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=yfTPUS52zms8yG9kv/OhQFZD9f0pxwdLIGzaIfmD7Tk=; b=nGNB2TgFwAO1e8hRZxmOnku7IUsnU8Eq9XqULfHQ8SaS1YCWi6AFvguyab9j522ql2bAdZWQWeO5omfPgOSKIxygRwqlctoNtYN11PbIUflkbqjoACbVv1wGyVLlpnk5UslDJqclM/N2k0fauaI/RKLRqF00ODWTfNXAZYx8Rr72rAqeAgjdZ3PZvaFQH0MooRsw5d85KGvckoBTcSbZVu8XkdozfOtKIgzNi/dU4+yPBDu5hxhjqam7+8OjbKggYXpKey4QOnnizbCb/aXQscmlFnTG2mDz/5UHPll8Z/gxIKPhP/q19jlirb8eWen5/iQwr6Uv7p1jhMRoTkY8MQ== 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=yfTPUS52zms8yG9kv/OhQFZD9f0pxwdLIGzaIfmD7Tk=; b=r/odkr4yxAwVPLnajiz2yfDgoJCeqeQVWbpYt1FRVhBM0lYyf9Gdmz6xkBtuYJpE5N12ZL5WV3tjD9aS4+P8+MHu+5Tkfaq8rtmjaPxFc2dQkf2g3NmJfvO/SQj+o/jGV01yyE/mmN/Oe1EoPfGSUVG42zoc/8Gp2Y/X0gAASq8= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (2603:10a6:205:8::26) by AM4PR05MB3363.eurprd05.prod.outlook.com (2603:10a6:205:10::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.29; Tue, 5 May 2020 11:37:20 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::bdf0:88a3:3a39:4be4]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::bdf0:88a3:3a39:4be4%7]) with mapi id 15.20.2958.030; Tue, 5 May 2020 11:37:20 +0000 From: Slava Ovsiienko To: Raslan Darawsheh , Matan Azrad CC: "dev@dpdk.org" , Ori Kam , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix matching for UDP tunnels with verbs Thread-Index: AQHWIsF+YDdQ01WoQka78UyCDzj5GaiZXXFA Date: Tue, 5 May 2020 11:37:20 +0000 Message-ID: References: <20200505094218.29666-1-rasland@mellanox.com> In-Reply-To: <20200505094218.29666-1-rasland@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 870f15b5-f97b-4b6f-0d7d-08d7f0e8ac41 x-ms-traffictypediagnostic: AM4PR05MB3363:|AM4PR05MB3363: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 0394259C80 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KkLPBgvJncBAlKl714Lj4/YY3zFriL1MX2q+xqoxGdycgDZSxKRF2K+sCoiCHgzJ0Z1KKpwZC1Nq9O6fmqoKQaa5aeF5REm4Nv8icPaPgcxzvk+9UFxUxutHCKHrQViQ8YKsbs6MwT2BbUUm7DykvKTXUldEbdqcz0k4oC2nWMGzJ368xMh+ZeTcaGU0uAYfXQz6+iIXM3fspkd74IyPXgHiyiU3TZCb1cr5NMAYn2rLUP0r2HCOYcT/XPXMwo3a2I9sjbSi3nBsjEd+/A4KYquvEvMfDxNqjkdGC0b8bEp2gBWcn2WpJZM9UobWC8J0PZZrynFYOMzFuE8lZxm3JFJgKM9wTP5rU8nw4X0JrwMz9r4K4cqKGOO0SBzISV1rs6wYSOEbuzmaME/KiHTvKZlZCRj4rmYoN4YzZbIdDXv/yT6qSa2hEYltUWccZKFadn+JJezoRudZ6rOnukuJMwmenSV1sZb8z7XrxjrMdWbPKWBjAfuoTpojRltCQ3Vg1N4YDeAGYUHmkB6lYV/wlw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM4PR05MB3265.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(346002)(366004)(396003)(39860400002)(136003)(33430700001)(316002)(66946007)(54906003)(52536014)(66446008)(76116006)(66476007)(64756008)(66556008)(8676002)(110136005)(4326008)(2906002)(450100002)(7696005)(478600001)(8936002)(9686003)(55016002)(6636002)(86362001)(5660300002)(71200400001)(186003)(33656002)(33440700001)(26005)(6506007)(53546011); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: JfQPbC7nkZitwyq0/CoqRVvIBrRrL5H5IvsjAdxmPCC/YER/k2qj2qITmFjABrJAsYLFFd65RawycIUd2ttis0VCIJssfeh0RWGcd6MeZqyfMJT+auE5RP+HMmASKN/cC3g6o1+M21kH4KAozlMNHUnhmf261sbOOWjw8X0wuVmPCXEUQorv/EqVvsROSlys7N8d9ChH/LdaPQ/DizK7yVdRLMpD57aweQUSI5OwnkmzJAY+xrz8b+NnPAlcDqHVZTr17mBWsr8jz3inCgYUDtX/7lSFAEF/09n/i9b7JrEHIop+cJaq9wmwmU+VULOTIWXnBqzZs7tyOJZZNfaefGYSz957uOIAq1dP6Zg8LkyCJyyJrFG5Lwv7xJtVsWtSDVxSJgOE4V9f4x/PjN8mwJDFfXT3yc/jX2BwAv0a/f4bVn7yzUgguSJ+Wohf3pAKsPlT8dp5fO6pSnN5oRW4Da+nhAsv+0R9dpIGGASLJm4Zqa/hktzWENMEYo12/COovIVEF/lQIR4aadH0GGKk5EWGZNj3TDpA7llysrd1qlGco7qp8GvxYqgsomX1DbeN01x/Wvv1b2A2E0NNx/xsc1H8W2aBdIwQShWSZI+Hps7w2Y5vzr0Pvw39IeQRV6JueYG7o/ENeygCQvrY/Q49JCYzx2Rw0dFbaJB5UnRd7XKFIiG2w8+hPq3EFa5q8bJ7BbQVkahzCfMLUYnf8OxO8uo2AIbntiZ7mS15RnYB29V+Y/GGYJkg7uRxW4EmAjfbZDlGTdWOAcHtAAo7FTTiedcy//aQ/MgbR6QheOH3Oqo= 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: 870f15b5-f97b-4b6f-0d7d-08d7f0e8ac41 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 May 2020 11:37:20.8178 (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: xPnHvefe/T2yci/d4DoQUPsGqPfpbMPW8mUWng7lcbMqTzC+JWZELnpdWtFjJJlb3PxRI26R6SAK4VrFeNDB8UPc5rincza4IsZDLNZgQns= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3363 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix matching for UDP tunnels with verbs 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: Raslan Darawsheh > Sent: Tuesday, May 5, 2020 12:42 > To: Slava Ovsiienko ; Matan Azrad > > Cc: dev@dpdk.org; Ori Kam ; stable@dpdk.org > Subject: [PATCH] net/mlx5: fix matching for UDP tunnels with verbs >=20 > When creating flow rule with zero specs it will cause matching all UDP > packets like following: > eth / ipv4 / udp / vxlan / end > Such rule will match all udp packets. >=20 > This change the behavior to match the dv flow engine which will > automatically set the match on relative outer UDP port if the user didn't > specify any. >=20 > Fixes: 84c406e74524 ("net/mlx5: add flow translate function") > Cc: stable@dpdk.org >=20 > Signed-off-by: Raslan Darawsheh Acked-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_flow_verbs.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c > b/drivers/net/mlx5/mlx5_flow_verbs.c > index 7efd97f54..9094fb70b 100644 > --- a/drivers/net/mlx5/mlx5_flow_verbs.c > +++ b/drivers/net/mlx5/mlx5_flow_verbs.c > @@ -680,6 +680,26 @@ flow_verbs_translate_item_udp(struct mlx5_flow > *dev_flow, > udp.val.src_port &=3D udp.mask.src_port; > udp.val.dst_port &=3D udp.mask.dst_port; > } > + > + if ((item + 1) !=3D NULL && !(udp.val.dst_port & udp.mask.dst_port)) { > + switch((item + 1)->type) { > + case RTE_FLOW_ITEM_TYPE_VXLAN: > + udp.val.dst_port =3D > htons(MLX5_UDP_PORT_VXLAN); > + udp.mask.dst_port =3D 0xffff; > + break; > + case RTE_FLOW_ITEM_TYPE_VXLAN_GPE: > + udp.val.dst_port =3D > htons(MLX5_UDP_PORT_VXLAN_GPE); > + udp.mask.dst_port =3D 0xffff; > + break; > + case RTE_FLOW_ITEM_TYPE_MPLS: > + udp.val.dst_port =3D > htons(MLX5_UDP_PORT_MPLS); > + udp.mask.dst_port =3D 0xffff; > + break; > + default: > + break; > + } > + } > + > flow_verbs_spec_add(&dev_flow->verbs, &udp, size); } >=20 > -- > 2.26.0