From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A2DFDA00C3; Mon, 17 Jan 2022 16:30:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 65A6541229; Mon, 17 Jan 2022 16:30:08 +0100 (CET) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by mails.dpdk.org (Postfix) with ESMTP id 08FF640141 for ; Mon, 17 Jan 2022 16:30:07 +0100 (CET) Received: by mail-lf1-f47.google.com with SMTP id e3so56222311lfc.9 for ; Mon, 17 Jan 2022 07:30:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hwxZFcF/WBHJQD/pkshZrYW72Fawbd7d8vz/xY5n6WA=; b=GuDP/oPcCpb9rZstREX3Wrs7MD7ePQq1BifDzIlBDKe/5YUpeoSnQB4ZIbiD+0CFWd BxeGsCqRVcSmBU1AXGtE0fe8X5vjN7vuOlAHqpazyvaTH9sv2UMOf+vbxBanQxgdKStB OfL4WCI4o0yPfefQkPE76PeUZyNHh1InK3UT4/KfrWQn3I+6ACRdvD6ZY1ge5zxIH2z0 WM99t7C0g0z7AvTQIydVXzjLzgi41NXgsFW8jjaKpgcxDEzpbUnG+rmsBd0zmtnCdqiG DBV0rgrPqMwIYMSDKFadOgSVvB3KLEhLu6WSgDrhb/G5BFu2TsIRtD6SG+UFTtWKww2/ OLxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hwxZFcF/WBHJQD/pkshZrYW72Fawbd7d8vz/xY5n6WA=; b=ExtMW5X6c0CbNB6vn9DbL28KwtfM9ig8ydj17sgCjf9npoZ3gpX1LDndbBhPq6ppEe fwBJEQZfKSZXWZ3BeWsM7Da2Zr0lb64FFfNsKrb6xj9g28fZVjD9xKwq8CJLwIDxthmh 30gRokBAnUfggKVVqOzQgiCFztW18JjyceNZno0RkQCnE1Am/Nf49dZPrR7RDcSMNlxP dxHkoDPo8WSEz55/3pBqaIThp2+sP2F5SARJ+O2N2cteYSwQXAZdR6b4QNyr6nWnm12N j66iNGuTMULAZruxUuIcpwBSj+AtEDlkD9bsO/h2KkOU3aF9VuktABkySjSTNxAvS+C+ YwMg== X-Gm-Message-State: AOAM533W7qMRJZCpVbjwdxTwnDDQ9s+phcYrzrdAl0OBVt/Zr9eg/l7M OtDrXYqf5aqncMglYmf2fsNl9HfnLA3L4khJ8Rg= X-Google-Smtp-Source: ABdhPJz8TTvTiIkNnr7HtJzGxqW54HZrpb0kC+BgfzJ8F8sdWlcfEYFwZR7AeqCxmLy/c4gBO2M7bYc/PahyI4Dm6ao= X-Received: by 2002:a05:6512:912:: with SMTP id e18mr16986497lft.163.1642433406442; Mon, 17 Jan 2022 07:30:06 -0800 (PST) MIME-Version: 1.0 References: <1639753232-115930-1-git-send-email-tudor.cornea@gmail.com> <20211217082439.13d36631@hermes.local> In-Reply-To: <20211217082439.13d36631@hermes.local> From: Tudor Cornea Date: Mon, 17 Jan 2022 17:29:55 +0200 Message-ID: Subject: Re: [PATCH] kernel/kni: retry the xmit in case ring is full To: Stephen Hemminger Cc: Tudor Cornea , ferruh.yigit@intel.com, thomas@monjalon.net, dev@dpdk.org Content-Type: multipart/alternative; boundary="000000000000c2224005d5c8d397" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --000000000000c2224005d5c8d397 Content-Type: text/plain; charset="UTF-8" Hi Stephen, > NAK > Doing this risks having a CPU lockup if userspace does not keep up > or the DPDK application gets stuck. > > There are better ways to solve the TCP stack queue overrun issue: > 1. Use a better queueing discipline on the kni device. The Linux default > of pfifo_fast has bufferbloat issues. Use fq_codel, fq, codel or pie? > 2. KNI should implement BQL so that TCP stack can see lock backpressure > about possible queue depth. > > Thanks for the suggestions. I agree that we risk a lockup, in case the DPDK app gets stuck. Indeed, I am running on an older Linux kernel, and the default queuing discipline is pfifo_fast. I'll experiment with the queuing disciplines you recommended. > As a simple workaround increase the KNI ring size. It won't solve the whole > problem but i tcan help > I obtained moderate success with increasing MAX_MBUF_BURST_NUM from 32 to 1024 in librte_kni. I'm not sure if such a change would be upstreamable. Perhaps it needs a bit of testing. I'll drop the current patch. --000000000000c2224005d5c8d397 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Stephen,


NAK
Doing this risks having a CPU lockup if userspace does not keep up
or the DPDK application gets stuck.

There are better ways to solve the TCP stack queue overrun issue:
1. Use a better queueing discipline on the kni device. The Linux default =C2=A0 =C2=A0of pfifo_fast has bufferbloat issues. Use fq_codel, fq, codel = or pie?
2. KNI should implement BQL so that TCP stack can see lock backpressure
=C2=A0 =C2=A0about possible queue depth.


Thanks for the suggestions.
<= /div>
I agree that we risk a lockup, in case the DPDK app ge= ts stuck.

Indeed, I am running on an older Linux k= ernel, and the default queuing discipline is pfifo_fast.
I'll= experiment with the queuing disciplines you recommended.
= =C2=A0
As a simple workaround increase the KNI ring size. It won't solve the w= hole
problem but i tcan help

I ob= tained moderate success with increasing MAX_MBUF_BURST_NUM from 32 to 1024 = in librte_kni.
I'm not sure if such a change would be upstrea= mable. Perhaps it needs a bit of testing.

I= 9;ll drop the current patch.

--000000000000c2224005d5c8d397--