From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0042.outbound.protection.outlook.com [104.47.32.42]) by dpdk.org (Postfix) with ESMTP id 93C401CFD8 for ; Fri, 6 Apr 2018 14:37:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KGYlpvKKduLVHk8Ovr6zEL8QKvBgnpJjX0gIueuzSrA=; b=KEhk1oEsHoL6PMYrOLgHsv+beearD3JL2pXqrNHRt1I6fZkGqBJzkWawrMkBonj3sRHXZG/xlDancnXVd1mWk/aBiy/2m0df3GV6ylTHMRbPtXiYMud0EfR6sEy5oAWwyUA88YQWqSNkBnJ09lUJnJeS4Jz8e4RMb36X8znn19o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by CY4PR12MB1509.namprd12.prod.outlook.com (2603:10b6:910:8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Fri, 6 Apr 2018 12:37:33 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 6 Apr 2018 08:36:47 -0400 Message-Id: <1523018211-65765-14-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523018211-65765-1-git-send-email-Ravi1.kumar@amd.com> References: <1522910389-35530-1-git-send-email-Ravi1.kumar@amd.com> <1523018211-65765-1-git-send-email-Ravi1.kumar@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: MA1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::23) To CY4PR12MB1509.namprd12.prod.outlook.com (2603:10b6:910:8::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 52e518d8-9825-48bc-8f87-08d59bbb2c16 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:CY4PR12MB1509; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 3:F7cB2MrnX+2EiRVbQUW4OzV1oQBIYafcZPV1IEKuxp+WhjPD0IkdpJPb8RY6cy+E/Enzl6LPakDH3lObuHQgfIbbgfCY538uDLIjXYmSCLylkMNHK09VJCWdZZLtk1bSwggTAzDNvapVlY6P0XVSQNDmVZegmoacBCG+N5rxE8XjZKBHApdP5S9ErqJlhXgAbqad211q+BFSBcEdpdqzgt+b45TTjVpMRNkTdDL6XPrC4VHt3WY+N9HLQkkSfH5a; 25:gVmyR1Ez2NMq/J2E6Q8pToZskdeplO/WjL3RdSdlpjMAdrNI9y0G1UcBjhKHnAUnh1aphh9jQEDB/He2E5f6/pOkStnFff8raxIw+d5SBIqBg+KQGpeGl87E4nf1O9JmxAnndAXi++yGoGQ73/qu+7mZuUHeXwj545D1eJtS1Ommy++fVeJ1ddPK5hltvJh2VMu+uthRuNPoC4Wn8WG8Wcn+Xmz+vmmrvA31OCqWue+PoDL/oLei/sk5n2B1V63tvKu0OhTXyDzk9GhPP/A84dtVvISlewjEuTLYES+LJE2olqGnCh5iYTo1nCal0Y1LeFMUGr3Y8RJk51jJwXcbYw==; 31:V+EJjcuRLyztO/TzvgpBxYGi5lWJJDvRE+FyIz5vw/aJ+6HqlPs2EqClVFHaXWT5yyFhhs0gLmlGrlVpXIcrc1kd2hDF160d+mdsXgsk74qd4qCu72mn2nEFcCwUQEqot2p6MYc2teRjBuLlsVxTP53AFlTCxUlulUCNv+7pUGgiHsC2HR3Ajf9JhOdx0TuFFE4u63MIENEK+tlHnW4JSYxsCZ1VBQU5u94X3qTPLVo= X-MS-TrafficTypeDiagnostic: CY4PR12MB1509: X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 20:4lBGAR/nqvZv/DplTYX5euXXIVtIAS7R2r50BPUXS0hwdy+Gmlg0Dbv8irvWvNY3VrTNTHBFVXRcOTs2X7BIEUNUHYFAetRmpn2F14m2tBN67PVvoFrm+OvyoN4Q40hpNVIOvnirry8na5SFcN5873Q66F/qyPz/6vxtlAJLjwOzKn5MPU7oqa/OYhKG0BUHK0SoxkxWrfFa4NGHyJzd2hYhV6foWaAalH7+OB0OilROqlUkwUbF7Oe//RQ8EEMfrJ+eRux4LVOgj/wZQuVlvbEgY+go6JkndEe6q8RYSMvrcHDYJzG+p2Wl0fmh5Fphcerhs0PXjLgR5s/9PbQ+36+Tis9Ahwy9DMsbe29oKesK9rZbIWXmomdySrSrQn/PtqHIS7kwQ27T27rCiOYXPJDjIStq9zJiVhrfSohCvXZOBpWg3By+pSer0WF07nHMgQvfP95x3r3SSrxoEWMv9yFca9x4J6UlNWw8/RrvUTMnDFXLRKa8YZuSCOYWFA+M; 4:aMTS8BEq4LwODM8hW2U052vim06a5/vtmUo1it83tp64KvEYQQB8wkiDcCiUAn51rMgsYHR+8e0scf6+xpD58t/Yrp50Em9G5T76ZXrbwhZ8dwYwNqVuzIUejkZs2NoSUKyxlEmWgkfovaD78H+J2cfdtzYC/UwIItu++lpY3Bp4oCS4T5geKKsVWxM+dekVAOlQH+YEGM0IaNMbsTeIj8fIX5Lz8XOt9pMfHfVHRlEx+Zmk22WHyONqP5PGkPMilYJic/1Rz0isemW1t3lK8VhQ+lWIm2MZBcZBl2iHbRYKnnmLkzc55uHIeGmG23Bg X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231221)(944501327)(52105095)(6055026)(6041310)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:CY4PR12MB1509; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1509; X-Forefront-PRVS: 0634F37BFF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(39860400002)(346002)(366004)(376002)(199004)(189003)(48376002)(72206003)(7696005)(105586002)(478600001)(6116002)(50466002)(3846002)(446003)(486006)(53936002)(11346002)(68736007)(2906002)(2616005)(51416003)(386003)(16526019)(186003)(26005)(76176011)(956004)(50226002)(16586007)(476003)(316002)(97736004)(305945005)(2351001)(2361001)(25786009)(7736002)(36756003)(59450400001)(5660300001)(52116002)(8676002)(6916009)(6666003)(47776003)(4326008)(6486002)(86362001)(53416004)(8936002)(66066001)(81166006)(81156014)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1509; H:wallaby-smavila.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1509; 23:JI3hLeBv7S6cVGu28/B+WrtaHTwnXBiGzkW76l6Q+?= =?us-ascii?Q?zdbqfHokyrx7Irl83fZNKr7qmp7nFJ7ABbDPypAK49UMfQRKS572faubDMpe?= =?us-ascii?Q?+tbwObLelJqhgmH5c/gbmOKvK4I3qaemyNyLAGcct+nx+k5tG4nZHiQprSiO?= =?us-ascii?Q?tqiamvv84CKCjBPYPGeMflWPNbUaBW6cWxRmo3RnAt3/HWO4XIiKpVIhyvSt?= =?us-ascii?Q?PSjDDLLHIe2LEpy/QIsGbcFBxw76izwENQfQpJc0GGjgJYsk/a/w6uIj1/EY?= =?us-ascii?Q?z8w67VEOaNxePIZexiKo2KqbliPwwjiTbuXapQ2EMbkQCPydzmxIv6SPu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YXmsQ0Q7ArAHIX0JmjMlRsBi5hg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1509; 7:3Y5xKCfaAnn2g0FnkiCJA4BkBsoSIN97HIvuzqpt/LRrtJP74NtuXdW5rqJr9AXUAjjrkBb5gcu8HnWwEVMURtKjC0QXc1Vf2sVrwpz6nP0L96oDXSBqq0zVEJazmoe45nW4XjsQf75FQNyczX4NqD3bAfAFsCxkPFpyYRgBLobd9z5aezVBeH8u2PNtjYqt4VWGRqnYotNMNcgMLFHvGihneuCWX6gpz1SwZmJgmVRZ92hj4VW5dnO09+aFCiLa; 20:rGe9PpXiDn/ObxbbE8tkXE2vMgkX5RAOA6MIh6BAIC8xZqBDABarHuYSVgo6HwvR3LzYAF8raPWqoyCwPRjYtw39G0UUfj9E86M6HWbZUSeP+R1FlE9qyH5r8WOLWEfXM/pH2HAo5Qw+bF1Yk2mhnyrO0GzqsIeTor3MAyMrmdBlWOdsjmKPGtyRdDAxEpEoDCZcWQa5PoKACPwIXJnpedfDEuo/WX5H1IIJ318joEcEqeuaENYQjubcYfsIzyXE X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2018 12:37:33.3971 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52e518d8-9825-48bc-8f87-08d59bbb2c16 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1509 Subject: [dpdk-dev] [PATCH v5 14/18] net/axgbe: add promiscuous mode support 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, 06 Apr 2018 12:37:36 -0000 This patch enables promiscous and multicast support for AXGBE PMD. Signed-off-by: Ravi Kumar --- doc/guides/nics/axgbe.rst | 2 ++ doc/guides/nics/features/axgbe.ini | 2 ++ drivers/net/axgbe/axgbe_ethdev.c | 48 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/doc/guides/nics/axgbe.rst b/doc/guides/nics/axgbe.rst index b6812c2..009be03 100644 --- a/doc/guides/nics/axgbe.rst +++ b/doc/guides/nics/axgbe.rst @@ -19,6 +19,8 @@ AXGBE PMD has support for: - Base L2 features - TSS (Transmit Side Scaling) +- Promiscuous mode +- Multicast mode - RSS (Receive Side Scaling) - Checksum offload - Jumbo Frame upto 9K diff --git a/doc/guides/nics/features/axgbe.ini b/doc/guides/nics/features/axgbe.ini index 2dbff18..9f4d38f 100644 --- a/doc/guides/nics/features/axgbe.ini +++ b/doc/guides/nics/features/axgbe.ini @@ -7,6 +7,8 @@ Speed capabilities = Y Link status = Y Jumbo frame = Y +Promiscuous mode = Y +Allmulticast mode = Y RSS hash = Y CRC offload = Y L3 checksum offload = Y diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index 3123572..e5495bd 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -15,6 +15,10 @@ static int axgbe_dev_start(struct rte_eth_dev *dev); static void axgbe_dev_stop(struct rte_eth_dev *dev); static void axgbe_dev_interrupt_handler(void *param); static void axgbe_dev_close(struct rte_eth_dev *dev); +static void axgbe_dev_promiscuous_enable(struct rte_eth_dev *dev); +static void axgbe_dev_promiscuous_disable(struct rte_eth_dev *dev); +static void axgbe_dev_allmulticast_enable(struct rte_eth_dev *dev); +static void axgbe_dev_allmulticast_disable(struct rte_eth_dev *dev); static int axgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete); static void axgbe_dev_info_get(struct rte_eth_dev *dev, @@ -73,6 +77,10 @@ static const struct eth_dev_ops axgbe_eth_dev_ops = { .dev_start = axgbe_dev_start, .dev_stop = axgbe_dev_stop, .dev_close = axgbe_dev_close, + .promiscuous_enable = axgbe_dev_promiscuous_enable, + .promiscuous_disable = axgbe_dev_promiscuous_disable, + .allmulticast_enable = axgbe_dev_allmulticast_enable, + .allmulticast_disable = axgbe_dev_allmulticast_disable, .link_update = axgbe_dev_link_update, .dev_infos_get = axgbe_dev_info_get, .rx_queue_setup = axgbe_dev_rx_queue_setup, @@ -219,6 +227,46 @@ axgbe_dev_close(struct rte_eth_dev *dev) axgbe_dev_clear_queues(dev); } +static void +axgbe_dev_promiscuous_enable(struct rte_eth_dev *dev) +{ + PMD_INIT_FUNC_TRACE(); + struct axgbe_port *pdata = dev->data->dev_private; + + AXGMAC_IOWRITE_BITS(pdata, MAC_PFR, PR, 1); +} + +static void +axgbe_dev_promiscuous_disable(struct rte_eth_dev *dev) +{ + PMD_INIT_FUNC_TRACE(); + struct axgbe_port *pdata = dev->data->dev_private; + + AXGMAC_IOWRITE_BITS(pdata, MAC_PFR, PR, 0); +} + +static void +axgbe_dev_allmulticast_enable(struct rte_eth_dev *dev) +{ + PMD_INIT_FUNC_TRACE(); + struct axgbe_port *pdata = dev->data->dev_private; + + if (AXGMAC_IOREAD_BITS(pdata, MAC_PFR, PM)) + return; + AXGMAC_IOWRITE_BITS(pdata, MAC_PFR, PM, 1); +} + +static void +axgbe_dev_allmulticast_disable(struct rte_eth_dev *dev) +{ + PMD_INIT_FUNC_TRACE(); + struct axgbe_port *pdata = dev->data->dev_private; + + if (!AXGMAC_IOREAD_BITS(pdata, MAC_PFR, PM)) + return; + AXGMAC_IOWRITE_BITS(pdata, MAC_PFR, PM, 0); +} + /* return 0 means link status changed, -1 means not changed */ static int axgbe_dev_link_update(struct rte_eth_dev *dev, -- 2.7.4