Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/118503/?format=api
http://patches.dpdk.org/api/patches/118503/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221018194131.23006-37-andrew.boyer@amd.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20221018194131.23006-37-andrew.boyer@amd.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20221018194131.23006-37-andrew.boyer@amd.com", "date": "2022-10-18T19:41:31", "name": "[v2,36/36] net/ionic: add watchdogs to protect each queue type", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "ba46fda82cec12ca515d13977ee8c5b6a16cd47c", "submitter": { "id": 2861, "url": "http://patches.dpdk.org/api/people/2861/?format=api", "name": "Andrew Boyer", "email": "Andrew.Boyer@amd.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20221018194131.23006-37-andrew.boyer@amd.com/mbox/", "series": [ { "id": 25088, "url": "http://patches.dpdk.org/api/series/25088/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=25088", "date": "2022-10-11T00:49:57", "name": "net/ionic: updates for 22.11 release", "version": 1, "mbox": "http://patches.dpdk.org/series/25088/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/118503/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/118503/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 56337A0560;\n\tTue, 18 Oct 2022 21:48:55 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4A1D34281C;\n\tTue, 18 Oct 2022 21:48:55 +0200 (CEST)", "from NAM12-MW2-obe.outbound.protection.outlook.com\n (mail-mw2nam12on2043.outbound.protection.outlook.com [40.107.244.43])\n by mails.dpdk.org (Postfix) with ESMTP id 86338427F1\n for <dev@dpdk.org>; Tue, 18 Oct 2022 21:48:53 +0200 (CEST)", "from DS7PR07CA0022.namprd07.prod.outlook.com (2603:10b6:5:3af::24)\n by DM4PR12MB7575.namprd12.prod.outlook.com (2603:10b6:8:10d::9) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Tue, 18 Oct\n 2022 19:48:51 +0000", "from DM6NAM11FT105.eop-nam11.prod.protection.outlook.com\n (2603:10b6:5:3af:cafe::ba) by DS7PR07CA0022.outlook.office365.com\n (2603:10b6:5:3af::24) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.34 via Frontend\n Transport; Tue, 18 Oct 2022 19:48:51 +0000", "from SATLEXMB04.amd.com (165.204.84.17) by\n DM6NAM11FT105.mail.protection.outlook.com (10.13.173.164) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.20.5746.16 via Frontend Transport; Tue, 18 Oct 2022 19:48:51 +0000", "from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com\n (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 18 Oct\n 2022 14:48:48 -0500" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=g2X6veHbvw4a0SHUnRFVndohtNTWEecA7U1qJ+DftX9iHiSQCE0GZqu6k+htck86pEGS/mOwWS7cMV2JUyP8aBbtzptnaXV2S+AmgGBfsSX5bCPojCsd/op6pxadXk/f+KeBV7ajEHW1GKlAG1I9kyKVTV09drcG7smV1P9317aS6IXOIxvARhYCVC7RXNfvR3QfA+AzYBjsFd5FqsZLxVmbZvEGPDOJxCtu2ilfWTn0DuL+7TjQqhYPoJRx13/kNu0vKA5a7Yx8qRnmMPjwm9Tx7pW2lKevkAreWaJw7WqydmSs2uYDm3iB5xba5pG5K4nolzjyrn3u3J5mtOtILQ==", "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=9jyksuWp4IEy4q2EG2JU1Y1zvIgPRyXwtD2Aad5YVb4=;\n b=lqKbPgEG3IdQ1HirfJWCeLQZavRj8y2vQvqB2ixPPo/xWkFFWsoRMW5EdMc87Dl+3qkhmWffCwIdoCMjvuMKLCGTxn7/Yfh2WvekCIXcnC8f7Z9X1rpu482eaXCsoVSB76MgJNoG7ByJXQ4x2c3XXmNEzqCLMuverFJ2EOj4la1LPbhmTfE6S4LixasM2ClwXUzNa8RGRrdhndqoL2aQ9FjJCTgWWGexYMsjPen4t1clWgPe86vtHkum3BrJxAMj2Uha1Dz4udo9q0Wylr2zDZQNoYbExAGbkzv3SsaJ6EM9LJO7YJXNejfohcc+PxrTtODEpj7spcmxuuZfd0SZuQ==", "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass\n (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;\n dkim=none (message not signed); arc=none", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=9jyksuWp4IEy4q2EG2JU1Y1zvIgPRyXwtD2Aad5YVb4=;\n b=rZrJLzzUd/9a0ZjnuaYpN4jDNzGN77CqybRG0tn0eGsNHdtpp2rdESHLnwoZ1NN9bxjLJFTQ84fVZjWRyxzQkWN1AHogXlzetHGAfwyPhx/tZcYCpn1ItlbxjBWh9FYZHn9z7x23bE/B1M3Kh+wssV80wa6G+CV6Yb/6KVSrUYI=", "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 165.204.84.17)\n smtp.mailfrom=amd.com; dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=amd.com;", "Received-SPF": "Pass (protection.outlook.com: domain of amd.com designates\n 165.204.84.17 as permitted sender) receiver=protection.outlook.com;\n client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C", "From": "Andrew Boyer <andrew.boyer@amd.com>", "To": "<dev@dpdk.org>", "CC": "Andrew Boyer <andrew.boyer@amd.com>", "Subject": "[PATCH v2 36/36] net/ionic: add watchdogs to protect each queue type", "Date": "Tue, 18 Oct 2022 12:41:31 -0700", "Message-ID": "<20221018194131.23006-37-andrew.boyer@amd.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20221011005032.47584-1-andrew.boyer@amd.com>", "References": "<20221011005032.47584-1-andrew.boyer@amd.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.180.168.240]", "X-ClientProxiedBy": "SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com\n (10.181.40.145)", "X-EOPAttributedMessage": "0", "X-MS-PublicTrafficType": "Email", "X-MS-TrafficTypeDiagnostic": "DM6NAM11FT105:EE_|DM4PR12MB7575:EE_", "X-MS-Office365-Filtering-Correlation-Id": "49ad3e48-f88b-4233-3b68-08dab141c7f5", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "BCL:0;", "X-Microsoft-Antispam-Message-Info": "\n LSRPZ8zPT9RvcQ0n9SC5Vdx8zqg43Le1Q+tdG+aacbHmVDG5npChqxJwFj3Tzsw/OwIptf52UylYyi4dh0Ah6jjtsqQ+P/9zjfop0Rk4fDfe9SCqiefH01Y2lTFLWd7/i52XZplTW4NmabgBxtKHGErBzK61l/bnEto5sHR15lZIbTvDSgJ90yGObns6HhreUmcO80khV49q5DPstbKZVSv20OzbqbYiQc9BRd1ds+z7iZsE/HhregNYeKsXCHvbP5wEW81+K4C7cePVMRW8czTy7O8Ux9P1pY3FjrJYCqZaxQQAdXlmxTDNEx+nUU4VylI22MPrz7DYSSjdOdbNnREeUeirgsFi2k4YxkrzsnLoSnNm/wLPs/o/fU7OHqfOhYDeV4uYJL+vXLfv6pj4j4qTgSxYdLiTlUn7m9WeqXvw9Ny+5rrZcbCMQT8KRQfKJ0f9ZWTu2KxNWWNMtMGLK5fVabPOFrTjW1jxDLjUuNjx2nOCclxoWcKZ7+3F4EEj/7B71/jyjbXGdkhT2otNNB7cB5gwXlOctDR8YlHaiLTPTrbBJF5XZucxHNGbJMAIFzfRaI0BVS4fXdu8upA+KgZQE94J39mbRvicLAXvAYBtVd76xJz7iYNtvnW1QAlIRpdKB9qKacoV883hWZAGRTogI6Xd/geoj5DSowcRCJACzNDYPM2xlj2/3WR3W/+K6CxrRWw9ilD6qmjdHn2Tw/cjD45NPDxUef51LJO8+Vkvrww8r9bSiNnoVMDWbsKT03cMshYS+JLEYBLaxzfsSF9A4Zj+Q+4Vz4MbBLG6ZIgIPsuY8PXezFMmCOOcWfne", "X-Forefront-Antispam-Report": "CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE;\n SFS:(13230022)(4636009)(376002)(396003)(39860400002)(346002)(136003)(451199015)(46966006)(40470700004)(36840700001)(36860700001)(82740400003)(82310400005)(478600001)(356005)(81166007)(186003)(4326008)(2616005)(40460700003)(36756003)(44832011)(6916009)(316002)(70586007)(70206006)(426003)(336012)(47076005)(83380400001)(6666004)(1076003)(5660300002)(8676002)(40480700001)(16526019)(2906002)(26005)(8936002)(86362001)(41300700001)(36900700001);\n DIR:OUT; SFP:1101;", "X-OriginatorOrg": "amd.com", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "18 Oct 2022 19:48:51.1449 (UTC)", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 49ad3e48-f88b-4233-3b68-08dab141c7f5", "X-MS-Exchange-CrossTenant-Id": "3dd8961f-e488-4e60-8e11-a82d994e183d", "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17];\n Helo=[SATLEXMB04.amd.com]", "X-MS-Exchange-CrossTenant-AuthSource": "\n DM6NAM11FT105.eop-nam11.prod.protection.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous", "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DM4PR12MB7575", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "Ring the doorbell again for the following scenarios:\n * No receives posted but Rx queue not empty after deadline\n * No transmits posted but Tx work still pending after deadline\n * Admin queue work still pending after deadline\n\nThis will help the queues recover in the extremely rare case that\na doorbell is missed by the FW.\n\nSigned-off-by: Andrew Boyer <andrew.boyer@amd.com>\n---\n drivers/net/ionic/ionic_dev.h | 4 +++\n drivers/net/ionic/ionic_lif.h | 3 ++\n drivers/net/ionic/ionic_main.c | 22 ++++++++++++\n drivers/net/ionic/ionic_rxtx.c | 1 +\n drivers/net/ionic/ionic_rxtx_sg.c | 50 ++++++++++++++++++++++++++-\n drivers/net/ionic/ionic_rxtx_simple.c | 50 ++++++++++++++++++++++++++-\n 6 files changed, 128 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/ionic/ionic_dev.h b/drivers/net/ionic/ionic_dev.h\nindex 5e238e8ab7..b1e74fbd89 100644\n--- a/drivers/net/ionic/ionic_dev.h\n+++ b/drivers/net/ionic/ionic_dev.h\n@@ -26,6 +26,10 @@\n #define IONIC_DEVCMD_CHECK_PERIOD_US\t10\t/* devcmd status chk period */\n #define IONIC_DEVCMD_RETRY_WAIT_US\t20000\n \n+#define IONIC_Q_WDOG_MS\t\t\t10\t/* 10ms */\n+#define IONIC_Q_WDOG_MAX_MS\t\t5000\t/* 5s */\n+#define IONIC_ADMINQ_WDOG_MS\t\t500\t/* 500ms */\n+\n #define IONIC_ALIGN\t\t\t4096\n \n struct ionic_adapter;\ndiff --git a/drivers/net/ionic/ionic_lif.h b/drivers/net/ionic/ionic_lif.h\nindex 00c8add95c..36b3bcc5a9 100644\n--- a/drivers/net/ionic/ionic_lif.h\n+++ b/drivers/net/ionic/ionic_lif.h\n@@ -85,6 +85,8 @@ struct ionic_rx_qcq {\n \tstruct rte_mempool *mb_pool;\n \tuint64_t rearm_data;\n \tuint64_t rearm_seg_data;\n+\tuint64_t last_wdog_cycles;\n+\tuint64_t wdog_ms;\n \tuint16_t frame_size;\t/* Based on configured MTU */\n \tuint16_t hdr_seg_size;\t/* Length of first segment of RX chain */\n \tuint16_t seg_size;\t/* Length of all subsequent segments */\n@@ -103,6 +105,7 @@ struct ionic_tx_qcq {\n \tstruct ionic_qcq qcq;\n \n \t/* cacheline2 */\n+\tuint64_t last_wdog_cycles;\n \tuint16_t num_segs_fw;\t/* # segs supported by current FW */\n \tuint16_t free_thresh;\n \tuint16_t flags;\ndiff --git a/drivers/net/ionic/ionic_main.c b/drivers/net/ionic/ionic_main.c\nindex 26e08d06c9..c957d55bf9 100644\n--- a/drivers/net/ionic/ionic_main.c\n+++ b/drivers/net/ionic/ionic_main.c\n@@ -230,10 +230,16 @@ static int\n ionic_adminq_wait_for_completion(struct ionic_lif *lif,\n \t\tstruct ionic_admin_ctx *ctx, unsigned long max_wait)\n {\n+\tstruct ionic_queue *q = &lif->adminqcq->qcq.q;\n \tunsigned long step_usec = IONIC_DEVCMD_CHECK_PERIOD_US;\n+\tunsigned long step_deadline;\n \tunsigned long max_wait_usec = max_wait * 1000000L;\n \tunsigned long elapsed_usec = 0;\n \tint budget = 8;\n+\tuint16_t idx;\n+\tvoid **info;\n+\n+\tstep_deadline = IONIC_ADMINQ_WDOG_MS * 1000 / step_usec;\n \n \twhile (ctx->pending_work && elapsed_usec < max_wait_usec) {\n \t\t/*\n@@ -245,10 +251,26 @@ ionic_adminq_wait_for_completion(struct ionic_lif *lif,\n \t\tionic_qcq_service(&lif->adminqcq->qcq, budget,\n \t\t\t\tionic_adminq_service, NULL);\n \n+\t\t/*\n+\t\t * Ring the doorbell again if work is pending after deadline.\n+\t\t */\n+\t\tif (ctx->pending_work && !step_deadline) {\n+\t\t\tstep_deadline = IONIC_ADMINQ_WDOG_MS *\n+\t\t\t\t1000 / step_usec;\n+\n+\t\t\trte_spinlock_lock(&lif->adminq_lock);\n+\t\t\tidx = Q_NEXT_TO_POST(q, -1);\n+\t\t\tinfo = IONIC_INFO_PTR(q, idx);\n+\t\t\tif (info[0] == ctx)\n+\t\t\t\tionic_q_flush(q);\n+\t\t\trte_spinlock_unlock(&lif->adminq_lock);\n+\t\t}\n+\n \t\trte_spinlock_unlock(&lif->adminq_service_lock);\n \n \t\trte_delay_us_block(step_usec);\n \t\telapsed_usec += step_usec;\n+\t\tstep_deadline--;\n \t}\n \n \treturn (!ctx->pending_work);\ndiff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c\nindex d216980450..b9e73b4871 100644\n--- a/drivers/net/ionic/ionic_rxtx.c\n+++ b/drivers/net/ionic/ionic_rxtx.c\n@@ -551,6 +551,7 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,\n \t}\n \n \trxq->mb_pool = mp;\n+\trxq->wdog_ms = IONIC_Q_WDOG_MS;\n \n \t/*\n \t * Note: the interface does not currently support\ndiff --git a/drivers/net/ionic/ionic_rxtx_sg.c b/drivers/net/ionic/ionic_rxtx_sg.c\nindex 4e4a18e5d7..2752ba2acd 100644\n--- a/drivers/net/ionic/ionic_rxtx_sg.c\n+++ b/drivers/net/ionic/ionic_rxtx_sg.c\n@@ -167,6 +167,7 @@ ionic_xmit_pkts_sg(void *tx_queue, struct rte_mbuf **tx_pkts,\n \tstruct rte_mbuf *mbuf;\n \tuint32_t bytes_tx = 0;\n \tuint16_t nb_avail, nb_tx = 0;\n+\tuint64_t then, now, hz, delta;\n \tint err;\n \n \tstruct ionic_txq_desc *desc_base = q->base;\n@@ -220,8 +221,26 @@ ionic_xmit_pkts_sg(void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\trte_wmb();\n \t\tionic_q_flush(q);\n \n+\t\ttxq->last_wdog_cycles = rte_get_timer_cycles();\n+\n \t\tstats->packets += nb_tx;\n \t\tstats->bytes += bytes_tx;\n+\t} else {\n+\t\t/*\n+\t\t * Ring the doorbell again if no work could be posted and work\n+\t\t * is still pending after the deadline.\n+\t\t */\n+\t\tif (q->head_idx != q->tail_idx) {\n+\t\t\tthen = txq->last_wdog_cycles;\n+\t\t\tnow = rte_get_timer_cycles();\n+\t\t\thz = rte_get_timer_hz();\n+\t\t\tdelta = (now - then) * 1000;\n+\n+\t\t\tif (delta >= hz * IONIC_Q_WDOG_MS) {\n+\t\t\t\tionic_q_flush(q);\n+\t\t\t\ttxq->last_wdog_cycles = now;\n+\t\t\t}\n+\t\t}\n \t}\n \n \treturn nb_tx;\n@@ -421,6 +440,7 @@ ionic_rxq_service_sg(struct ionic_rx_qcq *rxq, uint32_t work_to_do,\n \tstruct ionic_rxq_desc *q_desc_base = q->base;\n \tstruct ionic_rxq_comp *cq_desc, *cq_desc_base = cq->base;\n \tuint32_t work_done = 0;\n+\tuint64_t then, now, hz, delta;\n \n \tcq_desc = &cq_desc_base[cq->tail_idx];\n \n@@ -453,8 +473,36 @@ ionic_rxq_service_sg(struct ionic_rx_qcq *rxq, uint32_t work_to_do,\n \t}\n \n \t/* Update the queue indices and ring the doorbell */\n-\tif (work_done)\n+\tif (work_done) {\n \t\tionic_q_flush(q);\n+\t\trxq->last_wdog_cycles = rte_get_timer_cycles();\n+\t\trxq->wdog_ms = IONIC_Q_WDOG_MS;\n+\t} else {\n+\t\t/*\n+\t\t * Ring the doorbell again if no recvs were posted and the\n+\t\t * recv queue is not empty after the deadline.\n+\t\t *\n+\t\t * Exponentially back off the deadline to avoid excessive\n+\t\t * doorbells when the recv queue is idle.\n+\t\t */\n+\t\tif (q->head_idx != q->tail_idx) {\n+\t\t\tthen = rxq->last_wdog_cycles;\n+\t\t\tnow = rte_get_timer_cycles();\n+\t\t\thz = rte_get_timer_hz();\n+\t\t\tdelta = (now - then) * 1000;\n+\n+\t\t\tif (delta >= hz * rxq->wdog_ms) {\n+\t\t\t\tionic_q_flush(q);\n+\t\t\t\trxq->last_wdog_cycles = now;\n+\n+\t\t\t\tdelta = 2 * rxq->wdog_ms;\n+\t\t\t\tif (delta > IONIC_Q_WDOG_MAX_MS)\n+\t\t\t\t\tdelta = IONIC_Q_WDOG_MAX_MS;\n+\n+\t\t\t\trxq->wdog_ms = delta;\n+\t\t\t}\n+\t\t}\n+\t}\n }\n \n uint16_t\ndiff --git a/drivers/net/ionic/ionic_rxtx_simple.c b/drivers/net/ionic/ionic_rxtx_simple.c\nindex a191fd3ec9..0421fb32b2 100644\n--- a/drivers/net/ionic/ionic_rxtx_simple.c\n+++ b/drivers/net/ionic/ionic_rxtx_simple.c\n@@ -140,6 +140,7 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \tstruct rte_mbuf *mbuf;\n \tuint32_t bytes_tx = 0;\n \tuint16_t nb_avail, nb_tx = 0;\n+\tuint64_t then, now, hz, delta;\n \tint err;\n \n \tstruct ionic_txq_desc *desc_base = q->base;\n@@ -193,8 +194,26 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\trte_wmb();\n \t\tionic_q_flush(q);\n \n+\t\ttxq->last_wdog_cycles = rte_get_timer_cycles();\n+\n \t\tstats->packets += nb_tx;\n \t\tstats->bytes += bytes_tx;\n+\t} else {\n+\t\t/*\n+\t\t * Ring the doorbell again if no work could be posted and work\n+\t\t * is still pending after the deadline.\n+\t\t */\n+\t\tif (q->head_idx != q->tail_idx) {\n+\t\t\tthen = txq->last_wdog_cycles;\n+\t\t\tnow = rte_get_timer_cycles();\n+\t\t\thz = rte_get_timer_hz();\n+\t\t\tdelta = (now - then) * 1000;\n+\n+\t\t\tif (delta >= hz * IONIC_Q_WDOG_MS) {\n+\t\t\t\tionic_q_flush(q);\n+\t\t\t\ttxq->last_wdog_cycles = now;\n+\t\t\t}\n+\t\t}\n \t}\n \n \treturn nb_tx;\n@@ -342,6 +361,7 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do,\n \tstruct ionic_rxq_desc *q_desc_base = q->base;\n \tstruct ionic_rxq_comp *cq_desc, *cq_desc_base = cq->base;\n \tuint32_t work_done = 0;\n+\tuint64_t then, now, hz, delta;\n \n \tcq_desc = &cq_desc_base[cq->tail_idx];\n \n@@ -374,8 +394,36 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do,\n \t}\n \n \t/* Update the queue indices and ring the doorbell */\n-\tif (work_done)\n+\tif (work_done) {\n \t\tionic_q_flush(q);\n+\t\trxq->last_wdog_cycles = rte_get_timer_cycles();\n+\t\trxq->wdog_ms = IONIC_Q_WDOG_MS;\n+\t} else {\n+\t\t/*\n+\t\t * Ring the doorbell again if no recvs were posted and the\n+\t\t * recv queue is not empty after the deadline.\n+\t\t *\n+\t\t * Exponentially back off the deadline to avoid excessive\n+\t\t * doorbells when the recv queue is idle.\n+\t\t */\n+\t\tif (q->head_idx != q->tail_idx) {\n+\t\t\tthen = rxq->last_wdog_cycles;\n+\t\t\tnow = rte_get_timer_cycles();\n+\t\t\thz = rte_get_timer_hz();\n+\t\t\tdelta = (now - then) * 1000;\n+\n+\t\t\tif (delta >= hz * rxq->wdog_ms) {\n+\t\t\t\tionic_q_flush(q);\n+\t\t\t\trxq->last_wdog_cycles = now;\n+\n+\t\t\t\tdelta = 2 * rxq->wdog_ms;\n+\t\t\t\tif (delta > IONIC_Q_WDOG_MAX_MS)\n+\t\t\t\t\tdelta = IONIC_Q_WDOG_MAX_MS;\n+\n+\t\t\t\trxq->wdog_ms = delta;\n+\t\t\t}\n+\t\t}\n+\t}\n }\n \n uint16_t\n", "prefixes": [ "v2", "36/36" ] }{ "id": 118503, "url": "