From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0060.outbound.protection.outlook.com [104.47.34.60]) by dpdk.org (Postfix) with ESMTP id 098201B040 for ; Fri, 5 Jan 2018 10:53:16 +0100 (CET) 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=NrCwEGHXBeTej81OKyGh6JcqzVB8/o7g/fFQ+4AJwfg=; b=UpXq4+Fd5kcznRhMVQ4VFCoqJTibRYq+t9k6GB3wU2sjW0qEGCzKkhSeCadoXDKOmJ0H+D9VVHK7JoRfDHTOrkKOc5bA4jyUZRcRhNrcdepsfR4QOIvyCQFFZGUqiQNfw1lJokI8lolzYYQvGarh8BdCD322fd0AfCEUgDiNv0Q= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by BN6PR12MB1506.namprd12.prod.outlook.com (10.172.24.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Fri, 5 Jan 2018 09:53:14 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 5 Jan 2018 04:52:17 -0500 Message-Id: <1515145938-97474-15-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515145938-97474-1-git-send-email-Ravi1.kumar@amd.com> References: <1512047472-118050-1-git-send-email-Ravi1.kumar@amd.com> <1515145938-97474-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: BM1PR0101CA0031.INDPRD01.PROD.OUTLOOK.COM (10.174.221.17) To BN6PR12MB1506.namprd12.prod.outlook.com (10.172.24.147) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c77682de-bc4d-4821-014e-08d55422240d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:BN6PR12MB1506; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1506; 3:PP1DuYJCv9A/rzVcJGRfCJyqeIpFrP4gXEYN3qcHGNyUBz9OXkQdbrCpW5kzjejLJ0DThjVJ7aByxcyGUCqzmZ2I1KeJioEjWgAPNEPxKBPq6hYnR4/yrXoW/yx9Vw1ODyojLJcppVSG084t7ZQsFoLaSmUj3lAcNuUbX7Ud6G3ZO8PiihNw56jTLev/HOtGhHXo1RHApSeD4LyD1hSznrpjGaObdRPlUfrlxP3PWvVXPv/MceIyEdIOzn1rvBLn; 25:ACf6Sdj4B+Xz6zbB4geoU4Cuffzitu51Nq1BkzU0/W/hflmk/HVYw3EpPRR0Fwn+gw8dJhorVNoMGezRl9l18WkF5UT4tG0MSzl4vCuPkrjGzl594Yf99tbrFGkmgnZv13M67lIzm/Z7JRv61y8bpLGukie0pD/5iW148Z5OxgGocGFOFCFE9WpZK9na1WRgSPMjsZOpiGQhAos4vjkTSFur2rCVdbiQuu/vFZPSo+9Mpj+YLcQpW7pOCDofvsliSD21dbAIfPKmXHwm0TlhrihhRNg1P281tqDimfoPuFpLGNRYy+EQfe6a+hnpYa9b6nQQWkORh0Tv3bWpmUGXyg==; 31:xdmGfp8ffK7rclpAojWq/MwSDp1EkLitoHErEUIxAVFgmigui3OSvdCVdfhZllbCzQJ22/pYkza2Bv4T70hKg84wnc+C8igcwzozlMd2Lh4pnkbQyC3r5URRyegyK8294UDlIV2NF3mrSPGkWMNFy741F87K+EF9qNI1VgH8HhCXXfegK5d1gSRRcG8UnKxuZoKntnIZUBFb7i+I7m+SaBa/sHyMh8inZVQsTWR/NAc= X-MS-TrafficTypeDiagnostic: BN6PR12MB1506: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1506; 20:+ByzfVgyTD764Kk1s9w0GMvt3epodQ+rl9+KkW+PKp2GkjKydIbmHU4TyPAOs/2vZmoCTOf45cMlKygfIy3SRLvTXADcxZAwuu7IAK9Ulzq6UthRVS74Z6zgv9S4pZs5zbuLZKOT8VS8seSzCUsnqWitUTRltniLGg3a6E0d+heJVBfoUtYE3QWf10FKCOBonPQgKZt2xd0uwi0e6S0WKjQcKEPNK+wmvDYLwwMQU2QZbsHHnkrscNGBiqn6baQHxu8VMRbqaWeJhIujJk4njOZlUbac3z/aOOWZtrUqVi6HlMGLoMGoK3tjUl6BlnqKohkPPTdYNucTuWm/1dPE2erfTEupguCpTdFIzxoiGY3726rZIw3nM/mIPz4QzXb+8EkmH/2Wi7Z+xxJHLbwDiE+rRJTfzE+j6SPEHkVlORyiN3QYIidkUwrE7Uy+whgvVrrFWkT1G9a6i9DCJTqAIZhsHDqtANraTw8brcwXOPo1ffhHLnpSOEbS9T4rSReP; 4:Nv6ZzQHRAkZFVr8gXFk/THex5VzRn0c0XRdO3SLLS9QrFgdCgBgS3Gm5vGufYjygck/LtT0U8001aVO4OWwI6v6cG44aQkvXzj2gwTbQTETNzXwjuvOcSfnwFq0Iin6RFO6tS2sQBo5q3W824us/Te8LiB4vcFI3yia2NdfUyJOwN7V1q10tpwA3/mzulGYl3znfOn3ZX8hmAVIIuLHiyHf2S9pirADBpH0awazqAKJsvvXMYrsqZS+E8b05lpSvocpIZy+EYHq1GO4z3tPS+g62bxwJEcPci75ZyKqSMCvWE6Yk5xdIAWyRx6vg6t9N X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944501075)(6055026)(6041268)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:BN6PR12MB1506; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN6PR12MB1506; X-Forefront-PRVS: 05437568AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(346002)(366004)(396003)(39860400002)(376002)(199004)(189003)(105586002)(4326008)(53936002)(36756003)(68736007)(50226002)(7696005)(8676002)(51416003)(52116002)(25786009)(3846002)(106356001)(8936002)(2906002)(53416004)(6116002)(81156014)(2361001)(6486002)(81166006)(47776003)(97736004)(16586007)(316002)(66066001)(305945005)(48376002)(2351001)(478600001)(7736002)(16526018)(6916009)(2950100002)(86362001)(59450400001)(76176011)(50466002)(386003)(5660300001)(72206003)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1506; H:wallaby-smavila.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR12MB1506; 23:G2JGHwqdVyexNBzoizsMBmS79XqjxkkaVt/rCX5d0?= =?us-ascii?Q?qSufrIgfAMMMeBDzKJRClrpT6QdGPhyl/Rh37Rb4hY87lcdCdOy0ILrJyVZc?= =?us-ascii?Q?V8GcrFL1N0NN5w/1AXoEaT5ZhXhNfzXv5tQxKuK2ms6UDyoBAtYOAcxYQSIt?= =?us-ascii?Q?KFjBOcZvUV/K6V5JkVpbt3GAr2x70Ap1zVijSUSYpZZDe4Hc818evRYIhz/7?= =?us-ascii?Q?YzAEXrKKSdi4aGBnb8503MPzHqgqdr8kEU0B5N7VTCGoj1rN+Sxt9W6hCeBx?= =?us-ascii?Q?xT/Y7JmLTE2sOSBv2Efj5O/enjF4dwC8P0J5+VqLL2ycB36x7KctZWGVW8tr?= =?us-ascii?Q?KhwjkRuBG4yMI8p6cl2IOKGQoV0IbqnrwSzszSxfAG90A+JvT28hrcCJWCBA?= =?us-ascii?Q?UGhyAjD5uLNCNWzCIBKzIMzNFL7Vr1leYJsLHtWUlCMQoNpcV6zeAOWkRdQA?= =?us-ascii?Q?giUR+mC264Za7MR1Kju6shESsigceppssIWyYmEm3kIzMH4YWeF5E34ixo/P?= =?us-ascii?Q?eQRn6Da9gYLrlYFSklgdiRic9BlzFM1rSyQFJ5B9qgjeMmJ7UH6MeRIqBsul?= =?us-ascii?Q?1nPNlOMzZTpGnw6KhqUQYrFugvWMd9RJhSTh6hZ6FzPMKCNhHSoZel4hO6BA?= =?us-ascii?Q?hZfuf0Lc0+y3hYFZkSwr7/kQ7IhMzupUlyFKTfeJll7k/VqaoihCkxo0aIzq?= =?us-ascii?Q?WOn+q486YvJM0FVz+3lNm5TkxAOyfU5YVaY8CqMeFrWa0x1IxkBigWZtrfWJ?= =?us-ascii?Q?odxYQEpE7c6O71cUteFF8L+ur31RvkAKvHJqq9/jt4Ni527oFwNDxo7lb6cT?= =?us-ascii?Q?dKpwQW1huVlKTanKhh/Obi5mlxEUTX94UgQgCaE6SFhatCUWN1mgM/IDK127?= =?us-ascii?Q?HWGrYtmft91gbsa1wD1RP9oo/3d8+VhLKvBKy0W/pm6K+BogxFLLD5ofMiu9?= =?us-ascii?Q?Hg47ijktSuwEcW6FtZydeAAZe0IAkkdFoOV2PKHN8YOejm7QOQx2y96sTlkG?= =?us-ascii?Q?wTd4FPQK8ocf9RAL+8YoCKDRo/0246asKtBcSMwXsY8+O3YFkR/xQDQ03Li7?= =?us-ascii?Q?wb9vm7qjqxznm912qHgd38T6nuHsUcWr8y75fSZi6QuJh5V/NrfxjUbNvm9K?= =?us-ascii?Q?fvsEqGEKDENARP0CLMHaKAQXlR5ku6ZuGYmq8xpjyZ/k4FqvbyuGA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1506; 6:jIhMF5ccmWKaFyMBS4UNJCEpRcldAcskHDFWfVcCS4eJRWSnvYJvbe6F34D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X5wgKfL3dGkY6HIXgphye/sGMRHwInPEndqVeft4C9C0tKfRAcFFTRMmUrkDw4xFGe72nWAPXtafdlpw22eovGsgPG1pHmEM7QP0OW X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2018 09:53:14.1996 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c77682de-bc4d-4821-014e-08d55422240d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1506 Subject: [dpdk-dev] [PATCH v2 15/16] net/axgbe: add generic transmit and receive status 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, 05 Jan 2018 09:53:17 -0000 Signed-off-by: Ravi Kumar --- doc/guides/nics/axgbe.rst | 1 + doc/guides/nics/features/axgbe.ini | 1 + drivers/net/axgbe/axgbe_ethdev.c | 51 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) diff --git a/doc/guides/nics/axgbe.rst b/doc/guides/nics/axgbe.rst index 8fe75bf..9038463 100644 --- a/doc/guides/nics/axgbe.rst +++ b/doc/guides/nics/axgbe.rst @@ -136,6 +136,7 @@ AXGBE PMD has support for: - Base L2 features - TSS (Transmit Side Scaling) - Promiscuous mode +- Port statistics - Multicast mode - RSS (Receive Side Scaling) - Checksum offload diff --git a/doc/guides/nics/features/axgbe.ini b/doc/guides/nics/features/axgbe.ini index 9f4d38f..042ff1e 100644 --- a/doc/guides/nics/features/axgbe.ini +++ b/doc/guides/nics/features/axgbe.ini @@ -13,5 +13,6 @@ RSS hash = Y CRC offload = Y L3 checksum offload = Y L4 checksum offload = Y +Basic stats = Y Linux UIO = Y x86-64 = Y diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index 0b67cf6..9e5114b 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -143,6 +143,9 @@ 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 int axgbe_dev_stats_get(struct rte_eth_dev *dev, + struct rte_eth_stats *stats); +static void axgbe_dev_stats_reset(struct rte_eth_dev *dev); static void axgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info); @@ -204,6 +207,8 @@ static const struct eth_dev_ops axgbe_eth_dev_ops = { .allmulticast_enable = axgbe_dev_allmulticast_enable, .allmulticast_disable = axgbe_dev_allmulticast_disable, .link_update = axgbe_dev_link_update, + .stats_get = axgbe_dev_stats_get, + .stats_reset = axgbe_dev_stats_reset, .dev_infos_get = axgbe_dev_info_get, .rx_queue_setup = axgbe_dev_rx_queue_setup, .rx_queue_release = axgbe_dev_rx_queue_release, @@ -418,6 +423,52 @@ axgbe_dev_link_update(struct rte_eth_dev *dev, return old_link_status == dev->data->dev_link.link_status ? -1 : 0; } +static int +axgbe_dev_stats_get(struct rte_eth_dev *dev, + struct rte_eth_stats *stats) +{ + struct axgbe_rx_queue *rxq; + struct axgbe_tx_queue *txq; + unsigned int i; + + for (i = 0; i < dev->data->nb_rx_queues; i++) { + rxq = dev->data->rx_queues[i]; + stats->q_ipackets[i] = rxq->pkts; + stats->ipackets += rxq->pkts; + stats->q_ibytes[i] = rxq->bytes; + stats->ibytes += rxq->bytes; + } + for (i = 0; i < dev->data->nb_tx_queues; i++) { + txq = dev->data->tx_queues[i]; + stats->q_opackets[i] = txq->pkts; + stats->opackets += txq->pkts; + stats->q_obytes[i] = txq->bytes; + stats->obytes += txq->bytes; + } + + return 0; +} + +static void +axgbe_dev_stats_reset(struct rte_eth_dev *dev) +{ + struct axgbe_rx_queue *rxq; + struct axgbe_tx_queue *txq; + unsigned int i; + + for (i = 0; i < dev->data->nb_rx_queues; i++) { + rxq = dev->data->rx_queues[i]; + rxq->pkts = 0; + rxq->bytes = 0; + rxq->errors = 0; + } + for (i = 0; i < dev->data->nb_tx_queues; i++) { + txq = dev->data->tx_queues[i]; + txq->pkts = 0; + txq->bytes = 0; + txq->errors = 0; + } +} static void axgbe_dev_info_get(struct rte_eth_dev *dev, -- 2.7.4