From patchwork Wed Oct 7 15:25:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Auhagen X-Patchwork-Id: 11820811 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,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 3CA20C41604 for ; Wed, 7 Oct 2020 15:25:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D386F214DB for ; Wed, 7 Oct 2020 15:25:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=voleatech.de header.i=@voleatech.de header.b="eBs6xMmH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727805AbgJGPZW (ORCPT ); Wed, 7 Oct 2020 11:25:22 -0400 Received: from mail-am6eur05on2103.outbound.protection.outlook.com ([40.107.22.103]:47836 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726400AbgJGPZV (ORCPT ); Wed, 7 Oct 2020 11:25:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ek3kxNhydQoTzhZhzpHvVYY8Qc/fIUT2I81HWE5cSAtxK81qKCz0wiQzUlfmwEd+iTXlzE6Thx2OuzXkbnB+Tx5QoCBoFKju/amgbWLCf6/LQXLRbdy0bFt6oLlQ6P/rO7Ksn+FPpSsncPgYiBXJu7rTmrg3FTeH0z3CtTKt2+wnJdyyzE1alqyoo7UKDQnuJ+m8a9Vu1GHNJF1IY8UyHpPadYg+RC8LPRlRrFwSnQmG0VsAyN8oPdO4J0KQNqXEPsF05BVnzXu4uHdWLxDMNlmPoDeBCNR8yBhXqkQXzrjNLpfDJV8OWzu1e+QYhpO1QWvl6THv6IwjasCScolvAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r96DcCPBDm2rnnESfjL5FjoP85qsoYT27usAggSNawk=; b=HKA4PL1CizfYdWsIm0chhLJig3YE8uCEW2HDPKnDh5khA8vRKLZepHu8KuZD5uOMg9l94GMRDX+wov9kvgI2M15MFgCBGKuK7kUNIyQaYtQQVAh9lVOxSYh/DtuoJpEv1t2Rqr3s8vqZVFDwwLL8kVOkr8Z25ZgX7w6fzCYwCgZR8NSgmeFqXmRs6Q+M1bTx1PwrbHQVuvlMHIj2DQvBWiGSoZ5lxdmEb1QRFQe+NnAy4ovXDVKa3LDANMxsEyd5PY9YTmUOfxrA6VA4eJpvtY15nluMvOyyf14rv9B26c5saBgB9F1uEXcI56gvNZIcfWzz9Pyvn3QMszsK+rdEUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=voleatech.de; dmarc=pass action=none header.from=voleatech.de; dkim=pass header.d=voleatech.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=voleatech.de; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r96DcCPBDm2rnnESfjL5FjoP85qsoYT27usAggSNawk=; b=eBs6xMmHC7UIc/M7sNHC3N3xAqpxU1Fw3KZCnxCjMy1MnUjPaeqTQ+I61wV84SFUEUSxDgP+l3oUmecFgEWNa8n0gVJK/RCF2axKynJDm4bB7uIzD5XJjdcoN+w7l4TNtHO1kU7mweC15uAJgZYqZs0+y6mK12XDi2Z7XBR9lKI= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=voleatech.de; Received: from AM8PR05MB7251.eurprd05.prod.outlook.com (2603:10a6:20b:1d4::23) by AM0PR05MB6082.eurprd05.prod.outlook.com (2603:10a6:208:125::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Wed, 7 Oct 2020 15:25:16 +0000 Received: from AM8PR05MB7251.eurprd05.prod.outlook.com ([fe80::f132:2cc:34f2:5e4]) by AM8PR05MB7251.eurprd05.prod.outlook.com ([fe80::f132:2cc:34f2:5e4%7]) with mapi id 15.20.3433.045; Wed, 7 Oct 2020 15:25:15 +0000 From: sven.auhagen@voleatech.de To: anthony.l.nguyen@intel.com, maciej.fijalkowski@intel.com Cc: davem@davemloft.net, netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com, sandeep.penigalapati@intel.com, brouer@redhat.com Subject: [PATCH 1/7] igb: XDP xmit back fix error code Date: Wed, 7 Oct 2020 17:25:00 +0200 Message-Id: <20201007152506.66217-2-sven.auhagen@voleatech.de> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20201007152506.66217-1-sven.auhagen@voleatech.de> References: <20201007152506.66217-1-sven.auhagen@voleatech.de> X-Originating-IP: [109.193.235.168] X-ClientProxiedBy: AM0PR05CA0077.eurprd05.prod.outlook.com (2603:10a6:208:136::17) To AM8PR05MB7251.eurprd05.prod.outlook.com (2603:10a6:20b:1d4::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from svensmacbookair.sven.lan (109.193.235.168) by AM0PR05CA0077.eurprd05.prod.outlook.com (2603:10a6:208:136::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21 via Frontend Transport; Wed, 7 Oct 2020 15:25:15 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9545a86a-7a9b-45a9-cdbd-08d86ad53104 X-MS-TrafficTypeDiagnostic: AM0PR05MB6082: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:431; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3PzDKi935cPANcfoKvNBt657F/pQVILNAaQYb8FgGKsMkDc619dHLRed4j7pOoTwzmuvBEFLlblzL3KlUer/8uV1bvuCnLP0h8ff2cUazcQ/cQ1ws19diKkvW06SW8G5rrHJ3TdX405BUq8x1b5XfDJOgAUJO0dIg6iV6NlWoK53yAlas7ETc90h19GojnPbhmZEUxv7lr5H/ZW6kozZa5df5/5qSGb5pmI7CW/toBVtqQj0X8MuuzArxtqNfLT+pmi9uPcoL7G7OGlfooOiLWct2g9t9ypme/raRiXZkTfd+7IVV15R0eHa68nwZn3k0khZ2RUeVy1ydLRhs6SXZw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR05MB7251.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(39830400003)(136003)(366004)(346002)(376002)(186003)(66476007)(16526019)(2906002)(26005)(6486002)(5660300002)(9686003)(66946007)(6512007)(6506007)(83380400001)(4744005)(6666004)(52116002)(66556008)(8936002)(36756003)(316002)(86362001)(8676002)(956004)(2616005)(1076003)(478600001)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: 2h4/7wJm9dVbd+jHXe3YfcXexdcOTTONAAeFOy706VJOv0C3JSVt6aQRDIKWjIHrB2crVVLqoXgix+r+UvGS/zg9NF7Dvlr0HZwTyfRnfivGROWLZG+PvYiznxvP6/pqr9EY360EwUl3Osz6kisVg4Bzg1yy3BfXpA5EYhJp+5VgbSrAFD5dOl73mEhdreYadqd8cV4t/PSVsPkluzU18w0pImrZXEYGUPBiAX5kf20bTDF2kPcfCwVzReoaZ6jaNBn30y9oRJV5HLsxK2x+9SeXQLGGcamEzkHMVpnZjMuyoYLYSgk7MuY5b2WHtGAkcfjBuSXLkMqn86yLaPSdstWia7/vpvCq2keOKMuJSpnFtUwwRmTUmFTAUNyub7ntg7mSodmPSmaqDfidYuN+7I6N6Hm+Uo/bB+/WqrdQc8xmt4BUhcPaxJctoKJLDcfJMCqdAdsNktlwUF5T3UmqIbaVF0TDxunCwsreW8H6OTApivw+imhLET1jSVsbZGFqT0UPN8uJjS7SXUE96LjXrmPD0DMxyHmEYPlWRoL4Bf+3g3YbBnKWcQomTfYO0EZPN1ixEFB0846edLwFZieX5+Vm9asa+liAfUb+OtceNyNdc+D0RlRtGLiPqPQQz55A1XQOfqZs/csOq/5LUlA8UQ== X-OriginatorOrg: voleatech.de X-MS-Exchange-CrossTenant-Network-Message-Id: 9545a86a-7a9b-45a9-cdbd-08d86ad53104 X-MS-Exchange-CrossTenant-AuthSource: AM8PR05MB7251.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2020 15:25:15.8430 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b82a99f6-7981-4a72-9534-4d35298f847b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GmE53lkMnZ9zTkY5seSWeXI3G6LuKFJgyU8nPPCz2lskTghJJxLMBe3lvVHB07eOkPrMiJocLzd1gJ6TQm7vTBG3UoXHPJyB1KPLiHXVG3g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6082 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. Signed-off-by: Sven Auhagen --- 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); From patchwork Wed Oct 7 15:25:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Auhagen X-Patchwork-Id: 11820813 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,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 63548C41604 for ; Wed, 7 Oct 2020 15:25:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1026B215A4 for ; Wed, 7 Oct 2020 15:25:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=voleatech.de header.i=@voleatech.de header.b="Up556XNF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728300AbgJGPZZ (ORCPT ); Wed, 7 Oct 2020 11:25:25 -0400 Received: from mail-eopbgr00116.outbound.protection.outlook.com ([40.107.0.116]:11397 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727717AbgJGPZX (ORCPT ); Wed, 7 Oct 2020 11:25:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W2xF+NSLilU9BLR3FuuAOvmJhBHdh/R6ttsuapEnAMXrJDQwUplt298LTh/X/jo4l6F2uiskdUjkXyZDLilBMkm3j2wQUcu0kRX4MmQRZyVKsM+jRNm80WPxpTh74xPUVxJ5VcuVODFlnV5ljDXbfUl2NEhhUu4U8zgIbEw2ZSba4FeV3WnzRqTJlxS0uS/TQN3kZwXfRp/wwfVbqUP5ZsPr6v6WaInstRF82AVqxRPOuV6mEo5to+SayhtnwlJh3VhFIkw4frfgYYwb1QtT8+gqmq08dgNudaf5vHGi9gY4Qcp8i7zC2/y8buAhCGyJPGK5c8OquMN0+yTqeUl/iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fVG1VvosppfYgEKtYYjKCLGbwLAM1yt2+vxeLFoSi3I=; b=iGVCeeSz17k4P1BVWi72YvY7RE9AvH74gHtiDf2Yx6KzPIXSn3rTGWPDbI8kX1nI0jkyAJpzY7B1MyPx0yqRRMTGatx/pCAb+pDvDgZkntrl9Lm8kbBf9TxwbWAdhml9JsY4kKB+Nn7EIjtnWSyCFxAKOYaup6jZYPBF1kuLs6e5a3WU6zL41Vxpg4klUvPY1UpT5O9IUPcOxd6TsTWe4CEEy+YRRIPC5XGgf17v85Os4Skx+Nvo3upCP3Nm/HtUfUaoVPHGgvLE3V4Ino25BEW+OYheimn+/DFhJc/RxkrYwu/INs7EH9GTgtKsexC10G9yPtgV/ohlN15be/Hd7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=voleatech.de; dmarc=pass action=none header.from=voleatech.de; dkim=pass header.d=voleatech.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=voleatech.de; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fVG1VvosppfYgEKtYYjKCLGbwLAM1yt2+vxeLFoSi3I=; b=Up556XNFclE40SO6NZHsa1ajWrsEIzKs0kfY2BptjEI+vdlDp7yHu/qXDbVzFJkJllrm/Ehz/pt7JRoDtJIgtpSvqBkJJL0BAbpWQmMrew9XPPJbQAim/lhruTaI/uV9YsLTO76arWZp8kkdDkhG2BqGRlH+pntYlHvd2kwCgAU= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=voleatech.de; Received: from AM8PR05MB7251.eurprd05.prod.outlook.com (2603:10a6:20b:1d4::23) by AM0PR05MB6082.eurprd05.prod.outlook.com (2603:10a6:208:125::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Wed, 7 Oct 2020 15:25:16 +0000 Received: from AM8PR05MB7251.eurprd05.prod.outlook.com ([fe80::f132:2cc:34f2:5e4]) by AM8PR05MB7251.eurprd05.prod.outlook.com ([fe80::f132:2cc:34f2:5e4%7]) with mapi id 15.20.3433.045; Wed, 7 Oct 2020 15:25:16 +0000 From: sven.auhagen@voleatech.de To: anthony.l.nguyen@intel.com, maciej.fijalkowski@intel.com Cc: davem@davemloft.net, netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com, sandeep.penigalapati@intel.com, brouer@redhat.com Subject: [PATCH 2/7] igb: take vlan double header into account Date: Wed, 7 Oct 2020 17:25:01 +0200 Message-Id: <20201007152506.66217-3-sven.auhagen@voleatech.de> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20201007152506.66217-1-sven.auhagen@voleatech.de> References: <20201007152506.66217-1-sven.auhagen@voleatech.de> X-Originating-IP: [109.193.235.168] X-ClientProxiedBy: AM0PR05CA0077.eurprd05.prod.outlook.com (2603:10a6:208:136::17) To AM8PR05MB7251.eurprd05.prod.outlook.com (2603:10a6:20b:1d4::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from svensmacbookair.sven.lan (109.193.235.168) by AM0PR05CA0077.eurprd05.prod.outlook.com (2603:10a6:208:136::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21 via Frontend Transport; Wed, 7 Oct 2020 15:25:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c1925426-b8d9-4367-c554-08d86ad53180 X-MS-TrafficTypeDiagnostic: AM0PR05MB6082: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QW7HVDb+McRDImmx/MfxkYo3wBTn8P0BoWSOf7tEG0BaTB/XHwZfWrImsiEt9CRZwC1kIZRKjY7V5tCZnrr266Yoqiewt2RrygzSTk4W4vA87MFMTQwzu0oWlNiUtsdwIhA6OgYYt94RCBTMG8wDxCuftXgYWNJ7bh+im3NbAfnD4Fiw+6nzoVgwSqQ1z3DahkuwkjoPHPXE51x5l1jtcWVvo4Yz8BQo/P267B1TIkc/tmHJcyOQXHALRANySlis+A8+tEYmENL3HDnfYkSdRPne+wKpZqezArlBlFxQTVBOI21Wfpe2V57RWcvl0apnN4t85Qyk+3bTB5sUlf/r7g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR05MB7251.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(39830400003)(136003)(366004)(346002)(376002)(186003)(66476007)(16526019)(2906002)(26005)(6486002)(5660300002)(9686003)(66946007)(6512007)(6506007)(83380400001)(6666004)(52116002)(66556008)(8936002)(36756003)(316002)(86362001)(8676002)(956004)(2616005)(1076003)(478600001)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: gEN/QoCMIj4l+J8yfQ824NaVEgjzK+wPHBkfsTxeOkrHxSQyRpgizeSOg0ozXz/8D2QOKZ4UUW4435Ej8Dc68+qviSkmnOvPra8xodHgOVE3RjvQQuOxa8QrJkdnVoHVIMVAll3JcfliXZOLhjTGAhhFaJDo6fMVRxZ/yEG6+t7Wr1xyw3nsHOpqjkWgvFjtDmNQy0QvrjBZ2fo6ueM+uvj6ol2SdOq1k/XRaHs3UDUMhbS65zxg7drHiUxPuibjwjdG+geBo81KFZSec39GCmhH32EbGPTqxiqjN3e2ZSjp02zo8Y4AVwq/H8Z+yABTo/oJEB+ZHzg/QkLeWZ33sKKxlzh+xyi+t2naWQcsno8vOLryr6d7XMFSHFLF7aR8gfdpI5hKKdyWae3ta4fN/BwL6a4w63yMtZ3ksPLDFmh31Wh9bT8eaGcqlzWalPrtoWICED4sO89lq+gu+peQUC4ZS3kZI7NlYp+fM1rtP2PMKx40kqMGRIYRJc6cIxTl9v7ifylg6gm3UymZklz02gsGKr3JEP0p+kbaaPyQPY8A4NJXVLzy0k4H5/7eU9d17+8vidc/U3e2WPWFf4elEyo9M7K2QmHnYdFqAHdVIhbwalNkaJ3Tt6wUCFIaaVZ4FzMWpihUnilJn9f3/MRe0w== X-OriginatorOrg: voleatech.de X-MS-Exchange-CrossTenant-Network-Message-Id: c1925426-b8d9-4367-c554-08d86ad53180 X-MS-Exchange-CrossTenant-AuthSource: AM8PR05MB7251.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2020 15:25:16.5629 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b82a99f6-7981-4a72-9534-4d35298f847b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: azyEOJOEyxdIPpbPCr/4Ywq02Q+bg7UOY0LEiO08tnVMG3jDYvSXASM8s2KbjyldflgjDiFhy7NOAdSaGaC1Y6KfUsi2n4tY3hTGSDnkGm0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6082 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sven Auhagen Increase the packet header padding to include double VLAN tagging. This patch uses a macro for this. Signed-off-by: Sven Auhagen --- drivers/net/ethernet/intel/igb/igb.h | 5 +++++ drivers/net/ethernet/intel/igb/igb_main.c | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h index 0286d2fceee4..7afb67cf9b94 100644 --- a/drivers/net/ethernet/intel/igb/igb.h +++ b/drivers/net/ethernet/intel/igb/igb.h @@ -138,6 +138,8 @@ struct vf_mac_filter { /* this is the size past which hardware will drop packets when setting LPE=0 */ #define MAXIMUM_ETHERNET_VLAN_SIZE 1522 +#define IGB_ETH_PKT_HDR_PAD (ETH_HLEN + ETH_FCS_LEN + (VLAN_HLEN * 2)) + /* Supported Rx Buffer Sizes */ #define IGB_RXBUFFER_256 256 #define IGB_RXBUFFER_1536 1536 @@ -247,6 +249,9 @@ enum igb_tx_flags { #define IGB_SFF_ADDRESSING_MODE 0x4 #define IGB_SFF_8472_UNSUP 0x00 +/* TX ressources are shared between XDP and netstack + * and we need to tag the buffer type to distinguish them + */ enum igb_tx_buf_type { IGB_TYPE_SKB = 0, IGB_TYPE_XDP, diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 08cc6f59aa2e..0a9198037b98 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -2826,7 +2826,7 @@ static int igb_setup_tc(struct net_device *dev, enum tc_setup_type type, static int igb_xdp_setup(struct net_device *dev, struct bpf_prog *prog) { - int i, frame_size = dev->mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN; + int i, frame_size = dev->mtu + IGB_ETH_PKT_HDR_PAD; struct igb_adapter *adapter = netdev_priv(dev); bool running = netif_running(dev); struct bpf_prog *old_prog; @@ -3950,8 +3950,7 @@ static int igb_sw_init(struct igb_adapter *adapter) /* set default work limits */ adapter->tx_work_limit = IGB_DEFAULT_TX_WORK; - adapter->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN + - VLAN_HLEN; + adapter->max_frame_size = netdev->mtu + IGB_ETH_PKT_HDR_PAD; adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN; spin_lock_init(&adapter->nfc_lock); @@ -6491,7 +6490,7 @@ static void igb_get_stats64(struct net_device *netdev, static int igb_change_mtu(struct net_device *netdev, int new_mtu) { struct igb_adapter *adapter = netdev_priv(netdev); - int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN; + int max_frame = new_mtu + IGB_ETH_PKT_HDR_PAD; if (adapter->xdp_prog) { int i; From patchwork Wed Oct 7 15:25:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Auhagen X-Patchwork-Id: 11820815 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,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 C3F92C47095 for ; Wed, 7 Oct 2020 15:25:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A58E215A4 for ; Wed, 7 Oct 2020 15:25:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=voleatech.de header.i=@voleatech.de header.b="FPpFrQcu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728260AbgJGPZZ (ORCPT ); Wed, 7 Oct 2020 11:25:25 -0400 Received: from mail-am6eur05on2103.outbound.protection.outlook.com ([40.107.22.103]:47836 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726100AbgJGPZX (ORCPT ); Wed, 7 Oct 2020 11:25:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c7/BTBjT96P4Hg+3oJ+NGy6NsngU5o6V5YbFxx12tPXaKfWdQzO4jmOgO5ZiWRt4zhZmZqD9ehg1SmOXxmgrhaFIjWm3XLc/7lXov8KKPkM2m3jn7lw6ISPnAeAHcEKDdjPotTd/JT4Kkrh+ovxigtavhVZh0voKR3bv2YWZQ7hCtucBqa+E/+fzSX6LZ+MZgG1tW+giVRDRBSVCSyKGZMlYaKwZjfyacZMHOY4HPAi3bfpd8kam7AIAjylhNRQWW/j/IhaePHHjj+UfzQyL39xRqosrqTciBel2vo04J7uQ5/2+WDI8gkNKr32XR6uqAyTc854ITWe8y7tMkN8ssw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zBlTQr7fkC6/LIX+h2bx0YjWYamnecKnXvrPEQVYUA0=; b=dTBMxd7m+TKMqUnv3Gd1wOJIMKlvNeGUUEIWhemCeN/J29nak2HreramuUgQLDnKTxFcaowgsHmj6Jg8UsR2gColqvBU7xo5khzgyTpDbLGtRHPRfEoSj7T2oaO3gxADTc5S/foWB5fzug7I4Q5/B8oTwCYRSUuTi6AdBVCKuP2qNG22lGh+vtL4BSqBE10HH0v+XpMwuDLLKzDvYDgk5LdKMXbNPcRUFMmaQ1Nu5TmFL0U2KXmcpEMJzEo2BcFzS/FoxVxdhGog/4ft8MSx44JJ7TMPaCghS9PIy2MFgjJ0WaeqJh+nS+JjIAhv/NTRPc0jr2pT2zERDrE8gTVRNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=voleatech.de; dmarc=pass action=none header.from=voleatech.de; dkim=pass header.d=voleatech.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=voleatech.de; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zBlTQr7fkC6/LIX+h2bx0YjWYamnecKnXvrPEQVYUA0=; b=FPpFrQcul+OSTnGbB1sXtXg+mMG8XH1MpYFeK291OqHi1FwBJ5K6nEr2jAwrM+6TYccZVlnK2ugYIefbAKy7eRhdR7skR3844AUuJBvI8tHnAMtMfAh7BU5HCr0cm8CHnV6lw/mNM0dDdB+rFyUhJ+i/UsCHB2uaTOHX1tWy5tk= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=voleatech.de; Received: from AM8PR05MB7251.eurprd05.prod.outlook.com (2603:10a6:20b:1d4::23) by AM0PR05MB6082.eurprd05.prod.outlook.com (2603:10a6:208:125::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Wed, 7 Oct 2020 15:25:17 +0000 Received: from AM8PR05MB7251.eurprd05.prod.outlook.com ([fe80::f132:2cc:34f2:5e4]) by AM8PR05MB7251.eurprd05.prod.outlook.com ([fe80::f132:2cc:34f2:5e4%7]) with mapi id 15.20.3433.045; Wed, 7 Oct 2020 15:25:17 +0000 From: sven.auhagen@voleatech.de To: anthony.l.nguyen@intel.com, maciej.fijalkowski@intel.com Cc: davem@davemloft.net, netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com, sandeep.penigalapati@intel.com, brouer@redhat.com Subject: [PATCH 3/7] igb: XDP extack message on error Date: Wed, 7 Oct 2020 17:25:02 +0200 Message-Id: <20201007152506.66217-4-sven.auhagen@voleatech.de> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20201007152506.66217-1-sven.auhagen@voleatech.de> References: <20201007152506.66217-1-sven.auhagen@voleatech.de> X-Originating-IP: [109.193.235.168] X-ClientProxiedBy: AM0PR05CA0077.eurprd05.prod.outlook.com (2603:10a6:208:136::17) To AM8PR05MB7251.eurprd05.prod.outlook.com (2603:10a6:20b:1d4::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from svensmacbookair.sven.lan (109.193.235.168) by AM0PR05CA0077.eurprd05.prod.outlook.com (2603:10a6:208:136::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21 via Frontend Transport; Wed, 7 Oct 2020 15:25:16 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 76542f3c-fd6a-4f88-ecbb-08d86ad531e7 X-MS-TrafficTypeDiagnostic: AM0PR05MB6082: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OYcZ5CQZeGJaRsWAxWJXH2TH0nixCogs2LTD2U0tCazLaRZ3ZBTgR3G44Tsdhhci3MttTVhabpY0kxomHzeWCZPkmkcKiDnPDo1CIQGTUG1EpnqtZahZ6UAMSjw3TA3vAyBSxQ+YGcfJC2H84ssm8bFOxxIfLycDhT3s/13tv+IuGVa2VCZnYXLdbkhcpUkDsiEqC3Hm2AfLLhzjm7S+L9LiVpX6NBgbQPiELOByDoL8ecWfjOGUFhuTHo3tjmp5PtRzWFD8oqysxmbaLZ0q0uzJRdxt4Xi4V8KSfVxA4/u1r7PgOjCQ6metHQE/2r/MLjrJ+e9uL3hAR10MG0xF6w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR05MB7251.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(39830400003)(136003)(366004)(346002)(376002)(186003)(66476007)(16526019)(2906002)(26005)(6486002)(5660300002)(9686003)(66946007)(6512007)(6506007)(83380400001)(6666004)(52116002)(66556008)(8936002)(36756003)(316002)(86362001)(8676002)(956004)(2616005)(1076003)(478600001)(15650500001)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: Lxp1OAp3GlPuFolzdPG9mli1JcX0ZZhNpgttBfw+YHQ8cdsp+sE7g9N6wEtST+JIJpi1kXXwgOKf43hqB8rGKv9L9mkVRlFD16aW17ueNTQFiOXpBCDc9oNOdP177AzVQI4AVrvKnh176E53IdTwehpwoLOdgkuqR6cNuzWFHzSBuXZ3zHCiD0KbEOXa6jSR4voYZ2fGqTWKkrc3kwFyIPZBMZ2NvJTJw23GCKNdfIo2LcoR0M5hrWWNUT686In73Rbdkh8abqE05cHlJBqrSiYz9eNwUBQEypPxGA1PoM+3lk5Y2Ql2Lebhrm4Q09Rt5gs00YPsLYr9k+M/0jRs8OHUxF+BphE1Vh9/u9/AIEaO+AMj3WgoNB63BY+vCJ5mn+z4jPMJNlb7kZBC6SwmluQw9wAKQL7hxwWEI83kfJySVICMRajTMGLIfig1WAxHc3ghoawG7x4Jz4IVxTjypjVT8RA5ttwcGnBTHgkwtSnEQ+ka7zcHOp+GFcR3d6yepCJpOFhaUR4EcxtTiODZ/mau23nLqKrd30r6J3AqljFFMQ0Owxv45kJyZVu5ovg9Pw7WHXZgbQ9VQDDdskEyWuKgBDAoWlocTzv7+DufX4kKvqIw4mZtTTkGSnQfCxxZdaaOUiV3BwmQYuEtuH4guw== X-OriginatorOrg: voleatech.de X-MS-Exchange-CrossTenant-Network-Message-Id: 76542f3c-fd6a-4f88-ecbb-08d86ad531e7 X-MS-Exchange-CrossTenant-AuthSource: AM8PR05MB7251.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2020 15:25:17.2708 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b82a99f6-7981-4a72-9534-4d35298f847b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Fn0VSLntTzGbLNSId0o1vf/2xu2epnfRhw+zUFOVN/4whiXsRLg4hkoVTL34v4N90n9x1C61DGZ5U+Df8MoLGps8qfMHyPdIr7yE4SY2fqs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6082 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sven Auhagen Add an extack error message when the RX buffer size is too small for the frame size. Signed-off-by: Sven Auhagen Reviewed-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/igb/igb_main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 0a9198037b98..088f9ddb0093 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -2824,20 +2824,22 @@ static int igb_setup_tc(struct net_device *dev, enum tc_setup_type type, } } -static int igb_xdp_setup(struct net_device *dev, struct bpf_prog *prog) +static int igb_xdp_setup(struct net_device *dev, struct netdev_bpf *bpf) { int i, frame_size = dev->mtu + IGB_ETH_PKT_HDR_PAD; struct igb_adapter *adapter = netdev_priv(dev); + struct bpf_prog *prog = bpf->prog, *old_prog; bool running = netif_running(dev); - struct bpf_prog *old_prog; bool need_reset; /* verify igb ring attributes are sufficient for XDP */ for (i = 0; i < adapter->num_rx_queues; i++) { struct igb_ring *ring = adapter->rx_ring[i]; - if (frame_size > igb_rx_bufsz(ring)) + if (frame_size > igb_rx_bufsz(ring)) { + NL_SET_ERR_MSG_MOD(bpf->extack, "The RX buffer size is too small for the frame size"); return -EINVAL; + } } old_prog = xchg(&adapter->xdp_prog, prog); @@ -2869,7 +2871,7 @@ static int igb_xdp(struct net_device *dev, struct netdev_bpf *xdp) { switch (xdp->command) { case XDP_SETUP_PROG: - return igb_xdp_setup(dev, xdp->prog); + return igb_xdp_setup(dev, xdp); default: return -EINVAL; } @@ -6499,7 +6501,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu) struct igb_ring *ring = adapter->rx_ring[i]; if (max_frame > igb_rx_bufsz(ring)) { - netdev_warn(adapter->netdev, "Requested MTU size is not supported with XDP\n"); + netdev_warn(adapter->netdev, "Requested MTU size is not supported with XDP. Max frame size is %d\n", max_frame); return -EINVAL; } } From patchwork Wed Oct 7 15:25:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Auhagen X-Patchwork-Id: 11820817 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,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 3E8F3C47095 for ; Wed, 7 Oct 2020 15:25:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DEAC521548 for ; Wed, 7 Oct 2020 15:25:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=voleatech.de header.i=@voleatech.de header.b="dJuduJ69" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728641AbgJGPZc (ORCPT ); Wed, 7 Oct 2020 11:25:32 -0400 Received: from mail-eopbgr00116.outbound.protection.outlook.com ([40.107.0.116]:11397 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727817AbgJGPZ1 (ORCPT ); Wed, 7 Oct 2020 11:25:27 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d5EL7TcCh/4zK0QXyNuhJQMrdju9cJL8B4xuAAWqg3K8Dl8zWHFmC6BsIuTlR5lfvGBjwnaYjsEg0MS3SzLYSveU9f25cwAcx+5bFYDpr3S6BVajsVBUTVx4dyqVXu+oDFHwDTpAXmctIES/0RRwPscynp/Nxf547qs4EgbQZ04tVSHzAOZx062WVeaEWu9oiNUT6cwzv5FlKq9d+XY6jcSiBEM5fiCDOU384VfkxpmoD/VJ9ih+zzW1+3f+yVcUn5ZbE6A8I+RlxvqMpYFu/XADBvDVEGJeAOzZvS896VCdFUcMhH0z4juVX5tplHaNBTczmrfAvNd/98jAvpccBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8GrTuW1kyJ5GOXh4wrZclcvKN7O/b8G4kDI/WcLavfQ=; b=LdGorRe3eMbZ8dyKr8YOAehFqvoFHF8vLDRYL3CR9F2I8aTx2skyW9rRi5LJbfKX+C1nQ8T3Y3UPwPndLSJ82UFvzwRfI8MdWb5qsqrJUvwpKBpkFsaqJEr7ZLT0hIx+NR+gG9QP7A92uPGw4LiuYYybD2QYiBX8VWkOzHIf84xcLWPdQnEtQ3qugXt3elB0KnbcdxsHbNgJEKX9eQvKk5hAmyuUPkn++i864oG+ROP+8CuhvU51pQ/IJHKH3h4/4/Xmjwzfy8xOFIwyX7arj9TxxYeY7uPjHSBJpjQacM3BG2S36R1p1FtkKMZKfx3oJod1JrHa3SJFZOcDHGIvPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=voleatech.de; dmarc=pass action=none header.from=voleatech.de; dkim=pass header.d=voleatech.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=voleatech.de; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8GrTuW1kyJ5GOXh4wrZclcvKN7O/b8G4kDI/WcLavfQ=; b=dJuduJ6999Qt18taNlyAUfqTTIkyYZE2SSN7ByoGVjP9mFC8/i+sBP1QKBSZTO9fjUcfRqgMNYBlWSAsBhhtnmYX98gOHayd7qAg4wFjsVtC0fz3zixF2Njcjzb7EE6MAfKRcUBqJygVg/dH5oVHef8cP7sRiTbtT9c781e/pMg= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=voleatech.de; Received: from AM8PR05MB7251.eurprd05.prod.outlook.com (2603:10a6:20b:1d4::23) by AM0PR05MB6082.eurprd05.prod.outlook.com (2603:10a6:208:125::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Wed, 7 Oct 2020 15:25:18 +0000 Received: from AM8PR05MB7251.eurprd05.prod.outlook.com ([fe80::f132:2cc:34f2:5e4]) by AM8PR05MB7251.eurprd05.prod.outlook.com ([fe80::f132:2cc:34f2:5e4%7]) with mapi id 15.20.3433.045; Wed, 7 Oct 2020 15:25:18 +0000 From: sven.auhagen@voleatech.de To: anthony.l.nguyen@intel.com, maciej.fijalkowski@intel.com Cc: davem@davemloft.net, netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com, sandeep.penigalapati@intel.com, brouer@redhat.com Subject: [PATCH 4/7] igb: skb add metasize for xdp Date: Wed, 7 Oct 2020 17:25:03 +0200 Message-Id: <20201007152506.66217-5-sven.auhagen@voleatech.de> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20201007152506.66217-1-sven.auhagen@voleatech.de> References: <20201007152506.66217-1-sven.auhagen@voleatech.de> X-Originating-IP: [109.193.235.168] X-ClientProxiedBy: AM0PR05CA0077.eurprd05.prod.outlook.com (2603:10a6:208:136::17) To AM8PR05MB7251.eurprd05.prod.outlook.com (2603:10a6:20b:1d4::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from svensmacbookair.sven.lan (109.193.235.168) by AM0PR05CA0077.eurprd05.prod.outlook.com (2603:10a6:208:136::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21 via Frontend Transport; Wed, 7 Oct 2020 15:25:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 72b76a87-a47b-43e4-da83-08d86ad53260 X-MS-TrafficTypeDiagnostic: AM0PR05MB6082: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GDMMNCZYBJPXMBd/SGykremIt73d86AbAnBxiV07X6OXbTd7yelto5zmUS2o1GuOrH8dez7ARdDlWQfmGxM3Jby0EUMkzFKrM7LMRmUcCvVfoMKxrT9UBzoMxRnOrYdpLXr7XcdWkvMQaoGaGXB/USvUc0msHLdhX5xlKhop7eNZQt3aadWT2OO+zx9u/Knm7cWhv5j8AxkrjXbYgA0LjWhpwLFonZcs7UFBaJfmGd/5CHH/WGEEJE1STe7xNq3Q16O/mDGODkOmpO8ShsYTeIEjfwfXHTA8rlmpUc/iXJIZqCaSa8KZN909kLC10a4feLlO4MII5Xe/s3p9q8Z7rQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR05MB7251.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(39830400003)(136003)(366004)(346002)(376002)(186003)(66476007)(16526019)(2906002)(26005)(6486002)(5660300002)(9686003)(66946007)(6512007)(6506007)(6666004)(52116002)(66556008)(8936002)(36756003)(316002)(86362001)(8676002)(956004)(2616005)(1076003)(478600001)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: NOn7AXTGz0lvVZIsGkme4lo/0udZnvHy50dnMsxXSiU2cijiFdpekdhy6J259Hsp62YFrCwIl55e4Zsa1RuWc/U3kw1olft/mA9dPjGbv8uAzk8nX4zHHRV8BEdAC5metq7srYXO1bceDxDtNAmlGKRAhL+FOcWY92OxDyebS35fKfLSj44GUXSDBCttprH46A1mvgbVTASwQeisFbyCqXINa5sQJVChZqdb5T9MtS2+czFcmMvNq7xi8pZ/aU2/3ykFSfRF4K0eP7fKhUxeSqdyh5OBZ5whLc3Ct8oDTTrE5odW0PgtKNUjP/jP023JAerRzExq/eOD7EQKXxbj8Xz108YEmMdpCAy+Rugjc1QAl0Mv9cGU8S5/dYJpsehXYSHtqsoO1A7Q6z3+EQjsKuMTwD4inphRxjTZZ8vWINQUwMt3QRnYvwq6HZZKTtsXZxY/CvVILSPZisl1X3hQOTdvSFkXql0LRH4kBfOh4L5uqwnmFHVfXp0+3GCm/lLL1+MLrf9oJvqLfSwXHNfP495wBmpmdt/BxsR7A3z4zD1YGAQP0S0luZ3Mmh2db8tbO121xdU9vlvMEJcLDL/Z5sFlzFiIsi90X60I/QMwIwMgWaclPMnxbUbJnURWjWt+07ce1lxv+U+jjkoaeR+kpQ== X-OriginatorOrg: voleatech.de X-MS-Exchange-CrossTenant-Network-Message-Id: 72b76a87-a47b-43e4-da83-08d86ad53260 X-MS-Exchange-CrossTenant-AuthSource: AM8PR05MB7251.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2020 15:25:18.0364 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b82a99f6-7981-4a72-9534-4d35298f847b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cdeBQuTU5c9mW1SNwCtjLjRmCi7KIZNPycJ9TkZeAz/gNG8zYYSj/0nPh0o4LVX7zQGXtPU5FIq3FWd/95IpWc7ljVz3ea3QKcDk5c1wG3Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6082 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sven Auhagen add metasize if it is set in xdp Signed-off-by: Sven Auhagen Reviewed-by: Maciej Fijalkowski --- drivers/net/ethernet/intel/igb/igb_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 088f9ddb0093..36ff8725fdaf 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -8345,6 +8345,7 @@ static struct sk_buff *igb_build_skb(struct igb_ring *rx_ring, struct xdp_buff *xdp, union e1000_adv_rx_desc *rx_desc) { + unsigned int metasize = xdp->data - xdp->data_meta; #if (PAGE_SIZE < 8192) unsigned int truesize = igb_rx_pg_size(rx_ring) / 2; #else @@ -8366,6 +8367,9 @@ static struct sk_buff *igb_build_skb(struct igb_ring *rx_ring, skb_reserve(skb, xdp->data - xdp->data_hard_start); __skb_put(skb, xdp->data_end - xdp->data); + if (metasize) + skb_metadata_set(skb, metasize); + /* pull timestamp out of packet data */ if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP)) { igb_ptp_rx_pktstamp(rx_ring->q_vector, skb->data, skb); From patchwork Wed Oct 7 15:25:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Auhagen X-Patchwork-Id: 11820819 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,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 A389BC4727E for ; Wed, 7 Oct 2020 15:25:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54B6021548 for ; Wed, 7 Oct 2020 15:25:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=voleatech.de header.i=@voleatech.de header.b="c0RF7LD9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728596AbgJGPZc (ORCPT ); Wed, 7 Oct 2020 11:25:32 -0400 Received: from mail-am6eur05on2103.outbound.protection.outlook.com ([40.107.22.103]:47836 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726400AbgJGPZ2 (ORCPT ); Wed, 7 Oct 2020 11:25:28 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nrHoxExGlYKCGCABvEloMSIGD+crGHRogLJ8ZrQa8aI+hokm8XHgnIFGtdDzCx/ZBMiS2sKg39gkTUIKWZIfhx8hITle80DlKqOAQD+orrJOC9QY2ZdSDl3Y9U1+nhqC2aGO2ZjmJt7VSG/QlxQCQ50s0DniZKC7CoCb5+pw1KxwYSRqp72QxbZx8MO2PAEIcuoSlAyC8CH17oxdsvAcmxMPLAlfp0SY1DWQQJieCACj9BT2Aw1TquoAQWpSixjlZAYRTqRTUG5BBc4gyGtdzHxgiyYiNiXfiGTH5urjC5laOO36YhjPK3g4hmMQaW6LYupxyID7ivEpWvStMEJdQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0BfoaA16C0Lc2TtNvTumV450qqjh+Xn/r7XyNXBu0+U=; b=f9Ve/+W5vG+SGIPdvHVzaEZPXqdbPT8aiTDitcFgCfHOb49cbIUjjuGsJBELxYyZ/4IohPSyqUlICIveBo2TvJzRqhmfHPcpW+WG/p97/crb0FsvgJDrJCngZhiCnaCXl9vlm9mIW2PZFU9wFiYmkGuwg8b5Relz6JSUChf+WPUMm2ZfpCuNvXDw9p5mkXRswA4k9trXqLSiDSwOrITjSzgQAmJoIjoaM4Xkku46MfBOosLOk+v8PUkaOPvdryKwKUfdijgEHyptgE3goR/ksczmhFP8bdC7ZIB5UuhD5xmWMlGSDFKbO1N9zHQ0lVtrcxB6ynhiMgGdOVj5NrJolg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=voleatech.de; dmarc=pass action=none header.from=voleatech.de; dkim=pass header.d=voleatech.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=voleatech.de; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0BfoaA16C0Lc2TtNvTumV450qqjh+Xn/r7XyNXBu0+U=; b=c0RF7LD9Ck2QI+cebi3S+h8SyeBr+Jid7Crj3iyayLnSudqiRCB3z/36Ukswo6zF/XkKrO8jxxgqSADgJx2PDWuHlIUqTPyzTb4K0y9atGpnNqbHBcedkI5sktf4iWa+WT1hiponAxcWBlljLPTHzdEdb5TgePnRjOol9lTdBqI= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=voleatech.de; Received: from AM8PR05MB7251.eurprd05.prod.outlook.com (2603:10a6:20b:1d4::23) by AM0PR05MB6082.eurprd05.prod.outlook.com (2603:10a6:208:125::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Wed, 7 Oct 2020 15:25:18 +0000 Received: from AM8PR05MB7251.eurprd05.prod.outlook.com ([fe80::f132:2cc:34f2:5e4]) by AM8PR05MB7251.eurprd05.prod.outlook.com ([fe80::f132:2cc:34f2:5e4%7]) with mapi id 15.20.3433.045; Wed, 7 Oct 2020 15:25:18 +0000 From: sven.auhagen@voleatech.de To: anthony.l.nguyen@intel.com, maciej.fijalkowski@intel.com Cc: davem@davemloft.net, netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com, sandeep.penigalapati@intel.com, brouer@redhat.com Subject: [PATCH 5/7] igb: use igb_rx_buffer_flip Date: Wed, 7 Oct 2020 17:25:04 +0200 Message-Id: <20201007152506.66217-6-sven.auhagen@voleatech.de> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20201007152506.66217-1-sven.auhagen@voleatech.de> References: <20201007152506.66217-1-sven.auhagen@voleatech.de> X-Originating-IP: [109.193.235.168] X-ClientProxiedBy: AM0PR05CA0077.eurprd05.prod.outlook.com (2603:10a6:208:136::17) To AM8PR05MB7251.eurprd05.prod.outlook.com (2603:10a6:20b:1d4::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from svensmacbookair.sven.lan (109.193.235.168) by AM0PR05CA0077.eurprd05.prod.outlook.com (2603:10a6:208:136::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21 via Frontend Transport; Wed, 7 Oct 2020 15:25:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 047cc7b8-7985-4249-909e-08d86ad532cc X-MS-TrafficTypeDiagnostic: AM0PR05MB6082: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0sdUCViwXqyMijymLcuSOC43e6aCc5q3HuRTjxOQ+rM3dd/SYZztx4pPe9tIvoQk0RiWG6znhU+HK8FydGAEE+YqOV7VlisEibpjCmE1RXzPC2cgt6AYw5am0VqTmHOM26y5LLowXPTpWFwV+WBCH15oJPeNiwj0sE5jYg8VJi1pXYzk5AxPI1h+CoroPCgbfOgr2CyNIBzRVpF9KAvtqnVnZoukwiJsdX+vXmQKNTX0zNivxb1SvSyB6FBhSX04fR+1zAVLTJNLOKiIlL7LNP97Vc4lQETQXgx6B4iSXBPHh7XbYCUaPfWg9kBUZ1/IcVxq1AfPagcpnfS9DzFHzA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR05MB7251.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(39830400003)(136003)(366004)(346002)(376002)(186003)(66476007)(16526019)(2906002)(26005)(6486002)(5660300002)(9686003)(66946007)(6512007)(6506007)(83380400001)(6666004)(52116002)(66556008)(8936002)(36756003)(316002)(86362001)(8676002)(956004)(2616005)(1076003)(478600001)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: dyAGvPW7rK5UTfJrJEKZxC1YhREzcZaomVlqTZpvQeEkdd3T3QYSHwvpD6qBDqcBE14R6dii+XY+2zL9LKzpyWuCOJcLNNQ2PtSc9XsP0gEMCngpS+fOHfXdozl0O01s6CnWQ+VUhn8Gk+maWS7g/0qMbrljSBApZK93WW8oqHB4PrfzJ7cbghn+tvokgAh+WacbB6Yna5CAZHbEkZS3o1WQlVeFWBTsK8CXukKMwpuV0WmYlkdL04Bh+i+qSiBzpkpsHt7GSnxcNu4HYVop1Vipow2dPTLy0oO1eeEgZsgE+5MeE8n4/YGKueOf304GNff+PTb221sa84foh90njUqfcQ/C7PrJ8JWivseH29xN15zgnYKwZ0+xct4nik95EY+oG8NFkoeORl3Yfp6FUdQA+N8upwLeiZAIlvYHzLqvaQn4z3Nqu3bGEnjrzDizAnPQwP1I+YLhhayEbgzWnVCiMX8mdIJq/1vfzgLyBjynNmQk46g3vQh4dtkYGNIvoX+DT0xOOjW67RIWHvDMbT/VNXOTktMDhhGzS6jY7ACCdtSpo7Jr98jdkc/CVdoQn7fhp4m5bzIaQ26AG2nI6IFly1prIDpdk1g7DLxL4/kI4DgrlsALAlissa4MPGJYqWI6xRQd6IE9eDpLs1z7kg== X-OriginatorOrg: voleatech.de X-MS-Exchange-CrossTenant-Network-Message-Id: 047cc7b8-7985-4249-909e-08d86ad532cc X-MS-Exchange-CrossTenant-AuthSource: AM8PR05MB7251.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2020 15:25:18.7493 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b82a99f6-7981-4a72-9534-4d35298f847b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eQBz/v0DX0EuRrZDNnppdmpTLeSJo5LGz30+MUGbl2yx9UBVDsIqZ68hJDHoYzeyIaGJyxBIYF0bDBvA2r+quvBbatGhuUkrltJo4Tj3rU0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6082 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sven Auhagen Also use the new helper function igb_rx_buffer_flip in igb_build_skb/igb_add_rx_frag. Signed-off-by: Sven Auhagen --- drivers/net/ethernet/intel/igb/igb_main.c | 87 +++++++++-------------- 1 file changed, 35 insertions(+), 52 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 36ff8725fdaf..f34faf24190a 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -8255,6 +8255,34 @@ static bool igb_can_reuse_rx_page(struct igb_rx_buffer *rx_buffer) return true; } +static unsigned int igb_rx_frame_truesize(struct igb_ring *rx_ring, + unsigned int size) +{ + unsigned int truesize; + +#if (PAGE_SIZE < 8192) + truesize = igb_rx_pg_size(rx_ring) / 2; /* Must be power-of-2 */ +#else + truesize = ring_uses_build_skb(rx_ring) ? + SKB_DATA_ALIGN(IGB_SKB_PAD + size) + + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) : + SKB_DATA_ALIGN(size); +#endif + return truesize; +} + +static void igb_rx_buffer_flip(struct igb_ring *rx_ring, + struct igb_rx_buffer *rx_buffer, + unsigned int size) +{ + unsigned int truesize = igb_rx_frame_truesize(rx_ring, size); +#if (PAGE_SIZE < 8192) + rx_buffer->page_offset ^= truesize; +#else + rx_buffer->page_offset += truesize; +#endif +} + /** * igb_add_rx_frag - Add contents of Rx buffer to sk_buff * @rx_ring: rx descriptor ring to transact packets on @@ -8269,20 +8297,12 @@ static void igb_add_rx_frag(struct igb_ring *rx_ring, struct sk_buff *skb, unsigned int size) { -#if (PAGE_SIZE < 8192) - unsigned int truesize = igb_rx_pg_size(rx_ring) / 2; -#else - unsigned int truesize = ring_uses_build_skb(rx_ring) ? - SKB_DATA_ALIGN(IGB_SKB_PAD + size) : - SKB_DATA_ALIGN(size); -#endif + unsigned int truesize = igb_rx_frame_truesize(rx_ring, size); + skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, rx_buffer->page, rx_buffer->page_offset, size, truesize); -#if (PAGE_SIZE < 8192) - rx_buffer->page_offset ^= truesize; -#else - rx_buffer->page_offset += truesize; -#endif + + igb_rx_buffer_flip(rx_ring, rx_buffer, size); } static struct sk_buff *igb_construct_skb(struct igb_ring *rx_ring, @@ -8345,14 +8365,9 @@ static struct sk_buff *igb_build_skb(struct igb_ring *rx_ring, struct xdp_buff *xdp, union e1000_adv_rx_desc *rx_desc) { + unsigned int size = xdp->data_end - xdp->data_hard_start; + unsigned int truesize = igb_rx_frame_truesize(rx_ring, size); unsigned int metasize = xdp->data - xdp->data_meta; -#if (PAGE_SIZE < 8192) - unsigned int truesize = igb_rx_pg_size(rx_ring) / 2; -#else - unsigned int truesize = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) + - SKB_DATA_ALIGN(xdp->data_end - - xdp->data_hard_start); -#endif struct sk_buff *skb; /* prefetch first cache line of first page */ @@ -8377,11 +8392,7 @@ static struct sk_buff *igb_build_skb(struct igb_ring *rx_ring, } /* update buffer offset */ -#if (PAGE_SIZE < 8192) - rx_buffer->page_offset ^= truesize; -#else - rx_buffer->page_offset += truesize; -#endif + igb_rx_buffer_flip(rx_ring, rx_buffer, size); return skb; } @@ -8431,34 +8442,6 @@ static struct sk_buff *igb_run_xdp(struct igb_adapter *adapter, return ERR_PTR(-result); } -static unsigned int igb_rx_frame_truesize(struct igb_ring *rx_ring, - unsigned int size) -{ - unsigned int truesize; - -#if (PAGE_SIZE < 8192) - truesize = igb_rx_pg_size(rx_ring) / 2; /* Must be power-of-2 */ -#else - truesize = ring_uses_build_skb(rx_ring) ? - SKB_DATA_ALIGN(IGB_SKB_PAD + size) + - SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) : - SKB_DATA_ALIGN(size); -#endif - return truesize; -} - -static void igb_rx_buffer_flip(struct igb_ring *rx_ring, - struct igb_rx_buffer *rx_buffer, - unsigned int size) -{ - unsigned int truesize = igb_rx_frame_truesize(rx_ring, size); -#if (PAGE_SIZE < 8192) - rx_buffer->page_offset ^= truesize; -#else - rx_buffer->page_offset += truesize; -#endif -} - static inline void igb_rx_checksum(struct igb_ring *ring, union e1000_adv_rx_desc *rx_desc, struct sk_buff *skb) From patchwork Wed Oct 7 15:25:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Auhagen X-Patchwork-Id: 11820821 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,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 06D2FC4727E for ; Wed, 7 Oct 2020 15:25:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A621E21548 for ; Wed, 7 Oct 2020 15:25:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=voleatech.de header.i=@voleatech.de header.b="ilrLFrLF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727843AbgJGPZi (ORCPT ); Wed, 7 Oct 2020 11:25:38 -0400 Received: from mail-am6eur05on2103.outbound.protection.outlook.com ([40.107.22.103]:47836 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728365AbgJGPZe (ORCPT ); Wed, 7 Oct 2020 11:25:34 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OheDZsdaOJdoLtvSJfD5MBv9i98APKFgDlj4jF6+jzVhoinFHSeQZWTh+b7xNPEckbhav414bew7tFiXfCo6pHsZSvDjwj0UhiX9ZT0q7j4dsG9/UbWG+DSCC+gCbfl4XlGSY2tywG5ZpPfpP50usmuoDfEV3OY4cqIx1iKCefIAJOXXjX77Qiz369fRwtW8AFXtf10N1IxekDT6ndPb72z0x5dAKaAVFuDlMImki2wdb3REvjPfoD6K7eOpOeCpfauAOUYNBIbGLjUz38qPvoaLJue0DtO6xZNurDvH0f9sAptxFalQxt2wmpPIpveLUGWS+sbDzSnVpRAz4VK0xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2dtP7s34KALyRMZ6z1KK9W3Y2Ni4GBt1Yg1QZXE5dwM=; b=iEYKt4ms4Nf1emyvznOCXh45XMiuREwYlGIrcjCo7y/hFn/b+j5ZbKK63AxmyYzz2DuYyCQk2D5SpPE9BOUeQeLcaINQ6an0nw27JQjULUKbbkXUhTH7lJ8z4ONA81nTlLuE9eP4DN72KOpChGpyLZ03EKWhA3qzZ6s2maikX2Ozp9qCF9U1Q+gXljSgBAX8qxqKF2PQYbFKYSpQRWdvjmdrjuz6n93CiWu+m26QcW9BlfxQizjdYL0chUCUyFiHPlDXXAdoaHCm2sJHNG1Pro02SzcYZCmGhf6MYXRBiLuENz58fdLXnOhTCsCYLYZrcWAzxBnFoZiWaen63YqJ1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=voleatech.de; dmarc=pass action=none header.from=voleatech.de; dkim=pass header.d=voleatech.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=voleatech.de; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2dtP7s34KALyRMZ6z1KK9W3Y2Ni4GBt1Yg1QZXE5dwM=; b=ilrLFrLFI5Jh6XWN2lJM2hVVXovPT28FBHvMtEJIwAkAyHoDH5yxNQuP8TxedTr+m8JUeQ8C6c/iiTdrNqWPj+vQVj8JL/UKItGP4ERfKgi4FfWPIvklDqSbbBpgThzwr6HoA9vnIkTgkv+piZilZFL8eHjGEbsc04Fy2yJUtH0= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=voleatech.de; Received: from AM8PR05MB7251.eurprd05.prod.outlook.com (2603:10a6:20b:1d4::23) by AM0PR05MB6082.eurprd05.prod.outlook.com (2603:10a6:208:125::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Wed, 7 Oct 2020 15:25:19 +0000 Received: from AM8PR05MB7251.eurprd05.prod.outlook.com ([fe80::f132:2cc:34f2:5e4]) by AM8PR05MB7251.eurprd05.prod.outlook.com ([fe80::f132:2cc:34f2:5e4%7]) with mapi id 15.20.3433.045; Wed, 7 Oct 2020 15:25:19 +0000 From: sven.auhagen@voleatech.de To: anthony.l.nguyen@intel.com, maciej.fijalkowski@intel.com Cc: davem@davemloft.net, netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com, sandeep.penigalapati@intel.com, brouer@redhat.com Subject: [PATCH 6/7] igb: use xdp_do_flush Date: Wed, 7 Oct 2020 17:25:05 +0200 Message-Id: <20201007152506.66217-7-sven.auhagen@voleatech.de> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20201007152506.66217-1-sven.auhagen@voleatech.de> References: <20201007152506.66217-1-sven.auhagen@voleatech.de> X-Originating-IP: [109.193.235.168] X-ClientProxiedBy: AM0PR05CA0077.eurprd05.prod.outlook.com (2603:10a6:208:136::17) To AM8PR05MB7251.eurprd05.prod.outlook.com (2603:10a6:20b:1d4::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from svensmacbookair.sven.lan (109.193.235.168) by AM0PR05CA0077.eurprd05.prod.outlook.com (2603:10a6:208:136::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21 via Frontend Transport; Wed, 7 Oct 2020 15:25:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 33a6499a-179c-4c55-db8a-08d86ad5332e X-MS-TrafficTypeDiagnostic: AM0PR05MB6082: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:651; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AyLrW+LqGnhwXZylJhXEhqFE9E44j/+pPvVIdpDxORl2fNEVmxSa//ONOg0pOTBM6nHeavba/nH8qFOHZI6Nsc7ndijQ0QXF5+USW059m1xCyI4Q+LBIOWt8MlCgAavlriZ11b0rW2wQCZ3cDvZaCOa/aH7Af45Y3SF7Gpx22mHLEkx7jyil/p6oDiDcse48Qdt9TIwlU3gsS1SX2gcvlIISo3oz5/GkgwqWRQ6A2mu6WtZFrim5X531Sn/ofKY7rNYLsljwJh1oUH2JcLY6jhiAh5fJ6tkYPbEFDq7iNan3Fq2CD/qWY1ITzM2w5NIP X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR05MB7251.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(39830400003)(136003)(366004)(346002)(376002)(186003)(66476007)(16526019)(2906002)(26005)(6486002)(5660300002)(9686003)(66946007)(6512007)(6506007)(83380400001)(4744005)(6666004)(52116002)(66556008)(8936002)(36756003)(316002)(86362001)(8676002)(956004)(2616005)(1076003)(478600001)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: olPi5Xi4scvOrYyIHJrXBKESXhN0qxnGGzfVKOUCUtE6d/5z+azpfS3Mg/AV5i0A3C6JPyyqDEYmf+rr/y+V36i8DtzVswHAQ88llMKGu/JUgB2H2jL8gkAM9mIGYdoR6QYFTPO3XxSyhJBwCLiErpIBZJUgtFJaD6ZP7NZoNyNB2j59jSLT0ffk/j2LM/dhvg/baIxtVsr2ahiKB8PtTqGJ0QzAvlXPWMUZivum6/5wRdFSlUTbhHOZsm5xE2GASH6smssMMIL6bGya5f5/Jkuvn5wqYriuzHoiVLGW+Ti2/41iuwPtGhw0rDDl2eAU1XkpNcV1hUXBdIwNkYQNMeRcvusumx5DR+/tZkToQSJPpPqtj26gSSvJ/EzBdw/r07CxMVR/cu0HxqbHb0shF08z4Wcq494xGKBQlE4GT8h0EkPLhzji6RzAKuvn5LEh/8mFyp/n7CLThaOMF1R0MW0L7oqwev1IHAyt40CFAnMlhDbCMXMReagdPERPUb64Z3rGgRlWGryobQ9eVAXZ47K7L7CDask4AWleFuye1e5zurUe3DFdpdtiZ7ukUE7O9hcy+02A3F9KoPGkj/OTGpVTp8gOr37ZcFPA/EOZ/MpVk2JvILG8tdH/lsTUl1d2GqA1yo6YpmVixDzUL7/Fag== X-OriginatorOrg: voleatech.de X-MS-Exchange-CrossTenant-Network-Message-Id: 33a6499a-179c-4c55-db8a-08d86ad5332e X-MS-Exchange-CrossTenant-AuthSource: AM8PR05MB7251.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2020 15:25:19.4064 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b82a99f6-7981-4a72-9534-4d35298f847b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NZ+zNwXwitKQyOyMoMrRHQwz4i9ckghg2LdcYwNflVQMcOn99eXNd/0tr9Gwv3Vec1SvWVPtbPRdQ31B0FrqM81I/QXEZRzm8MDHcobjEQA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6082 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sven Auhagen Since it is a new XDP implementation change xdp_do_flush_map to xdp_do_flush. Signed-off-by: Sven Auhagen Reviewed-by: Maciej Fijalkowski --- 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 f34faf24190a..6a2828b96eef 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -8759,7 +8759,7 @@ static int igb_clean_rx_irq(struct igb_q_vector *q_vector, const int budget) rx_ring->skb = skb; if (xdp_xmit & IGB_XDP_REDIR) - xdp_do_flush_map(); + xdp_do_flush(); if (xdp_xmit & IGB_XDP_TX) { struct igb_ring *tx_ring = igb_xdp_tx_queue_mapping(adapter); From patchwork Wed Oct 7 15:25:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Auhagen X-Patchwork-Id: 11820823 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,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 CE426C4727F for ; Wed, 7 Oct 2020 15:25:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7BEB821548 for ; Wed, 7 Oct 2020 15:25:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=voleatech.de header.i=@voleatech.de header.b="I9jbVGco" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728715AbgJGPZi (ORCPT ); Wed, 7 Oct 2020 11:25:38 -0400 Received: from mail-eopbgr00116.outbound.protection.outlook.com ([40.107.0.116]:11397 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728430AbgJGPZe (ORCPT ); Wed, 7 Oct 2020 11:25:34 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hIF2zRh/heJhqdDojH0Oxr05Mk61jgMoYxICvy14RQv01i/qkFrjQUPw0SDt+bwjeVr3ml8ViH/Fq42aJyfl0In87XkmzirXzgLwS2gKP5mqlBBYA14HNO4QfhQNsyARuyjnb+BYukLi7tK7HcJuFh1GLs7KYDl32GT1kdTh19yYPK9HP0TTBF/dry1qv+1bfqREIlfvrZB+a7YXangL2zUMnpRO4Yc4CHiT3ceAS0n7zgS/Rj9OOO3QhIr/oz843fzycSz0a0wdLQcp8kVVSNYEmz9LWv6BbX/S89/sCORkvV2GNrnB8zlXxER6iaMm8Z32/F1d3u5fROQsqcqC6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hhxQloRrrqx68ZSJ5Q291n9pvxp1ZLPavwTFanwPuUs=; b=GvfvgzaDDXB0o0C0iLHyTWRhfTjRwkoJKYVo7xrKk3ZnOIpEOuBGWcfhRS/01UOfUKokTQhADEaDhtWUjd5hYpty/WJpUAhTH0sepI+HF9MzqAk9QHhlSDsSMK/Fv9oUpv3cT1r80Z/jxz4U/tVKnxO7D1OwiKAjsZ420CRKz2RDzNOxMAOfNtYBaKhCywLSamlGWy9dWsyZUuJct8zq2JLkb4SGWPYiSjcprTxeRrH831PA3zHzHO3ZB5gDDeTJUh9PnzGbSpuXKzNSRFk/OKmFdthYqvbH5MI2PcW8+w76jBPsktviuMvznpgdq4nXWckPigN/KDgVX19nLKcHtA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=voleatech.de; dmarc=pass action=none header.from=voleatech.de; dkim=pass header.d=voleatech.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=voleatech.de; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hhxQloRrrqx68ZSJ5Q291n9pvxp1ZLPavwTFanwPuUs=; b=I9jbVGcoCTChPLtWWtIA/G7R4NlSE70teUD1Xl25FZmtoIcXciMD2vPq0/x3PsHDRQQ+7sPc33sXimD0vLLfTYV9nb9Ukw1qhHZfZDYNUWGj001zPG6rxuNok5TT358D74PKQ+tU29Krb7HV6tMddt9f+ocf9ky9Cs5SOUIhCCI= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=voleatech.de; Received: from AM8PR05MB7251.eurprd05.prod.outlook.com (2603:10a6:20b:1d4::23) by AM0PR05MB6082.eurprd05.prod.outlook.com (2603:10a6:208:125::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Wed, 7 Oct 2020 15:25:20 +0000 Received: from AM8PR05MB7251.eurprd05.prod.outlook.com ([fe80::f132:2cc:34f2:5e4]) by AM8PR05MB7251.eurprd05.prod.outlook.com ([fe80::f132:2cc:34f2:5e4%7]) with mapi id 15.20.3433.045; Wed, 7 Oct 2020 15:25:20 +0000 From: sven.auhagen@voleatech.de To: anthony.l.nguyen@intel.com, maciej.fijalkowski@intel.com Cc: davem@davemloft.net, netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com, sandeep.penigalapati@intel.com, brouer@redhat.com Subject: [PATCH 7/7] igb: avoid transmit queue timeout in xdp path Date: Wed, 7 Oct 2020 17:25:06 +0200 Message-Id: <20201007152506.66217-8-sven.auhagen@voleatech.de> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20201007152506.66217-1-sven.auhagen@voleatech.de> References: <20201007152506.66217-1-sven.auhagen@voleatech.de> X-Originating-IP: [109.193.235.168] X-ClientProxiedBy: AM0PR05CA0077.eurprd05.prod.outlook.com (2603:10a6:208:136::17) To AM8PR05MB7251.eurprd05.prod.outlook.com (2603:10a6:20b:1d4::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from svensmacbookair.sven.lan (109.193.235.168) by AM0PR05CA0077.eurprd05.prod.outlook.com (2603:10a6:208:136::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21 via Frontend Transport; Wed, 7 Oct 2020 15:25:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9d7d8398-181b-48b0-63ed-08d86ad53390 X-MS-TrafficTypeDiagnostic: AM0PR05MB6082: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WVDlHj0C0dfJd8luxIC5Klhk4P8+96oK7Xpupz2glJbeNs/AygISCTxmB9V1ZWko+T+nb1YcGAG1N80tZzd0dTMijP2z53XcFNHlhIwGzYogz1og16O9aPwGWs0ppFrByKjMcr0Tf9i5d1UypSMqpYh3VYlhPLVT5M0p/KktdLqPStDZKg6WdBAmBXOPDppKjPaGIr0vQ5r163GJWea027DLgbne0rJDazSmlAeou3OwBFoSutJydZpp09HDYsO9luo46QZNh4mbvkZF0C4FHuFwWcbR8v+uCc/R8omt88QGXKeDr57QK8nlL1WvzeId X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR05MB7251.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(39830400003)(136003)(366004)(346002)(376002)(186003)(66476007)(16526019)(2906002)(26005)(6486002)(5660300002)(9686003)(66946007)(6512007)(6506007)(83380400001)(6666004)(52116002)(66556008)(8936002)(36756003)(316002)(86362001)(8676002)(956004)(2616005)(1076003)(478600001)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: ojIty6b8AlG/QXXjXoBVkXkur0rnuyWBzmcWmOc/K/n3v7q+EF3pDXd4UX7PNF90njQ5ImlFjDU2KPn4KE+1qswbXpmfMvUmM1x37mEAOtXGCk6/nPv2zMkzgL9IfyLALZ5zJ3Ya3n30kByNa1vRGtV2n6x10mk+FrElmBjp2tElKW6C4RHlwWBIn8K+BNZpfok94tPKIM19+7evC8dB6EJN54eOsw0NRQYXJehNdVpiwcdE33cjCtdzn9TUJo0pzs2+DcW5x+D1/Ch3nUz9gYxSTGS78Xc5eU/uXp37iysHtSr9Gblr03kNktWmRJj9Pdb9ZIg2zFTRCcqYRnSxQsTmMEHMHW4CQivlcbm11bXukP5vq1RbfaUuutxyOxLvCWrRf6yYOXXr/vByCTIf0yU6cr3bUKoWQvP2rfaY96uw+ZS5OKDW1ph0erLXSKh+cIKjJYyB2d1BeHjCL3y+BwtFDeWmKCS5Ldo+6uaRTRRlQrIc4eHjEAAS7OosTehlFiGVt/T1+gbI7bUgP+aIxUgRHyOfcB99nvfspIJDOqX2Kvgd0bB1qWAfiPIV2Qyx5015I91Bxm3iPgfiAzGWJX+NjYzTy4Pcvxk5N3zAZt0DXPu+YqrMksKs1cA/O6gt9/z/i7H/FoGRHvf8pq2Ngg== X-OriginatorOrg: voleatech.de X-MS-Exchange-CrossTenant-Network-Message-Id: 9d7d8398-181b-48b0-63ed-08d86ad53390 X-MS-Exchange-CrossTenant-AuthSource: AM8PR05MB7251.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2020 15:25:20.0784 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b82a99f6-7981-4a72-9534-4d35298f847b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: n7DInmPGWGrt6hvuW7+pXe8aUfUpb4xebFpXa+/GXeTtxC3pQtvP+trOnH9xuRe6AzKSoOO/OK8AognpSwjd7t1Z/rYLKrkERU3a7pSSR0I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6082 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sven Auhagen Since we share the transmit queue with the slow path, it is possible that we run into a transmit queue timeout. This will reset the queue. This happens under high load when the fast path is using the transmit queue pretty much exclusively. Signed-off-by: Sven Auhagen --- drivers/net/ethernet/intel/igb/igb_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 6a2828b96eef..d84a99359e95 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -2916,6 +2916,8 @@ static int igb_xdp_xmit_back(struct igb_adapter *adapter, struct xdp_buff *xdp) nq = txring_txq(tx_ring); __netif_tx_lock(nq, cpu); + /* Avoid transmit queue timeout since we share it with the slow path */ + nq->trans_start = jiffies; ret = igb_xmit_xdp_ring(adapter, tx_ring, xdpf); __netif_tx_unlock(nq); @@ -2948,6 +2950,9 @@ static int igb_xdp_xmit(struct net_device *dev, int n, nq = txring_txq(tx_ring); __netif_tx_lock(nq, cpu); + /* Avoid transmit queue timeout since we share it with the slow path */ + nq->trans_start = jiffies; + for (i = 0; i < n; i++) { struct xdp_frame *xdpf = frames[i]; int err;