From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20060.outbound.protection.outlook.com [40.107.2.60]) by dpdk.org (Postfix) with ESMTP id 8C8A11B1CA; Thu, 25 Jan 2018 18:12:11 +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=KVBhCHzdrx41N3MxVa1egn4OS1RKs3z+baEYp1VKdCE=; b=Yx47uXZFbe9MvfC9KIHs/XmcIChb2sjxeLslEWTq9L9dzKR6WsEERzxSbKhKw13C9ttTXVFcTQbrYvi1/3fD3knaVwOZHrlfyirob+MhT+mfzIipOL1V21SSux0UPqCioKqbK37YUhZMfeLi3bk1MAB53jTKr1zadNAE4qLoEdY= Received: from AM4PR05MB3201.eurprd05.prod.outlook.com (10.171.186.30) by AM4PR05MB1537.eurprd05.prod.outlook.com (10.164.79.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Thu, 25 Jan 2018 17:12:11 +0000 Received: from AM4PR05MB3201.eurprd05.prod.outlook.com ([fe80::b56c:7be7:1526:ba77]) by AM4PR05MB3201.eurprd05.prod.outlook.com ([fe80::b56c:7be7:1526:ba77%13]) with mapi id 15.20.0444.015; Thu, 25 Jan 2018 17:12:10 +0000 From: Mordechay Haimovsky To: Shahaf Shuler , Adrien Mazarguil CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-stable] [PATCH] net/mlx4: fix no broadcasts reception in promisc Thread-Index: AQHTlfJuPiCND0FtnEaCH1FHXtXFwaOExZZw Date: Thu, 25 Jan 2018 17:12:09 +0000 Message-ID: References: <1515323086-100332-1-git-send-email-motih@mellanox.com> In-Reply-To: Accept-Language: he-IL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=motih@mellanox.com; x-originating-ip: [109.67.132.212] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB1537; 7:1iDaLDxjJOXIuxJNGq1oxxPrcKmsdgSjg89lG8K6O9n74Dt3xDoMXPRWFlffJ1wPzwjG7YSnE85mJZkyKKOqAkI6TevciXITAD5EXK9R1oKG4B3UMfc7GRlVt4S2VM5JuOSMv87m0aru9oas3/8vqBLjWssurTsOqsqNtstYfu0P9DzNv+8f5F6L2+rYBPUof9e7HLGPnfjNLJblKRFphJaG0IV1Tp7VDbxNzDo5yKvUWj4gMMMBVhgJWanOWuIb x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 16491494-3706-40ef-b603-08d56416c504 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:AM4PR05MB1537; x-ms-traffictypediagnostic: AM4PR05MB1537: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231023)(2400081)(944501161)(6055026)(6041288)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:AM4PR05MB1537; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB1537; x-forefront-prvs: 0563F2E8B7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39380400002)(39860400002)(366004)(376002)(189003)(199004)(53474002)(43544003)(13464003)(2950100002)(33656002)(5660300001)(6636002)(66066001)(7696005)(478600001)(6116002)(3846002)(76176011)(2906002)(9686003)(53936002)(105586002)(55016002)(2900100001)(14454004)(6436002)(5250100002)(6246003)(81166006)(81156014)(68736007)(316002)(106356001)(25786009)(450100002)(8936002)(4326008)(7736002)(3280700002)(99286004)(102836004)(74316002)(3660700001)(59450400001)(110136005)(305945005)(54906003)(86362001)(26005)(6506007)(229853002)(97736004)(53546011)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1537; H:AM4PR05MB3201.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: JNWQcipLNW3CrCIPVIyLhaeIkrMity6I7hoSIk+RdbovmJDojNrBZ8R4Z8ANUsRCKVDK/qCrEcSm7zGwXUSwZQ== 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: 16491494-3706-40ef-b603-08d56416c504 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jan 2018 17:12:09.9177 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1537 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:12:11 -0000 The mlx4 does not support "don't care" bits in its flow spec mask, therefor= e we do cannot use=20 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, }; 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, }; What we can use instead In order to place the device in promiscuous mode i= s: 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); Now *_DEFAULT rules are low priority rules which catch the appropriate traf= fic which was not caught by another rule. There is probably another rule for BC which is added in the driver that ca= tches the BC, that is why we do not see it.=20 When we add an additional BC rule, we will also get it. Moti > -----Original Message----- > From: Shahaf Shuler > Sent: Thursday, January 25, 2018 5:38 PM > To: Mordechay Haimovsky ; Adrien Mazarguil > > Cc: dev@dpdk.org; Mordechay Haimovsky ; > stable@dpdk.org > Subject: RE: [dpdk-stable] [PATCH] net/mlx4: fix no broadcasts reception = in > promisc >=20 > Sunday, January 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 is = 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). > > + * 2. All multicast: > > + * port MAC/VLAN + broadcast + catch-all multicast. > > + * 3. Otherwise: > > + * port MAC/VLAN + broadcast MAC/VLAN. > > * > > * About MAC flow rules: > > * > > @@ -1304,9 +1307,6 @@ struct mlx4_drop { > > !priv->dev->data->promiscuous ? > > &vlan_spec.tci : > > NULL; > > - int broadcast =3D > > - !priv->dev->data->promiscuous && > > - !priv->dev->data->all_multicast; > > uint16_t vlan =3D 0; > > struct rte_flow *flow; > > unsigned int i; > > @@ -1340,7 +1340,7 @@ struct mlx4_drop { > > rule_vlan =3D NULL; > > } > > } > > - for (i =3D 0; i !=3D RTE_DIM(priv->mac) + broadcast; ++i) { > > + for (i =3D 0; i !=3D RTE_DIM(priv->mac) + 1; ++i) { > > const struct ether_addr *mac; > > > > /* Broadcasts are handled by an extra iteration. */ @@ - > > 1404,7 +1404,7 @@ struct mlx4_drop { > > goto next_vlan; > > } > > /* Take care of promiscuous and all multicast flow rules. */ > > - if (!broadcast) { > > + if (priv->dev->data->promiscuous || priv->dev->data->all_multicast) >=20 > Please help me to understand the issue. > The promisc and allmulti spec and mask contains the broadcast addresses. > They are not received because of the ibv flow rule type (MC_DEFAULT / > ALL_DEFAULT) ? >=20 > > { > > for (flow =3D LIST_FIRST(&priv->flows); > > flow && flow->internal; > > flow =3D LIST_NEXT(flow, next)) { > > -- > > 1.8.3.1