From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0055.outbound.protection.outlook.com [104.47.38.55]) by dpdk.org (Postfix) with ESMTP id 000BF1B568 for ; Fri, 12 Oct 2018 13:09:37 +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=cjwFIEugipm1Q3BjFlTBrbesqziZ66TlOM8bWSBEops=; b=Wh2jWkRvoxQ9hq4MqQ8MOeWv98uvdXisSsOxAbx4jvdp0JEnT3/fk8Oa5QMr9SUeAJfsI74pAX+cMc44nwrkg77FIHG1Hi0D6UAzw+Vitr3/eu0uLXz1T4uX3pv//mb98IemGjBJQog+54yWElXGRxgxSr9w2EWfRA+i0r+f0fE= Received: from BY1PR0701MB1660.namprd07.prod.outlook.com (10.162.110.22) by BY1PR0701MB1627.namprd07.prod.outlook.com (10.162.110.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.22; Fri, 12 Oct 2018 11:09:36 +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; Fri, 12 Oct 2018 11:09:36 +0000 From: Igor Russkikh To: "dev@dpdk.org" CC: Pavel Belous , Igor Russkikh , "ferruh.yigit@intel.com" Thread-Topic: [PATCH v6 14/22] net/atlantic: implement promisc and allmulti modes Thread-Index: AQHUYhwPe4jihf+4yki85c0yRSCIjw== Date: Fri, 12 Oct 2018 11:09:36 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5PR0701CA0008.eurprd07.prod.outlook.com (2603:10a6:203:51::18) 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; BY1PR0701MB1627; 6:rTNQfPodsoPxfS6AFU9oqQb6UOOcNq5FoZOhM+5wXxZJg4hFYWoiJYh5rBQ0l/4hd23ox1l6Vk2AGnJIdHPgR74mrN2g4QFraL/88U2nwb9cFf4Quw6z9ZyyomPypugU0zsX6Grc83t7XV4JU6RC3956kT4zxczQEkoBLLVyuQEHELfYFS88Lw/WWZj7a8n2sq39k3kc+KtTO7PAKAFLkvSZGajQhrAfIKN21/es6Lr6QjDriRV/o6MxlQzxwwyA3rIpjXCMEkyCYxHf0hbqLk1Ab4JTngn6GinZXx5L6k4tLkUqEabfQ/vPhxNEEg6u7ojruUgteuwNs27SkZDoAB4FEEMcKK2+/M+O5IujmceR9jbVon3aJn8aKSD+SrBhoDjHwEEQ2LV4piOp6Xdq4LCqoNA/gxavTGogkUNEDk/JplLs92Djz+n+rvY9dz2CpNsg23XH1dXyVuwTbb9vevaeozD7lrynFFlTY795QUE=; 5:vX7s9d+zL7BoaAVx/8spEu1D/vEn4peF6WcHavq3yivGAzA0gLhnuvuIuAtpOFuSJKGJL4F7XqOePTt73KSzVOuUftStND+QFJpUdAjiOptYpmpYh28RHjAaomSzNV7E2Cew62hsG3TI+BJh3X/vP3rvx2K4c6bl03uu7Icfeh0=; 7:ts4TCNPIpT3Tn9x9idDFMBpbL9LEg7z4OlUwnvGuN9OEu+xwgZ3xOx4hT3oLuB+k/LTuLj83BU2pUkKZZKcqlOk9K0qTJ8m4ClefaVBsvQ6PSWnDsrV1/BSSt6Dx4C2s5gq9J89dmEzEmKAYhAG10wNfnnQc6LCH0pP1F3wD+o/4UojN8N50rKTx8FHcBPus8U2uKxErPMia2S6nXUBcg/fYKItXhIkaZxy7RPeyd31veD/I1W1Q6vrxFKjP4Cxc x-ms-office365-filtering-correlation-id: e25ef704-b00d-4c6b-ec21-08d6303331d4 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BY1PR0701MB1627; x-ms-traffictypediagnostic: BY1PR0701MB1627: 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)(3231355)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991067); SRVR:BY1PR0701MB1627; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1627; x-forefront-prvs: 0823A5777B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(136003)(39850400004)(396003)(189003)(199004)(186003)(6116002)(486006)(5640700003)(446003)(6436002)(6512007)(53936002)(71200400001)(71190400001)(14454004)(72206003)(316002)(2351001)(44832011)(3846002)(7736002)(305945005)(2906002)(4326008)(6486002)(97736004)(26005)(2501003)(102836004)(5250100002)(11346002)(86362001)(25786009)(476003)(2616005)(106356001)(54906003)(105586002)(256004)(14444005)(5660300001)(66066001)(81166006)(81156014)(1730700003)(8676002)(478600001)(36756003)(68736007)(6916009)(8936002)(99286004)(386003)(6506007)(118296001)(2900100001)(52116002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1627; 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: 75MgCZX+x6w1nI7RkChrkshMvyGVqUgvz/EDweYy6je6y4TL+L0QR9NU4jaE61WXayx+YxpdtinEWZz/Vx4mxc8EPvORm+8b5wY6IbiI91kusoEAVzU3N29Ls0as58IE7JpT8ccAIxid32E+jsUQkftnaJJmN9Iexg+ATpY0D/fKXyl41M27+D77sLhT90Pk32zjoDUFIx2t2t1rnqbVxhLfFSaz6E+jBlzmsH/2njdrz9jWL/H+ZTtyzqbvb28+2bo7o/mgNDRpkYzFZYDKvjDuBAqUvvJ6lAY5qeVy6EvDPmjdUllpXvUPWtTSRy9o8PJ/tiOlBkuYX4t48Fa2F0cU05rlDoIxO0TP9kIjcyI= 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: e25ef704-b00d-4c6b-ec21-08d6303331d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2018 11:09:36.2101 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1627 Subject: [dpdk-dev] [PATCH v6 14/22] net/atlantic: implement promisc and allmulti modes 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: Fri, 12 Oct 2018 11:09:38 -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 cea9787ba1a9..347ac80a1ceb 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 d76d071dc3e7..5223b57ebd83 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 @@ -812,6 +822,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