Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp241562pxx; Wed, 28 Oct 2020 03:52:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGD8fsN0qg0lQL5jBtkqd1gJUcIBhvHYi/V8SeX3eBno3rsdec+08rsEOYYPFvDNEzwwXI X-Received: by 2002:a17:906:a1d8:: with SMTP id bx24mr6662748ejb.161.1603882370591; Wed, 28 Oct 2020 03:52:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603882370; cv=none; d=google.com; s=arc-20160816; b=GhzZVcU73N82qzAxwEB/fSOZNWvAL3mPh+b4NadE2tRydvOdOkvBAgp8Euet+O+zCR Gy4b0YehRJ0jp0vulzZ18GkTljaofFUwbI7cPTDAKDl/NzXgsd4dBf18XBLOV4Ma6d1X I3KcacBbrKCRR+29SmeyiIj/9djVNNoXjACf1sCOTaO4WSKW5b/hXqmjQCE61S6ZLf8p 0YlNVpGN/alAltiRPw7dfgvBG7oE5j7kTT2xUK/tIWWNsF16eS91YFAQ1Uy7Fu4eiBx6 3Gfc8iiCvcGm6+Ja+pMObsU9wy5NhkyNrklCdnhduOdjlns/9lsPtZcppxkg1fMpsnEV 9cRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=N3PrOWiqrEa4qsvPY3LlO6YiTAvTgwfJG/ycWXg0nKk=; b=H8V8qjoFyvNJ2r+kagUgCHo5UDCAYYaGOPYSq1oBJbyU3LuVsiX1KybtYyGdIKNgQs UhNhGHBjnTxLz7M7tsMbLsjBpyU5bp9YxxG0QXTvf27RJkEc92yD3ssnSgwE/ZbgK3rT /ucBHPi6dqaav/CSgtai5UriV/YHHSlvPliZxlzgRPfQBgnf/XbxoYzc6ggIeBEsGNnC Xw56Ubi0sXe5Kv8aKreAu0J0SMVH/hPu7aK6Jma+EB/iDm8lv6q15dbOXRxw93AMxtfW ByKF3DkOHw/dU5NPqK60ZpyhkHsn1MRmhww87DqAbsNDGYISDyp+7pbNigQc4g/d8/Vw GtJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IfbUW8dn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d4si2698178edr.173.2020.10.28.03.52.28; Wed, 28 Oct 2020 03:52:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IfbUW8dn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1780865AbgJ0OzA (ORCPT + 99 others); Tue, 27 Oct 2020 10:55:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:47934 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1766280AbgJ0Or6 (ORCPT ); Tue, 27 Oct 2020 10:47:58 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CC6F5207DE; Tue, 27 Oct 2020 14:47:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810077; bh=VXz311ySXAooZYlF4YlnnfuKP8cN8xxb7DHHl+Ud6yo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IfbUW8dnvYxqV32xHC41H2Xpu2UKsjM143Cai7zK7IGDKrs1uJh+H7IdoSbeLAIPh cSrwx5wyJkEdORIE8HxUVootrB0/dWTS+D/k9CRwFccOoRUx3V92t7J4P24/FGVvNP 8oYL7mz8wX2hZEIZAgo3lKAENJVkGBaecqj4suv0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Lemon , Tariq Toukan , Jakub Kicinski Subject: [PATCH 5.8 005/633] mlx4: handle non-napi callers to napi_poll Date: Tue, 27 Oct 2020 14:45:48 +0100 Message-Id: <20201027135522.925297023@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonathan Lemon [ Upstream commit b2b8a92733b288128feb57ffa694758cf475106c ] netcons calls napi_poll with a budget of 0 to transmit packets. Handle this by: - skipping RX processing - do not try to recycle TX packets to the RX cache Signed-off-by: Jonathan Lemon Reviewed-by: Tariq Toukan Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 3 +++ drivers/net/ethernet/mellanox/mlx4/en_tx.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c @@ -943,6 +943,9 @@ int mlx4_en_poll_rx_cq(struct napi_struc bool clean_complete = true; int done; + if (!budget) + return 0; + if (priv->tx_ring_num[TX_XDP]) { xdp_tx_cq = priv->tx_cq[TX_XDP][cq->ring]; if (xdp_tx_cq->xdp_busy) { --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c @@ -350,7 +350,7 @@ u32 mlx4_en_recycle_tx_desc(struct mlx4_ .dma = tx_info->map0_dma, }; - if (!mlx4_en_rx_recycle(ring->recycle_ring, &frame)) { + if (!napi_mode || !mlx4_en_rx_recycle(ring->recycle_ring, &frame)) { dma_unmap_page(priv->ddev, tx_info->map0_dma, PAGE_SIZE, priv->dma_dir); put_page(tx_info->page);