From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10080.outbound.protection.outlook.com [40.107.1.80]) by dpdk.org (Postfix) with ESMTP id 91C731B3A3 for ; Thu, 27 Sep 2018 13:20:13 +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=otFjiBvnb7sfG3Tlu84wH+quGMLzJeJBETTT1CDqWWM=; b=VUd5kiYflfvCOR0yb5IXme9wj6qLPbN12S9h8bhfVk5urG/w5iannk45y3fV+cKje1HRSpW+wLBjtBOdYnzY8FVGNsuoBtKPQIc5Nhjl0kCcucPkkMIUEKoI5apFIsk/wD8thuqC//JeJa2yXV0FFvyh3F4KopdblduemSUhsOo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; Received: from mellanox.com (37.142.13.130) by VI1PR05MB1263.eurprd05.prod.outlook.com (2a01:111:e400:5188::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.25; Thu, 27 Sep 2018 11:20:08 +0000 From: Raslan Darawsheh To: keith.wiles@intel.com Cc: thomas@monjalon.net, dev@dpdk.org, shahafs@mellanox.com, rasland@mellanox.com, orik@mellanox.com Date: Thu, 27 Sep 2018 14:19:55 +0300 Message-Id: <1538047196-13789-1-git-send-email-rasland@mellanox.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20180720105742.12669-1-thomas@monjalon.net> References: <20180720105742.12669-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: HE1PR09CA0059.eurprd09.prod.outlook.com (2603:10a6:7:3c::27) To VI1PR05MB1263.eurprd05.prod.outlook.com (2a01:111:e400:5188::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 45113f98-6706-421a-7fa4-08d6246b2f8e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB1263; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB1263; 3:cO2p/NHX3dnaIBvRlsaXIlMHr/7qgcg2xS+mABKsiWDTea9pKxh6WqdMsh8mOqjkyPvtQTy6FVNa4UgUYziauPrMBNqMXm/X2FFfMwtrdvFGj25w3B/PSTg1j7FJsrl2jxEc7O7drt7Ixw6kRr3St2TCmOr2//aWUmIzsWJasMUSqN1yBznIBsvkWhTyFu/SEeLCE1b79Mb6W7J+Smznuoa8g8GxgicagcBWuBV+ztntEpku8Rfgo/z+YC7fZf/X; 25:hAmW/0vxVY/2daFbIKHGTejvTTkmMxT9r85OFtQ2WIpGVVxIwvHYwaj2cv83BQWgxrVWP7yx/KeyVI0EIhtp03HDjbxisoukc0TFtWeCiysWmFUcZX0dqc8sU1le1lF/2unrMtwmNWwITsIjLSFdjroBdFYPkWknbz5ah8l+sB3kURYM2edpQGGZ+trRfbkBXCLhI0HkdITLOdsJNk1SIyblvjs3Yd8dXMF7JDzinqJSygRXtHPciv6wDC7SLNvE1GZj0bCZInSxzL0JcDILzkzwTkvsZi+6lZZFMYnFloAb15ulQ/ZA4quCG1gHso3Jua3DfmLIYyMQA+a+fNGGTeycH5pvEikn2ru3sNR1Xgk=; 31:aBsv/4Oa1M/mkI+U3TeJSvOi0HpVLoEEWsq7nsvvIFhbWYvidUeMKrzweAPzIMaKRyQEbwST7aMYCyszRiwDVKmsWpGJEv0aYzap22npUoYd6Km8bnjx91rz5E7gLouHOlXOnnRvu+Y2BgWa3XTGVSrLndLWU4RUZeMALviGEBVt0u4IPFBTL7T5vV7wYiuz27ezo/O/uRJwVoxWZ6hR3SH7iz4+BU85y2gkuWULyFs= X-MS-TrafficTypeDiagnostic: VI1PR05MB1263: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB1263; 20:JXsMdofYjoH+V1bMhmsKPmFQKlBjLekScsj0MxPI9guCDPQ365mzyqE6n4DoQwHNo3Pto8ys6mCqiiQlXUb76CX+2u3rzXw9hyOx4NplHNorQKUx9YWKl0/oj8f7TOXaBgyU6735HdjfNBJQs6AP5VG1vSD/5XVwM/FoZyWK0beqUBpFwP+fRpdWw09JFbSg469b5ZumprA+tTrZtfiuJ/RZCRRO1cexQHjlgVtiKW0xQ925IPy7K1xp8kCgsIIwgJ5haET2jWwz6Rrg8VPiS17oA9QW629agSdaQjpEV5Bqt8m+FCxOSyMhrjM9ommQ0Pl7MYomY4rHoO0d3NRkYRuMGML37z5+9wfBqUrMs1wl3M7L39/UkrhLwPbwksF0j2YfVD6qX/gMIqYe6/9E1gcAyaiYNvFFonhvxuE2qNASRVGMpoHsj4/GwQp0RUQ0Z0WtA8PgiSNvkIt5sSdzL63zp07gXQwoGDBxEk09V4p0W7h6iXLQPa6ZWapIVV2b; 4:JxQsXxFCJASQZFKm6tsOrL5922eTmk8oAEEtCtwtKLZeUVb7rcD5sTAHRYLYmPp9w5r5Ng1K6CeVgk4eUE4FRe8FLI22d8Pdg6ccVDzTZRrVp+6E4aMQYo13oD04iK10q5KOM0sX3bpPnTGK1JwisAHwonPuvnfDQgJlnC4rb9eXrY4/qzF8dX5vbbubuDr1M3LLYmYOwnIdnV4QJ/1JBglFi7aQBouWSLdd1Fj4G4Aj7rRLm4Ta/yBP8sZKCuAAqKHIB5bkEMiw3yvxzoK5Iw== 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)(5005006)(8121501046)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(201708071742011)(7699051); SRVR:VI1PR05MB1263; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB1263; X-Forefront-PRVS: 0808323E97 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(346002)(376002)(396003)(366004)(39860400002)(189003)(199004)(76176011)(97736004)(7696005)(51416003)(53936002)(66066001)(47776003)(478600001)(21086003)(5660300001)(4326008)(33026002)(386003)(55016002)(36756003)(52116002)(68736007)(8886007)(16586007)(6116002)(3846002)(86362001)(69596002)(34290500001)(446003)(476003)(2616005)(486006)(7736002)(81156014)(8936002)(956004)(11346002)(305945005)(81166006)(8676002)(26005)(50226002)(186003)(316002)(50466002)(16526019)(25786009)(106356001)(6666003)(2351001)(107886003)(48376002)(2361001)(2906002)(6916009)(14444005)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB1263; H:mellanox.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-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR05MB1263; 23:+LOt9tUclEDVZcsuRCqbsK8OxuYipTgRB9k0z1tiZ?= =?us-ascii?Q?T/Q1TRC35kSvDkC6welgxjsOw9DXqgxyCh6w6nEI/sBbthqZ5v7I4GaWJyN+?= =?us-ascii?Q?VYdbudyMwKjYjBp4QNDMNcabGTNMd8axIfV9hX5scZOoW633wJWYRFOCICMC?= =?us-ascii?Q?HOvSyldzNFhNnneNMD31voBBQ98GTbU5VEZwHRjOZpDJTLmhq6lFZsfIGq4f?= =?us-ascii?Q?Kthx1Pq3ganOfIh8POV8vwFAQmiQYOVQVdC9TiK27WxgB6WASDyLewvjRZ75?= =?us-ascii?Q?dDZlHP9eZD8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uFk7V9PH4V9Mksj5fHl75Rhtlw==; 5:mMIwjVwpSI8DmfTMbdzYYG231Elik8nRbjsKQKmh+FK5u5naLwTxv0gALfZYrYJmzX5xAX9oJkyBfiGI2laKe6qe/d/7ORuRtXfKAkiSYrmjWJx6F/RtJeAQWFcTVWoWjtoTr0i/LpdMNPXO2oEAujO5ZhGMJbBN0YfHA7d0OBw=; 7:A1GaE620OSBm5nSRT7FGOXmWwdEJ6KlqMBmpuUFdsopW5W0B1zwLrI6Q9ZPW6TpMTDRah9qYIlo7jReS2ENOn/zqd3qgHMnTenXi+sNU48ZqNzMfL/iP/dct+aViVlhYAJSDM5ONRsmPtR75I2QeHx1Xbz3ov/4yHNw1ni2xVikBw5Zg4KiaE/WVlAGbhWb/KDFXkEb5HkbI3BpwGTICq87AH2PyItingVEJ5r/G2AOKGblmiqZXCURnpAzalp7k SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2018 11:20:08.7471 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 45113f98-6706-421a-7fa4-08d6246b2f8e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB1263 Subject: [dpdk-dev] [PATCH v3 1/2] net/tap: change queue fd to be pointers to process private 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: Thu, 27 Sep 2018 11:20:13 -0000 change the fds for the queues to be pointers and add new process private structure and make the queue fds point to it. Signed-off-by: Raslan Darawsheh --- drivers/net/tap/rte_eth_tap.c | 63 ++++++++++++++++++++++++------------------- drivers/net/tap/rte_eth_tap.h | 9 +++++-- drivers/net/tap/tap_intr.c | 4 +-- 3 files changed, 44 insertions(+), 32 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index ad5ae98..8cc4552 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -64,6 +64,7 @@ static struct rte_vdev_driver pmd_tap_drv; static struct rte_vdev_driver pmd_tun_drv; +static struct pmd_process_private *process_private; static const char *valid_arguments[] = { ETH_TAP_IFACE_ARG, @@ -331,7 +332,7 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) uint16_t data_off = rte_pktmbuf_headroom(mbuf); int len; - len = readv(rxq->fd, *rxq->iovecs, + len = readv(*rxq->fd, *rxq->iovecs, 1 + (rxq->rxmode->offloads & DEV_RX_OFFLOAD_SCATTER ? rxq->nb_rx_desc : 1)); @@ -595,7 +596,7 @@ tap_write_mbufs(struct tx_queue *txq, uint16_t num_mbufs, tap_tx_l4_cksum(l4_cksum, l4_phdr_cksum, l4_raw_cksum); /* copy the tx frame data */ - n = writev(txq->fd, iovecs, j); + n = writev(*txq->fd, iovecs, j); if (n <= 0) break; (*num_packets)++; @@ -976,13 +977,13 @@ tap_dev_close(struct rte_eth_dev *dev) tap_flow_implicit_flush(internals, NULL); for (i = 0; i < RTE_PMD_TAP_MAX_QUEUES; i++) { - if (internals->rxq[i].fd != -1) { - close(internals->rxq[i].fd); - internals->rxq[i].fd = -1; + if (*internals->rxq[i].fd != -1) { + close(*internals->rxq[i].fd); + *internals->rxq[i].fd = -1; } - if (internals->txq[i].fd != -1) { - close(internals->txq[i].fd); - internals->txq[i].fd = -1; + if (*internals->txq[i].fd != -1) { + close(*internals->txq[i].fd); + *internals->txq[i].fd = -1; } } @@ -1007,9 +1008,9 @@ tap_rx_queue_release(void *queue) { struct rx_queue *rxq = queue; - if (rxq && (rxq->fd > 0)) { - close(rxq->fd); - rxq->fd = -1; + if (rxq && rxq->fd && (*rxq->fd > 0)) { + close(*rxq->fd); + *rxq->fd = -1; rte_pktmbuf_free(rxq->pool); rte_free(rxq->iovecs); rxq->pool = NULL; @@ -1022,9 +1023,9 @@ tap_tx_queue_release(void *queue) { struct tx_queue *txq = queue; - if (txq && (txq->fd > 0)) { - close(txq->fd); - txq->fd = -1; + if (txq && txq->fd && (*txq->fd > 0)) { + close(*txq->fd); + *txq->fd = -1; } } @@ -1214,13 +1215,13 @@ tap_setup_queue(struct rte_eth_dev *dev, struct rte_gso_ctx *gso_ctx; if (is_rx) { - fd = &rx->fd; - other_fd = &tx->fd; + fd = rx->fd; + other_fd = tx->fd; dir = "rx"; gso_ctx = NULL; } else { - fd = &tx->fd; - other_fd = &rx->fd; + fd = tx->fd; + other_fd = rx->fd; dir = "tx"; gso_ctx = &tx->gso_ctx; } @@ -1331,7 +1332,7 @@ tap_rx_queue_setup(struct rte_eth_dev *dev, } TAP_LOG(DEBUG, " RX TUNTAP device name %s, qid %d on fd %d", - internals->name, rx_queue_id, internals->rxq[rx_queue_id].fd); + internals->name, rx_queue_id, *internals->rxq[rx_queue_id].fd); return 0; @@ -1371,7 +1372,7 @@ tap_tx_queue_setup(struct rte_eth_dev *dev, return -1; TAP_LOG(DEBUG, " TX TUNTAP device name %s, qid %d on fd %d csum %s", - internals->name, tx_queue_id, internals->txq[tx_queue_id].fd, + internals->name, tx_queue_id, *internals->txq[tx_queue_id].fd, txq->csum ? "on" : "off"); return 0; @@ -1633,6 +1634,10 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, char *tap_name, goto error_exit_nodev; } + process_private = (struct pmd_process_private *) + rte_zmalloc_socket(tap_name, sizeof(struct pmd_process_private), + RTE_CACHE_LINE_SIZE, dev->device->numa_node); + pmd = dev->data->dev_private; pmd->dev = dev; snprintf(pmd->name, sizeof(pmd->name), "%s", tap_name); @@ -1669,8 +1674,10 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, char *tap_name, /* Presetup the fds to -1 as being not valid */ pmd->ka_fd = -1; for (i = 0; i < RTE_PMD_TAP_MAX_QUEUES; i++) { - pmd->rxq[i].fd = -1; - pmd->txq[i].fd = -1; + process_private->rxq_fds[i] = -1; + process_private->txq_fds[i] = -1; + pmd->rxq[i].fd = &process_private->rxq_fds[i]; + pmd->txq[i].fd = &process_private->txq_fds[i]; } if (pmd->type == ETH_TUNTAP_TYPE_TAP) { @@ -2089,13 +2096,13 @@ rte_pmd_tap_remove(struct rte_vdev_device *dev) tap_nl_final(internals->nlsk_fd); } for (i = 0; i < RTE_PMD_TAP_MAX_QUEUES; i++) { - if (internals->rxq[i].fd != -1) { - close(internals->rxq[i].fd); - internals->rxq[i].fd = -1; + if (*internals->rxq[i].fd != -1) { + close(*internals->rxq[i].fd); + *internals->rxq[i].fd = -1; } - if (internals->txq[i].fd != -1) { - close(internals->txq[i].fd); - internals->txq[i].fd = -1; + if (*internals->txq[i].fd != -1) { + close(*internals->txq[i].fd); + *internals->txq[i].fd = -1; } } diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h index 44e2773..4146f5c 100644 --- a/drivers/net/tap/rte_eth_tap.h +++ b/drivers/net/tap/rte_eth_tap.h @@ -46,7 +46,7 @@ struct rx_queue { struct rte_mempool *mp; /* Mempool for RX packets */ uint32_t trigger_seen; /* Last seen Rx trigger value */ uint16_t in_port; /* Port ID */ - int fd; + int *fd; struct pkt_stats stats; /* Stats for this RX queue */ uint16_t nb_rx_desc; /* max number of mbufs available */ struct rte_eth_rxmode *rxmode; /* RX features */ @@ -56,7 +56,7 @@ struct rx_queue { }; struct tx_queue { - int fd; + int *fd; int type; /* Type field - TUN|TAP */ uint16_t *mtu; /* Pointer to MTU from dev_data */ uint16_t csum:1; /* Enable checksum offloading */ @@ -92,6 +92,11 @@ struct pmd_internals { int ka_fd; /* keep-alive file descriptor */ }; +struct pmd_process_private { + int rxq_fds[RTE_PMD_TAP_MAX_QUEUES]; + int txq_fds[RTE_PMD_TAP_MAX_QUEUES]; +}; + /* tap_intr.c */ int tap_rx_intr_vec_set(struct rte_eth_dev *dev, int set); diff --git a/drivers/net/tap/tap_intr.c b/drivers/net/tap/tap_intr.c index fc59018..a4b212d 100644 --- a/drivers/net/tap/tap_intr.c +++ b/drivers/net/tap/tap_intr.c @@ -71,7 +71,7 @@ tap_rx_intr_vec_install(struct rte_eth_dev *dev) struct rx_queue *rxq = pmd->dev->data->rx_queues[i]; /* Skip queues that cannot request interrupts. */ - if (!rxq || rxq->fd <= 0) { + if (!rxq || !rxq->fd || *rxq->fd <= 0) { /* Use invalid intr_vec[] index to disable entry. */ intr_handle->intr_vec[i] = RTE_INTR_VEC_RXTX_OFFSET + @@ -79,7 +79,7 @@ tap_rx_intr_vec_install(struct rte_eth_dev *dev) continue; } intr_handle->intr_vec[i] = RTE_INTR_VEC_RXTX_OFFSET + count; - intr_handle->efds[count] = rxq->fd; + intr_handle->efds[count] = *rxq->fd; count++; } if (!count) -- 2.7.4