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 F25E245A34; Thu, 26 Sep 2024 09:52:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2FA34025D; Thu, 26 Sep 2024 09:52:13 +0200 (CEST) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mails.dpdk.org (Postfix) with ESMTP id DFC74400EF for ; Thu, 26 Sep 2024 09:52:11 +0200 (CEST) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-42cb6f3a5bcso7844075e9.2 for ; Thu, 26 Sep 2024 00:52:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1727337130; x=1727941930; darn=dpdk.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=gvAU1Fr9fG8x0tembZaZX00fJcRdZh2rSIvt0HoZr2w=; b=WwUPnKjkz74yh04tOcoFYy/Vg7+BNPFHNGAteIkg2LBhELtOKxsuKLU3IS/2qmDnN6 aC8EhrDRMFYT5Gbg7nlI+KFwi4IVfz/tSt3UAD836T7qh0fkZzLfzfb1EXwx3QQfGVUj qUNDrCk2nrNmUPtomQCGNcOSzp3hUj5183gep6aLSpopSWV/m1QBly+tvEl0+uoHgkN2 aUEw+WQrriBRsQDCxzEFQecUoWf0ndW+3SGESHBmWH3j3E0+ZjE6ymFgCbMcyym707r4 9PFHIWmos2rGnazup9kSgKf4aeArkrglJOII/RNXg9l5xO914pCDf5XkNVA+XU/3Ds8C 30Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727337130; x=1727941930; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gvAU1Fr9fG8x0tembZaZX00fJcRdZh2rSIvt0HoZr2w=; b=mh9XSQVCZ+HrAd8KQVVTACJcgoAg+J80094OlbeCYu9f5sjlBZqTv+cN7wyUq1iw1F yBgwZdPXlpcT5tlNsdED2/PF3WZuXkppZM5vkZkB0M78mHwwr0SizZhPmivzG5dhK7MX 8Qqbtgl8+5khlMEh7Kh7fszkeV6vPQLWZH6tgaJBtr5DiYX2mwhO2TVp3JeQVfb9oBO7 AZtCae3pounXIN2vex5t5UToP66mL1uI0ykZnNeGTgIOJ/39bK9H0CHqBYDRw1msebqU 3r6iSN5eqGDnBv0OPRoKWxCxeO/6o0tA0RgwnyycJ/apB+Waxz5jBQgChw+C5JYsnEFl AwtA== X-Forwarded-Encrypted: i=1; AJvYcCV/Rx3c3OnWRDuw/4+wk6vcvhdNd7BVC9mTXN+iBc/PKN1fbndsa6Xxn9enGAiDObA323w=@dpdk.org X-Gm-Message-State: AOJu0YyDZzTFGOpCKnIYMzJg5whBk0t2Q8/1iBaDzva38H1eBvWPXQ+g hSY7aditdCLrV4gKxwSnNP8oVKFDgkpi1KnR8Q0KFeMshk2+dCRtUwsFqskIyX8= X-Google-Smtp-Source: AGHT+IH+l8oOgt032OR3KL5JyNJXe8Sd8Za7NKJDpnKbZw4wFr71Ljg3wKQVaoCyurM1u9Pp+k3c+g== X-Received: by 2002:a5d:5587:0:b0:374:d254:61b3 with SMTP id ffacd0b85a97d-37cc2468648mr4662138f8f.14.1727337130471; Thu, 26 Sep 2024 00:52:10 -0700 (PDT) Received: from [192.168.200.22] ([84.245.121.62]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93a1a8c71csm202900166b.87.2024.09.26.00.52.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Sep 2024 00:52:10 -0700 (PDT) Message-ID: Date: Thu, 26 Sep 2024 09:52:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/1] dts: add send_packets to test suites and rework packet addressing To: Jeremy Spewock Cc: paul.szczepanek@arm.com, Honnappa.Nagarahalli@arm.com, probb@iol.unh.edu, alex.chapman@arm.com, thomas@monjalon.net, Luca.Vizzarro@arm.com, npratte@iol.unh.edu, yoan.picchi@foss.arm.com, wathsala.vithanage@arm.com, dev@dpdk.org References: <20240904152827.11914-1-jspewock@iol.unh.edu> <20240920180852.34792-1-jspewock@iol.unh.edu> <20240920180852.34792-2-jspewock@iol.unh.edu> Content-Language: en-US From: =?UTF-8?Q?Juraj_Linke=C5=A1?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 >>> + if num_ip_layers > 0: >>> + ip_src_is_unset = "src" not in l3_to_use.fields >>> + ip_dst_is_unset = "dst" not in l3_to_use.fields >>> + else: >>> + ip_src_is_unset = None >>> + ip_dst_is_unset = None >>> >>> - # The packet is routed from TG egress to TG ingress >>> - # update l3 addresses >>> - packet.payload.src = self._tg_ip_address_egress.ip.exploded >>> - packet.payload.dst = self._tg_ip_address_ingress.ip.exploded >>> - else: >>> - # The packet leaves TG towards SUT >>> # update l2 addresses >>> - packet.src = self._tg_port_egress.mac_address >>> - packet.dst = self._sut_port_ingress.mac_address >>> + # If `expected` is :data:`True`, the packet enters the TG from SUT, otherwise the >>> + # packet leaves the TG towards the SUT >>> + if pkt_src_is_unset: >>> + packet.src = ( >>> + self._sut_port_egress.mac_address >>> + if expected >>> + else self._tg_port_egress.mac_address >>> + ) >>> + if pkt_dst_is_unset: >>> + packet.dst = ( >>> + self._tg_port_ingress.mac_address >>> + if expected >>> + else self._sut_port_ingress.mac_address >>> + ) >>> >>> - # The packet is routed from TG egress to TG ingress >>> # update l3 addresses >>> - packet.payload.src = self._tg_ip_address_egress.ip.exploded >>> - packet.payload.dst = self._tg_ip_address_ingress.ip.exploded >>> + # The packet is routed from TG egress to TG ingress regardless of whether it is >>> + # expected or not. >> >> Is this true? This might've been an error in the original >> implementation. If it's expected (that is, the returning packet), it >> should be routed from TG ingress to TG egress, no? > > I guess I'm not completely sure. It would make sense that the L3 > addresses should be switched as well based on either expected or not, > but currently it isn't modified, and os_udp still works which makes me > think the addresses aren't switched by the kernel interfaces, which I > believe is the only time these addresses are actually used (since we > use sendp in scapy). > Right, I went too deep in my thinking and confused myself :-). The path of the packet is: TG egress -> SUT ingress -> SUT egress -> TG ingress That is just one way path and I mixed the other direction into my thinking as well. With just one path, the MAC addresses are going to change, but not IP addresses.