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 525FEA04C7 for ; Mon, 14 Sep 2020 15:30:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CBD2B2BAB; Mon, 14 Sep 2020 15:30:56 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 42537FFA for ; Mon, 14 Sep 2020 15:30:55 +0200 (CEST) IronPort-SDR: lFo7HTSv3ZP6yS7zGx+KScBl9WvGyNSLAJOWdo8TgRxFMX0DsOGPdsVCwHq0nqqUboW4DuGBxa 35GrRPx/iaSg== X-IronPort-AV: E=McAfee;i="6000,8403,9743"; a="177136817" X-IronPort-AV: E=Sophos;i="5.76,426,1592895600"; d="scan'208,217";a="177136817" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2020 06:30:54 -0700 IronPort-SDR: xwJprh9cCYM8M5zdQuDjCCnlpyeXvjIQvihS90Gqh5VuFWdJVYDd7+8Fysf2rL/DgstCzihntE 9znUV2yuB9Zw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,426,1592895600"; d="scan'208,217";a="287626274" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga008.fm.intel.com with ESMTP; 14 Sep 2020 06:30:54 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 14 Sep 2020 06:30:53 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 14 Sep 2020 06:30:53 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.104) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Mon, 14 Sep 2020 06:30:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gELdfaWaASpDjPjRAFtFhTCmIwMsNsYGpsHKiMhN4fQKrjzR6OGFaJAF0QRJgCNsg6/PtkgOXQzJDG8NMdFML1B2MixpwilnzGHNofjoqmI0BaLHUff1b0MfAnyvUfDGp8kJxQK6f7TKnrZzg0tyjBwBgPcCywlCY2bbwj7OrHm4MEFcJugtolwRgoqND4KvtB0DpOyQ7vCxazgD66BP/LNB3ejS3dmzXF5C3vsDWL7zqB160BB1NOFqY5f66qqC0AIZC7+V+vE3FQ9bO4gzKJHFZzbm6P99vY3aeAoF7ZFosSWlQ7gXMgJYNjuXoRrAqiJvnSlL0+KqkdaOOXFg6w== 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-SenderADCheck; bh=3vG86MFu4TJEYMopxnPj8VDH42iTM6QkQRj2+xk5EpE=; b=LygqbBJKATWkvUUI2SOJYq6x57a8jkDlKWSFcHG1sdoi4+GP6g19NVc4R97fa7UHiKoTwG8mYv4nHJATjgG+x8xxxrvjezMRdduQGhNOA9RIgL+tOGl2ilqCmQZzZuzbYYz6TSHGBxy57ltlguQUxk0mmAOmHiEOF8m8d6VkCDYpplz3ZpFSa7gkdefWYuqsLHknLpCGzs9GyHTy1FhjK8dAQ8dbsxWiZ/yCMjtnG+gOMVn7wOXWkZ/OYrvBcQH8DAUqw3PZujWDSQziX11qIq1r5OH9uLTqNABVcor0C9YzxhJkfXnXdx0/UrstCSfiun2IpiGBS++TLNEew6j/Rw== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3vG86MFu4TJEYMopxnPj8VDH42iTM6QkQRj2+xk5EpE=; b=yKuVJxlMY/GHsHuWYT9w83NLpg13bIz5rOcHMjpsArkLHyrrob/GyUrNNo4n5XNJ1Ka2pAd+gV7F+l5G2tcgQgPGI4luvISAP+D21FEk8S6hgsXwu2nMFt+Cd20UqOZdLT8G6f5nLQx90mGWzcdzcZiSkurg447IVI9ckZ7SuTY= Received: from DM6PR11MB4593.namprd11.prod.outlook.com (2603:10b6:5:2a3::8) by DM6PR11MB2793.namprd11.prod.outlook.com (2603:10b6:5:c0::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Mon, 14 Sep 2020 13:30:46 +0000 Received: from DM6PR11MB4593.namprd11.prod.outlook.com ([fe80::a591:2831:4705:9c25]) by DM6PR11MB4593.namprd11.prod.outlook.com ([fe80::a591:2831:4705:9c25%6]) with mapi id 15.20.3370.019; Mon, 14 Sep 2020 13:30:46 +0000 From: "Wiles, Keith" To: Ravi Tandon , "users@dpdk.org" Thread-Topic: [dpdk-users] Replicating PCAP packets read by pktgen for multiple source addresses Thread-Index: AQHWihlQNUX5zH86s0qSuFnWirm8pKloIe0s Date: Mon, 14 Sep 2020 13:30:46 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [47.24.6.94] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 461dabea-38de-4091-7246-08d858b2635c x-ms-traffictypediagnostic: DM6PR11MB2793: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: L8LElNhNCyNqcceWksF0OcU/cec7KBBqkLfe1czYYbPFZST5LV2gj979EEq7S7hsM5nG86b2biKPAFkb3uXrs3WJYQw9a5VomV7jow1KAvWhoDvYnjayn5HKPbR/kZ2XGO0OD5QgbABuJXWQThWZYQr8/PnXcy75kWy2Icshm/ca3H8ml48p2WCjK5SjuiO1L/6lLSzNqmbxUuBIGXQnaZ6cLrY9mMcNApEhDcx37L7yoVC551FAkH0TlKd2K6NSGl9jDtvlpXZZVfaq4JRMw3EPCYEWzut+69RZdUoKk+u1IPg/c7lKhHkpsvkkystP+3fOFpgD6TspgG+Fh3L6yA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4593.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(396003)(39860400002)(346002)(366004)(376002)(186003)(9686003)(52536014)(5660300002)(7696005)(478600001)(316002)(55016002)(33656002)(76116006)(66446008)(66946007)(66556008)(64756008)(71200400001)(66476007)(110136005)(91956017)(86362001)(2906002)(8936002)(53546011)(83380400001)(26005)(6506007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: rsKP7XpT6GHyNrlwgi3sf0X/6qF4tvBkblmXSs+SMYHnAr+5sjdzv6mLeYn20Qdfxrh3dhk6fmdzsqr/cQBFVahQ/yRC6Rx85PX0hL65wBZxddmAYr3a/OIZqDlfxVmoZ/Op4Jc7iSfUSZbtSl8tiXDMClzRB9YLtGEPqWIClm597D2EwcIHxlQ87xyRXSqd+3FUl1vz51Hr8mcY2eYKczMC2zNFW/KZcJo+cQ3ekVH5kXoJhwheVv6YTxUKHxqEvQcUDiGEQ6+nGrTRg5hOPCRoYOD9nNKbgRLCAOK5nq9KhFv4EBrRuIaiGowYOyU75xPPw6Ttg+u15fohFvzFJKMJEF5kdWgRO1HUiZcDQVaGnH0Vt2rbkK7kY4zq4kuelrwBHAWNV22viaJE+PHcvhIUEmA4/nggFSGWbHTLveUQSjDnS9TMpyx684B1sOI4i/76lntHjkeT6SSod689jtM8lSfIQBdmjNBqAPzMCSRzPnG4Gw4ICjSb6pz8/Z45KHZ0v3pWUQVnRwnEbIGxj9CgNdtxEet6++jYRB4ss/Gx4fqc17U8aRCvhXH46y0eiufZ6bDw/pu7K5EtgiYyAjQZ4aJGaRBqLeigiooHwfUVGAcfIGDnNAXQQqw0fQRVbi1z59ggdZpTzbvcT2p8TA== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4593.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 461dabea-38de-4091-7246-08d858b2635c X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Sep 2020 13:30:46.6295 (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: 5UQGNV3OcD11pPShfigfXQjhjLYCg1pize02hSbLV5jvDoTJWVy31P/QoBMw964UOsKDzVpdiMmF6kWV1+JBzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2793 X-OriginatorOrg: intel.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-users] Replicating PCAP packets read by pktgen for multiple source addresses X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" You can edit the packet in the function below, but you have to do that acti= on everytime. Freeing the mbuf I sok, you can look into the refcnt value in= the mbuf if you want tx_burst to not free the packet completely. From: users Date: Sunday, September 13, 2020 at 5:00 PM To: users@dpdk.org Subject: [dpdk-users] Replicating PCAP packets read by pktgen for multiple = source addresses Hi, I want to use pktgen to read a pcap file and play that pcap file say 10 times by editing the source IP address for each run, please let me know what's the best way of doing this. I first thought of editing the source IP in the rte_mbuf pointed by pkts before calling the rte_eth_tx_burst(info->pid, qid, pkts, cnt) function but it seems that rte_eth_tx_burst function frees up the rte_mbuf pointed by pkts after sending the packet once so I cannot edit the pkts buffer again. static __inline__ void trafficgen_send_burst(port_info_t *info, uint16_t qid) { struct mbuf_table *mtab =3D &info->q[qid].tx_mbufs; struct rte_mbuf **pkts; struct qstats_s *qstats; uint32_t ret, cnt, tap, rnd, tstamp, i; int32_t seq_idx; if ((cnt =3D mtab->len) =3D=3D 0) return; mtab->len =3D 0; pkts =3D mtab->m_table; if (trafficgen_tst_port_flags(info, SEND_RANGE_PKTS)) seq_idx =3D RANGE_PKT; else if (trafficgen_tst_port_flags(info, SEND_RATE_PACKETS)) seq_idx =3D RATE_PKT; else seq_idx =3D SINGLE_PKT; tap =3D trafficgen_tst_port_flags(info, PROCESS_TX_TAP_PKTS); rnd =3D trafficgen_tst_port_flags(info, SEND_RANDOM_PKTS); tstamp =3D trafficgen_tst_port_flags(info, (SEND_LATENCY_PKTS | SEND_RATE_PACKETS)); qstats =3D &info->qstats[qid]; qstats->txpkts +=3D cnt; for (i =3D 0; i < cnt; i++) qstats->txbytes +=3D rte_pktmbuf_data_len(pkts[i]); */*Inserting a for loop here doesn't help as rte_mbuf is freed by rte_eth_tx_burst*/* /* Send all of the packets before we can exit this function */ while (cnt) { if (rnd) trafficgen_rnd_bits_apply(info, pkts, cnt, NULL); if (tstamp) trafficgen_tstamp_apply(info, pkts, cnt, seq_idx); ret =3D rte_eth_tx_burst(info->pid, qid, pkts, cnt); if (tap) trafficgen_do_tx_tap(info, pkts, ret); pkts +=3D ret; cnt -=3D ret; } } Basically, I want to resend buffers stored in rte_mbuf again and again, after modifying source IP in each run. Thanks Ravi