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 3663242989; Wed, 19 Apr 2023 14:21:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1277A40A79; Wed, 19 Apr 2023 14:21:34 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 6971D4021F for ; Wed, 19 Apr 2023 14:21:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681906892; x=1713442892; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=ejWqICiRpQY3L/9rNLwaDvIzTpwzGHaKfU0Ate50je8=; b=lCxEcJO257KB73ZsAi4EmTOzuMg2U2fkBveixsrzuwA4cR7KM1M5dcTy UBHxTVLHRO3X+64gDNwS7e1nxtnbDD2iVhE+gnQVv/tRt5hdGf4dzqaX0 3l5K3OJAbuJ9bOOBHWFYz8FPgpsDawydZ5V+3DeMW5sVe7zPuCbmyOhiJ Jnuu9CLGNzG5MSP+jWPi+vLraJ8O1f2fkuA9KIGGMQhEln6HHxyLcAtWw 1S15aIikpz3sWPEAN8fqexsnaERI6gDfaL6TfvOnOdcBD0WrggyMnhqrV Aqu7KCGfbkMlQw38UOelM6KUWxrGZEemPcmT8mbsfCyygwi+RwZZIDYlr A==; X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="347286111" X-IronPort-AV: E=Sophos;i="5.99,208,1677571200"; d="scan'208";a="347286111" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2023 05:21:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="815615337" X-IronPort-AV: E=Sophos;i="5.99,208,1677571200"; d="scan'208";a="815615337" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga004.jf.intel.com with ESMTP; 19 Apr 2023 05:21:31 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 19 Apr 2023 05:21:31 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 19 Apr 2023 05:21:30 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Wed, 19 Apr 2023 05:21:30 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Wed, 19 Apr 2023 05:21:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nH1uFo/Gh+03YmFlX2GDUAArg6qEof6kJOqEzIk600grKizyB5G0k7skyAspr2olz0xn9kHgC/0mVtq+QvstgP7SWYBd/unSyseMRTefgoIcOFys/vKLmk2zVoTkrYkYiF1MN4StJ1lBKQMdWUvQ14AxAv+ZV9wfeNy/mOtKy1N8tTH0P69450Htq+XhpUCpRCr+pTpHi/zHaEZ22UgUw/C1ryENvx0vtbTzjL8seqqWOQXIGTNPUc0dF3/cT67bddzVznCfyjvp7OJB+Aakv2IcRVhC92rm1eWH2rzFfnNw44IKoqhnfb12ByXoMh0o8YJmMy+Bj/i9LKkLpVLNDg== 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=P/RT1l9WO71yw4EcusCSlOSm1SC2fWOZegY5IH3TfWQ=; b=f2CFBWyfrDKaroJkAYC+RLK/cs8DAuFKtQ1pk+PH8uyxbvftzaT2O/H9yF99q7xToKmnn3EYqGdyDM2KzVXl8Hh5RbiM/ijZgfbiG7Dp5fKu57AWJpe/pSqMDmUX06zNj8g41VH2cxLWoU32NsonqATDoYGrlVThSI0T3/jo1I7tvv/8BbmdDfHUhyuss9VKTQ6WOUzBHCaTGwldU98Q8nmbbQCa1qChApZPv7gZpo0OboDguQgWKAg91KUAMtzql2rjAxMB/8DZ2rxfu1b4P+ab4UKWZaXQeAOgNm1aRC3PnXiRICplIDBWf6OHQHJwh/NTUthec8XuPQEDpJebkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) by SA1PR11MB6781.namprd11.prod.outlook.com (2603:10b6:806:25d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Wed, 19 Apr 2023 12:21:28 +0000 Received: from MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::8d3b:6bb3:3e95:6c05]) by MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::8d3b:6bb3:3e95:6c05%5]) with mapi id 15.20.6319.022; Wed, 19 Apr 2023 12:21:28 +0000 Message-ID: Date: Wed, 19 Apr 2023 17:51:18 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v4] app/testpmd: txonly multiflow port change support To: Joshua Washington , Yuying Zhang CC: , Rushil Gupta References: <20230411202430.2817217-1-joshwash@google.com> <20230412181619.496342-1-joshwash@google.com> Content-Language: en-US From: "Singh, Aman Deep" In-Reply-To: <20230412181619.496342-1-joshwash@google.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN2PR01CA0184.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:e8::8) To MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR11MB0062:EE_|SA1PR11MB6781:EE_ X-MS-Office365-Filtering-Correlation-Id: 93108094-95cc-46e6-2183-08db40d099cd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KrYmDJcy8umPU/aTvQgOxnyfNoPc0plXTMwpPfXjiQlMoc6DJNx7QqUYjHVFlpdLqGBbqTUWxjYOzziHXtxnvV0DUDrplxomz3is5rJ+NTPPzSoEOhXSP14Scyq5B7RRQLGaf/O2abX5Zvhpocu3FbP9h9yOL9tRb/XiqDZTT3aglYAs7l/Hks2uk4a+dB3mqD9RvvXe0SMnA5DDBJDnxvfVE3Yl31u8QhIME5PXz7JPuuIFTQ8scQg3NGLb6ObZLA3FK8v49vc7qFbCYDcWUAOjzdmOKJ6gZOLcoJ2pqZaiWX8b7AIfdupPV/VComZUsTPUzjbaxDdt0QT4XftMvGxxwYlHJrMmnb5cv9ZImUQOolqfI8YtrOo8iJ/ax8wWkiHT/1cE0TUXAw8ZtdTerKk4R/iVUhVWDLWqxFze9R2kVFoven2Korsd07k5/cgLfblfp0gpuHXEEmT7/RCp5WsZK4jI87ZTbPFpXtEkRnXNp8W4KRP5pacg0oW3c8avDbsLgh+yPtMAABeX13QX6K66ifmwsnW1kTlLBkUmkUCUAmRNutlb7Cq0b2Kydgl23/qcLeG92KEmTTHwION7NpOEeHJYISSiWkziEoTADMR5O0qycvVOKruQacGJB46SO1Gtl+chTQOBu6tkHFUjJw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB0062.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(39860400002)(136003)(346002)(376002)(396003)(366004)(451199021)(8936002)(38100700002)(36756003)(8676002)(2906002)(86362001)(31696002)(5660300002)(478600001)(6486002)(6666004)(6636002)(110136005)(31686004)(186003)(2616005)(6506007)(53546011)(66946007)(66476007)(6512007)(26005)(316002)(82960400001)(83380400001)(66556008)(41300700001)(4326008)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TWxJSW9kL0ZRMWh4VFNnVFBYNDMwVDBmM2VKczA5Y2NmRUhjT1RJZ05wWmZz?= =?utf-8?B?TmV0LzFFV0xUVWVvSnNFaC9XSDBGWFRwa3lSSTFxTURvWFQ1eUxCQTNFRTlT?= =?utf-8?B?UWdBMmVQdUtBL3Z0c2JnbW9DNlAxdDlPd1hzRjN1ZzRWeHMxUlJuUzZBL1dK?= =?utf-8?B?UEZ4cDErUTVVZmNMc1RwZzlma2ZWbUdQM282M1htaWRPd0syU2RabS9BVEtY?= =?utf-8?B?YUxURlBZSEI5MEU1OGQ1RWs1U2pTN1FnaFlGZ2JGQy91MlU3bnFYa1p6cGNI?= =?utf-8?B?SkRFdU1BR25NcXRQUll3TmVvR21JRVFXWVdoelViNnZOSFRENi9ydUp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8?B?SDhBdVVKZVA1amw3cGdrV25MbG9iWEVZR0lqQlFOb0JvcXN2WWF3ejBqSnc0?= =?utf-8?B?OVE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 93108094-95cc-46e6-2183-08db40d099cd X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB0062.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2023 12:21:28.4760 (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: ctRmet3ZWjQhM6HHIqzRlQcGVCHmbWCeVU1drLUYOiMTAJMVQrRQE3BbD/IamJD1EgXs9Kqn+FZra01Fg9KWdrPJUO5tYflEspfykQSUA88= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6781 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 4/12/2023 11:46 PM, Joshua Washington wrote: > Google cloud routes traffic using IP addresses without the support of MAC > addresses, so changing source IP address for txonly-multi-flow can have > negative performance implications for net/gve when using testpmd. This > patch updates txonly multiflow mode to modify source ports instead of > source IP addresses. Generally routing is based on DST IP addresses, was SRC IP also having an impact in your case ? > > The change can be tested with the following command: > dpdk-testpmd -- --forward-mode=txonly --txonly-multi-flow \ > --txip=, Missing "-" in command: --tx-ip=, > > Signed-off-by: Joshua Washington > Reviewed-by: Rushil Gupta > --- > app/test-pmd/txonly.c | 34 ++++++++++++++++++---------------- > 1 file changed, 18 insertions(+), 16 deletions(-) > > diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c > index b3d6873104..7fc743b508 100644 > --- a/app/test-pmd/txonly.c > +++ b/app/test-pmd/txonly.c > @@ -56,7 +56,7 @@ uint32_t tx_ip_dst_addr = (198U << 24) | (18 << 16) | (0 << 8) | 2; > #define IP_DEFTTL 64 /* from RFC 1340. */ > > static struct rte_ipv4_hdr pkt_ip_hdr; /**< IP header of transmitted packets. */ > -RTE_DEFINE_PER_LCORE(uint8_t, _ip_var); /**< IP address variation */ > +RTE_DEFINE_PER_LCORE(uint16_t, _src_var); /**< Source port variation */ > static struct rte_udp_hdr pkt_udp_hdr; /**< UDP header of tx packets. */ > > static uint64_t timestamp_mask; /**< Timestamp dynamic flag mask */ > @@ -230,28 +230,30 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, > copy_buf_to_pkt(eth_hdr, sizeof(*eth_hdr), pkt, 0); > copy_buf_to_pkt(&pkt_ip_hdr, sizeof(pkt_ip_hdr), pkt, > sizeof(struct rte_ether_hdr)); > + copy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt, > + sizeof(struct rte_ether_hdr) + > + sizeof(struct rte_ipv4_hdr)); > if (txonly_multi_flow) { > - uint8_t ip_var = RTE_PER_LCORE(_ip_var); > - struct rte_ipv4_hdr *ip_hdr; > - uint32_t addr; > + uint16_t src_var = RTE_PER_LCORE(_src_var); > + struct rte_udp_hdr *udp_hdr; > + uint16_t port; > > - ip_hdr = rte_pktmbuf_mtod_offset(pkt, > - struct rte_ipv4_hdr *, > - sizeof(struct rte_ether_hdr)); > + udp_hdr = rte_pktmbuf_mtod_offset(pkt, > + struct rte_udp_hdr *, > + sizeof(struct rte_ether_hdr) + > + sizeof(struct rte_ipv4_hdr)); > /* > - * Generate multiple flows by varying IP src addr. This > - * enables packets are well distributed by RSS in > + * Generate multiple flows by varying UDP source port. > + * This enables packets are well distributed by RSS in > * receiver side if any and txonly mode can be a decent > * packet generator for developer's quick performance > * regression test. > */ > - addr = (tx_ip_dst_addr | (ip_var++ << 8)) + rte_lcore_id(); Good to have feature where last IP octet had lcore_id. Helped to identify, packet came from which core. > - ip_hdr->src_addr = rte_cpu_to_be_32(addr); > - RTE_PER_LCORE(_ip_var) = ip_var; > + > + port = src_var++; > + udp_hdr->src_port = rte_cpu_to_be_16(port); > + RTE_PER_LCORE(_src_var) = src_var; To be safe, can we use the Ephemeral port range [49152 to 65535] and adjust lcore_id within it. > } > - copy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt, > - sizeof(struct rte_ether_hdr) + > - sizeof(struct rte_ipv4_hdr)); > > if (unlikely(tx_pkt_split == TX_PKT_SPLIT_RND) || txonly_multi_flow) > update_pkt_header(pkt, pkt_len); > @@ -393,7 +395,7 @@ pkt_burst_transmit(struct fwd_stream *fs) > nb_tx = common_fwd_stream_transmit(fs, pkts_burst, nb_pkt); > > if (txonly_multi_flow) > - RTE_PER_LCORE(_ip_var) -= nb_pkt - nb_tx; > + RTE_PER_LCORE(_src_var) -= nb_pkt - nb_tx; > > if (unlikely(nb_tx < nb_pkt)) { > if (verbose_level > 0 && fs->fwd_dropped == 0)