From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBC2C15B3; Sat, 6 Jan 2024 03:30:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dYDIp+Mb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A09CDC433C7; Sat, 6 Jan 2024 03:30:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704511831; bh=ZZT5W/3OayChCmzDajSxgELxnptLBYGuC7NHIb+7uWU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dYDIp+Mby3VrwUNXuc505hhrUlZWX6YnsTAVt4cp6JDLy3Cz/pqLGQN6+dmvKEmUM 2bedL6TjTCT6R5Sx4kfi5PQ6E4J7L/vPeDv+H2ZW4FI3RUowD8z3DslbcTqNHNpoNZ ZXNamfRP8ONsklOAVRAkW8fuc+XE39d7oF/R1NHo2RKfHsh0OZWYc6pdBK6uibWJ23 +jCooMpqaBF/RbdMPN75AGF+VYJLlOZvW1yoInTFV+TtxrsESTc5LPiL8/RpPfRQBw 4OmYf1xM5QVcP/N4S/mSmIq7nx/naIBfHsFaIz/z0QBVzDKrlqebewzFQTGkmiK2Ql r9ZGd6gofQaHQ== Date: Fri, 5 Jan 2024 19:30:29 -0800 From: Jakub Kicinski To: Shinas Rasheed Cc: , , , , , , , , , , , , Veerasenareddy Burru , Satananda Burla , "David S. Miller" , Eric Dumazet Subject: Re: [PATCH net-next v3 6/8] octeon_ep_vf: add Tx/Rx processing and interrupt support Message-ID: <20240105193029.004ee174@kernel.org> In-Reply-To: <20240105203823.2953604-7-srasheed@marvell.com> References: <20240105203823.2953604-1-srasheed@marvell.com> <20240105203823.2953604-7-srasheed@marvell.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 5 Jan 2024 12:38:21 -0800 Shinas Rasheed wrote: > +static int octep_vf_iq_full_check(struct octep_vf_iq *iq) > +{ > + if (likely((IQ_INSTR_SPACE(iq)) > > + OCTEP_VF_WAKE_QUEUE_THRESHOLD)) > + return 0; > + > + /* Stop the queue if unable to send */ > + netif_stop_subqueue(iq->netdev, iq->q_no); > + > + /* check again and restart the queue, in case NAPI has just freed > + * enough Tx ring entries. > + */ > + if (unlikely(IQ_INSTR_SPACE(iq) > > + OCTEP_VF_WAKE_QUEUE_THRESHOLD)) { > + netif_start_subqueue(iq->netdev, iq->q_no); > + iq->stats.restart_cnt++; > + return 0; > + } Please use the macros from netdev_queues.h here as well. Looks like you may be missing a memory barrier here. And please call this function after queuing an skb to make sure NETDEV_TX_BUSY is almost never returned. See Documentation/networking/driver.rst