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 3FC6AA00BE; Thu, 10 Feb 2022 16:08:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E12942728; Thu, 10 Feb 2022 16:08:21 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 9BFD4426EE for ; Thu, 10 Feb 2022 16:08:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644505698; x=1676041698; h=message-id:date:from:to:cc:references:subject: in-reply-to:content-transfer-encoding:mime-version; bh=UqeARVy9bdpW5cPg9hwAIng/NlUiAzu+TRtzhJSG0U0=; b=UAzHck6duMCaQRy+SsOcOycIkE3vwtijNnfgxNk+JOBc1KVtkE+edfvq +3HnHMyPNPFvcfgQ6NKPtnaVKrH60zepzsYjH5v97nQkp/83UPEwujqqN VxmBGb45alrHZWya2NAwbAD9ZhsluHc+i1xO6P55nFEwmNT00h+PlH1wV yrYzzCd4G5nVSHzEKNu7A+BeJVvb3zE24ZfqLBJ5IQ6Tthn0EHnZXfWn0 OecK6lwkp2LbxoWk49FOYnNzf39JH7NRX5NQyvqncWrnHBUYnLkMaYCNH hgYX0zxAN+8arr6Vvc9bN1HqHSTQ4zn3ALbJJYP04SxHW9NxouTGB2r6A Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="274059021" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="274059021" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 07:08:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="500423582" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga002.jf.intel.com with ESMTP; 10 Feb 2022 07:08:17 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 10 Feb 2022 07:08:17 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 10 Feb 2022 07:08:17 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Thu, 10 Feb 2022 07:08:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j+H+1RNzVT7kmzyvuU3JKY7GKCdBTkvnjOjHoh+7k4FdRSguiolx+qRGElbw18lxub1A2eFVA/LgreMrH/rN7gLoiWHYVvTcWEviYQelFeOokEILq3LmoHADznNZBA6QlU5VGMPgpERFHCOjHuFIhpVkQJvXbQqC/B/MsocKNNL60uvQTc+OIewUZXGt4f6n3xjrMgfsq2uECTnMS22ppai9+8Mx27EvNz8k1lU50qNWW2xJlrv8DO/WsZZtWMVPSaStin7OD+vRGjvLn2Wt73Lg+W4+ck2nqe3Oaz3bqZVe7Ba/v/kapHROT4t46MIjzmbrgAlES1qJetnwqBIjWg== 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=Yy9wazn77d1Vow2xtzmZm7EXtwF31wAPrxLc3l/L9F4=; b=UcDIUc5NRdV0N0e1qN3p6mZ0v4NjxrkwCzH5uW+I0TplBE2N0gh0KKXw82/VFD65CVcrEywLAP1JdipCqx5QZcMG3Hu3U1/yT42lvY3tmzpgeEYaHU4EuS7QF5wJs4g5IDWUFhL9MtOs4NWCb4/tuhYjN/tKK6VXyK8j1v8WwZwS/u2GUKCeFaCPTDe9RuQ44Ohtux0MlLzNOdFp+j66pff00oZ8o/RVhIq4wbFV3bpK+N8MQXMdt2QmqfcFt6/5q5enqbM7NVkbmLsOjr1lzOXO5oS+CM09F37qV9/GiyMAcIOYNx8TTbcAgpIzrCf3c0tqX6QPXlR2tG0BcNlvGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by DM5PR1101MB2170.namprd11.prod.outlook.com (2603:10b6:4:54::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.17; Thu, 10 Feb 2022 15:08:15 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::98be:5506:5020:28a2]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::98be:5506:5020:28a2%4]) with mapi id 15.20.4975.011; Thu, 10 Feb 2022 15:08:14 +0000 Message-ID: <47ab416e-7ca5-7da9-ce64-74159a6146eb@intel.com> Date: Thu, 10 Feb 2022 15:08:06 +0000 Content-Language: en-US From: Ferruh Yigit To: Ciara Loftus , CC: , References: <20220208134800.52142-1-ciara.loftus@intel.com> <20220209094808.41464-1-ciara.loftus@intel.com> <713f6d3a-51dc-a9e8-d0d2-2623fd44adb6@intel.com> Subject: Re: [PATCH v4] net/af_xdp: re-enable secondary process support X-User: ferruhy In-Reply-To: <713f6d3a-51dc-a9e8-d0d2-2623fd44adb6@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0433.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a9::6) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a125710-83eb-401a-05d0-08d9eca72928 X-MS-TrafficTypeDiagnostic: DM5PR1101MB2170:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6AuK3s7QX/aRNTKv1qkTd8hJCRbR0t0dJtIb3W8LJ89z3ZlEYFnLYZPpa2NvQZ5xI0JJmcO2NyAJCRDA0N+h6qlzMFiLqWHWn68ERrQ7oLiXUmi8SegWGo5x23di6pn3ilrDL8AWxVOemGliiVR/tmJuTSkQ/Ly/GqplUNfK8MVwbJC1TIdL/V3u5L/USHvJiy6bfG6lWftdfSv84wCIUhF+MEISDMEajHpCteWyNpyOWBQlX+iQNQubiK2uGAtpyWUqYhOxXDjyjDj0VOI8ZVPJqJRUU8PtAkJFZlvmdWhSpFV0nwcK5M01WJawKavsz5lcmjZAR0SMuicH41q0cXJGOF6PS4qfDp87WPFvLO2V/dLAmrQqfUP35/Ub/q7tDT/Vdzx/nW+Egfb+W5e/5qVxmsq9W/luUECqbZbe+RHF7JbtGPKXieS3HokNUpJ3riZLm5ck5qP8XKWNKs+AusaksHZ0PvzXWOPHAsSTQWN/rYAbWdUyuWupSko2YFOcQ3dXpIJuyvdGb2D3biszynM+2cwHhiT5Y1mII2svRB0/OYktvhwHDjwN8nmLNtD8B+wn4mbHHH+6TmpvGO22tyxNJHWUstJsj/6HSdKyOfhtYMeqeThvlO/jA50Yjr4zHpIvhP/u5+yVw0j4WpvVvs5KWIE7F/rVBlSpivdha78ljvrMjr/0/PxVZhbirjpNR68SnN1NSJxvoWqdQyCKutbAJ4gBOjoXgJU6QDJ56BUjE1qFD4yryqIpYGQFE4ENA44uYTN2HrpNurYKyMm1Vso6fx/vJwjTgR7OSWpdWEA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(83380400001)(31686004)(36756003)(2906002)(186003)(38100700002)(26005)(2616005)(44832011)(107886003)(5660300002)(31696002)(508600001)(316002)(966005)(6486002)(53546011)(6512007)(6506007)(86362001)(55236004)(82960400001)(66946007)(66476007)(66556008)(4326008)(6666004)(8936002)(8676002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?c2lPbDZzV3lHVEFHRlVWZW9EMGI1ZndIY0x5N0pQdFVnYURKVW5YcWhROUtU?= =?utf-8?B?RWpSTEJidmdVQTBVUDRZS3FwdTV6UHJ1WUNpeWRzakRjV0E3aVhHbXVyVWdU?= =?utf-8?B?Q0FvT0E1dnNpUXA4R3BQVGtLbzU0KzQvUWVURlA4RXcvbGthYjIxc056MlBJ?= =?utf-8?B?K2dGckRUVGtpaUY1OFJqcEZ1UWJlSGl2STdJOVZBZis3c0V6ZTgzbENUWWdl?= =?utf-8?B?TzBocCtRdlBmSzVSL2FkL3k2UGRJaHdNL0NUcnhSUXdMZkhxVGZvY1o2NWwv?= =?utf-8?B?aWpSQmhIZVpmdFg5NzJrYUhCOE1GL2RYNUZ6d0djTElORGxQTWx0VCtKelVu?= =?utf-8?B?QzB3OHErTUR3WTc2SzhIUVZETVZ0NStIM3lMY0RlYT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KCbooGGyd3Ep0HuRNNLVU=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 4a125710-83eb-401a-05d0-08d9eca72928 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 15:08:14.6332 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5hpk3P0rPOgiXEJKsvR8T7WbYmuKRzN+Urp5NE6tMOyp2qC7DypIEs3ZvXkGLyYxr4ssQJ/htqyWZpOmaJHrtg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2170 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2/9/2022 5:55 PM, Ferruh Yigit wrote: > On 2/9/2022 9:48 AM, Ciara Loftus wrote: >> Secondary process support had been disabled for the AF_XDP PMD because >> there was no logic in place to share the AF_XDP socket file descriptors >> between the processes. This commit introduces this logic using the IPC >> APIs. >> >> Rx and Tx are disabled in the secondary process due to memory mapping of >> the AF_XDP rings being assigned by the kernel in the primary process only. >> However other operations including retrieval of stats are permitted. >> >> Signed-off-by: Ciara Loftus >> >> --- >> v3 -> v4: >> * Rebase to next-net >> * Reword limitation which requires Rx and Tx to be disabled. >> >> v2 -> v3: >> * Rebase to next-net >> * Updated logs to be more specific about multi-process IPC >> * Free process_private in _close and _remove functions >> * Use rte_eth_dev_get_by_name instead of global array >> >> v1 -> v2: >> * Rebase to next-net >> >> RFC -> v1: >> * Added newline to af_xdp.rst >> * Fixed spelling errors >> * Fixed potential NULL dereference in init_internals >> * Fixed potential free of address-of expression in afxdp_mp_request_fds >> --- >>   doc/guides/nics/af_xdp.rst             |   9 ++ >>   doc/guides/nics/features/af_xdp.ini    |   1 + >>   doc/guides/rel_notes/release_22_03.rst |   1 + >>   drivers/net/af_xdp/rte_eth_af_xdp.c    | 215 +++++++++++++++++++++++-- >>   4 files changed, 211 insertions(+), 15 deletions(-) >> <...> >> + >> +/* Secondary process rx function. RX is disabled because memory mapping of the >> + * rings being assigned by the kernel in the primary process only. >> + */ >> +static uint16_t >> +eth_af_xdp_rx_noop(void *queue __rte_unused, >> +        struct rte_mbuf **bufs __rte_unused, >> +        uint16_t nb_pkts __rte_unused) >> +{ >> +    return 0; >> +} >> + >> +/* Secondary process tx function. TX is disabled because memory mapping of the >> + * rings being assigned by the kernel in the primary process only. >> + */ >> +static uint16_t >> +eth_af_xdp_tx_noop(void *queue __rte_unused, >> +            struct rte_mbuf **bufs __rte_unused, >> +            uint16_t nb_pkts __rte_unused) >> +{ >> +    return 0; >> +} >> + > > Hi Ciara, > > Can you please review following patch, if it is good we can merge it first > and rebase this patch on top of it to use generic dummy burst functions. > > "ethdev: introduce generic dummy packet burst function" > https://patches.dpdk.org/project/dpdk/patch/20220208194437.426143-1-ferruh.yigit@intel.com/ > That ethdev patch can be delayed, so I will proceed with this patch. noop burst functions in the PMD can be updated later.