From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0080.outbound.protection.outlook.com [104.47.32.80]) by dpdk.org (Postfix) with ESMTP id B9FB01B448 for ; Tue, 9 Oct 2018 11:31:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-aquantia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6b6TLED2zYEv45tvEs2CbJjJ/khAkuk56hGxaT9NyuI=; b=TQEF4vOPIJroYWoK7OSJcOA09rSkyrvvePuNtQ7dAw5UgPBbiPGNFhTHolPIC+xej7DP6+XMF3t037UPNnB4ChpnpcYWu9lqoNan/njqfLz1kGd2QCNR8kvtHl6EeJNlU2l4c/NVFMBM/joCceZUPmD5wLyKs6g+fDLsHoSZulE= Received: from BLUPR0701MB1651.namprd07.prod.outlook.com (10.163.84.21) by BLUPR0701MB1650.namprd07.prod.outlook.com (10.163.84.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.23; Tue, 9 Oct 2018 09:31:53 +0000 Received: from BLUPR0701MB1651.namprd07.prod.outlook.com ([fe80::7c97:1527:4c0:8b46]) by BLUPR0701MB1651.namprd07.prod.outlook.com ([fe80::7c97:1527:4c0:8b46%3]) with mapi id 15.20.1207.024; Tue, 9 Oct 2018 09:31:53 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "ferruh.yigit@intel.com" , Pavel Belous Thread-Topic: [PATCH v4 14/22] net/atlantic: promisc and allmulti configuration Thread-Index: AQHUX7LpJ6nxWs/gq0ChOiAsAD4idA== Date: Tue, 9 Oct 2018 09:31:53 +0000 Message-ID: <1bf9163ff4e790eb4fe18435278dc64603ede8f5.1539075891.git.igor.russkikh@aquantia.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR01CA0028.eurprd01.prod.exchangelabs.com (2603:10a6:208:69::41) To BLUPR0701MB1651.namprd07.prod.outlook.com (2a01:111:e400:58c6::21) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BLUPR0701MB1650; 6:Uey8aKz1fyknW3TyaXPcNlpQfU1pOHI5HtfMp6cdzipMR61JwQ6fBggvnJ/qI/nLT775tBa+DTyJdOq7W/KOS3tBUjpJk2Kh5L285XJluzOEjTBtHVgHzN034E0S2obl06U5bSL4d7sHifNZXkh9Czr7vqb4uzQTt2Wf2wTmn0r+FruapQ2P/Vvk5cRyzbTTD7RHVsbGqZvyviwUtqEvrDdP+USsXxHAf2stSnHlZ+DtrYFiR+3gzgLXiYZK6a1S6FkF2imgMOxu0ktZdeBOSyVoTVkEg7SG1NNWlq3NCz9ZI9JX4njob9g6p6dBquB6DAW+JJj2744g8KgYzvB02TlyqN6zWMUxNU1u2kZ9C2nKjwFyVzH2jHgQGGhr+vg0A1f0/8U4DmesUXZtIthDCYdHhrGK7xDLjYNHqh+5I82G+V7A02qgQdPZuVCJ70kOmbk/fx3AOYQSyag1gmx8QQ==; 5:4nv2lUZ6Z1f2ikDzPpz+5wokomQ6Yo1Dr39S81uBBoEzJxjnqkhEkeN6UQct/g344ZEQTzD7WjOaJPNSFMDGFINaXrJ3HTMd6ZdzMqWwsTxFMl32uzr9h+cSPritmLlaaPH/sVIAFTnOkxSuL7MwWfxlZmcq7ra7s/kdIvs/A1A=; 7:3lZ2kNkYW00/DuuKz2VjBbT6S+5HFDCx/mdUjWhEUTSYwOljh+/BkOAAkl919YKY7O7ZlHlrszgaum44CE/QztZk/jOhCd+4ImHaSpOIEGuWEXaViQMRNerghop0BnemsOaG1Y9RgbKv4ZLelkwLPdjyzIiwz/yKkVKQUpwNnZAwmJZwi0S25xpliTK0iBqEh+gnqcRFE1C+fTqMujZLBmN1vCl27f5za+2/W1SIs0vD6BquAwbqQc7jOVvFBJDA x-ms-office365-filtering-correlation-id: 7d8e5dda-434e-4f65-b0ce-08d62dca0bd0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BLUPR0701MB1650; x-ms-traffictypediagnostic: BLUPR0701MB1650: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231355)(944501410)(52105095)(93006095)(93001095)(3002001)(149066)(150057)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(201708071742011)(7699051); SRVR:BLUPR0701MB1650; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1650; x-forefront-prvs: 08200063E9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39850400004)(346002)(376002)(396003)(136003)(189003)(199004)(81156014)(5640700003)(6116002)(71200400001)(105586002)(68736007)(316002)(3846002)(107886003)(71190400001)(26005)(118296001)(2616005)(5250100002)(25786009)(4326008)(102836004)(44832011)(446003)(476003)(11346002)(186003)(2906002)(106356001)(97736004)(2501003)(2351001)(486006)(478600001)(99286004)(53936002)(386003)(1730700003)(5660300001)(6506007)(36756003)(66066001)(54906003)(305945005)(256004)(14444005)(86362001)(575784001)(7736002)(2900100001)(76176011)(8936002)(52116002)(8676002)(6486002)(72206003)(6436002)(14454004)(81166006)(6512007)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1650; H:BLUPR0701MB1651.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 6h6W8+5AsWhfUGPATNWRKu/0NGsRfPw6GKpjyGysdJn1rlGRtyQMUmgiNA7GLxiGkjb7C2qn5GDvXI9EjEbEnAi+Ko0BdCg38XGwEI9h45K3dtSv8absu76XwmYr+EYJqryvrdsxF8yBWAFXpoBJ311ucO2JvB7QIXDsoMe2WV62ty7xLN34DxMbt+RjVZS+AgzlWGtFyft3G3K4bZxAYE6+hGhZlAmv3/dx0aeaHbiOaIvE27tnQcdniogusNjV4ez2oM+hCZu5fxWn5hEP+Zu3w7rbS3FZC2cDbk1BOAgSXnthNbsV/3LDYbcrwBqkFW/O2GhAOkFKfsYHz8fMkqJpoBdBCE7y99J6i+DDEUU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d8e5dda-434e-4f65-b0ce-08d62dca0bd0 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Oct 2018 09:31:53.4431 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1650 Subject: [dpdk-dev] [PATCH v4 14/22] net/atlantic: promisc and allmulti configuration 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: Tue, 09 Oct 2018 09:31:55 -0000 From: Pavel Belous Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous --- drivers/net/atlantic/atl_ethdev.c | 44 +++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 44 insertions(+) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_e= thdev.c index afae232cb22c..a6ce2c47e0d7 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -22,6 +22,10 @@ static int atl_dev_set_link_up(struct rte_eth_dev *dev)= ; static int atl_dev_set_link_down(struct rte_eth_dev *dev); static void atl_dev_close(struct rte_eth_dev *dev); static int atl_dev_reset(struct rte_eth_dev *dev); +static void atl_dev_promiscuous_enable(struct rte_eth_dev *dev); +static void atl_dev_promiscuous_disable(struct rte_eth_dev *dev); +static void atl_dev_allmulticast_enable(struct rte_eth_dev *dev); +static void atl_dev_allmulticast_disable(struct rte_eth_dev *dev); static int atl_dev_link_update(struct rte_eth_dev *dev, int wait); =20 static int atl_dev_xstats_get_names(struct rte_eth_dev *dev __rte_unused, @@ -170,6 +174,12 @@ static const struct eth_dev_ops atl_eth_dev_ops =3D { .dev_close =3D atl_dev_close, .dev_reset =3D atl_dev_reset, =20 + /* PROMISC */ + .promiscuous_enable =3D atl_dev_promiscuous_enable, + .promiscuous_disable =3D atl_dev_promiscuous_disable, + .allmulticast_enable =3D atl_dev_allmulticast_enable, + .allmulticast_disable =3D atl_dev_allmulticast_disable, + /* Link */ .link_update =3D atl_dev_link_update, =20 @@ -905,6 +915,40 @@ atl_dev_link_update(struct rte_eth_dev *dev, int wait = __rte_unused) return 0; } =20 +static void +atl_dev_promiscuous_enable(struct rte_eth_dev *dev) +{ + struct aq_hw_s *hw =3D ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + + hw_atl_rpfl2promiscuous_mode_en_set(hw, true); +} + +static void +atl_dev_promiscuous_disable(struct rte_eth_dev *dev) +{ + struct aq_hw_s *hw =3D ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + + hw_atl_rpfl2promiscuous_mode_en_set(hw, false); +} + +static void +atl_dev_allmulticast_enable(struct rte_eth_dev *dev) +{ + struct aq_hw_s *hw =3D ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + + hw_atl_rpfl2_accept_all_mc_packets_set(hw, true); +} + +static void +atl_dev_allmulticast_disable(struct rte_eth_dev *dev) +{ + struct aq_hw_s *hw =3D ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + + if (dev->data->promiscuous =3D=3D 1) + return; /* must remain in all_multicast mode */ + + hw_atl_rpfl2_accept_all_mc_packets_set(hw, false); +} =20 /** * It clears the interrupt causes and enables the interrupt. --=20 2.7.4