From patchwork Thu Apr 21 13:21:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maciej Fijalkowski X-Patchwork-Id: 12821616 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F7F8C43217 for ; Thu, 21 Apr 2022 13:21:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231841AbiDUNYi (ORCPT ); Thu, 21 Apr 2022 09:24:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231631AbiDUNYh (ORCPT ); Thu, 21 Apr 2022 09:24:37 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12DBDBC22; Thu, 21 Apr 2022 06:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650547308; x=1682083308; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PQmqOn+KgAcS/RR9MQjoll3YVK5YnLxlMQMVZ6DK4x0=; b=iAIcDuC7Ass2zDSndDX/z3ln9PawCEyV7xijFjzujNtD7CdPTfCxaLzt Dc9u+MQq9tZTpZM0GcLBJkHg0fZUxlBX9PYAXhhQOh7CoGSC17zzKaUYO Y2uJZexl2xXYw19BKxWUN9GNUKncCfcBHZNldlDW3/T1tg0FVXg0yj/zt iR7cMV1Aq8pznck9aHa6h5o+ECr/sLsUQi9z6saBRDK1T44s2ZXKLd5t4 5OckL5rwDol+RDT76dyHr9XsDWooDoNZG/ksE8JWWlmFaQ3q/iDlHTOnU 2uh/p4PDOGbOZ6PrdBeQ0NQuGRjXjs9HjLMEvGPWcHmLrcBby3cMfS8gU A==; X-IronPort-AV: E=McAfee;i="6400,9594,10323"; a="251664913" X-IronPort-AV: E=Sophos;i="5.90,278,1643702400"; d="scan'208";a="251664913" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2022 06:21:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,278,1643702400"; d="scan'208";a="593655735" Received: from boxer.igk.intel.com ([10.102.20.173]) by orsmga001.jf.intel.com with ESMTP; 21 Apr 2022 06:21:45 -0700 From: Maciej Fijalkowski To: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, sfr@canb.auug.org.au, andrii@kernel.org Cc: netdev@vger.kernel.org, magnus.karlsson@intel.com, linux-next@vger.kernel.org, Maciej Fijalkowski Subject: [PATCH bpf-next 1/2] ixgbe: xsk: get rid of redundant 'fallthrough' Date: Thu, 21 Apr 2022 15:21:25 +0200 Message-Id: <20220421132126.471515-2-maciej.fijalkowski@intel.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220421132126.471515-1-maciej.fijalkowski@intel.com> References: <20220421132126.471515-1-maciej.fijalkowski@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Intel drivers translate actions returned from XDP programs to their own return codes that have the following mapping: XDP_REDIRECT -> IXGBE_XDP_{REDIR,CONSUMED} XDP_TX -> IXGBE_XDP_{TX,CONSUMED} XDP_DROP -> IXGBE_XDP_CONSUMED XDP_ABORTED -> IXGBE_XDP_CONSUMED XDP_PASS -> IXGBE_XDP_PASS Commit c7dd09fd4628 ("ixgbe, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full") introduced new translation XDP_REDIRECT -> IXGBE_XDP_EXIT which is set when XSK RQ gets full and to indicate that driver should stop further Rx processing. This happens for unsuccessful xdp_do_redirect() so it is valuable to call trace_xdp_exception() for this case. In order to avoid IXGBE_XDP_EXIT -> IXGBE_XDP_CONSUMED overwrite, XDP_DROP case was moved above which in turn made the 'fallthrough' that is in XDP_ABORTED useless as it became the last label in the switch statement. Simply drop this leftover. Fixes: c7dd09fd4628 ("ixgbe, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full") Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c index 68532cffd453..1703c640a434 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c @@ -144,7 +144,6 @@ static int ixgbe_run_xdp_zc(struct ixgbe_adapter *adapter, result = IXGBE_XDP_CONSUMED; out_failure: trace_xdp_exception(rx_ring->netdev, xdp_prog, act); - fallthrough; /* handle aborts by dropping packet */ } return result; } From patchwork Thu Apr 21 13:21:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maciej Fijalkowski X-Patchwork-Id: 12821617 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15A5FC4332F for ; Thu, 21 Apr 2022 13:21:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231896AbiDUNYq (ORCPT ); Thu, 21 Apr 2022 09:24:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231823AbiDUNYk (ORCPT ); Thu, 21 Apr 2022 09:24:40 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1285338BF; Thu, 21 Apr 2022 06:21:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650547310; x=1682083310; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JUa5m/3AYneWyoIuicUzQgOmiMwiYyHAEiy56xSFTB8=; b=eYUiRkf5fjcORMCKhvBaKuFevbvu3xGuaaPKKGTqEL0uBslI+bfATDON wygAKtT4kL+k5CYlFGpUa68yEKkZWU/gmL3iIRYgYrXMf4zMO7QfqEsPI cAxTk0yTIRXf3XAatwYYNvB43110/eMoHtqrc36CYVTW+isGu4aZmnS0S +Wc6IfedIvS9/+klXC7HHJvamj9NE3P6V9wvJcTkyi3aJZoijHyT72+gN CzhZaPPCGN4mt8gVENUQaS+GMWeFGxclu/230TPqmv1gJnxhZ32hDcmvw TbUoB4zn1XnpF+/ssH4ApNGThEJOdpWUhOS1SXHtTs4jViSERE45bLRUT A==; X-IronPort-AV: E=McAfee;i="6400,9594,10323"; a="251664928" X-IronPort-AV: E=Sophos;i="5.90,278,1643702400"; d="scan'208";a="251664928" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2022 06:21:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,278,1643702400"; d="scan'208";a="593655747" Received: from boxer.igk.intel.com ([10.102.20.173]) by orsmga001.jf.intel.com with ESMTP; 21 Apr 2022 06:21:48 -0700 From: Maciej Fijalkowski To: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, sfr@canb.auug.org.au, andrii@kernel.org Cc: netdev@vger.kernel.org, magnus.karlsson@intel.com, linux-next@vger.kernel.org, Maciej Fijalkowski Subject: [PATCH bpf-next 2/2] i40e: xsk: get rid of redundant 'fallthrough' Date: Thu, 21 Apr 2022 15:21:26 +0200 Message-Id: <20220421132126.471515-3-maciej.fijalkowski@intel.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220421132126.471515-1-maciej.fijalkowski@intel.com> References: <20220421132126.471515-1-maciej.fijalkowski@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net Intel drivers translate actions returned from XDP programs to their own return codes that have the following mapping: XDP_REDIRECT -> I40E_XDP_{REDIR,CONSUMED} XDP_TX -> I40E_XDP_{TX,CONSUMED} XDP_DROP -> I40E_XDP_CONSUMED XDP_ABORTED -> I40E_XDP_CONSUMED XDP_PASS -> I40E_XDP_PASS Commit b8aef650e549 ("i40e, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full") introduced new translation XDP_REDIRECT -> I40E_XDP_EXIT which is set when XSK RQ gets full and to indicate that driver should stop further Rx processing. This happens for unsuccessful xdp_do_redirect() so it is valuable to call trace_xdp_exception() for this case. In order to avoid I40E_XDP_EXIT -> IXGBE_XDP_CONSUMED overwrite, XDP_DROP case was moved above which in turn made the 'fallthrough' that is in XDP_ABORTED useless as it became the last label in the switch statement. Simply drop this leftover. Fixes: b8aef650e549 ("i40e, xsk: Terminate Rx side of NAPI when XSK Rx queue gets full") Signed-off-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/i40e/i40e_xsk.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c index 050280fd10c1..af3e7e6afc85 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c +++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c @@ -189,7 +189,6 @@ static int i40e_run_xdp_zc(struct i40e_ring *rx_ring, struct xdp_buff *xdp) result = I40E_XDP_CONSUMED; out_failure: trace_xdp_exception(rx_ring->netdev, xdp_prog, act); - fallthrough; /* handle aborts by dropping packet */ } return result; }