Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4851640pxj; Wed, 9 Jun 2021 03:32:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyA1NlHopW/OZ6e7ZoD5K8HAocQWLKJFQrFtLvJz+whzhqxBpCAiFjdFun3p+fHcNu95F3A X-Received: by 2002:a17:906:76d2:: with SMTP id q18mr27485778ejn.294.1623234771254; Wed, 09 Jun 2021 03:32:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623234771; cv=none; d=google.com; s=arc-20160816; b=RB7j6nLgsuAURGgNqbXqN8S1qNg/3o2YPMK+zDqc9OAJ3v5u7OZKzeQv6h4+q+keFd jN9OaP6jVD5OZ0CKBLbrvn+eC2bKSIXEv+nupa9wOQJBYWuF3eA/ravv9PkG58wvb8wF ZeS6AwrwrYEdGvnP93PWn0UooBmkBBx4iJXQynhwBC729VJogK44UZR54t3oXQmCIZ3o NpAVDF+jjeDli6OqOhL+AbG3DLAVPi2oL1zH4rjzmM5jEuiXpv+kDZXOyRayZRJRMK1t kB26nvdwfMapt039wtyeszt7G+Cm1sPgwqiBjbGQ/xs3f+a8ow6uo4Y9Q6FnSAR0Bd6P i56A== 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=cT6BMauJA5TCWBLww0K4L5E/Ciqd2A2MEE9jp4lwIRQ=; b=RiOKslQJmZHqogyTvFfwn2VLdM5BwC6ON1Jo70TygLOw750UBdcaBGT4KeO2HVOw0R nPMj+6t2CJgfcUDXL2lf0Eg9MA2P9wNbnBVGuHklJq7+0O/v0Eek/Ycwwzv/j2ixH9Sw sjs+BVxGX83nwcJe2+AuXBOqwv2DRPxXXu6rAwuuDg4KL4OA8m5fLcd0CRf0OOAZm3IA U3qWjNfT1CeE56yxkvj5zUoWGHTb+eIrc876PD0fgrPLUzoLr+Q4btvOWtjxkiexWaa9 ak5Z5tDI9qv5/Ui9NyYQSCHG3PDsbqredCpxcT0ucZPFm6D2tBu6/2NEuvLYVb3BjvfE t2ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0QGLMoNq; 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=pass (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 y2si2059593edu.447.2021.06.09.03.32.27; Wed, 09 Jun 2021 03:32:51 -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=@linuxfoundation.org header.s=korg header.b=0QGLMoNq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236478AbhFHTBi (ORCPT + 99 others); Tue, 8 Jun 2021 15:01:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:49356 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236529AbhFHSyc (ORCPT ); Tue, 8 Jun 2021 14:54:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 65179613BC; Tue, 8 Jun 2021 18:41:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177674; bh=cF2gf06p0ZjoCP7ov+Qa0PZo0uMfYOcFQQ/ahArk0Vk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0QGLMoNqlAEKqkf0qEoy+v5Vr1O+AOxm1LykJYRedhVo46bJfaYxogSn7uX41H62G CSv0aBMQyR8VJIH2k3OE5bDh9EHXgzUXsy+sje49nCMXqJZvbQ64MZBVtSO8XxSLJi JcIClKrHRC7akgIMNCLCr5fiujhc/NhdkyLE+dFk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jesper Dangaard Brouer , Magnus Karlsson , Vishakha Jambekar , Tony Nguyen , Sasha Levin Subject: [PATCH 5.10 041/137] igb: add correct exception tracing for XDP Date: Tue, 8 Jun 2021 20:26:21 +0200 Message-Id: <20210608175943.798969224@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175942.377073879@linuxfoundation.org> References: <20210608175942.377073879@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: Magnus Karlsson [ Upstream commit 74431c40b9c5fa673fff83ec157a76a69efd5c72 ] Add missing exception tracing to XDP when a number of different errors can occur. The support was only partial. Several errors where not logged which would confuse the user quite a lot not knowing where and why the packets disappeared. Fixes: 9cbc948b5a20 ("igb: add XDP support") Reported-by: Jesper Dangaard Brouer Signed-off-by: Magnus Karlsson Tested-by: Vishakha Jambekar Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/igb/igb_main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 368f0aac5e1d..5c87c0a7ce3d 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -8419,18 +8419,20 @@ static struct sk_buff *igb_run_xdp(struct igb_adapter *adapter, break; case XDP_TX: result = igb_xdp_xmit_back(adapter, xdp); + if (result == IGB_XDP_CONSUMED) + goto out_failure; break; case XDP_REDIRECT: err = xdp_do_redirect(adapter->netdev, xdp, xdp_prog); - if (!err) - result = IGB_XDP_REDIR; - else - result = IGB_XDP_CONSUMED; + if (err) + goto out_failure; + result = IGB_XDP_REDIR; break; default: bpf_warn_invalid_xdp_action(act); fallthrough; case XDP_ABORTED: +out_failure: trace_xdp_exception(rx_ring->netdev, xdp_prog, act); fallthrough; case XDP_DROP: -- 2.30.2