From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0063.outbound.protection.outlook.com [104.47.2.63]) by dpdk.org (Postfix) with ESMTP id D7A201B28E; Thu, 25 Jan 2018 18:45:19 +0100 (CET) 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; bh=lF3e7Qp7+2BaheQYPuvkG+qhiBTSRi7NXjtb+Zw85mM=; b=RbO4Z830vbzwSaqlWXmONnfuwi9V0Bym7LZ0adN36hBkXyg6bEZOmGhCW/zyQQEpBDnxjzE3EZCswaWUCz1iiEJLhVK82Cimku87mYo8zuv0mFOuXOda7I8xmR9IFNe2wbwlt7lJFVeyiiCC3T/7vbXesjvY7ODFdRKuA8lCzeQ= Received: from VI1PR05MB3149.eurprd05.prod.outlook.com (10.170.237.142) by VI1PR05MB1518.eurprd05.prod.outlook.com (10.164.85.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Thu, 25 Jan 2018 17:45:17 +0000 Received: from VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::789c:3f06:bb88:e29c]) by VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::789c:3f06:bb88:e29c%13]) with mapi id 15.20.0428.019; Thu, 25 Jan 2018 17:45:17 +0000 From: Shahaf Shuler To: Mordechay Haimovsky , Adrien Mazarguil CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-stable] [PATCH] net/mlx4: fix no broadcasts reception in promisc Thread-Index: AQHTh6dlrisrK18MU0eC1lykGUGiYqOE1SMQgAAa0oCAAAh0QA== Date: Thu, 25 Jan 2018 17:45:17 +0000 Message-ID: References: <1515323086-100332-1-git-send-email-motih@mellanox.com> In-Reply-To: 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=shahafs@mellanox.com; x-originating-ip: [31.154.10.107] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB1518; 7:eW6YkGXn4hhyZrUISs+P2EZeFCG+02T2C9sE8BJpeBAOS5QeKAOcN2/OEOVnjyJuf3dGOivXPB3bApcj3fzYVDS1DcHx6bEU/Ngoppkyz3V4tOWCfGU8rXPOYrzZ9fLT6uAkOt/XYoUBIsMNrgGa0EE+QqH8h+UlY+ebljh9/1mlZ7optLoXN3jv+yrq53RJMxWY7DmSG0e3nBwtJPkmsfqRrO7xNbXWW23Z6kk/+a8pRAr7TcMk/dQq5W2LcRdX x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: af4337f4-cee0-4a3e-9006-08d5641b65ab x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:VI1PR05MB1518; x-ms-traffictypediagnostic: VI1PR05MB1518: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231023)(2400081)(944501161)(6055026)(6041288)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:VI1PR05MB1518; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB1518; x-forefront-prvs: 0563F2E8B7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39380400002)(39860400002)(396003)(346002)(376002)(199004)(189003)(3846002)(99286004)(2906002)(81166006)(6116002)(6636002)(81156014)(2950100002)(68736007)(106356001)(33656002)(9686003)(105586002)(6436002)(53936002)(3660700001)(26005)(55016002)(6246003)(4326008)(229853002)(5660300001)(450100002)(3280700002)(478600001)(2900100001)(54906003)(97736004)(76176011)(305945005)(316002)(7696005)(74316002)(8936002)(66066001)(102836004)(14454004)(6506007)(86362001)(110136005)(25786009)(5250100002)(59450400001)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB1518; H:VI1PR05MB3149.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: viAOg2nOcixFwY3VdgcNfj+vaIz/fEsCWmKIEu39XxDHOpmcfDu6zT51gr1nAQ1xA6HRCon5/Nx1DcQrBYYyvg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM 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: af4337f4-cee0-4a3e-9006-08d5641b65ab X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jan 2018 17:45:17.4492 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB1518 Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] net/mlx4: fix no broadcasts reception in promisc 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: , X-List-Received-Date: Thu, 25 Jan 2018 17:45:20 -0000 Thursday, January 25, 2018 7:12 PM, Mordechay Haimovsky: not support "don't care" bits in its flow spec mask, therefore > we do cannot use The following rules used by mlx5 for promiscuous and > allmulti: > if (dev->data->promiscuous) { > struct rte_flow_item_eth promisc =3D { > .dst.addr_bytes =3D "\x00\x00\x00\x00\x00\x00", > .src.addr_bytes =3D "\x00\x00\x00\x00\x00\x00", > .type =3D 0, > }; >=20 > claim_zero(mlx5_ctrl_flow(dev, &promisc, &promisc)); > return 0; > } > if (dev->data->all_multicast) { > struct rte_flow_item_eth multicast =3D { > .dst.addr_bytes =3D "\x01\x00\x00\x00\x00\x00", > .src.addr_bytes =3D "\x00\x00\x00\x00\x00\x00", > .type =3D 0, > }; >=20 > What we can use instead In order to place the device in promiscuous mode > is: > struct all_flow_attr { > struct ibv_flow_attr attr; > } __attribute__((packed)) all_attr =3D { > .attr =3D { > .comp_mask =3D 0, > .type =3D IBV_FLOW_ATTR_ALL_DEFAULT, > .size =3D sizeof(all_attr), > .priority =3D 0, > .num_of_specs =3D 0, > .port =3D PORT_NUM, > .flags =3D 0, > }, > }; > struct ibv_flow *all_flow; > all_flow =3D ibv_create_flow(qp, &all_attr.attr); >=20 > Now *_DEFAULT rules are low priority rules which catch the appropriate > traffic which was not caught by another rule. > There is probably another rule for BC which is added in the driver that > catches the BC, that is why we do not see it. > When we add an additional BC rule, we will also get it. Thanks, understood.=20 7, 2018 1:05 PM, Moti Haimovsky > > > Subject: [dpdk-stable] [PATCH] net/mlx4: fix no broadcasts reception > > > in promisc > > > > > > This patch fixes the issue of mlx4 not receiving broadcast packets > > > when configured to work promiscuous mode. > > > > > > Fixes: eacaac7bae36 ("net/mlx4: restore promisc and allmulti > > > support") > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Moti Haimovsky > > > --- > > > drivers/net/mlx4/mlx4_flow.c | 16 ++++++++-------- > > > 1 file changed, 8 insertions(+), 8 deletions(-) > > > > > > diff --git a/drivers/net/mlx4/mlx4_flow.c > > > b/drivers/net/mlx4/mlx4_flow.c index 69025da..ec13f5a 100644 > > > --- a/drivers/net/mlx4/mlx4_flow.c > > > +++ b/drivers/net/mlx4/mlx4_flow.c > > > @@ -1223,9 +1223,12 @@ struct mlx4_drop { > > > * > > > * Various flow rules are created depending on the mode the device i= s in: > > > * > > > - * 1. Promiscuous: port MAC + catch-all (VLAN filtering is ignored). > > > - * 2. All multicast: port MAC/VLAN + catch-all multicast. > > > - * 3. Otherwise: port MAC/VLAN + broadcast MAC/VLAN. > > > + * 1. Promiscuous: > > > + * port MAC + broadcast + catch-all (VLAN filtering is ignored= ). No need to add here anything. Promiscuous includes broadcasts by definition= . =20 > > > + * 2. All multicast: > > > + * port MAC/VLAN + broadcast + catch-all multicast. No need to add here anything. All multi includes broadcasts by definition. = =20 If no further comments from Adrien, and you agree, I can fix those two duri= ng the merge (no need for another version). Adrien - please have a look on it tomorrow=20 Reviewed-by: Shahaf Shuler