From nobody Wed Nov 27 12:25:06 2024 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7856C186E52; Thu, 10 Oct 2024 04:00:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728532849; cv=none; b=uF/JLjy3SgzXSFRVcef/1Hw6HIvis6Ke0STNO30tsh5Gc6EWXn4uE+297Y5rYtpAr2nR7PmvjeIMS6gPlrvcwM3GqOtdqi3ErsJQxtrZXPfO+A/+1ZkgkY+bRhd7QXkAcvI5X8CBZLiSOC96ekPxNrcJwtFBTHXDXbssvrd/ZP8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728532849; c=relaxed/simple; bh=bMiKiivS6Hwq0GnIZyU6rmvR5xet7idTh0v0HxIRiZs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iW+JJEWwLyhlxtDA1s8oXtfdXwx1zEPqU5fbtRbEteP4XEMuBviqM8+5JV0E87u4H6KVpwPjT1dOZrjdgECWdOuT4y/CC7Bz3XjbOLyjWTntZngBZl778uielab86GzLDGCC/u7M6bRS3P6pJSP8dl9Y9k0DJCrOIgr/RfkD8Po= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=A2RMtudG; arc=none smtp.client-ip=209.85.210.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A2RMtudG" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-71e1a715c72so397911b3a.1; Wed, 09 Oct 2024 21:00:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728532847; x=1729137647; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aXUQxyqRIc3HsDOFZodLKypqEMMMkzcDuxRdse3iogo=; b=A2RMtudGawvpVyQ1mIHRviRLxPI0LZQoNGkbC/v7Ced7NQBumH2TnhN7aLqX3FYgt3 ryWHwlhdkVsk+myLQ8Z8aO+MX6liVRdEQRjNnleOZJJjz7ndHkEPq6abc8wya43cE5cr tB+KMi9alVhshI0iFxpNPZrnjoi+xsICZjv0/hBaQpGMC8nNUsCpaPPKvlhXBT81WxtO mnsTg20zsFKwuJnRVpMqtWZZv2FRn3zEVNwSW9Jp1hnOjv8kaRqJifrKKZi/6s0MF0xk 0CDzXYgmQTemBZXMzkdHje/8BAK+Fpi8FYW16ouQ2YZVrAx2/pcNP3WzDtLTmwcR6m6R spDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728532847; x=1729137647; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aXUQxyqRIc3HsDOFZodLKypqEMMMkzcDuxRdse3iogo=; b=nFOtvEYvWV+w5dF4JVY2MoxzAEUeh0YMLdCMtYRmMLmpXls4hm2iBLDJVvzOT4Hzmr n5Ty0autY1cycO5C4/CHuMHyjFUFIxGzb+QHwGRIUpk0k05AuBPnUAgYk+Fh8zTjsALb dMCsmUfeUMiXkCLm4BPJQETYAQGTRDH2J6oOSgQwLIQ7dXy/jWs2OukD8rxODs+lBWcH xj/drJHeq+qIGOYDO7Fv4+PMQURvwICCzUNW/Novrub5c/6aPINBONpG18pM7i2SkJ4c thY3SfH5axVaU9Qa5kLUWhzqccMoGPmEo0s8wuqm6DsZPF/16dYImY2/YPtrb9mMCcne MvhQ== X-Forwarded-Encrypted: i=1; AJvYcCVWJqfQQo5u9SqJ7snGOPBUtu8RTu/KR4TkivTFo0GgWx5oanNBJAGJLTFfHxbpywV3nb2v2jVMuuX/KeI=@vger.kernel.org X-Gm-Message-State: AOJu0YyfQOWIJRGNpqK0jjUhsWecpWRw0OKmzz74VEfznJHwj8W6M4X9 ek4MEP1PqjtFFp+0o87GpcqMKr9WJT/dnNQS8bDEpaobqQjB9bhUbxlPZeRVl/I= X-Google-Smtp-Source: AGHT+IFzm4OFZjqxL0RAiIv9HM898L7vC4IxecD9LWuzhi9tjGPCcMSzNGtJ7AGnbqSplIGtH8d6dw== X-Received: by 2002:a05:6a00:4f91:b0:71e:c0c:598a with SMTP id d2e1a72fcca58-71e267f5216mr3748080b3a.22.1728532847426; Wed, 09 Oct 2024 21:00:47 -0700 (PDT) Received: from fedora.dns.podman ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2ab0b5dfsm187638b3a.199.2024.10.09.21.00.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 21:00:47 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Shannon Nelson , Jiri Pirko , Stanislav Fomichev , Simon Horman , linux-kernel@vger.kernel.org, Hangbin Liu Subject: [PATCHv2 net-next 1/3] netdevsim: print human readable IP address Date: Thu, 10 Oct 2024 04:00:25 +0000 Message-ID: <20241010040027.21440-2-liuhangbin@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241010040027.21440-1-liuhangbin@gmail.com> References: <20241010040027.21440-1-liuhangbin@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently, IPSec addresses are printed in hexadecimal format, which is not user-friendly. e.g. # cat /sys/kernel/debug/netdevsim/netdevsim0/ports/0/ipsec SA count=3D2 tx=3D20 sa[0] rx ipaddr=3D0x00000000 00000000 00000000 0100a8c0 sa[0] spi=3D0x00000101 proto=3D0x32 salt=3D0x0adecc3a crypt=3D1 sa[0] key=3D0x3167608a ca4f1397 43565909 941fa627 sa[1] tx ipaddr=3D0x00000000 00000000 00000000 00000000 sa[1] spi=3D0x00000100 proto=3D0x32 salt=3D0x0adecc3a crypt=3D1 sa[1] key=3D0x3167608a ca4f1397 43565909 941fa627 This patch updates the code to print the IPSec address in a human-readable format for easier debug. e.g. # cat /sys/kernel/debug/netdevsim/netdevsim0/ports/0/ipsec SA count=3D4 tx=3D40 sa[0] tx ipaddr=3D0.0.0.0 sa[0] spi=3D0x00000100 proto=3D0x32 salt=3D0x0adecc3a crypt=3D1 sa[0] key=3D0x3167608a ca4f1397 43565909 941fa627 sa[1] rx ipaddr=3D192.168.0.1 sa[1] spi=3D0x00000101 proto=3D0x32 salt=3D0x0adecc3a crypt=3D1 sa[1] key=3D0x3167608a ca4f1397 43565909 941fa627 sa[2] tx ipaddr=3D:: sa[2] spi=3D0x00000100 proto=3D0x32 salt=3D0x0adecc3a crypt=3D1 sa[2] key=3D0x3167608a ca4f1397 43565909 941fa627 sa[3] rx ipaddr=3D2000::1 sa[3] spi=3D0x00000101 proto=3D0x32 salt=3D0x0adecc3a crypt=3D1 sa[3] key=3D0x3167608a ca4f1397 43565909 941fa627 Reviewed-by: Simon Horman Signed-off-by: Hangbin Liu --- drivers/net/netdevsim/ipsec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/netdevsim/ipsec.c b/drivers/net/netdevsim/ipsec.c index f0d58092e7e9..102b0955eb04 100644 --- a/drivers/net/netdevsim/ipsec.c +++ b/drivers/net/netdevsim/ipsec.c @@ -39,10 +39,14 @@ static ssize_t nsim_dbg_netdev_ops_read(struct file *fi= lp, if (!sap->used) continue; =20 - p +=3D scnprintf(p, bufsize - (p - buf), - "sa[%i] %cx ipaddr=3D0x%08x %08x %08x %08x\n", - i, (sap->rx ? 'r' : 't'), sap->ipaddr[0], - sap->ipaddr[1], sap->ipaddr[2], sap->ipaddr[3]); + if (sap->xs->props.family =3D=3D AF_INET6) + p +=3D scnprintf(p, bufsize - (p - buf), + "sa[%i] %cx ipaddr=3D%pI6c\n", + i, (sap->rx ? 'r' : 't'), &sap->ipaddr); + else + p +=3D scnprintf(p, bufsize - (p - buf), + "sa[%i] %cx ipaddr=3D%pI4\n", + i, (sap->rx ? 'r' : 't'), &sap->ipaddr[3]); p +=3D scnprintf(p, bufsize - (p - buf), "sa[%i] spi=3D0x%08x proto=3D0x%x salt=3D0x%08x crypt=3D%d\n", i, be32_to_cpu(sap->xs->id.spi), --=20 2.39.5 (Apple Git-154) From nobody Wed Nov 27 12:25:06 2024 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AC5A186E52; Thu, 10 Oct 2024 04:00:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728532854; cv=none; b=uPwRcxbNiS1ykErtQgICtIujqFdsbfBH1+BnrvCcHQjRGFpIrUrA8eCfDRKI2VYQKlOmySSavFKBqfoHgiE8nwVUOzYYA3vwtRDwlq1xHQoWU+04DJ3HgpmBrBsMVKtQgXXz+f8sJZkY4q9xwcBGnEffs/kSn/05PjhpZA40dE8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728532854; c=relaxed/simple; bh=1lPC7Oy+mVMGOi7EYINru7hjhZdzKV45s6abe9EUfdQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uHRwHSUE0izhbBqzKOUDDUVhBVNtjRa1sME0RpR+y50T20O08YSLeK5R39cnRfNT/0AjCwto3BF+ci5RZKtqGuMSKsak3Cm4Ng4/3pk0s+wxXNrk66gg1R2BpF5dFqw0+Z4FkDHpggZ/r5arnaXVpN3gnNA0cWqSWzDtIOEFS40= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KB/2mmGr; arc=none smtp.client-ip=209.85.215.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KB/2mmGr" Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-7e9fdad5af8so293219a12.3; Wed, 09 Oct 2024 21:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728532852; x=1729137652; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uLS8ExhuyPf8yV1va/VDdqkqBHkw9CH2tEXMgiitFuw=; b=KB/2mmGr382nAQs5K+upf8JUt9bD4775c1UZEeJrbNlIoniCkHx4oNI12tB059lUjk xR26OeqVoAsGria1wtA9OcpJ2aWVDE+eTLzyagvR+JQwU/Zw+E4I1zKmlbD2LjnE7/j0 I/QgPnRN4dfQ2nsXRozpsJNKmVFFZxPwjcYtCgRSJ2hsDdZ9UgqJNDrEtqcQICjoSVcA XhPJFbeuhkZ9H/V5CamSEuA78ZjsTsP+bZW9fliQlWBwXPzA4I/beY5AcW5+aYR4Zhpk 8k2vJjoRn26a71PNZFNGNFt1I5ZL7WZ0gyZlNZou1z2xKLDte3lhjSYUL+w6jqFaZoMW EblA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728532852; x=1729137652; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uLS8ExhuyPf8yV1va/VDdqkqBHkw9CH2tEXMgiitFuw=; b=g8WkjSOjJHLHqcsEWL4lqfQlEo6LaZ85oIMxBHJtrKZ9u8yQXYlXmIV8apX7y44uxi 6f2RHa+bF9+fTiTWpLq30glUWgu6R3AB/ltJvOviOVu/Nz34hBEdGSmpeo0DFa0WC0m3 BVtepLmwW5dUSslfcHerRMZ2Ox2zpv/OGxr1hwD72bOZlg7M6r0jjYvRFo+fs60AK1cL J5D2Fpr5hrlfaZjgQnetabFWOQ1sUiihVlvI07DA3H/D3lBDF4eFeQpXex9NcaQJujt8 acrSwDcCL26sLNugPLYA9qtp0WsFPepbr2AumBJ2iS0bnvTXiQLZ2H5Qim+56+uPtm4e N2hw== X-Forwarded-Encrypted: i=1; AJvYcCVTlUsbt0noaS6Tq1FavI2iitzh1/YmI9g6uuO21memMYQlUP03je36yzPMb4BYoXu/TioskKuQrpA/Xd4=@vger.kernel.org X-Gm-Message-State: AOJu0YxeOnIJmGlFV7yLar6tcHizoeSTQsWQL1Rgi10iMjXzLL59kWmO 2DlJZLLgsTBgVlg2pIiUobm3iw8d/3i7ywXsELg6/AVrKwZJdP3+EOY1V1pq9LU= X-Google-Smtp-Source: AGHT+IEWGpMo/RiqGJL0+7YuiegTc9JHzPiVgIt84IJoLYTMjXmOA9y6KXItL9EnqYgo6DShOlQwLQ== X-Received: by 2002:a05:6a21:1643:b0:1d8:aca7:912 with SMTP id adf61e73a8af0-1d8aca7102emr4459880637.28.1728532851741; Wed, 09 Oct 2024 21:00:51 -0700 (PDT) Received: from fedora.dns.podman ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2ab0b5dfsm187638b3a.199.2024.10.09.21.00.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 21:00:51 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Shannon Nelson , Jiri Pirko , Stanislav Fomichev , Simon Horman , linux-kernel@vger.kernel.org, Hangbin Liu Subject: [PATCHv2 net-next 2/3] netdevsim: copy addresses for both in and out paths Date: Thu, 10 Oct 2024 04:00:26 +0000 Message-ID: <20241010040027.21440-3-liuhangbin@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241010040027.21440-1-liuhangbin@gmail.com> References: <20241010040027.21440-1-liuhangbin@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The current code only copies the address for the in path, leaving the out path address set to 0. This patch corrects the issue by copying the address= es for both the in and out paths. Before this patch: # cat /sys/kernel/debug/netdevsim/netdevsim0/ports/0/ipsec SA count=3D2 tx=3D20 sa[0] tx ipaddr=3D0.0.0.0 sa[0] spi=3D0x00000100 proto=3D0x32 salt=3D0x0adecc3a crypt=3D1 sa[0] key=3D0x3167608a ca4f1397 43565909 941fa627 sa[1] rx ipaddr=3D192.168.0.1 sa[1] spi=3D0x00000101 proto=3D0x32 salt=3D0x0adecc3a crypt=3D1 sa[1] key=3D0x3167608a ca4f1397 43565909 941fa627 After this patch: =3D cat /sys/kernel/debug/netdevsim/netdevsim0/ports/0/ipsec SA count=3D2 tx=3D20 sa[0] tx ipaddr=3D192.168.0.2 sa[0] spi=3D0x00000100 proto=3D0x32 salt=3D0x0adecc3a crypt=3D1 sa[0] key=3D0x3167608a ca4f1397 43565909 941fa627 sa[1] rx ipaddr=3D192.168.0.1 sa[1] spi=3D0x00000101 proto=3D0x32 salt=3D0x0adecc3a crypt=3D1 sa[1] key=3D0x3167608a ca4f1397 43565909 941fa627 Fixes: 7699353da875 ("netdevsim: add ipsec offload testing") Reviewed-by: Simon Horman Signed-off-by: Hangbin Liu --- drivers/net/netdevsim/ipsec.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/netdevsim/ipsec.c b/drivers/net/netdevsim/ipsec.c index 102b0955eb04..88187dd4eb2d 100644 --- a/drivers/net/netdevsim/ipsec.c +++ b/drivers/net/netdevsim/ipsec.c @@ -180,14 +180,13 @@ static int nsim_ipsec_add_sa(struct xfrm_state *xs, return ret; } =20 - if (xs->xso.dir =3D=3D XFRM_DEV_OFFLOAD_IN) { + if (xs->xso.dir =3D=3D XFRM_DEV_OFFLOAD_IN) sa.rx =3D true; =20 - if (xs->props.family =3D=3D AF_INET6) - memcpy(sa.ipaddr, &xs->id.daddr.a6, 16); - else - memcpy(&sa.ipaddr[3], &xs->id.daddr.a4, 4); - } + if (xs->props.family =3D=3D AF_INET6) + memcpy(sa.ipaddr, &xs->id.daddr.a6, 16); + else + memcpy(&sa.ipaddr[3], &xs->id.daddr.a4, 4); =20 /* the preparations worked, so save the info */ memcpy(&ipsec->sa[sa_idx], &sa, sizeof(sa)); --=20 2.39.5 (Apple Git-154) From nobody Wed Nov 27 12:25:06 2024 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77E3419AA5A; Thu, 10 Oct 2024 04:00:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728532858; cv=none; b=mPfDW6MfRwiMQZ2sLgicRN1eplkFvA0UGHs8Vbmv+ZGdVJlsDz20+DvDyAHMCpNOvtalBfbu0ZuCNCJX1eFDh6ebcsDOykQPXyoB8GuLNJY8h2zD7M64KiCipVXv9S7XMPswlMdczkwc+CiTvvG0MYNFlTXFB0bdWnUh2niEuqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728532858; c=relaxed/simple; bh=POE/ZNcaKi7AQv6OZbHnFeOggVcp+v2NoAF/IV3rDUs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XHDzcju+XO+9vWxFjeO6nKqKbSRL+8+Sw0gQVswtwHEy91HRXVtRcmtn7Keq2wUmiU8cxPG1nW+RSzd+gDcz1x9PoKsbk/MpPThX6r6//nEgpSGKPb1lRDztr5aRAd26NR4ynjTwakT2UlCyHhgCt86AT2USTOqI+28TMyNpl34= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=INH+9RrC; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="INH+9RrC" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-71dfc78d6ddso474508b3a.0; Wed, 09 Oct 2024 21:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728532857; x=1729137657; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tWIzD1VrGPIJLaJktHrn5QN9bD3hbWPe2noYoRb587M=; b=INH+9RrCjQj7g4i/ojTcYHoujDLkMJHHXsEIaiTQeusbR1lR5U64d5wTvhp9HvDX0C 0z2RYpXtbSxFAOddbgz8AUCQWUu2VkuJ0wg0dskNO3cGMLBDN3DPSS5VK5qMyP4WOv1v 8Vp1jxMxZsa4ck7nFKFPzk3tm7dN0h4HCgoBOwmVd2h7+jwiaRn3PsP2RL4jBD8ns3Ee j12N8lk/G//0QQXqu1qYbMB0c0BIDvTXJZHT6rJJsXYTI3KbejUC1LZnJcEkigfwVXg/ t/5kxy3d5Y34jC28BC2xvj0O0OCTdyQ9V/5Lj9j3sV4u0wfHRdWp9nTo480Etp8CGm30 yX+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728532857; x=1729137657; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tWIzD1VrGPIJLaJktHrn5QN9bD3hbWPe2noYoRb587M=; b=YqvfNK31AplZrHUovS1bRY8Zo3zDli94lebhRGdkZ4m2wOs4LBHA0o0+WpLkvj5QR8 H5rGTusNvEf+sWYqPCvqwX+oKyV+9HECDWM65xh40F2eJZNNavfoYWeBMe61XBkfPK/J qj4s7Lph7ujo8/ua1WWpLB2lfY/ZCgLmP2rXzu1akUw8C/8Ng2cf/auv6Cf4OieghA8w JCapdR3+QknEiYJuJXYgXWaZzEqfbczpBB+lT5UMIEFkFSaGK3yvS/O0Vmg2CblIHcZw QT7uv++IlCUbIYsso+yYKHwVOgi5+3pr45IaF/gDkgtRVatBgQ4D1CFh2v6lLPNDlsDg EOnw== X-Forwarded-Encrypted: i=1; AJvYcCV5sxvq9AoFviTjGnQBZxgeAWjBqN2hUWwhQsPBNSbL0PY5uDS+zRlLYrvXwHOaTivcBOFigk7IRrZuewA=@vger.kernel.org X-Gm-Message-State: AOJu0YzxpPOJVCyIaW3sWZC9v0I1a3ZPyBuFy5733awuZU02cMxKnQ7m NnSLBXdO5z6MgG0BQERMCfs9uTSkWD6GuqLEUybKmR4tGdplFgLxwXFSqoMkdBo= X-Google-Smtp-Source: AGHT+IGkmQd4R7OrAKgMbsmxf9TKyVa+0fEVtU5rGk4FYzaiCL27kzbb0L0y4auO7WQOjj6QX3ib4w== X-Received: by 2002:a05:6a00:18a8:b0:71e:30d:f448 with SMTP id d2e1a72fcca58-71e1dbc2126mr8580632b3a.22.1728532856615; Wed, 09 Oct 2024 21:00:56 -0700 (PDT) Received: from fedora.dns.podman ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2ab0b5dfsm187638b3a.199.2024.10.09.21.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 21:00:56 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Shannon Nelson , Jiri Pirko , Stanislav Fomichev , Simon Horman , linux-kernel@vger.kernel.org, Hangbin Liu Subject: [PATCHv2 net-next 3/3] selftests: rtnetlink: update netdevsim ipsec output format Date: Thu, 10 Oct 2024 04:00:27 +0000 Message-ID: <20241010040027.21440-4-liuhangbin@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241010040027.21440-1-liuhangbin@gmail.com> References: <20241010040027.21440-1-liuhangbin@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" After the netdevsim update to use human-readable IP address formats for IPsec, we can now use the source and destination IPs directly in testing. Here is the result: # ./rtnetlink.sh -t kci_test_ipsec_offload PASS: ipsec_offload Signed-off-by: Hangbin Liu --- tools/testing/selftests/net/rtnetlink.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selft= ests/net/rtnetlink.sh index bdf6f10d0558..87dce3efe31e 100755 --- a/tools/testing/selftests/net/rtnetlink.sh +++ b/tools/testing/selftests/net/rtnetlink.sh @@ -809,10 +809,10 @@ kci_test_ipsec_offload() # does driver have correct offload info run_cmd diff $sysfsf - << EOF SA count=3D2 tx=3D3 -sa[0] tx ipaddr=3D0x00000000 00000000 00000000 00000000 +sa[0] tx ipaddr=3D$dstip sa[0] spi=3D0x00000009 proto=3D0x32 salt=3D0x61626364 crypt=3D1 sa[0] key=3D0x34333231 38373635 32313039 36353433 -sa[1] rx ipaddr=3D0x00000000 00000000 00000000 037ba8c0 +sa[1] rx ipaddr=3D$srcip sa[1] spi=3D0x00000009 proto=3D0x32 salt=3D0x61626364 crypt=3D1 sa[1] key=3D0x34333231 38373635 32313039 36353433 EOF --=20 2.39.5 (Apple Git-154)