From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0060.outbound.protection.outlook.com [104.47.42.60]) by dpdk.org (Postfix) with ESMTP id 6124B4CBB for ; Fri, 7 Sep 2018 17:23:34 +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=G+SY5rHn0q9gOJ9pI6zyxFsleNRfYcuQIDJ0zP+dpkU=; b=pEgCt9H9KKrZmzqkx3opOfyI1tsix3R1mXk/fhxm1M571yvFY3pzVAsVPyZ2og+p46kSk2RjU3dBGF/HWnpzLLLlciea/OPQ9TyzstmS3Uby/GlZASdNbM9Mdqr3V58U1XoMiFYTJo0D2rTSZyehht8sWZ6O/WB3vXsTzC1aLXM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; Received: from ubuntubox.rdc.aquantia.com (95.79.108.179) by BLUPR0701MB1652.namprd07.prod.outlook.com (2a01:111:e400:58c6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Fri, 7 Sep 2018 15:23:31 +0000 From: Igor Russkikh To: dev@dpdk.org Cc: pavel.belous@aquantia.com, Nadezhda.Krupnina@aquantia.com, igor.russkikh@aquantia.com, Simon.Edelhaus@aquantia.com, Corey Melton , Ashish Kumar Date: Fri, 7 Sep 2018 18:21:54 +0300 Message-Id: <1536333719-32155-17-git-send-email-igor.russkikh@aquantia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536333719-32155-1-git-send-email-igor.russkikh@aquantia.com> References: <1536333719-32155-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: BN6PR20CA0060.namprd20.prod.outlook.com (2603:10b6:404:151::22) To BLUPR0701MB1652.namprd07.prod.outlook.com (2a01:111:e400:58c6::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d7fa31d6-8fbd-4cbd-ce70-08d614d5df2f X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BLUPR0701MB1652; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1652; 3:Al+aAmCYHhwhUkRO3THW6aSXCCgZ18WJeSeDZeuTvjcmvH/Tysc+Ya2AUeRkfQ+zexmyw3jfWA97n6tEerYrZo5RqryyFxfzbz95bQvlwIPym413xo4SUPMFtpSLv485oHNgwqwJdykVWpFlAH1uI4VHP4UkZQ+i32tkgrOOHBaFlb0D+PPsNzybl1RzJfeUYdWlPHTo/ZHVWV9bJYROzkkDD+s0lVdT0V77x++cTzD8DZts7KP156eO87jM/YZk; 25:6+nAyPg9I+BfeKwGkV0pIWfDdmlp0s6WoFnnqfa/6sSsCh/8D7irwiaKQturiN8OfvmTMAfkZ9R92dPCOxUv9rmpniM/I8PUMJkxWhRow3dmp4033fC6quJ7CToJzYv+cvUV+/1+yEFJ6hp/o3yfHD9hJ/39e6rG2YtPicJMVYHqn/o2k7ph3ijisFkTJ3qRirJdMQEKEUJILRpJTQzDZLRBq5/u8YB7/eM6Z+0ilr7tdWbtFnw9a1BCw5jVkbBi66w4GtE17f25EzbOd4V3ymdMWFB6iPB9jYiUyx+JsJOxLOUN4tKu4DX41/pb4/R+Vqrl6FOF5J9wMVloRVggJg==; 31:mqReeCbmAcuMlCdznBaLiTHn94tpj+oRg6uWN87JR8v1zp7BVtw13ipYaoneffOXprkM9wrqTGG8VBMgWWNVf/4pyrTudvuAoH8Y2m7qTm/BoJ2eFT9POAbb7VBHA3TRJummWG8uTM9C5MONsI++r6q7hMuAQcKrTtMOHWKBrHv4TUp5mAkN50kZSKvxmT4QREF0+meDDL0rkpFKnfW+ke1Xmy0o8WPkb+KF3jugUzo= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1652: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1652; 20:7ZWs27z8OzusghA4Ob2hJeYMZ260GBG4DO+ogsIADgL6jn27TXFoCx2FKZ22geAvjGwTnzoUgSFKDLpcAUEX7ootZEKGBVRYasIYiwMfFRECRV3KWLhR8kD0uGUZuVWntR3id961P7B8eSuzpPf3NqBz9v6+2Opgjv65mX+SX/kl3zydKdK9Tkz+kS6icUjQmYQHKry6LDr8Y5YNyUjokkTd6t7skfo8rMsyI728sMEP+OZPeedQDSKAkHo/WB+yWMxxBF59gv/nMh/okvG7sHYyr3ftwonlR0SZRwoKDNdqlnLrzPGwMN/n5Cu09ct0K4tKwMxUZONlqjgKtPqVrnB07G0nAw26GcDRTnBIAnF4tlsZepzCQP4R34Eu2VUf6MGGFcZk/2QmQh/aMhBCGqnRf/PSAbOllX6l8/1yxo9iBGyD0Vu602lsO6aJlFVSDqS41n7RhwU3sAIh3ePK+lIrve6Di9A1dJEZYrb/wWiX06VXQ56or498vdwOVyC5; 4:5/w2SmXo/lcBbltY4R+8g/SiTt6f45r4ucZ2q1hoM/ZElriSe2HeVAtoElEQC1PAnuAxoN+MY8+nMNdAr4Cfmo4E+RxGJ69GVg0R3+pAgF8OpLEToQzBs5LD5LKwRxlt7Fg68FXMgi7sGd8tVowF6lhrbrPMs6LD1ypv+nG36Fz4ChorVW56RmqFjDqY4g4+HQLax89ZaJoco//Cutha0Mof2MBv7eQCGqUiHNo/bUg325vL10W5js2VUZaPMMWsU57VXiM/s7bwjdci+h8glA== 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)(5005006)(8121501046)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699050); SRVR:BLUPR0701MB1652; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1652; X-Forefront-PRVS: 07880C4932 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39850400004)(396003)(376002)(366004)(346002)(136003)(189003)(199004)(81156014)(81166006)(44832011)(8936002)(2351001)(486006)(106356001)(2361001)(105586002)(446003)(2906002)(50226002)(476003)(11346002)(956004)(2616005)(305945005)(7736002)(16586007)(316002)(54906003)(14444005)(16526019)(66066001)(26005)(7696005)(52116002)(8676002)(51416003)(76176011)(186003)(386003)(68736007)(478600001)(6666003)(6916009)(6486002)(5660300001)(53936002)(47776003)(4326008)(25786009)(86362001)(48376002)(50466002)(72206003)(6116002)(97736004)(36756003)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1652; H:ubuntubox.rdc.aquantia.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-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1652; 23:QxlqKk1IwyKNAT+xPlK1JXJMblafX5fSQOKMkKs?= =?us-ascii?Q?jTlZZ+vx6455K64RXKbwiMW15irY6jboS0jAzuV947/JSInIQcVVzJovjLOt?= =?us-ascii?Q?pS/36WILKZXgEAPRvpK5uUGqXw8N5H7+sLBruIgxjWldTHc2Ve9f85JRKOJI?= =?us-ascii?Q?ZJqchwsd0qKqcJQ1GaT1m3g6Vl8znlYz4bjw2aD/WJSJsHMoX1YgXLOwTr4l?= =?us-ascii?Q?/rVv3udGjeTqDB5zmWWK+UoU4wzQgnoswNiJI40+Nvy3g95wA0kVaK3GHs/T?= =?us-ascii?Q?Mn0mYUtoBclxQ4WohcU/FoAMFAdBE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6L16cqn4ghmVFllIYu8aG52ffV9JkAya/PFFS0QJ477Pb/zoEDAWJkzQZYCNdX+Ek4IdsmiaXD3YXqFQaAflmckOs0pmTjbCopdf68Ffaq6VSoRssEC15uBVqDlm/w=; 7:4qKiJJE14ODtn59jfADug5Z+VQ5DK7Cg93w2hLYh9kbnNDVjGRfdecuxUSTyuvZQplsrFFkyzFfssh7cBly8ukUFVaMQs1GE+GuloQdmrz25ss9BhJpR9iMkOofPGyTekdd1b30eVIOlrbZUFsjtJAzBsns8RURSyHYO9KQQo7Q/ntjljZI7X722jiQlJwe79JYViaiLi4kxg/Gup6lNNBVXi/DAQb5l+ghI5Us5LqVBhEmTJK833Lgt8UknFVDX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2018 15:23:31.1144 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7fa31d6-8fbd-4cbd-ce70-08d614d5df2f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1652 Subject: [dpdk-dev] [PATCH 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: Fri, 07 Sep 2018 15:23:35 -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 00e686639..b3ec7c492 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, @@ -184,6 +188,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, @@ -728,6 +739,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