From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0074.outbound.protection.outlook.com [104.47.38.74]) by dpdk.org (Postfix) with ESMTP id 95F9C1B4E4 for ; Thu, 11 Oct 2018 12:35:30 +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=IfZTpomBiA6Ja7Mll+0t2G7vnpCkvaRnX00OrfvaG44=; b=eywitGHXwQLj87ax6AwmKVpRlqUSdEH4svIkwjv86TKmpVyPZCn0t85rJE9wmUk+tvTq2Klp+EJbs+ouVab/cIoSXB6yLbmOltveQBOO5rUxME9vF1wFDc7jml7RBFdQ+vZAQB2brZq8tmZBXSpcGntKQF3BqDZWv39TS6LJxlo= Received: from BY1PR0701MB1660.namprd07.prod.outlook.com (10.162.110.22) by BY1PR0701MB1206.namprd07.prod.outlook.com (10.160.105.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.24; Thu, 11 Oct 2018 10:35:28 +0000 Received: from BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::346d:e756:e70e:17]) by BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::346d:e756:e70e:17%3]) with mapi id 15.20.1228.020; Thu, 11 Oct 2018 10:35:28 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "ferruh.yigit@intel.com" Thread-Topic: [PATCH v5 15/23] net/atlantic: promisc and allmulti configuration Thread-Index: AQHUYU4gC/w3W39HAU2f5YbwDX043w== Date: Thu, 11 Oct 2018 10:35:28 +0000 Message-ID: <0fec582a1785adda53825c31ca55fdcdbfbf988f.1539249721.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: VI1PR04CA0088.eurprd04.prod.outlook.com (2603:10a6:803:64::23) To BY1PR0701MB1660.namprd07.prod.outlook.com (2a01:111:e400:522a::22) 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; BY1PR0701MB1206; 6:/AKwQS4ijmUn0q+ER44ltxNzh5aNEqLRJyD2prMiypHDBdcElO5YcYAe0DpC7zmLNAdrX518JbUGrJVJUgWw4xioEJUyjMdbW9B6l7ApQOLpmqhxPeP6aexRF0SiiwWmVOAWWZbx4Z1qO5XABG6bn7E1mm3/0EQEn9silpP6tzrC+KA4DGw1NQn4OkYZgskXS7ALD3UwozXBfPXESqDmNes77giJxolc7nl66FsbbvNThDO3iEY0dm3xxSrDOiyzaNj69vjoUk/BnJo6P5ofdcYi5WU2WrgwJJp1LRouWFx7aaBeth5nHyy7z/5izYowiuI8BAehPUHpB5bw981NXDU99tMx0UB6fpOEk9Tr08u02xpHdT0gsvMmHznEW0IjQwIdigbdRjqwMukMoSrF5P/jdZLVlL+WtckKfnQONHojXgTMmhv887UtVH4ehimXKfVjWJ6me7CRvAwC4eYaEAOFpPhWEYl2eH8A6i3KkJE=; 5:H8v+3qZ/7SU3xnB5DYx+kdLDCTmHI1YnyStPyaqYIvECMNBjHPYBgDgAm30y3ILdcr0Wt3kYxtFLjcyAo7sq7WrvwJPPRiB/kmFHDS4kDhYOFeBFsHdqmJu4YpNvZrikVfOY/N7OaXfSPeS5mzRuQiqozV/anxidSu1Q5JeEiqE=; 7:+FMwjxiAHQbRbmjvmK5BUnsj/4lUwgteF+uaial7Ze2rKhMNzxz9bzLreM5lWhx2m+8R71AHGMjffEhUYHN29OsfShHiiGw4ucg8F6qxvbLmOSqcT4kr4RmqPIHi1TKVjOh9OdkWU6Fj/Bj2lYOoLH2KaSyhtfZPPdl3oY0oqStKIsnASGz8033tGTS4fYJRlX6dsrzDqGsGXQfp+A2/m/t5y8HpzO6lMcbUr4yfEIUiQDZydP7thwR8q7M4FZ/3 x-ms-office365-filtering-correlation-id: 2dfd1995-a3a0-44ad-6581-08d62f65430f x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BY1PR0701MB1206; x-ms-traffictypediagnostic: BY1PR0701MB1206: 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)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051); SRVR:BY1PR0701MB1206; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1206; x-forefront-prvs: 08220FA8D6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(1496009)(346002)(136003)(396003)(39850400004)(376002)(366004)(189003)(199004)(486006)(14444005)(256004)(2351001)(25786009)(186003)(44832011)(2501003)(26005)(6436002)(6512007)(118296001)(478600001)(5640700003)(305945005)(71190400001)(71200400001)(72206003)(4326008)(53936002)(66066001)(7736002)(8676002)(6486002)(102836004)(36756003)(14454004)(81166006)(81156014)(1730700003)(386003)(6506007)(6116002)(3846002)(446003)(54906003)(68736007)(11346002)(476003)(99286004)(76176011)(52116002)(8936002)(316002)(2616005)(86362001)(106356001)(575784001)(5660300001)(97736004)(2900100001)(105586002)(6916009)(5250100002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1206; H:BY1PR0701MB1660.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: 3NiJqQIAMkGSqbs0HP/Bvnmz0Vhdf2jDdZYTDYsy0JQhr+3Ppw8Nj/9OHHZ/OyS+HoPoimvjFZ0dxUyRxKp2OTQZkhmuV25uvWRIKoaLhetKE7gSk2awLmWTonv5mUa8I5XCf+xVbjFgnajhzMcab/mZf7xr8+hSK1iU8wYkMTNO7f0Qc2X2d7ts8wcFfi/cLV/VlFLsNHIwGlrNA9bEydr/sGIbY0ovcBo2mVsUwCUf3a3/HlU71t8wY/yAkxqSxH+RqL128JGXrk7U3j2Jtph4rapFCTWEPlsOyPq/NYppO+w+3RQTk3xpws7wP3L8hZZPA3iZPmPzCxFJ/cOd4FPd94VLz6OjqW7WNcTFs+8= 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: 2dfd1995-a3a0-44ad-6581-08d62f65430f X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2018 10:35:28.8453 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1206 Subject: [dpdk-dev] [PATCH v5 15/23] 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: Thu, 11 Oct 2018 10:35:31 -0000 From: Pavel Belous Add support for promiscuous/allmulticast modes configuration. Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous --- doc/guides/nics/atlantic.rst | 2 ++ doc/guides/nics/features/atlantic.ini | 2 ++ drivers/net/atlantic/atl_ethdev.c | 44 +++++++++++++++++++++++++++++++= ++++ 3 files changed, 48 insertions(+) diff --git a/doc/guides/nics/atlantic.rst b/doc/guides/nics/atlantic.rst index 1108d458f836..b09c79babdf4 100644 --- a/doc/guides/nics/atlantic.rst +++ b/doc/guides/nics/atlantic.rst @@ -13,6 +13,8 @@ Supported features ^^^^^^^^^^^^^^^^^^ =20 - Base L2 features +- Promiscuous mode +- Multicast mode - Port statistics - Checksum offload - Jumbo Frame upto 16K diff --git a/doc/guides/nics/features/atlantic.ini b/doc/guides/nics/featur= es/atlantic.ini index e4b7cc18778f..8e5041002049 100644 --- a/doc/guides/nics/features/atlantic.ini +++ b/doc/guides/nics/features/atlantic.ini @@ -9,6 +9,8 @@ Link status =3D Y Link status event =3D Y Queue start/stop =3D Y Jumbo frame =3D Y +Promiscuous mode =3D Y +Allmulticast mode =3D Y CRC offload =3D Y L3 checksum offload =3D Y L4 checksum offload =3D Y diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_e= thdev.c index 2af95b457154..f9f1e9f0ed86 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, @@ -164,6 +168,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 @@ -813,6 +823,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