From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3317EA04FF for ; Tue, 24 May 2022 15:44:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1AAFF42B72; Tue, 24 May 2022 15:44:17 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2071.outbound.protection.outlook.com [40.107.212.71]) by mails.dpdk.org (Postfix) with ESMTP id 3FE604281C; Tue, 24 May 2022 15:44:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UBjZLQsZitZQSuR6zfazMakzD89UHfoGCjKdhycqegrViyjLk9lMfLr2voHk/FqQuQEAyY5bsN3XE4IxW1qw9Fja5p0OyuHPfd8uKJalN5t8E77x1ty74Pnur16sze4/k4VTSEVlOYoUMu8P0FAyi77y4oCwZnkqunreD7NjhyH2O7Za9ZnlUjTJAgGoTJ8/7eZJOXlK4Ni72KWeJkMbN/Un+rdhC2gw1ecShjjkFe3d89HPeEvpnevehhnN66tLdjFfjjMHkESLZKMb7gCnGaHeSMR8enToIHHqnn7mDziP+C26MJAgba301KIctp7sgzYdqoOxxYi4LqVogmwA2g== 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=ezEVoN2rVjbLx3iQSJIbKvKjxRklvlMJ1ORTcm4Wgdg=; b=Y5pQnfXqoejUhfuPcQAg7i+KkF1KLgBGotCf3jMecMpJAU4FGhwrJyxBloN5pBR45l3eSmoPf9SDjOrb+DmuG+XZrqIKoAd8VZSQWDuFrnIiKuwlcf7B5b+c9OpXG+l9S7umqooynsm2gbcSNHJSNJ7JP5hL5db3YaYvzPZYsW1Yfu9iygRpxNdX6wvJVLAiNM/vSX8gdW3q+/wjmXJ4PCOaJeSq5vNtnG9yB0osKn0WYQUJfeaLVuJFmAxiGGPt9tyXnpV4xv+2lU8K9fbJN13ENYC/JwFOsznzQ4BQCuBqrtcVeY3IuutrOE7MUBPEtFhdFtNdirjL16anfc032w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 149.199.80.198) smtp.rcpttodomain=huawei.com smtp.mailfrom=amd.com; dmarc=fail (p=quarantine sp=quarantine pct=100) action=quarantine header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ezEVoN2rVjbLx3iQSJIbKvKjxRklvlMJ1ORTcm4Wgdg=; b=PKebv8S2XKIyBfnrPczwU0oXI0ptTDRGiq6mz7UBdbk9zInuJ/NkFYnopIyLXodEJdUA2qkLKbKRL/lcKNCCQ3t1QB5u1V1BAjbCVeGeYeAu9XiSZUsuM/lhx8axNffMDMwkXeJrUxS21I3kiDuOfAvhGdTGCPFca90RHiowTM4= Received: from BN9PR03CA0606.namprd03.prod.outlook.com (2603:10b6:408:106::11) by BN6PR02MB3331.namprd02.prod.outlook.com (2603:10b6:405:69::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.15; Tue, 24 May 2022 13:44:12 +0000 Received: from BN1NAM02FT056.eop-nam02.prod.protection.outlook.com (2603:10b6:408:106:cafe::9d) by BN9PR03CA0606.outlook.office365.com (2603:10b6:408:106::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.15 via Frontend Transport; Tue, 24 May 2022 13:44:12 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 149.199.80.198) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=fail action=quarantine header.from=amd.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning amd.com discourages use of 149.199.80.198 as permitted sender) Received: from xir-pvapexch02.xlnx.xilinx.com (149.199.80.198) by BN1NAM02FT056.mail.protection.outlook.com (10.13.2.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5273.14 via Frontend Transport; Tue, 24 May 2022 13:44:12 +0000 Received: from xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 24 May 2022 14:44:10 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch01.xlnx.xilinx.com (172.21.17.15) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 24 May 2022 14:44:10 +0100 Envelope-to: humin29@huawei.com, stable@dpdk.org, chas3@att.com, nhorman@tuxdriver.com, dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com Received: from [10.71.116.35] (port=20187) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1ntUpW-0004FG-RN; Tue, 24 May 2022 14:44:10 +0100 Message-ID: <3581c8fc-0623-7c61-4c67-8b9ba40343f5@amd.com> Date: Tue, 24 May 2022 14:43:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] net/bonding: fix mbuf fast free usage Content-Language: en-US To: "Min Hu (Connor)" CC: , Chas Williams , Neil Horman , , Thomas Monjalon , David Marchand References: <20220521070814.35704-1-humin29@huawei.com> From: Ferruh Yigit In-Reply-To: <20220521070814.35704-1-humin29@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a5d7d0f0-1ac8-4bbd-cd23-08da3d8b7c9c X-MS-TrafficTypeDiagnostic: BN6PR02MB3331:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 2 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZHTcU+gkKPk3HyDzmJc3YUxNbIVtM0r+BcRihWA/fM5lJPISpVj6SppO4PP+hKI+9XOi2KncY1LYU3ns8a+xxZpv3Zo/9LMNDsdXXMiooAaitU9lI+BPKJ8jsEFuwGqnj0Wbmni1DbkktUOrVBDKjDwNUGGNYmB2Q8QGBBU92tuEelE2y/nYWqeTnsOOV1MI6kgUc9p1zVlkKRs+qIsjXgQ02SHBwrefdy1IbjUAfelK3aRZvw/C5RaIIYm0pPYav2hJyp0fpQJcJJb4GENHqCV7z78FIcebGHXzlEyCNa8DgdyYs3pexwrvU5oAwE3s5Sy/9xRlzfCtWDvXBGAOChajvD1ApTw4qWDZhK5x3HcmmO+YyZtgCfp01/QXOSntZZ1fwEKi9O4UPIhKd6Z9huIUdtXvtT6a9UMdc4b+Ou22SZD9RCHqD4i/GdI31feXGot1mkg9I7E+nsZ03bJNA6OkAskdx3F4MGeTcuc4yRXBYufmLTvun3M90bvg3a+Z6hwAI6D2e40NeYFD6Sr8WqcVend4mWF31VZ/Jfcf4rFdXWgjwRuA1iJcvNnmO3LHmTn7bk+Prt7ULKTu1IEtgm1VNl9dwqtVAJScwsv4Z7IQZNoR/646wDIW/RGeMQUB/HvP52x+OQXfHY6k9/gfZUxOB3nTo/H14Jq61d5GlBiz39vh45koAh1PXPboPSW731MrqPS3S4tDPLKYwrPZRpCa6aWOMiDPuoXY7YLAD5I= X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch02.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(8936002)(8676002)(70586007)(4326008)(316002)(9786002)(26005)(83380400001)(53546011)(82310400005)(70206006)(7636003)(31696002)(47076005)(6916009)(336012)(36756003)(86362001)(31686004)(35950700001)(2906002)(508600001)(356005)(6666004)(40460700003)(44832011)(54906003)(2616005)(5660300002)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2022 13:44:12.5027 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a5d7d0f0-1ac8-4bbd-cd23-08da3d8b7c9c X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT056.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB3331 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 5/21/2022 8:08 AM, Min Hu (Connor) wrote: > [CAUTION: External Email] > > Usage of 'RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE' offload has two > constraints: per-queue all mbufs comes from the same mempool and > has refcnt = 1. > > Bonding mode Broadcast, Tx mbuf has more than one refcnt. > Bonding mode 8023AD, It contains two mempools separately for LACP > packets and other packets. In Tx or Rx, Fast mbuf free will operate > mbuf from different mempool. > > This patch will prevent 'RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE' offload > when in bonding mode Broadcast and mode 8023AD. > Hi Connor, Please find a few syntax comment below, rest lgtm. > Fixes: 78aecefed955 ("bond: move param parsing in configure step") > Cc: stable@dpdk.org > > Signed-off-by: Min Hu (Connor) > --- > drivers/net/bonding/rte_eth_bond_pmd.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c > index c929b55768..5ca90c7590 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -3563,6 +3563,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) > const char *name = dev->device->name; > struct bond_dev_private *internals = dev->data->dev_private; > struct rte_kvargs *kvlist = internals->kvlist; > + uint64_t offloads; > int arg_count; > uint16_t port_id = dev - rte_eth_devices; > uint8_t agg_mode; > @@ -3613,6 +3614,15 @@ bond_ethdev_configure(struct rte_eth_dev *dev) > } > } > > + offloads = dev->data->dev_conf.txmode.offloads; > + if ((offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) && > + (internals->mode == BONDING_MODE_8023AD || > + internals->mode == BONDING_MODE_BROADCAST)) { Can you indent above two lines one more tab, to differentiate them from content of the if block. > + RTE_BOND_LOG(WARNING, "BOND MODE Broadcast & 8023AD don't support MBUF_FAST_FREE offload, force disable it."); - Why "BOND MODE" is uppercase, if there is no special reason for it, I suggest using lower case. - Can you break the message to next line, this enables shorter line without breaking the message: RTE_BOND_LOG(WARNING, "BOND MODE Broadcast & 8023AD don't support .... > + offloads &= ~RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE; > + dev->data->dev_conf.txmode.offloads = offloads; > + } > + > /* set the max_rx_pktlen */ > internals->max_rx_pktlen = internals->candidate_max_rx_pktlen; > > -- > 2.33.0 >