From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-eopbgr730063.outbound.protection.outlook.com [40.107.73.63]) by dpdk.org (Postfix) with ESMTP id 600001B396 for ; Sat, 29 Sep 2018 12:32:15 +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=gpP22dAcqGla3WsDhiAkJ9oMBdIG+OuzgXouCn+C0ug=; b=gdhkSzStEW6J9ctTLL0+VrlRW+3kQGkWiCGbS23fKI79HZnaDtUX//6kAufymvdYFPXLSmV0yRdePvkhxDNPLIP36wSFFyFMPEOc/rMkH70W86nZ7FxlfwcO9AZKGjWxrtE52yRt+Oy3VlbP3CrLSqFiuSy3MmAfQQAmJa9ZVEE= 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.1185.22; Sat, 29 Sep 2018 10:32:07 +0000 From: Igor Russkikh To: dev@dpdk.org Cc: pavel.belous@aquantia.com, igor.russkikh@aquantia.com, Pavel Belous Date: Sat, 29 Sep 2018 13:30:28 +0300 Message-Id: <5788ce2f2879cdf3117356987b3f8d84e8f28ef6.1538215990.git.igor.russkikh@aquantia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [95.79.108.179] X-ClientProxiedBy: VI1P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:bd::19) To BLUPR0701MB1650.namprd07.prod.outlook.com (2a01:111:e400:58c6::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e680d7f6-2619-43f0-4e83-08d625f6d255 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BLUPR0701MB1650; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 3:OY5dzgOiz1BzOOcyWdjyKUg6jR8wwO/EM9xbTVofhfQoo+Ye6c6PObWvQXEGfBi0vKBKb40zNuI74CckBSCJzgW8X4to31DMUMt/enApRQEMgnNxOnCHLj6X5US5JR/0YLoY30FoIcNSsPUmNkMRsYuvWLbOr18RD6dtEoVfiXZA9xUTrkBAnKljp+fVcTA0+qicX2vf/AjoIgWV0PuFNAPA50OOG4wTkrmusqMfLY3vBIUQxbI4WOHuHlTsZIYs; 25:IWPB+kIQsl2z6WKsbRSdW5g7FoFO8rBvfPIn2sM8zHffT+pKeEXbOBvYrrYVXyfQTXnuPosMur7KvUkaPop3nP53f4vOlD/+oIWx5tnH6VDI6E9MPXVhH7yTAYOEA3F4f0AmIPrZ1tYHvvc6D498tzqWMwxXWiDr3PKF0SDg+GtUdbs+QgoLM69jltQeYollrELq6w4CHxp7mpsrhDB8+BHsnMVzSmChmul43hN0bPCdLopnGWT8ztHEV1rHOIqHUmG70FyFOsI9UArZGppYOEymyph/kmcrv4vYrnKe7qoD+TuazqA1hHxqOl5BHjHZ+f7hWtN4UW9gitCLe2pPd+A7Mpv1EYEGTydhJvkP4aw=; 31:6muv3xHHjFEwJyQbh1GNZDChkhdGEAtyR3xf3CsqyxONeWgOZMjkFjD/VPRDjHsGxfeT51NreoNomPToYAid7jXk94DN/tMqoXDTxAHEV3h22UYmHExsuX0i44UKJvGA+hKw95YhwgvH4XBzLxfjZdzjhB7thAQuxA2li0n/TWhrFCb/zQawwgKxrBKZ3pGIgxZALGRB7/q/Xoc0mqzn05KWDLxWhvYxY9vMjNFBcuQ= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1650: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 20:ZnlVBRPwW6S6DFb2mgrWvPlZuYLMGhWjDI136vio3qLtujSn7IuNMznnIxPp+/1j77QnUjZzrK8pXKhRSRSuSfIx46S+YJsPWqll6p5X0xsZRksrg13S0jAZj4NiGJRJnZO5OCVuxzZJAyd+uacRhzX3yMhEhaXindXAs7A2GVHZ+6rVRH7tWOFv90bhpfSIWuQvVZFTRynDSeFR7zWKl6v6lOKf+zFehPlRuLjHtI+8gBk3nU0XRPMDf/Uhi+w0+eoti10624odWG1FXpdxQLaiTd93PlCogWezhx2X5vpmcWDC5WnsCd4JFi8+cDCm6qMiLgzJolNzBp2w1utP5Bn24LHBL+g+0hk9N1VPvnJ+DmY/dOOdFCPRVoy0V9PS7iUpPaOj6hIKqEuvKU1OW0xmlFALJABe1+WuGmSj9SI1cnYdz6FywM0D8/gpKFDcL6b5BbWGKXvlarIRdrkT4SJX6MMSnsJLbctPna1cTTys2W07e+oQsW9pXfEJCQce; 4:eMkHEQHnpq499Xqf5wCSxOsuNUcN2+p1nTjVv+iARN7Ib2GUycMAQSlr6zUa+2+qBFM5Bl3eF2PhfcZXoDz0rcm5PtE65pgfbMEoYMcelWkGJWnG/P8chgYxUZIBYMagkF9Pw5si3IdRziViAU+EaTTIU1pHhYN0jGzbsGFyEExVxOeg/cJX3QfwamLrBRxpKqtJCljcdbM3iN/XRFZQrGZqH4yjfeval7Fjxwz+22GAmgiEgvvtAq7v47sRxIF+brpn7GfE/oZ3nn8NUISU3A== 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)(3002001)(93006095)(93001095)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699051); SRVR:BLUPR0701MB1650; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1650; X-Forefront-PRVS: 0810818DA0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(136003)(396003)(376002)(39850400004)(366004)(189003)(199004)(16526019)(14444005)(446003)(76176011)(2906002)(6916009)(6666003)(97736004)(8676002)(81166006)(81156014)(36756003)(4326008)(316002)(8936002)(50226002)(34290500001)(575784001)(86362001)(5660300001)(68736007)(16586007)(118296001)(72206003)(3846002)(6116002)(53936002)(386003)(105586002)(6486002)(47776003)(66066001)(486006)(25786009)(305945005)(50466002)(44832011)(956004)(2616005)(26005)(107886003)(52116002)(51416003)(7696005)(186003)(476003)(478600001)(2361001)(7736002)(2351001)(48376002)(106356001)(11346002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1650; 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; BLUPR0701MB1650; 23:/gS76uuvsSKqXTUZTwmUzmKLmSANfoNJgrMzJvC?= =?us-ascii?Q?GHA57jSC0cIHsNkV2I5ZWoUGzKi0B5t2lBFTDpI8fVYE5PUn66u9lfjo01mN?= =?us-ascii?Q?WvPC6/uKXMuXmY2gHHprMzNWJv3nFYs6H/BoWUO3IABEUiNl6fiVAUe9PTLm?= =?us-ascii?Q?f1UDs8/B7wgbXLw+/ZaYX0REDy29RKWJJ59PGf+57bMRsCwB4L/e3dt9I2r0?= =?us-ascii?Q?bHhsmaw53y+rM8FbP6QM3DHylM2Le2nfuuRgt5lr+3LCPXPfdFcBbFjwGmvK?= =?us-ascii?Q?aL3eA0VS0loullUN++EOkmTQ8TVNyjuznxb+8FhstWdtmhYfjU/Ed7VmNKDk?= =?us-ascii?Q?03IvXZuu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9qm8D6cePE9YbjPRhXiBSicn/XIHF0y4aPR1qtehlv7EsR27f3ptYMAAsWpM3fSH2IsJHUAjAV0RHNJMCVs3X62k8SASY5nA649mwa87cKZVyIERa8+8612WxFVrt7sapF6Xgp4M=; 7:4WqHoyIC1daE3uswtffFWagIjDp+xK/tgO22oqhFynCpW/hrHoKHaDpPr/vNXJ9wmMUWtQYwOUZ7zmokuoWQvtWO9y8PyIytccCJffuOijpWaip3eSoeDAcjGbB270bBzh1sFy5cAbkudi1ljkTacciXZvhX3ZgN3fPtJFulTj1HP+xc4Mt/cqY5JhdJBJu3hMlSFSdFJpiDsCBIwqUouj57E2gkR8psBMC/87OuTfaq3HFlIZahfVvqV/3zDLdK SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2018 10:32:07.9551 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e680d7f6-2619-43f0-4e83-08d625f6d255 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 v3 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: Sat, 29 Sep 2018 10:32:15 -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_ethdev.c index bc0cb3da1f66..e71be3e14ca5 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); static int atl_dev_xstats_get_names(struct rte_eth_dev *dev __rte_unused, @@ -167,6 +171,12 @@ static const struct eth_dev_ops atl_eth_dev_ops = { .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, @@ -905,6 +915,40 @@ 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. -- 2.7.4