From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795617125; b=ptjDJMpU0beQ6jtMg1WgI9aR4WBvFCYeM6eCQSvZc3OCgnKsgz3Nzi8sCOo+x+sRwZ8U DUnUg+8GY+9yEYeM6JC+37fPoe55av0i/dZX5OCYHVD23b2zFtgsm7RP/XxE3vMs5OcQA GfOI6MnTXgmysmcoZaVG3mrDe3P8baP1JmdHCSMSJh81bUP7L79qosmZV0oWYfzQpBoOs U3Itk+w6RJxmrDocj6QnEzeny921fDUdlzIzrEVxbVg6UcIOWCiBhxODXDEQT7w4ppRbV R8jg0N28oKacOw4Io0lNGeCboJUJS9088DFBr3hdJgNV8FTt8A7Tr4LGDB1SrVFSFdw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795617125; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received: X-Received:Received:Message-ID:Date:MIME-Version:User-Agent:Subject: To:Cc:References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=Y9M4mZ1sXqBnAt7gUxOS/kbwMdJhgsv3SyZWvfyQ2Ug=; b=QeMLzN5Oqp8+PLPdHHNFTsvdyvmQuOdKa1pTZR41JoW19Cyis3BPJnYwrcrleprmrj67 g0ZS4hB2GuBOsMN9kK6aqUETQb3TgN/52+tW8nrlz7qDBnFu9TlmqlRM/hfiOK44eg5KL veVvKA5Tr8LJPTvNCEOav9zSbcNRIx/sdtIDvRWWR8NAtdXRZns2+ENWNwSwttyid8xWU UEpk6OkHfmrxqItThuWh2lxU2/5QWu2hbo08y8TC6H/tchBkrzRh99CX9WP3ozO6I52x3 etUca9TjXIFzEtnxXsofvN2TsgwDREAt58UJDxWQqqm+pnn2+gHzqdLacldF9H8tJkQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Pk9LZwaQ; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=rst8sXcQ; arc=none smtp.remote-ip=170.10.133.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCB2B606A323 for ; Wed, 25 Nov 2026 14:32:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CCB2B606A323 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Pk9LZwaQ; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=rst8sXcQ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795617123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y9M4mZ1sXqBnAt7gUxOS/kbwMdJhgsv3SyZWvfyQ2Ug=; b=Pk9LZwaQ2+g/0dcs7vL3nS9GSAOKXf2OGUP4gXeVHPeiEM3bAidVvCslxyMrHtUE146um3 MHePkNpnpHa8TUcA/FEZlfkk4zqp7n15TxLT5aNN7y+cQ8tOhJFzz6M/vL98jhNHZvUA4w 56ULbMUgUxJUxbZM/1/14RI6ur0digc= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-320-EYbAC9BuPzuTtTJk2EN-PQ-1; Wed, 25 Nov 2026 14:32:01 +0000 X-MC-Unique: EYbAC9BuPzuTtTJk2EN-PQ-1 X-Mimecast-MFC-AGG-ID: EYbAC9BuPzuTtTJk2EN-PQ_1795617120 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4a204ac318aso27897675e9.2 for ; Wed, 25 Nov 2026 06:32:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1795617120; x=1796221920; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Y9M4mZ1sXqBnAt7gUxOS/kbwMdJhgsv3SyZWvfyQ2Ug=; b=rst8sXcQ4ZLlyc618K0YgyoBvkOQ7ylopU26y8HcJHM6OyJPUCl7D99AMEtglTMSTh kgkm/shE8hGo2zOKf9Xy5+0Vl8aWbIvJxNXtFgKNaHXertWesY/sG4q4haubyYlDu6Qz apDRpXrp1WCYbKZwntwZYtXts/p7ke+EHwoKuyhb0LKs2mQaIxokbAkTn/s0XNE9eGo9 L9llm1XNGfX+E9yH98bs8ySJq5se87nr1Iu1zcyHXdnwxwCXfhGXeMsxoICr9mZfg1fa Wc5TS4/uFm1cgjap09olqnxS27G9h6/PpXkq6QVK2wqgC2VKx+tTw+PPebpV0UUkXiTf 59dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795617120; x=1796221920; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Y9M4mZ1sXqBnAt7gUxOS/kbwMdJhgsv3SyZWvfyQ2Ug=; b=Ta0DRT0qk4TN2fUT/iH5bibXCZARPfp1FkqASd+pjciJ7kLlubl+8+LT06BxuDx++7 36SgPaL5kyRRz5WZOV27nmIl8bhLTRbRvj5/KowX0P6Kfn2zWlDgh4O27/ZHQjhwk1Hq K2yXO+u9WQyZBDCyKQALwsv+42WaRcSeqQYZVMGcFwkCtis587KvCTJ3p9zWO69PerZS gUJJOO5IkYHyxj8RBbnUSMqQdGo0YOL8JDKLeOYOSEE4FC0TygTTR/saxayLQC4gk4BV x1NyPPtipmspzBMppHs8qH7aZpU2US0Ay3/zGcbFVDXKzDMCgRiyzugHqBmzB62ASXZs q3tQ== X-Forwarded-Encrypted: i=1; AL+hErGtyx8IdRfytRnf7lGUMmYrpCyLZMtF7x9IkCfI0lMx0xuSrHRhJXwL8j3zQGHiM9CNnu6Bf+MENrp0pmA=@vger.kernel.org X-Gm-Message-State: APuU4Z/8bQnJnoBWxa1wmyRZn0xy9HfZfJYCZo7rlJngyKIcNIHxi8SY HVFUqTntRs36nh/2SAnbv8zPXzVlFQGQ+GB4Vb72mncf6MW570KYNCLYWuHm3kWr9bixlxRQO5q 3r86od59KSeEqDejCa4q39oRxBUJVh7Eun7KwreFJNi4IdSf8QtO0f/501ZiRvZ0Jtw== X-Gm-Gg: AZFdTZeFUMknmIxdiDUCz8ZgmXyL3XIeXBElIyw1MiwLu/eS2vLiRqvZ9ZlBFjpHoRn lowtjZC1mWYP9Qy7B+E84gkbQSCZzpO6Z7t0r6O28AxNI+s22i4AE+p13Vr2yap1o3PePmy+rcK h4kCBXwAHc8FCDRHprqgdXEu8K4biTjYM+avE0+ZninrFyDjdoAnV5UpyHuM9b9mBs4d2L48p+Q dX8QnIHjqXbPO6gMaBwuK1ktsHwLZW+sF56TyMnIXUecmrhNajcIs8NltmuRvIHvRPgdVVlotlx 6vlF/deLxyaG4s2BQqnZOt86I5vSZGxpfbJE8FQj2NW3IHK1eiqeVNXLfnuWMQ3/OgnMwIWoZon FICpQCT03B3uUI54o5fBM0IKDB6Q4SKmWhj2gQD7rIVG5+OyWT57NJgQtFRjaIRHf00BqBPgnPQ WhQdYpQzHZmGzTM7v2/Wesv4fpUh/v0yEtLdjGdA8KETma X-Received: by 2002:a05:600c:64c8:b0:4a0:1c0e:b057 with SMTP id 5b1f17b1804b1-4bb887e2380mr338242115e9.4.1795617120255; Wed, 25 Nov 2026 06:32:00 -0800 (PST) X-Received: by 2002:a05:600c:64c8:b0:4a0:1c0e:b057 with SMTP id 5b1f17b1804b1-4bb887e2380mr338241515e9.4.1795617119786; Wed, 25 Nov 2026 06:31:59 -0800 (PST) Received: from [192.168.88.30] (ip231-128-192-82.pool-bba.aruba.it. [82.192.128.231]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6b110d56sm33434554f8f.40.2026.11.25.06.31.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Nov 2026 06:31:58 -0800 (PST) Message-ID: <3766f988-9ea9-4ead-870f-fab0549e15b6@redhat.com> Date: Wed, 25 Nov 2026 15:31:57 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 net 3/4] net: hns3: fix interface stuck after OOM with full hardware rx queue To: Jijie Shao , netdev-bot+sashiko@kernel.org Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, andrew+netdev@lunn.ch, shenjian15@huawei.com, liuyonglong@huawei.com, chenhao418@huawei.com, yangshuaisong@h-partners.com, ningwei15@huawei.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261118130330.3026625-4-shaojijie@huawei.com> <179535384062.3135.791733868582964041@kernel.org> Content-Language: en-US From: Paolo Abeni In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 11/23/26 08:33, Jijie Shao wrote: > on 2026/11/22 21:24, netdev-bot+sashiko@kernel.org wrote: >>> @@ -4489,10 +4519,15 @@ int hns3_clean_rx_ring(struct hns3_enet_ring *ring, int budget, >>>        * FBD number with head pointer >>>        */ >>>       if (unused_count > 0) >>> -        failure = failure || >>> -              hns3_nic_alloc_rx_buffers(ring, unused_count); >>> +        failure |= hns3_nic_alloc_rx_buffers(ring, unused_count); >>> + >>> +    if (unlikely(failure)) >>> +        hns3_ring_set_oom_state(ring); >> [Severity: Medium] >> Can rx_oom_cnt be incremented twice in a single NAPI poll here? >> >> The commit message says the counter is "incremented for each NAPI poll >> that hits an RX allocation failure". When the fraglist napi_alloc_skb() >> fails in hns3_add_frag(), the path looks like this: >> >> hns3_clean_rx_ring() >>    hns3_handle_rx_bd() >>      hns3_add_frag() >>        hns3_ring_set_oom_state(ring);   /* rx_oom_cnt++ */ >>        return -ENXIO; >>    goto out; >>    failure |= hns3_nic_alloc_rx_buffers(ring, unused_count); >>    if (unlikely(failure)) >>        hns3_ring_set_oom_state(ring);   /* rx_oom_cnt++ again */ >> >> -ENXIO doesn't match the new err == -ENOMEM check. But failure can still >> be true, either from a failed exit refill or from an earlier failed >> in-loop refill. Under the memory pressure that caused the fraglist >> failure, the refill is likely to fail too. >> >> hns3_ring_set_oom_state() has no per-poll dedup, so in this case the >> counter goes up by two for one poll. > > The second increment only happens when a second allocation actually > failed.  hns3_add_frag() counts its failed napi_alloc_skb() and returns > -ENXIO, which doesn't set `failure`, so the exit refill still runs and > bumps the counter again only if it fails too.  Two increments mean two > failures.  I agree "for each NAPI poll" can read as at most once per > poll, that's just imprecise wording. I agree another repost is not needed here. However patch 1, 2 and 4 are net-next material and only patch 3 is borderline net material. To avoid a repost and splitting, I would apply everything to net-next. /P