From patchwork Thu Dec 10 01:02:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 341702 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F32C9C4361B for ; Thu, 10 Dec 2020 01:04:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CACEC239FD for ; Thu, 10 Dec 2020 01:04:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730635AbgLJBEP (ORCPT ); Wed, 9 Dec 2020 20:04:15 -0500 Received: from mga12.intel.com ([192.55.52.136]:15984 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729064AbgLJBDz (ORCPT ); Wed, 9 Dec 2020 20:03:55 -0500 IronPort-SDR: DpeEnnNIQirkzuTevo836QHQBGwOHQpCWiUBts0fqB6Qaoo8XETiHl3cokvLdLToQ/8uxHttM5 gDIDuZc2anuQ== X-IronPort-AV: E=McAfee;i="6000,8403,9830"; a="153414664" X-IronPort-AV: E=Sophos;i="5.78,407,1599548400"; d="scan'208";a="153414664" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2020 17:02:59 -0800 IronPort-SDR: CROWgHs31tpuH6KpX9xLR0G2cpR3E+0ZzohVO7t7j05CXs9aWpBJBaK1npqP5FYgjYG2O02IuZ J3Z/BY9SOqyg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,407,1599548400"; d="scan'208";a="338203373" Received: from anguy11-desk2.jf.intel.com ([10.166.244.147]) by orsmga006.jf.intel.com with ESMTP; 09 Dec 2020 17:02:59 -0800 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org Cc: Sven Auhagen , netdev@vger.kernel.org, sassmann@redhat.com, anthony.l.nguyen@intel.com, Dan Carpenter , Maciej Fijalkowski , Sandeep Penigalapati Subject: [net 1/9] igb: XDP xmit back fix error code Date: Wed, 9 Dec 2020 17:02:44 -0800 Message-Id: <20201210010252.4029245-2-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201210010252.4029245-1-anthony.l.nguyen@intel.com> References: <20201210010252.4029245-1-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sven Auhagen The igb XDP xmit back function should only return defined error codes. Fixes: 9cbc948b5a20 ("igb: add XDP support") Reported-by: Dan Carpenter Acked-by: Maciej Fijalkowski Signed-off-by: Sven Auhagen Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/igb/igb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 5fc2c381da55..08cc6f59aa2e 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -2910,7 +2910,7 @@ static int igb_xdp_xmit_back(struct igb_adapter *adapter, struct xdp_buff *xdp) */ tx_ring = adapter->xdp_prog ? igb_xdp_tx_queue_mapping(adapter) : NULL; if (unlikely(!tx_ring)) - return -ENXIO; + return IGB_XDP_CONSUMED; nq = txring_txq(tx_ring); __netif_tx_lock(nq, cpu);