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 76FC4424A3 for ; Fri, 27 Jan 2023 16:36:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7161140FDF; Fri, 27 Jan 2023 16:36:47 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2046.outbound.protection.outlook.com [40.107.223.46]) by mails.dpdk.org (Postfix) with ESMTP id C4D7640146; Fri, 27 Jan 2023 16:36:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lldBtcDO7ADsrIpFETexiF8Ge0yQvXEtqTjHqir7Py/cIxQDVF2iSRwJ4epac92P3kuMIJHQUZoEiMQi0bzXUFGeJ/oMCQ17HCVSWaLaz+e25ebFlI7ptxZHZBz00KukUFjlUtQqKeTcy9eCl/kxBUZaSP4IIzTJvDAyvkNag323+a0OkHnTCMGYCaAJsx/OKxm6Ru8Dzeb3Vo0AsWD4Fx2L6uhOqfN2hTJiCq/paRt2sUA0nQW+4yr+o14iYFhSyQGEmPcoG5FtM3YCc2DBxedZMQZhSX6suMZMG/0wAGNamPqBz0KslnhcLZ/awq2kndcRUNHaTeGS3nfKaKuZkw== 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=prRfqz5Bbbbqupr7zbKofSBj93/HzfOuF9TuNfHoWAU=; b=oJ8wYLz9zFV9b5N4zx2oJeC7P76/ZvrQBljNr8GFjB7kkCO4a5StyfMOlDfw9fgMtHzRxavsBx1D5khXNLX0XOB3qsLqcMH+b540DXOqsKtagyDOd9e/X0AI1xl9gnocU3JrofERMwJ01RxiBpfngBqI8svHHMxvrYd4wYHimjqWh41iAXdl6BWpwgG4KakOhGeaWqc72aBDW3EuenHoJ+Q+3IeAnoDhEZFjb6Tin53TidPEzwyC02qkmtaA16S3rbhOuTFO8619f4GhuxTaI+ELqy2WWrQ06CmeFx3iwd1DuZTot2rgUyi7yexP9CSDG99V0eTtxwrmwfvzBO4iKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=prRfqz5Bbbbqupr7zbKofSBj93/HzfOuF9TuNfHoWAU=; b=uEFm684ZktY+mvwa/+5sm5j8a6Xd8bC7KIQPcZd2NaDiNMoizBKr8TLlOKC5hdRuuz1E3ZHwkAoBXxNh8teb4Qmz+40VFhTjYLIeDW4uNXA1sUgzrtpLHru15ua4qCaS862LfLbYGDoEqp2IYSjn79SnOBpRn4pHmxaMjmjb4I0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by MN2PR12MB4125.namprd12.prod.outlook.com (2603:10b6:208:1d9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.23; Fri, 27 Jan 2023 15:36:45 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%8]) with mapi id 15.20.6043.022; Fri, 27 Jan 2023 15:36:45 +0000 Message-ID: <731ecbc6-b338-899e-62be-ecda963951a1@amd.com> Date: Fri, 27 Jan 2023 15:36:39 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 To: Jiawen Wu , dev@dpdk.org Cc: stable@dpdk.org References: <20230118060039.3074016-1-jiawenwu@trustnetic.com> <20230118060039.3074016-4-jiawenwu@trustnetic.com> Content-Language: en-US From: Ferruh Yigit Subject: Re: [PATCH 3/8] net/txgbe: fix packet type to parse from offload flags In-Reply-To: <20230118060039.3074016-4-jiawenwu@trustnetic.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0410.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a0::14) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|MN2PR12MB4125:EE_ X-MS-Office365-Filtering-Correlation-Id: dcb3216a-2d31-46d8-0320-08db007c4bc3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q8pUSpfANN3Q9ApmrlymbBpwMAi0XmNlXKdiA5FOzVT3skVuE3G3qjso6AhG2jWODUwfTNkC6DiyUpaKfDcj7aHkAjpAABc0bwYsaIkInrFl6Q6WRXQ0vRUGzkhGTqr6pK0ojgo6XKe/f5zzJdd3r/BNUVXKLZb3RB2vxvjCulvDnomfoVUq0GRbfOhUwbQJF0xitmYbFboq2PXpQXhXQmAy3vk8l3T0lBg7na3ba2bPMwJHMp8YisbgQBs0h0gGEobbtKePZvO5VdfzD1QgH4ZqD9g4dAPhBta2yCNQP2PvfvNR04JXPgTqVtNAdHerj1qRDbH7f3RT0rKld6HFIt59P6R4WOD/n2JoHtRYmCHxbkyDPtgjpUVdIszsu933fep13KSV+q/n0OhLnSZJgC/XODO2GzjVQgHsZ4bV8+eMUW9eMps+GgEOQoL3XqZQFnZMOq3QQpkhxiSFLy8pbPlcRog2f8p3Fu0tL9whyKtaQ3iipS+a5lA3r+JImaJBJ5/Epz+TyauEjdBG01fxpLO5CuP8IdL03YnjN5xjLmd1lcgESSXP76ghbhUWyVzjtZewGM235vnqe1DBGxpBA/o1OiEhWC9gB+qmuI2wCNgqkyNhrt85fX8W8rTdTMYlJ8lHtglUkl8a3tSuc5wdTWlc3FaTEULBeB4qfuGKRuw59wKxMeaXmOM4tkjh8x6UezJtW2uiRYtYwg0fQapDA+MYVbsNXFBdKyKjfWBQR3A= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(136003)(396003)(366004)(376002)(346002)(39860400002)(451199018)(41300700001)(8936002)(6666004)(5660300002)(83380400001)(38100700002)(86362001)(31696002)(316002)(36756003)(66556008)(66476007)(66946007)(6512007)(8676002)(4326008)(26005)(186003)(2616005)(6486002)(478600001)(53546011)(6506007)(31686004)(44832011)(2906002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?c2dSeFJIZy9XT01WV3JxaWFRRXd5N1p3ZGI2MXMwOTdTZWVUc1Bkd0dYTkMw?= =?utf-8?B?eUVHNUswcFVLbzFULzJVTmRhOWY0WW1DS0xndUtWSm9ZQUwrNkNYd2FjTy9E?= =?utf-8?B?Zi93V0FvNHhrNlRoNGIvVzBRazF5cVFBS2JWRlJ6NTBtc2U0T3lhV0FXei9t?= =?utf-8?B?QlpWdUsrNll5MW1ZSFlrZllWc1Z2SmFLOHltWDZuRlhac09ObjAxU1pzeXl6?= =?utf-8?B?NEpLc1kvR0doNUREQmx3dUR4blFkbERDa3E2ZFZGVUtZa2JRVlV6ZFRwdk9s?= =?utf-8?B?RW1JdDl1dkhy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mJ0MnBReEhYUTVKb2kvTDNH?= =?utf-8?Q?UoYyku3sqGHaksQ4MBRBD7bkI?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcb3216a-2d31-46d8-0320-08db007c4bc3 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2023 15:36:45.2260 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7DZ1+woWZ8KYfAuH1uGh6/Wd0+6ElCIl24NcwLf0fHbdwoQIKGUiLEHryXl/qsbI X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4125 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 1/18/2023 6:00 AM, Jiawen Wu wrote: > In some external applications, developers may fill in wrong packet_type > in rte_mbuf for transmission. It will result in Tx ring hang when Tx > checksum offload is on. So change it to parse from ol_flags. > Can you please give more information on what packet_type value is causing problem in Tx path? > Fixes: ca46fcd753b1 ("net/txgbe: support Tx with hardware offload") > Cc: stable@dpdk.org > > Signed-off-by: Jiawen Wu > --- > drivers/net/txgbe/txgbe_rxtx.c | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c > index ae70ca3beb..e91aaf60ef 100644 > --- a/drivers/net/txgbe/txgbe_rxtx.c > +++ b/drivers/net/txgbe/txgbe_rxtx.c > @@ -516,20 +516,21 @@ tx_desc_ol_flags_to_cmdtype(uint64_t ol_flags) > return cmdtype; > } > > -static inline uint8_t > -tx_desc_ol_flags_to_ptid(uint64_t oflags, uint32_t ptype) > +static inline uint32_t > +tx_desc_ol_flags_to_ptype(uint64_t oflags) > { > + uint32_t ptype; > bool tun; > > - if (ptype) > - return txgbe_encode_ptype(ptype); > - > /* Only support flags in TXGBE_TX_OFFLOAD_MASK */ > tun = !!(oflags & RTE_MBUF_F_TX_TUNNEL_MASK); > > /* L2 level */ > ptype = RTE_PTYPE_L2_ETHER; > if (oflags & RTE_MBUF_F_TX_VLAN) > + ptype |= (tun ? RTE_PTYPE_INNER_L2_ETHER_VLAN : RTE_PTYPE_L2_ETHER_VLAN); > + > + if (oflags & RTE_MBUF_F_TX_QINQ) //tun + qinq is not supported checkpatch is complaining about c99 comment syntax ('//'). > ptype |= RTE_PTYPE_L2_ETHER_VLAN; > > /* L3 level */ > @@ -587,6 +588,14 @@ tx_desc_ol_flags_to_ptid(uint64_t oflags, uint32_t ptype) > break; > } > > + return ptype; > +} > + > +static inline uint8_t > +tx_desc_ol_flags_to_ptid(uint64_t oflags, uint32_t ptype) > +{ > + ptype = tx_desc_ol_flags_to_ptype(oflags); > + This function get 'ptype' as parameter and immediately overwrites is with calculated value, what is the point of getting 'ptype' as argument. > return txgbe_encode_ptype(ptype); > } > Overall why 'ptype' is calculated for Tx path, I see this value is used to see if it is tunneled packet or not, is there any other usage of ptype in this path? If not why parse all packet types?