From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5D81BA0561; Fri, 28 Feb 2020 06:57:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A3D051BFDA; Fri, 28 Feb 2020 06:57:44 +0100 (CET) Received: from mx0b-00169c01.pphosted.com (mx0b-00169c01.pphosted.com [67.231.156.123]) by dpdk.org (Postfix) with ESMTP id 2D3201BF8F for ; Fri, 28 Feb 2020 06:57:43 +0100 (CET) Received: from pps.filterd (m0048188.ppops.net [127.0.0.1]) by mx0b-00169c01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01S5s8Eq008464 for ; Thu, 27 Feb 2020 21:57:42 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paloaltonetworks.com; h=mime-version : from : date : message-id : subject : to : content-type; s=PPS12012017; bh=ibEJ5PqUFDFkYJQGJm2soI3kEsFH++WmFacqPoGDUjI=; b=RDl8VRXurTHoR3UKfLno25FM83OUsXt7ItmuGkNeQQd4ig+JQck4JTTp3Cm3DlR/ndGI 6tGXPapZX4DHI4fzC+JIartGhrrakNOeN4UQaVhf9X6rgjEXD0xicvwOFwEwYERWt8ki nzR3crg5rcIvbdIRctLATOogPV/LhhHLBrCjagosxRCSsU1M/Lq7newoe5d+3NYl3+Ij UfsuisVIfMPa7zUBYe0J3q5zdCuLBxLvqZ7vLLSZcm4ZMrz/VscEJWXcU2DlT1V6AH46 r62ugfVwjpceHuv5MnoBRdskhTk7H3MXZJ1igZZsc1GujU9Tie1EbUf9/oTp7OuEwqPR TQ== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0b-00169c01.pphosted.com with ESMTP id 2yepu9hfus-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 27 Feb 2020 21:57:42 -0800 Received: by mail-qt1-f200.google.com with SMTP id l25so2079879qtu.0 for ; Thu, 27 Feb 2020 21:57:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paloaltonetworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=ibEJ5PqUFDFkYJQGJm2soI3kEsFH++WmFacqPoGDUjI=; b=dUD26Sz1OeHqV9XOSvc3/2bnXsGjuDJ1Kc8AW1PCVkfQDM42VFOzUuwcjdUJP/7ECf G1/YjNoiGExZ1izeT+SWwSHFWbc6+IdEx7cq0YSC+UTrnZAHdi/A8sX3OPsLiD6LHGtP 7PKEdEUDxH34b9D5v1iyaDpgjc4UVq06QSS1WQ0lgJ9C3EUtTQfNcM8d83vL2x0aeWBn RIODd3QoqXUTGG+rg/0uAT8YU+eab5SEscQfS2BjVGfqsN8jhgNEJyI4B0JNBoY21w93 CwCMg3/Y+e2rbV68ca8cKU+H4Rljquq2QK4E/bePqiGEXCZLFnU+z4zfzZXNvFpjG22K jVXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ibEJ5PqUFDFkYJQGJm2soI3kEsFH++WmFacqPoGDUjI=; b=CUsUJhtOcmy58mBmkGXFK6mhAx7XpuygJn5+AC2SwavoK8RmhnDtdrLwe9DYIsQ3nS YuNVQTWmGJWg4Hx7Gp96INYi+JAY7PM7PdOX1YTRrRxCwp3jnbuu0iNgAeJSRVCoLhnd 1HykDs38D+WiZbm4rCsg08P9IPRAxhIXDTM5Fu3+F3P7L/d9Li0Oijd95JfpS9RPRxP5 F834w/DaTPLWuEAvVaf2bowIa8RH/rJK5eyNfcCDIBvjO3LRNp6UnREfIADPEDThPIwt UiwXymypWB2BgTcLtSyXedad2fRuvzAyrm9lfRC9LKA77PxeWkeIid+vCzxUhqZ5t8Bb sfjw== X-Gm-Message-State: APjAAAVSUSNDrdL/cf45E9+1glhWGKRGyOTbGpMtCwoJbADZkkCClXFl HNL2CLfsT0WiG6q3/Yl6mXywHl7Wxo/0gcRc360nYHphAKz/nSAeyYQ5FmdU9tdVqJwZo3ElrC7 npjcHr0pNuCVZKGEXrmY= X-Received: by 2002:ac8:4c89:: with SMTP id j9mr2921182qtv.29.1582869461043; Thu, 27 Feb 2020 21:57:41 -0800 (PST) X-Google-Smtp-Source: APXvYqwMzB0b8L3Hd3ifAR5B3c73pgniV5Bch6V6ckZrI5Gb2Zk7icYVNIVDy7ycBGUH8sFNLuWZMcohiGlccxAm/ys= X-Received: by 2002:ac8:4c89:: with SMTP id j9mr2921168qtv.29.1582869460727; Thu, 27 Feb 2020 21:57:40 -0800 (PST) MIME-Version: 1.0 From: Venky Venkatesh Date: Thu, 27 Feb 2020 21:57:29 -0800 Message-ID: To: dev@dpdk.org X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-28_01:2020-02-26, 2020-02-28 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 mlxlogscore=641 clxscore=1011 priorityscore=1501 spamscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=3 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002280052 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] DSW eventdev bug? X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, This is concerning the DSW PMD for eventdev. In our application we put some debugs to see that the same ATOMIC flow isn't scheduled to 2 different cores. Strangely enough we hit it. Not sure if we are missing something OR it is a bug. We put some instrumentation code inside DSW and found the following: - Time T1: flow1 is on core1 - Time T2: core1 decides to migrate flow1 to core2 (using seen_events etc.) - Time T3: core1 completes migration of flow1 to core2 - Time T4: core3 sends flow1 pkts (PKT1) to core2 - Time T5: core1 wants to do another migration and again picks flow1!!! flow1 is owned by core2 at this time - Time T6-T7: core1 migrates flow1 to core4. core2 happily acknowledges core1's attempt to migrate flow1 since it just has to pause, unpause and flush while PKT1 is still in core2. There is no error check to see if someone else is migrating my flow :) - Time T8: core3 sends flow1 pkt (PKT2) -- this time to core4. Now we have the problem of PKT1 in core2 and PKT2 in core4 I think what went wrong was that core1 was using a stale seen_events which had the old stuff from previous migration. During dsw_port_end_migration we only reset seen_events_len but not seen_events_idx. So while the latest events (since the last migration) are towards the end to port->seen_events (since seen_events_idx is pointing there) all the candidate flow finding may end up looking from 0 - seen_events_len: thus using stale information from past migration. Pls confirm if the above findings are correct. I tried the following and seems to fix the problem. Pls let me know if this is the way to fix the issue: diff -up ./drivers/event/dsw/dsw_event.c.original ./drivers/event/dsw/dsw_event.c --- ./drivers/event/dsw/dsw_event.c.original 2019-09-05 16:39:52.662976000 -0700 +++ ./drivers/event/dsw/dsw_event.c 2020-02-27 14:49:14.320156000 -0800 @@ -627,6 +641,7 @@ dsw_port_end_migration(struct dsw_evdev port->migration_state = DSW_MIGRATION_STATE_IDLE; port->seen_events_len = 0; + port->seen_events_idx = 0; dsw_port_migration_stats(port); Thanks -Venky