Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp6842771imb; Sat, 9 Mar 2019 07:50:50 -0800 (PST) X-Google-Smtp-Source: APXvYqyhBI+eOvu1bgSWXQ8e4xbyFUKt5RLBxTohO7SvLd46AewVU+FXoA+DmcqumNg0bbIE4TN5 X-Received: by 2002:a63:6bc9:: with SMTP id g192mr21876086pgc.198.1552146650046; Sat, 09 Mar 2019 07:50:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552146650; cv=none; d=google.com; s=arc-20160816; b=CoBg1Q1dwWmb1CxuZjvMV4JRuc/4WPHo874t7/cl6M6kmX/hQTMr4QY7PXZayQLec8 pWYz736+b84m2dRbM5Ndoabhh9bUfXqYZ4aglGJ6WvY9MheSboC1+XGhWMOU73grIjXP xruPM8Pt1XK8SS7mfHovuzMMMvy4hvxWA2PhUFXtg16hIqUS0vsUR2JWRrrbg/UJBrXR ewfcVxBC7EV40GW7b7X207H66vCupQ2d1bWF1a7GS2Fn2Y1fbkTPPKwU4AGGdKM4ZjhI 45mZ+lMjVBkUCyeKHP6h8kaf/bFK1LqCziMteJEP1KILnGXcDvHIh/1WrAB34se60V6E pX3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=1vH19OLSobakAZFj+R+HeYC8yMmPXzpd0MbGz9aiYIc=; b=EFEKuDe++54+ECILE+3sT0K+4K/zwriRUK7fu4PMbHrc8vM1hpqVvCDIHL0a6JCIsL EPmvmW2iN6bCA4E5nU7JlvXldt0cxaeonAieoaTf25f/hopU1Es4leskbaNtVHWAc5eL w4qlMDx6Q26/yyMec4gumJmnvWzybf0FsKs5jtlSVXOCOtyU+PUSQZo138Yclvy4YR4Z NuCiLR1TpEmF5b4yr+IOPdxq4pLfirnliNXkTcbxr9lb+pPX+hR2BRC+rxi0BJTZbjwu dRUHGVlHgrtcW0qLdoblPUv7BwNmp6Iz7y3XLRUO6pP10oz2BQQCgzGWnTxuksro9ReV EXIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org ([209.132.180.67]) by mx.google.com with ESMTP id 25si581390pfp.87.2019.03.09.07.50.34; Sat, 09 Mar 2019 07:50:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726445AbfCIPuP (ORCPT + 99 others); Sat, 9 Mar 2019 10:50:15 -0500 Received: from mail-ed1-f45.google.com ([209.85.208.45]:35989 "EHLO mail-ed1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726399AbfCIPuO (ORCPT ); Sat, 9 Mar 2019 10:50:14 -0500 Received: by mail-ed1-f45.google.com with SMTP id e4so523472edi.3 for ; Sat, 09 Mar 2019 07:50:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=1vH19OLSobakAZFj+R+HeYC8yMmPXzpd0MbGz9aiYIc=; b=pfcw1p1jl+TVKSUarm1dCuQgjFxrsASi7uFT84z7PQLtdIqJ0A/13CL3vyu9fTT6iS /oqbOZySmIT6PDQ9XMM4rfPbnUfNTf1YizzWrBKnsSBQQCz3NQ62C/yocVE2uW8/YFso GqQfVI+kImQ58Aviitw3YpwyDEUWU3A/9++SrdYurziTcLkZGKE/zcwz5QKrzelo2WDO kXX5/9xPJ9dpJXHviLOckAP7hdVjCpALqc4MM9hyvfWpwwgkwY6fo72Gxce4ikI3Aor6 p+Z89HFZt9/jIoHSh6Ed2W11t48iZggegFNdVqhXJxYsEybnZesC9pcbktqycI7ysW7P i6Yw== X-Gm-Message-State: APjAAAWzjBx5W3Ovvxjjvwq89ysRlTlIDzpPeSagq8fVnyqIZLL0ZGco xm/3dqC+XhhGwzbfMTJ4EktWEQ== X-Received: by 2002:aa7:c50b:: with SMTP id o11mr38104654edq.14.1552146607863; Sat, 09 Mar 2019 07:50:07 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk (alrua-x1.vpn.toke.dk. [2a00:7660:6da:10::2]) by smtp.gmail.com with ESMTPSA id d10sm2003112ejr.64.2019.03.09.07.50.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2019 07:50:07 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 969561804A0; Sat, 9 Mar 2019 16:50:01 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Appana Durga Kedareswara Rao , Andre Naujoks , "wg\@grandegger.com" , "mkl\@pengutronix.de" , "davem\@davemloft.net" Cc: "linux-can\@vger.kernel.org" , "netdev\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" Subject: RE: [PATCH] net: can: Increase tx queue length In-Reply-To: References: <1552140446-31535-1-git-send-email-appana.durga.rao@xilinx.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Sat, 09 Mar 2019 16:50:01 +0100 Message-ID: <87zhq43v4m.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Appana Durga Kedareswara Rao writes: > Hi Andre, > > >> >> On 3/9/19 3:07 PM, Appana Durga Kedareswara rao wrote: >> > While stress testing the CAN interface on xilinx axi can in loopback >> > mode getting message "write: no buffer space available" >> > Increasing device tx queue length resolved the above mentioned issue. >> >> No need to patch the kernel: >> >> $ ip link set txqueuelen 500 >> >> does the same thing. > > Thanks for the review... > Agree but it is not an out of box solution right?? > Do you have any idea for socket can devices why the tx queue length is 10 whereas > for other network devices (ex: ethernet) it is 1000 ?? Probably because you don't generally want a long queue adding latency on a CAN interface? The default 1000 is already way too much even for an Ethernet device in a lot of cases. If you get "out of buffer" errors it means your application is sending things faster than the receiver (or device) can handle them. If you solve this by increasing the queue length you are just papering over the underlying issue, and trading latency for fewer errors. This tradeoff *may* be appropriate for your particular application, but I can imagine it would not be appropriate as a default. Keeping the buffer size small allows errors to propagate up to the application, which can then back off, or do something smarter, as appropriate. I don't know anything about the actual discussions going on when the defaults were set, but I can imagine something along the lines of the above was probably a part of it :) -Toke