Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4851323pxj; Wed, 9 Jun 2021 03:32:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJze0REVbFMGuD4t/NN9C6ePVOkJRl8/ryf64O+n3Ivq3Y5wzEHkmh4389ZTd8u3k2NCAtue X-Received: by 2002:a17:906:dffc:: with SMTP id lc28mr27288173ejc.96.1623234736559; Wed, 09 Jun 2021 03:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623234736; cv=none; d=google.com; s=arc-20160816; b=ELWilN321b5AbJTH1Ams0tVoY1p7FCRzc4CIEp7fwvmc6H2y6GGsDJU+shkSIdZEN1 /lIyEXdzZOoHmgAPf2OjsGpBGEztb/Wvxusz/t2GWmV9PcjZ3hH11tngXTyyJNKFShO1 H97MsKMpcNSONZObj94qoS+3X0GiAHtADw7+g6OZ5kolPeOiehsVaN1HOXkxgsnzKxWI OZypamMkAwTAzCa+HEHJ5nqFESXTV45xoYJjeKHRjJ7pQ4bBBfTp9dQBfrr03XXHOO0e BaHl0fHmd6N18FLORJv6XaHQVJPxVvIqnJSMy0FVJANs3rg3LSqsjR98z1CSfK8wAByI Nw1g== 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=xjBiDIycmTxmdq0N562Jk/w2QGrEVRaxa/8N6vlFPRw=; b=FRKvn2I4N8aeUgldmoqmBDZCC7i/7aG/3Jc5o/bCaQ30uk/IvhgOs5ZUtq/Dw72O0m +am5zQnzbeVHcBRjCPtu6DGKd/s9mZTgM5ofIDk75uiJgOkS182G/xqJzAH1u5AGuOiF IIwzpZw7/qcwBNf+yTsPFhkjDdUbeKYEQWfH+S3O/Mx1e7L35ls9ePZzL/GN7CuEFnlQ HYQG4KcDpvvf9PkVVED9yyDQmnaIy0JESt66/r8sqE16f+hKgZoylNixws7Gm5urjd15 3ia8UUtx6jV1e80O890LC7riL/d+Rxr3DKjMQfMTxOHtrC4oNCGL+EghV5bLd8I9Dw5H GayQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CAlSB5dg; 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 lz7si1948963ejb.40.2021.06.09.03.31.52; Wed, 09 Jun 2021 03:32:16 -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=CAlSB5dg; 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 S234550AbhFHTBQ (ORCPT + 99 others); Tue, 8 Jun 2021 15:01:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:59262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236474AbhFHSyT (ORCPT ); Tue, 8 Jun 2021 14:54:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5CDA56157F; Tue, 8 Jun 2021 18:41:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177660; bh=Dm/mlbZyX2ExMxM+PpnXu4dT0jhOZNabyYsq3fzpN5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CAlSB5dgt0HbkZxzA124YnMPRkyNIaWZHBv4+sFPBdRweNhjPZ43qGKDt5+aU984D /PpoDcbhPcFUDfhniuLC1vgSjvxKWUkmpHLsK3NNltLwyxflrAiuCNGZ9Gfq5tyX3D 3HUcpqFTfLDoYjIhpAI7mQy0/wGElWAJ1Qg613Xc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Maciej Fijalkowski , Kiran Bhandare , Tony Nguyen , Sasha Levin Subject: [PATCH 5.10 054/137] ice: simplify ice_run_xdp Date: Tue, 8 Jun 2021 20:26:34 +0200 Message-Id: <20210608175944.223304246@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: Maciej Fijalkowski [ Upstream commit 59c97d1b51b119eace6b1e61a6f820701f5a8299 ] There's no need for 'result' variable, we can directly return the internal status based on action returned by xdp prog. Reviewed-by: Björn Töpel Signed-off-by: Maciej Fijalkowski Tested-by: Kiran Bhandare Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_txrx.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c index 1510091a63e8..5cc2854a5d48 100644 --- a/drivers/net/ethernet/intel/ice/ice_txrx.c +++ b/drivers/net/ethernet/intel/ice/ice_txrx.c @@ -537,22 +537,20 @@ static int ice_run_xdp(struct ice_ring *rx_ring, struct xdp_buff *xdp, struct bpf_prog *xdp_prog) { - int err, result = ICE_XDP_PASS; struct ice_ring *xdp_ring; + int err; u32 act; act = bpf_prog_run_xdp(xdp_prog, xdp); switch (act) { case XDP_PASS: - break; + return ICE_XDP_PASS; case XDP_TX: xdp_ring = rx_ring->vsi->xdp_rings[smp_processor_id()]; - result = ice_xmit_xdp_buff(xdp, xdp_ring); - break; + return ice_xmit_xdp_buff(xdp, xdp_ring); case XDP_REDIRECT: err = xdp_do_redirect(rx_ring->netdev, xdp, xdp_prog); - result = !err ? ICE_XDP_REDIR : ICE_XDP_CONSUMED; - break; + return !err ? ICE_XDP_REDIR : ICE_XDP_CONSUMED; default: bpf_warn_invalid_xdp_action(act); fallthrough; @@ -560,11 +558,8 @@ ice_run_xdp(struct ice_ring *rx_ring, struct xdp_buff *xdp, trace_xdp_exception(rx_ring->netdev, xdp_prog, act); fallthrough; case XDP_DROP: - result = ICE_XDP_CONSUMED; - break; + return ICE_XDP_CONSUMED; } - - return result; } /** -- 2.30.2