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 27D21A0C4E; Tue, 2 Nov 2021 16:24:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E34DB411A7; Tue, 2 Nov 2021 16:24:32 +0100 (CET) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by mails.dpdk.org (Postfix) with ESMTP id 18DC04113F for ; Tue, 2 Nov 2021 16:24:32 +0100 (CET) Received: by mail-ed1-f49.google.com with SMTP id w1so23451852edd.10 for ; Tue, 02 Nov 2021 08:24:32 -0700 (PDT) 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=Fl5Slo4SCvz3I41Ud79oJoGiH6AYSKsBODqviT+V98I=; b=OWKXcg+HYqf26aovUVCCAZPwbeufV9fNNINGuOzXnf4llrEHFJZ8qd18e95vUfnAvi FoLunntHafINBtPWVV+ZSeCUd0Ma/C8SmAnji8QtpUQJcrQQwTz2Dh8C+QAoD5OffWMj sPR4GS428pYNOLH+v6zt1QQYmFcZpsIp3d1osrLmZVWWOC817oNIq+3r4uR6VcYAoJKI hRALV10YsGs71bJ6PcF7g1jORHgA2egkvAPPx3E43ZGfcLcmKGiUquoeQUIITicwEg9C rprW1JrC8xEinI2IUMQ03ZzpXNXq7z+iTuF+zFSyfOeTs79neM5zNaeiJQfi6jApbpu2 DsJQ== 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=Fl5Slo4SCvz3I41Ud79oJoGiH6AYSKsBODqviT+V98I=; b=ggdi+hWGyvRJTa0Bx7u9QOeFnO+dBu0VV2sM0S8ivDODAq5CT5Apne2SiJiBKHhJTb qTvLnEna2/4pIAUaYle9SW1qbhs2ZJ9aNjbb2V4VZG/o2nj+qZrWGVvKr9CBLLL7Ff2P z0T2JS82Kkpzlh4WSMZFkvykCo7jGA85TqSXuaH+CVihHM6tYh6Z6HLWGXF5xIsF7Tt+ /o+H7AnUIQV2G2Y5rLNlC3QllI7zSjryI7uRRg2SeyzPJcc/1UNp8OhG9+jJkvM8yD6G Ri0o/zFcrSDew3AmMFwvBRyMwrgROcFvljBLm9ukgUvn+0lIJXOTh7ttrCLIw3oFqMbL XbJA== X-Gm-Message-State: AOAM531aMsqX7S5d8CTAavby5nYfciB+fu8m+kY/0LvSaHxSHhXuRT6c TMF4KrK4nXnL/f+X40HhKDNkOpSt56sW9iaJbw4= X-Google-Smtp-Source: ABdhPJyoV15+lxe13y4rD1H8OPol65ueRDg/JhujG3TDGclokm4PJlQwqeQ+PuAI3OGSy0YQK2XMxcBDOEnBtybqmJE= X-Received: by 2002:a17:907:774d:: with SMTP id kx13mr46899549ejc.239.1635866671814; Tue, 02 Nov 2021 08:24:31 -0700 (PDT) MIME-Version: 1.0 References: <1629466761-127333-1-git-send-email-tudor.cornea@gmail.com> <1631540746-38443-1-git-send-email-tudor.cornea@gmail.com> <9ec3e2cb-412a-a48b-2567-7e5ad6b1153f@intel.com> <7dd5cbb2-dfb8-8c54-9b48-9e271c0e51b1@intel.com> In-Reply-To: <7dd5cbb2-dfb8-8c54-9b48-9e271c0e51b1@intel.com> From: Tudor Cornea Date: Tue, 2 Nov 2021 17:24:20 +0200 Message-ID: To: Ferruh Yigit Cc: linville@tuxdriver.com, Thomas Monjalon , Mihai Pogonaru , dev@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH v2] net/af_packet: fix ignoring full ring on tx 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 Sender: "dev" On Tue, 26 Oct 2021 at 17:41, Ferruh Yigit wrote: > Hi Tudor, > > I have used testpmd, 'txonly' forwarding. Tx recovers after interface up, > but by adding some debug logs I can see 'poll()' returns with POLLOUT even > there is no space in the buffer. > > According the logic in the PMD, when 'poll()' returns success, it expects > to have some space in the Tx buffer. > > So I agree to add the check. > > Only have a question on the POLLERR, should we separate the POLLERR check > to cover ifdown case, what do you think about following logic: > > if (!TP_STATUS_AVAILABLE) { > if (poll() < 0) > break; > if (pfd.revents & POLLERR) > break; > } > > if (!TP_STATUS_AVAILABLE) > break; > > Hi Ferruh, Thanks for the suggestion. I was thinking of adding this check, and intuitively, it seems correct. I tried to do some further testing. I tested with the POLLERR check, and I don't see the issue anymore. However, if I remove the second if (!TP_STATUS_AVAILABLE), I seem to get bursts of 2048 packets followed by periods of not sending anything when toggling the interface link state. Without the second if(!TP_STATUS_AVAILABLE) statement, the issue seems to reproduce, regardless if I add the check for POLLERR or not. RxB=0 RxP=0 TxB=0 TxP=0 RxB=0 RxP=0 TxB=0 TxP=0 RxB=0 RxP=0 TxB=0 TxP=0 RxB=0 RxP=0 TxB=0 TxP=0 RxB=0 RxP=0 TxB=0 TxP=0 RxB=0 RxP=0 TxB=0 TxP=0 RxB=0 RxP=0 TxB=0 TxP=0 RxB=0 RxP=0 TxB=606208 TxP=2048 RxB=0 RxP=0 TxB=0 TxP=0 RxB=0 RxP=0 TxB=0 TxP=0 I will send an updated version of the patch. Thanks, Tudor