From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70074.outbound.protection.outlook.com [40.107.7.74]) by dpdk.org (Postfix) with ESMTP id 7F0241B42D; Wed, 10 Oct 2018 09:01:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JU3DbWKGuDqzaOphU2TEybmiXCn41qp5OQKu+2+lpmI=; b=MYPvhVWFO/fgU/wlgqG035XpOoXryrJ/s+vslUfKlX6pgpGzkVOikU+dq/k0KizTJ8rDfRhun5yrlncEgk6gsCvEXKkj0sgu4MveXR5hNduyzjePbK7MmrMQT6bH6AFVdUk5h0O2GazXura9E2f4oolCt89+49l7dN+Sr8gjiN0= Received: from DB5PR05MB1254.eurprd05.prod.outlook.com (10.162.157.140) by DB5PR05MB1320.eurprd05.prod.outlook.com (10.162.157.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.28; Wed, 10 Oct 2018 07:01:41 +0000 Received: from DB5PR05MB1254.eurprd05.prod.outlook.com ([fe80::3516:b329:5c35:51a5]) by DB5PR05MB1254.eurprd05.prod.outlook.com ([fe80::3516:b329:5c35:51a5%2]) with mapi id 15.20.1207.029; Wed, 10 Oct 2018 07:01:41 +0000 From: Raslan Darawsheh To: "keith.wiles@intel.com" CC: Thomas Monjalon , "dev@dpdk.org" , Shahaf Shuler , Raslan Darawsheh , Ori Kam , "stable@dpdk.org" Thread-Topic: [PATCH] net/tap: fix reported number of Tx packets Thread-Index: AQHUYGcY6oFp/izeZ06HMCdLslZGyA== Date: Wed, 10 Oct 2018 07:01:41 +0000 Message-ID: <1539154893-20548-1-git-send-email-rasland@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HE1PR06CA0142.eurprd06.prod.outlook.com (2603:10a6:7:16::29) To DB5PR05MB1254.eurprd05.prod.outlook.com (2a01:111:e400:51cc::12) authentication-results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [37.142.13.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB5PR05MB1320; 6:kEiEJeypg5a2cHRNsXsJVFhpSk7mbKx69Go15ZlQXNyBnNBrIpdFZ0gObQu9ks/zE1ZQwq2Xl2ciuIsFe1XvHA/z84/rn8bjB0BKIOp68F1zXdnrq5JaXb9bLbrNVOBl3RW/w7+TchiiF90HCUIF7lt/ZTn7wNyrEOQ9ghvyrjFJDW/nWSVw9+fQHuBrVFMkFcvKqSsfUKgBjaawOgTcgPsbiAfJhFFFef/CpbkygTtN6Q8rtD+7eRTeIj473UzeRnhslSwE5sGRr0+1InfvBSrH0PLjq5HDLoQtiQX0uoYJMmeJY97uX1XIl7llRhci1W7sMQSevjeJJB90AqJtNdo0PM+jM47lqCyVSi7I2IYllQKxyAiF0lV54ASA38JX4ge6Lmg6bprc+S9lz1MLf+OmJC3XUvpj8sVM3LrnTYUgI/s60XSd1l+u8KxoKZQwkMWce/ioSy9MCq/gLPhNFw==; 5:wz/Rj8EyveA1ZkPndqfWajERWGiDbTzUkhHaZM8uvKQgDy+1R/SxEFRpwR1Xu2RKbFr29/+CXZ/7HWMZ9sufsEuksfLUdawN2Qk+XzDTfWAdz2P/nJgBWZedUUl7kb96A72RQ2UU/yNKcvb1dBFp9GgXvwiKm3RCetS9JVKLQ4c=; 7:3ht9ItT2vjWBZbGIQ5v6pZ/ovmdmclUKamnn6SOK9BJhKGtqBbhEtLi7tm5Xfxc9ORgWK3kfnHSHNtcOXH6/qtHQE7HHSDV3KX40SAKyP+7Jtozd7qbBgQmuSZPbfxlCZzM78736cNYneBlmUOoWXHUSUJpa01GGfiVIIbQIjNVHpLV9ZeIl4vwfL8JR+gXq44McGi0TryPqhcYHErVI6SKezsfVln1EF7NCgIcLmRIIuqkwuD2I4WMqrTb7ChWW x-ms-office365-filtering-correlation-id: e40fd8e7-17b9-4fec-486e-08d62e7e3add x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB5PR05MB1320; x-ms-traffictypediagnostic: DB5PR05MB1320: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr 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:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:DB5PR05MB1320; BCL:0; PCL:0; RULEID:; SRVR:DB5PR05MB1320; x-forefront-prvs: 08213D42D3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(376002)(396003)(346002)(366004)(189003)(199004)(8936002)(305945005)(2501003)(105586002)(14454004)(8676002)(5250100002)(256004)(81156014)(81166006)(106356001)(54906003)(14444005)(102836004)(86362001)(66066001)(575784001)(478600001)(50226002)(2900100001)(2351001)(71200400001)(71190400001)(2906002)(97736004)(99286004)(52116002)(53936002)(486006)(5660300001)(386003)(6506007)(6916009)(476003)(6116002)(316002)(3846002)(6486002)(2616005)(26005)(4326008)(6436002)(186003)(6512007)(68736007)(7736002)(36756003)(1857600001)(25786009)(5640700003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR05MB1320; H:DB5PR05MB1254.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: ynXt7Bd5t+SOWmfG99SMyU9tYXCqEhq49XuwOpr4WNRz3vTQ7wDaEbYjlGq7JJTbMeoh4z/mTF+e5d/KIw2OEGgmFe1ws7cpmRURfnfJ9LHjH+MNCU4hykV7TSoFphZQvi9CqFv4yxXbYu3kTqfebdJRoCWFOIUvCmObYOFPzjpkYoOAPhKIMsPPOr+2lr8pckLALN4ld7pVxiq+gv5WUh33KsDM9K9u6RjOQx0BbeaSRD5wx6NL40sKz5DRBCuSzbGnQUWd5QtVDpj4c1PanmjdijWniTDOZGUp1kvS4hlPiuglE+YyAXRvLkIV88ULnC0zK6onjbXoAWFt2DnVBpjWIqkr6b7khFqRmLfw3KA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: e40fd8e7-17b9-4fec-486e-08d62e7e3add X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Oct 2018 07:01:41.4316 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR05MB1320 Subject: [dpdk-dev] [PATCH] net/tap: fix reported number of Tx packets 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, 10 Oct 2018 07:01:44 -0000 When writev fails to send packets it doesn't update the number of Tx packets, but it still num_tx is updated. the value that should be returned is the actual number of sent packets which is num_packets. Fixes: 02f96a0a ("net/tap: add TUN/TAP device PMD") CC: stable@dpdk.org Signed-off-by: Raslan Darawsheh --- drivers/net/tap/rte_eth_tap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 83c9288..228add2 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -707,7 +707,7 @@ pmd_tx_burst(void *queue, struct rte_mbuf **bufs, uint1= 6_t nb_pkts) txq->stats.errs +=3D nb_pkts - num_tx; txq->stats.obytes +=3D num_tx_bytes; =20 - return num_tx; + return num_packets; } =20 static const char * --=20 2.7.4