From patchwork Fri Dec 2 13:46:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 13062756 X-Patchwork-Delegate: kuba@kernel.org 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 9DB2EC4321E for ; Fri, 2 Dec 2022 13:47:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233396AbiLBNrM (ORCPT ); Fri, 2 Dec 2022 08:47:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232011AbiLBNrL (ORCPT ); Fri, 2 Dec 2022 08:47:11 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2124.outbound.protection.outlook.com [40.107.223.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD1F0D3DEB for ; Fri, 2 Dec 2022 05:47:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LNKqlqp48rXoB2wnrjhtYHzSBUz1x73P2Mopy8VnYWi/OMDfcA/T731DbLhW0XvxHfCgYOAsqivvTETaHfHXYJZ9Wz/IRSoBqSsVNk/XXcPI+J7hPzwcgW/zFdcTAdZRMyzeat1FjLtI4ZlWLW6uD6FH/RP6n7eQDwNyGmia1fPekey8q4R0FvvbXTn41GymUi+294Pc/DEZ6EsXc+T7oKjwiu+edfEYkYC48LCo2GLcvngEFnBtHZp0C1Rkgu2UzczbnLWlPuJYgEySuNDAVi/Oj6mHMGZDAj2Wr7GBxdAIoEHelPiZuPi8n3Kv06Sl/kjIDFk5/Ge5peFA3kmPVA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DdXA1gx2N42YEB4TXIvtnVFhRonA5muuUbMjbkcY1lo=; b=NJZe3Dm5yKin4rwEtMQmlpRXLJtiRFOpcKDagc29ZXOjQnl3T9lt5G//QcnUO5HbYPt5+LXgGgKsKzDFrZQPOgGol1Ih+cYXc7UPtCMyGRGU+gl/kd2mEo3wIKgsntkuYxBiwkzEPQZ5y7L28eI5vcXzJZ1YXvkfs3onAgXhq2YovNs9u8dK9ebc4XuEk9T69RerRFEUn/O7MRI8b5XVNA7bWPnWaGgJEmZD5bUcvoNmyPJReY7jrMzY05kEwp1Qq7usoj/Kt6HYm1OR1LtwJkuBkNc+mTVKYAy22BSYt0Dn3/TBFcRnm+RbbY6uRWKPlHE3/lx8fT0+KeNkiY9qnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DdXA1gx2N42YEB4TXIvtnVFhRonA5muuUbMjbkcY1lo=; b=pkEAnjlUl+p3CFx04oXzUajETSR9+KBcrL4mGxGsrcMbcFn5/bcDZkypDwd/9v5Jzez7ghdLxITWkH5mKtWoW1rIPbqF3TwWYA9bcSlU+VvCB2hZNX4tAHfeCsn1GcnirZZRxrBay1CXC7sIX4RHE/4139EivTyuU05HFcZTTng= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by PH7PR13MB5913.namprd13.prod.outlook.com (2603:10b6:510:158::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.23; Fri, 2 Dec 2022 13:47:08 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::483b:9e84:fadc:da30]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::483b:9e84:fadc:da30%9]) with mapi id 15.20.5880.010; Fri, 2 Dec 2022 13:47:07 +0000 From: Simon Horman To: David Miller , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, oss-drivers@corigine.com, Yinjun Zhang , Richard Donkin , =?utf-8?q?Niklas_S=C3=B6derlu?= =?utf-8?q?nd?= , Simon Horman Subject: [PATCH net] nfp: correct desc type when header dma len is 4096 Date: Fri, 2 Dec 2022 14:46:46 +0100 Message-Id: <20221202134646.311108-1-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: AS4P250CA0008.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5df::9) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|PH7PR13MB5913:EE_ X-MS-Office365-Filtering-Correlation-Id: 5ec8f545-c7ba-4bb8-3f4b-08dad46bb411 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s66kifB8qUfHPBVE2PhtN2Ed3qajqgX+NHdNGtVZ6v79O5zFgItAZZGqGCKAo6agfWx+hqmMWA+89JiTNM5coOPx/nMp0rWtTiYAB5Y+VirGeitXCR5ho5Vih5iqP/0swGKVE3W/spDSLhYYVjS/IPczEZdMf+ip1p3pT2voQ+wlHvvQdmX2jGmKRWYYZRkpUYtPf0KEQWEsWDiP4eJkZ+bHBx76CrqUE3/FzAnUdvnrvvB9kS4Oru6RtDzH4jrZ+VgxJpXrAVEDY01TBEgaSsVHkXt/6eHOAYbbSGWgG+ELY/Hk55y5Km/Yfk/+iDULLxwx18xppfsJE4xTc/fExaJDIsV3ywzZ5lVO1aP2cwr54U//zyQkXGzRBm2hVUH1h0RYrYYj8G6MqAqFL1smgo0RwkY6V0963zkZmVAJgvg/AIc6PFUtJTHblUuI1AG4VN7LfSoc1so0lazWcOm4jk4VRmKazfZ1gBw7FFIdIuFw9NmtyybrNVh6z6RyWDmNYQcodMRpSi3BcR9yiKt8JSlCDIqJaeDvejtsqDSl/zG68QhhW/yALlxXWwAsBQbby9YSJkr9Ui80cJNt/k/MYVOkpChrTAnPZ2qfy+01SdiVeR353IIwNtTpB/qgRh07Nskw5IATJX5hGNlp7VtDBw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(376002)(346002)(136003)(396003)(39840400004)(451199015)(2616005)(2906002)(107886003)(83380400001)(6486002)(66946007)(66476007)(8676002)(66556008)(36756003)(6666004)(6506007)(52116002)(6512007)(478600001)(41300700001)(186003)(5660300002)(8936002)(1076003)(38100700002)(316002)(54906003)(44832011)(110136005)(4326008)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?I+Fvs6IQJqpm9CCMPoBOSRN4meKF?= =?utf-8?q?YerdTUFWpxukR6E7RGfxexDgUX7eYE7fZ9zelvELYMhlTTpmWGz4p3QKq55iYNuRJ?= =?utf-8?q?kB4SmrwxxybtvUm75VIc8hKn1q9Wzc6lJgK5iZ8v3I4Crue6BY2jbDSrTUpAUev9/?= =?utf-8?q?xXAuyqrg040oRjNnIOPSHHhtWuoUPniFjJ3chBvZtL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H/fkoUG0UhrJhYTBdd?= =?utf-8?q?ujAM9SLyJa2UOVpFH0/4Vq82vGKsX4xzENtNDBmxqvUhz3ZRGw5kZqAh9KF9AG2i8?= =?utf-8?q?sxN1rT3QD92vODQ2Ts3bpHXVDaPWi0GKYhGL6BUQ1MqC2YsOK2ukZ7hwvsbi8oOzx?= =?utf-8?q?c8s7yJk2669Cr6CMvkeJcdVP6EW+Bf0CFT8QPakjWcHPjeR1ODy/ZiNsS61qgMfzU?= =?utf-8?q?wLudjidjleQlHSdBfTZdmfxO8nmiNCw/+tTqWTfgGUCHbBQjQ8N5vYiwP3maahDwH?= =?utf-8?q?AZdXdXQZE5poxJK0UgDtOtxaRN59e6L355yDcGGYBuIRLbqbhBYBE2QiePCoZOBzA?= =?utf-8?q?eEVy27hYaNNwOzJAODP03U3JekQtiJpj/mja/GNex5hXBefYekTEM/bKOFrloAsGx?= =?utf-8?q?UU2PJenn13GO/kvdENPrNxdluYabkV8ZTHuTV9ipH+tHHiL+CQ1iEqewLmJhmTnwU?= =?utf-8?q?N5jTKWf4yDOHWiGKiMScR2fvkYHpTPnQSjX+fVMDefoUZQUaMOXU4+BFF0QvpUzm9?= =?utf-8?q?RFZx2GMAasx4x3Uvf5Ho471hoJDvz4tOw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ec8f545-c7ba-4bb8-3f4b-08dad46bb411 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2022 13:47:07.6151 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 63SZVeSbV8oo39HAJcJE8GR/QTMCKLGIwRmNpOU4x8Vn4DC8KdM7Ixm3DkDYfopOD5XyEEOQUX/mpjkBS+S2wN0owdSVhki3btAm+vrNcUs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB5913 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Yinjun Zhang When there's only one buffer to dma and its length is 4096, then only one data descriptor is needed to carry it according to current descriptor definition. So the descriptor type should be `simple` instead of `gather`, the latter requires more than one descriptor, otherwise it'll be dropped by application firmware. Fixes: c10d12e3dce8 ("nfp: add support for NFDK data path") Fixes: d9d950490a0a ("nfp: nfdk: implement xdp tx path for NFDK") Signed-off-by: Yinjun Zhang Reviewed-by: Richard Donkin Reviewed-by: Niklas Söderlund Signed-off-by: Simon Horman Reviewed-by: Leon Romanovsky --- drivers/net/ethernet/netronome/nfp/nfdk/dp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfdk/dp.c b/drivers/net/ethernet/netronome/nfp/nfdk/dp.c index 2b427d8ccb2f..ccacb6ab6c39 100644 --- a/drivers/net/ethernet/netronome/nfp/nfdk/dp.c +++ b/drivers/net/ethernet/netronome/nfp/nfdk/dp.c @@ -282,7 +282,7 @@ netdev_tx_t nfp_nfdk_tx(struct sk_buff *skb, struct net_device *netdev) dma_len = skb_headlen(skb); if (skb_is_gso(skb)) type = NFDK_DESC_TX_TYPE_TSO; - else if (!nr_frags && dma_len < NFDK_TX_MAX_DATA_PER_HEAD) + else if (!nr_frags && dma_len <= NFDK_TX_MAX_DATA_PER_HEAD) type = NFDK_DESC_TX_TYPE_SIMPLE; else type = NFDK_DESC_TX_TYPE_GATHER; @@ -927,7 +927,7 @@ nfp_nfdk_tx_xdp_buf(struct nfp_net_dp *dp, struct nfp_net_rx_ring *rx_ring, dma_len = pkt_len; dma_addr = rxbuf->dma_addr + dma_off; - if (dma_len < NFDK_TX_MAX_DATA_PER_HEAD) + if (dma_len <= NFDK_TX_MAX_DATA_PER_HEAD) type = NFDK_DESC_TX_TYPE_SIMPLE; else type = NFDK_DESC_TX_TYPE_GATHER; @@ -1325,7 +1325,7 @@ nfp_nfdk_ctrl_tx_one(struct nfp_net *nn, struct nfp_net_r_vector *r_vec, txbuf = &tx_ring->ktxbufs[wr_idx]; dma_len = skb_headlen(skb); - if (dma_len < NFDK_TX_MAX_DATA_PER_HEAD) + if (dma_len <= NFDK_TX_MAX_DATA_PER_HEAD) type = NFDK_DESC_TX_TYPE_SIMPLE; else type = NFDK_DESC_TX_TYPE_GATHER;