From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0078.outbound.protection.outlook.com [104.47.32.78]) by dpdk.org (Postfix) with ESMTP id DE9208DA9 for ; Thu, 13 Sep 2018 13:36:09 +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=NnuHw0LSf0j5uoqmvt8Ib74yhTfbQjANBlRIjiabRhI=; b=jx7eM31hlzlQQE/kAgfk4tIRairH1PgcCBG1Z568a+EdazJHhlnSUkGMaEWF56UdLMx11ELb9zewwqh/WXBlkb/gBZplthpcHWOzS2Rz+O1+LpvGbnTOwedOCvx27w7bH/eI4PAK72nEJvTQE40/bV6CIZpX67TSrUNfgEMItdE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; Received: from ubuntubox.rdc.aquantia.com (95.79.108.179) by BLUPR0701MB1650.namprd07.prod.outlook.com (2a01:111:e400:58c6::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Thu, 13 Sep 2018 11:36:07 +0000 From: Igor Russkikh To: dev@dpdk.org Cc: pavel.belous@aquantia.com, igor.russkikh@aquantia.com Date: Thu, 13 Sep 2018 14:35:23 +0300 Message-Id: <1536838528-11800-16-git-send-email-igor.russkikh@aquantia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536838528-11800-1-git-send-email-igor.russkikh@aquantia.com> References: <1536838528-11800-1-git-send-email-igor.russkikh@aquantia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [95.79.108.179] X-ClientProxiedBy: VI1PR0202CA0026.eurprd02.prod.outlook.com (2603:10a6:803:14::39) To BLUPR0701MB1650.namprd07.prod.outlook.com (2a01:111:e400:58c6::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93542d44-02b7-4f09-61b8-08d6196d1946 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BLUPR0701MB1650; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 3:y8KV0PGejfvT0pqbLSgjrWAR73ASMkW05iSdrKMSCmZLDy2JLo9gQsg0f48AcG0/1FG0Xj/HIV1dZeCr56+kC+hCfRDsvANUfpgTjtczxOpwngJzIABaol0nCzBQb0IuqJWmX5CG095SX/ceKgDuOt7JKOZJlf54RabjlVb+ekjeq5l0NL2qkFRVKZ0RFnF38d6Q3wu737v1XQZb48zA5LIaxK48gq6nM5Cjxd8YVYGI6p5TVkoe7+yapIqY1ZSE; 25:X4T8fBzhRHDZ9NOZBmn0q0MtocoEAjG9CjvnjOkV8AH0NSEAgG5+6Pr8w3RVJyuXJUboPIt30LYBhccfc70zfqHUmUCFbSI7P4cTSUaImJ2usMTWge0x3u81kHohTbvYhx+FNTaytHbBCUdeFj7sfzJlPfni0Jlqmz7G2vlwp+Jkisj5Cf+Q3zZ7vB1KJxhLhQYSV0JbvQqG2kwiUOhyOyDDplweM4TtixORdN52G0NDHajcUPq1X0UEIWIUSSN5uMQU02wKKD7R2QH2kI9biq5+mdDsbAo5O54p0np4vsBFvYYWLQrAP2MDpSnLQRMjazxQRMKvcHHTpBKqVXBd+cvEPjrOnHPaR+kgttpOsRs=; 31:1rxk7/fXswT18HqwUNWpCA6EEsRPK2CukA74iRPZxoI0n7GtpIF4LTj6q08tcNkaYCi4yQujs1VBpMViEVvT+0d0sVajMR+enXS/810f9rr3XangW/g1tIXQ/ei4AAPl+oWTEjx/HYYNJVeXgYeLDgykT7wtKXrn8yc7u7KxStbRc+2YbAslxFXDzJ1QLVVhyY7/hwv+8QA1/BJeaBk+Luj9NStuoWi1nCo47Pr1bV4= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1650: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 20:6Ebg8hWVcLXrZfOd46om9TBOz6/r4rYoscUE8FkaRwje602EzcsXeAT8ZN0AkbLc3SeZTMv2nv1JBYbl03NVOW+jfU6TCnu1DrwJtRTXOLpV7MGsNEbAQRMOt6/A27aDCp602a8Z/5y9ew/UFRo3aU4LLd4JXNei8ckFLwjdQL2IYjVbiqEXJJx1ScWC3d1mZrAPNrkgamLNzVvCurhwj83uHOVOOIAXtz8jxuxSJTe8DQEnWIQ3jmn7b8DzNzlAOInJnRbIf9z/4k/BfIDzSM+PAhlPMUPCHIJwrBj1MK2PKdkFNoU0/euKyXmNYyaDlGdavAS56r8Sq7iY8zgCULWlJ8C15B2/kVgc7QZxpcMZsAkkJlttdKhKpS63wQxK5HqaBQWpzWWF6Xm/wuPA99VcC7YzcPTuZ8tH7+V313WoMfOq6sfsMWbQxq3TamByl7wvTNiy23hKv+jZnJdofypewgyB5UYF3n5GunjNaIiuYkPISjYUAnzBYJ2b/Gqh; 4:R80RbI3iXkdARE4ekwPlulaPJI//wQKdyxEZTbfTQu5VN4vMPRRMagjDGgiBEwN4VPs0Ky36glDOkexQM0Kw7hqwq2b0hkDoDSrHdVRKP2VG5zYOm87STdeMt/4/jOgRlE0eQVB85pWzJ1Emp/0oNKbsIOZjQlNgdBhXJbx5O6loOkv16/2gFeV3G+hUe6uI0OoLa+BrLkNcm4yiVlRwwWPEgsAsNaLD6wcev+dN0rN7gd60xVYvZ5nF/ovF0y+R+b4gY5WitBn+FRieE5aScw== 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)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699050); SRVR:BLUPR0701MB1650; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1650; X-Forefront-PRVS: 07943272E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39840400004)(366004)(396003)(376002)(136003)(346002)(199004)(189003)(6666003)(6916009)(97736004)(8936002)(68736007)(25786009)(50226002)(81166006)(81156014)(4326008)(107886003)(6486002)(51416003)(2906002)(53936002)(5660300001)(36756003)(86362001)(316002)(52116002)(8676002)(16586007)(7736002)(305945005)(11346002)(446003)(476003)(956004)(47776003)(72206003)(66066001)(44832011)(478600001)(486006)(186003)(26005)(16526019)(14444005)(386003)(48376002)(2351001)(106356001)(2361001)(2616005)(3846002)(105586002)(50466002)(7696005)(6116002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1650; H:ubuntubox.rdc.aquantia.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1650; 23:7WxppsDg/AX/is0VFeteHI1wXlgy+IFnVQWHZDq?= =?us-ascii?Q?C6c2RkPSfIfT+fUzz7PyFHcZx+kFPeLD59dZ+DH9RByIXCHKmbrDzVGaqBP3?= =?us-ascii?Q?PqCDwOGF12MVnhyJmFSqflkZMXVbDUTWreySgoxvRCgfSjnkOoUA5yO+YRt1?= =?us-ascii?Q?VCYEmwONra4JkQeo9jG704dxBmpOs/2Iq/wpXq3+OysDLzpSJ5ZDYn15Jnv2?= =?us-ascii?Q?tYBUuJx3FhMcJsSJWu0yx4ifIDi42mKCjRMemV9gfO/uhlA+gaGlrYWKyY29?= =?us-ascii?Q?ny4zKkHTk2MNG8BRq1z+xI8Y71jRYDhFwRYx6SG1WuxEs29Gj8yLcEV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LhUVW0RIGXfBcGGuXQeZs1t0bpbQKZMoYDz2G4RsgTDIi9/fK8DH+mQVPkYLVQ0=; 7:ZcBkz3L69D/WmJJBrU+klGc9xWMLYc6Av+X/Id8UBlA0/XHM7/3xO6KGCCcgy5pTr2b8yJmz+MOlkNVBYLgAVEvBLETtokqmVnhFtrG0Rgm3x9uf6NC6JfArnKrqvQ2HVg7iN+7A3zpLyM16DVxLxTIXw/vFaxIgwXG5mifO4R9JBcbLQmtCyBN+VasxmOubgV3saGWLx2uSCTqXAVBEu3pTr0q94goayDC4wDCxWHwbFLVoz5GQoeiAeV1Y4QzO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2018 11:36:07.6758 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 93542d44-02b7-4f09-61b8-08d6196d1946 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 v2 16/21] 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, 13 Sep 2018 11:36:10 -0000 From: Pavel Belous Signed-off-by: Igor Russkikh --- drivers/net/atlantic/atl_ethdev.c | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 08f1a07c8..44bdbcbb3 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -53,6 +53,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); static int atl_dev_queue_stats_mapping_set(struct rte_eth_dev *eth_dev, @@ -188,6 +192,13 @@ static const struct eth_dev_ops atl_eth_dev_ops = { .dev_set_link_down = atl_dev_set_link_down, .dev_close = atl_dev_close, .dev_reset = atl_dev_reset, + + /* PROMISC */ + .promiscuous_enable = atl_dev_promiscuous_enable, + .promiscuous_disable = atl_dev_promiscuous_disable, + .allmulticast_enable = atl_dev_allmulticast_enable, + .allmulticast_disable = atl_dev_allmulticast_disable, + /* Link */ .link_update = atl_dev_link_update, @@ -735,6 +746,41 @@ atl_dev_link_update(struct rte_eth_dev *dev, int wait __rte_unused) return 0; } +static void +atl_dev_promiscuous_enable(struct rte_eth_dev *dev) +{ + struct aq_hw_s *hw = 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 = 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 = 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 = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + + if (dev->data->promiscuous == 1) + return; /* must remain in all_multicast mode */ + + hw_atl_rpfl2_accept_all_mc_packets_set(hw, false); +} + /** * It clears the interrupt causes and enables the interrupt. * It will be called once only during nic initialized. -- 2.13.3.windows.1