From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0065.outbound.protection.outlook.com [104.47.38.65]) by dpdk.org (Postfix) with ESMTP id AD5EB99DC for ; Wed, 23 Aug 2017 16:03:31 +0200 (CEST) Received: from MWHPR03CA0014.namprd03.prod.outlook.com (10.175.133.152) by BN6PR03MB3315.namprd03.prod.outlook.com (10.174.233.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1385.9; Wed, 23 Aug 2017 14:03:30 +0000 Received: from BN1BFFO11OLC004.protection.gbl (2a01:111:f400:7c10::1:186) by MWHPR03CA0014.outlook.office365.com (2603:10b6:300:117::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Wed, 23 Aug 2017 14:03:30 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11OLC004.mail.protection.outlook.com (10.58.145.15) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Wed, 23 Aug 2017 14:03:29 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v7NE2Q3I004389; Wed, 23 Aug 2017 07:03:27 -0700 From: Shreyansh Jain To: CC: , Date: Wed, 23 Aug 2017 19:42:05 +0530 Message-ID: <20170823141213.25476-33-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170823141213.25476-1-shreyansh.jain@nxp.com> References: <1499179471-19145-1-git-send-email-shreyansh.jain@nxp.com> <20170823141213.25476-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131479706102675960; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(105606002)(97736004)(8656003)(33646002)(2351001)(106466001)(110136004)(77096006)(50226002)(36756003)(50466002)(5660300001)(53936002)(15650500001)(356003)(48376002)(8676002)(8936002)(305945005)(81156014)(81166006)(47776003)(54906002)(76176999)(626005)(68736007)(2906002)(86362001)(575784001)(2950100002)(4326008)(5003940100001)(1076002)(6916009)(50986999)(6666003)(104016004)(85426001)(189998001)(498600001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB3315; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11OLC004; 1:wX80Vrj1ia62Ct4NBnSs6fuqliPtDfKJM/2DuCQIAPzSQjxsQ1cLKJAqqT0GaIYCmIPHKXlHWnq0tYFK6FWygHyX7OE9v5Jiw+Y+slwQ3D7DVUR/HCDBCUjtbdbl+wzL MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 57d0c547-c460-492c-d899-08d4ea2fbbe0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603185)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BN6PR03MB3315; X-Microsoft-Exchange-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DpE30P63ZUn6Uz03aetjvOBBJaYuzwwtZ9VPv8JfqxfBexSOx2u5sg/j0rDqKVgh+RQoccyrKW5apJ3bSe8mp9bH+jJo11GNnGt2uIdCPod5mCIsoPQ199hNQm75lzTfSrxliVsWKFaQuLwtbqSBQqst9aIwveCPulrNsky0nrX7seS7BHp8XbRTOStSJnYpLIH2PFtvrKWQz3KbVHiLApOfluLMUio9BJRSU+9vYr324NrsriviclJ6MKJpy0BoeaJ+PtwB7py/c= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(13016025)(13018025)(5005006)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123563025)(20161123556025)(20161123561025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123559100)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR03MB3315; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR03MB3315; X-Forefront-PRVS: 040866B734 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB3315; 23:SptwjR4vNpUtZbgQ5N1Bj+CFJXvKPMc10LPoCqRZe?= =?us-ascii?Q?xYRZfWKO9HIIwQs7HKV5APyQV6nI9hgYMBSswv/vunjAdbwsyoIb+HoKCQRj?= =?us-ascii?Q?gakIhBj/JkyAZNVcUjdk3T/9yjYrRzLlxkl05oasFc5+9iOtn5Gj7cLDwAAk?= =?us-ascii?Q?PJ9+FLbIdq25oJEidfx+ADBXzfdc3YQU/rEeTKwBqBXNIspSnzHIgPbyyyrl?= =?us-ascii?Q?y1mvLrxU9Z9GKLot47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E?= =?us-ascii?Q?Hx+gsPzbVyFYYRVrvbzKfHmF35C3qeTY4U/3fB1iRC3rWxQ2WghfHmlqDCfw?= =?us-ascii?Q?1ioC0FzeR9GML3x68Yzc6zB418NXMsiX0sg?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3315; 6:c1mp4kVn2kphjpN2deXiBmATmj2g0ha9gKt0GQqmL6cbS4BY/vL1fzcB81AMLop4gGiwZsdXYTAKTV+fQXYgMHHecjnqhOhUbq2Jt7iDX8F0hBKw3o6ALImBHpNRpibntmJaem24MJxFGkK0lIHRQLdAPWvIok3NWrsyqVRzWnwpHZD1+d3yHWXxFoV1O+YD6ynO5NOqr9blWytuMjX+uStXeT1Wess0m0900dqcmEdvqimXaPqSfpekv5afDbzcRHJvUVOPzGdkHnmrWnafrEJ2/SuXwieUSfLJL+jF32B//Jfz8BzEU9C6RQQSRH0mfhYZbu0yl9P8Fa0MyRWwRw==; 5:D3VziT1f1PHMoK8zWCxOJEWtHDxJu4ITzmDOfB56A5fA/Xx5Fg+1DspDY22oDDcjNNO9QEOqMSM3VE3unXSrZSn8s1bY1pZLackxHkrxM1yl2X18AQ2NtwDZfriS8nX8ClkMh8mwDSuvuasgy2LFKg==; 24:xsL1YIhD59G4cJNnghZfareaanaNh00Rvo8voUHixybRMoTrUuWNl3MWyhUFpds9AyGLRSC/dNeD5krPPQGcHfja1MtBWCQZyw18wHC4ZpU=; 7:WcZyi+fCqeYD53EXzObwRyawZc9owFkU9LMI3Mpv4qusBujtLGCTuglUd15uKp1Jd3i44YiD6opXN1aouTfP5wjE1LH8dsV7jtFpa9t0CAGYmMdUeB1KqlXziyuxpCRu2Hbqu5K7oTAz030RDS8kT3RL+CVvgbMPPmEdhPgIi+PyH1K9FfcIy3wvqNrCnVtXLO3krzvkkE//HPcZWFGLds1FqvJyiThH+XLDJlAntvg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 14:03:29.9087 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB3315 Subject: [dpdk-dev] [PATCH v3 32/40] net/dpaa: add support for MAC address update 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: Wed, 23 Aug 2017 14:03:32 -0000 Signed-off-by: Hemant Agrawal Signed-off-by: Shreyansh Jain --- doc/guides/nics/features/dpaa.ini | 1 + drivers/net/dpaa/dpaa_ethdev.c | 55 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/doc/guides/nics/features/dpaa.ini b/doc/guides/nics/features/dpaa.ini index f21a85f..cdf5e46 100644 --- a/doc/guides/nics/features/dpaa.ini +++ b/doc/guides/nics/features/dpaa.ini @@ -10,5 +10,6 @@ Jumbo frame = Y MTU update = Y Promiscuous mode = Y Allmulticast mode = Y +Unicast MAC filter = Y ARMv8 = Y Usage doc = Y diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 982e762..d7b0e16 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -310,6 +310,57 @@ static int dpaa_link_up(struct rte_eth_dev *dev) return 0; } +static int +dpaa_dev_add_mac_addr(struct rte_eth_dev *dev, + struct ether_addr *addr, + uint32_t index, + __rte_unused uint32_t pool) +{ + int ret; + struct dpaa_if *dpaa_intf = dev->data->dev_private; + + PMD_INIT_FUNC_TRACE(); + + ret = fm_mac_add_exact_match_mac_addr(dpaa_intf->fif, + addr->addr_bytes, index); + + if (ret) + RTE_LOG(ERR, PMD, "error: Adding the MAC ADDR failed:" + " err = %d", ret); + return 0; +} + +static void +dpaa_dev_remove_mac_addr(struct rte_eth_dev *dev, + uint32_t index) +{ + int ret; + struct dpaa_if *dpaa_intf = dev->data->dev_private; + + PMD_INIT_FUNC_TRACE(); + + ret = fm_mac_rem_exact_match_mac_addr(dpaa_intf->fif, index); + + if (ret) + RTE_LOG(ERR, PMD, "error: Removing the MAC ADDR failed:" + " err = %d", ret); +} + +static void +dpaa_dev_set_mac_addr(struct rte_eth_dev *dev, + struct ether_addr *addr) +{ + int ret; + struct dpaa_if *dpaa_intf = dev->data->dev_private; + + PMD_INIT_FUNC_TRACE(); + + ret = fm_mac_add_exact_match_mac_addr(dpaa_intf->fif, + addr->addr_bytes, 0); + if (ret) + RTE_LOG(ERR, PMD, "error: Setting the MAC ADDR failed %d", ret); +} + static struct eth_dev_ops dpaa_devops = { .dev_configure = dpaa_eth_dev_configure, .dev_start = dpaa_eth_dev_start, @@ -330,6 +381,10 @@ static struct eth_dev_ops dpaa_devops = { .mtu_set = dpaa_mtu_set, .dev_set_link_down = dpaa_link_down, .dev_set_link_up = dpaa_link_up, + .mac_addr_add = dpaa_dev_add_mac_addr, + .mac_addr_remove = dpaa_dev_remove_mac_addr, + .mac_addr_set = dpaa_dev_set_mac_addr, + }; /* Initialise an Rx FQ */ -- 2.9.3