From: Simon Horman <horms@kernel.org>
To: Ivan Vecera <ivecera@redhat.com>
Cc: intel-wired-lan@lists.osuosl.org,
Jesse Brandeburg <jesse.brandeburg@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org,
Jacob Keller <jacob.e.keller@intel.com>,
Wojciech Drewek <wojciech.drewek@intel.com>,
mschmidt@redhat.com, netdev@vger.kernel.org
Subject: Re: [PATCH v5 4/5] i40e: Fix broken support for floating VEBs
Date: Sun, 3 Dec 2023 16:22:20 +0000 [thread overview]
Message-ID: <20231203162220.GI50400@kernel.org> (raw)
In-Reply-To: <20231124150343.81520-5-ivecera@redhat.com>
On Fri, Nov 24, 2023 at 04:03:42PM +0100, Ivan Vecera wrote:
> Although the i40e supports so-called floating VEB (VEB without
> an uplink connection to external network), this support is
> broken. This functionality is currently unused (except debugfs)
> but it will be used by subsequent series for switchdev mode
> slow-path. Fix this by following:
>
> 1) Handle correctly floating VEB (VEB with uplink_seid == 0)
> in i40e_reconstitute_veb() and look for owner VSI and
> create it only for non-floating VEBs and also set bridge
> mode only for such VEBs as the floating ones are using
> always VEB mode.
> 2) Handle correctly floating VEB in i40e_veb_release() and
> disallow its release when there are some VSIs. This is
> different from regular VEB that have owner VSI that is
> connected to VEB's uplink after VEB deletion by FW.
> 3) Fix i40e_add_veb() to handle 'vsi' that is NULL for floating
> VEBs. For floating VEB use 0 for downlink SEID and 'true'
> for 'default_port' parameters as per datasheet.
> 4) Fix 'add relay' command in i40e_dbg_command_write() to allow
> to create floating VEB by 'add relay 0 0' or 'add relay'
>
> Tested using debugfs:
> 1) Initial state
> [root@host net-next]# echo dump switch > $CMD
> [root@host net-next]# dmesg -c
> [ 173.701286] i40e 0000:02:00.0: header: 3 reported 3 total
> [ 173.706701] i40e 0000:02:00.0: type=19 seid=392 uplink=160 downlink=16
> [ 173.713241] i40e 0000:02:00.0: type=17 seid=160 uplink=2 downlink=0
> [ 173.719507] i40e 0000:02:00.0: type=19 seid=390 uplink=160 downlink=16
>
> 2) Add floating VEB
> [root@host net-next]# CMD="/sys/kernel/debug/i40e/0000:02:00.0/command"
> [root@host net-next]# echo add relay > $CMD
> [root@host net-next]# dmesg -c
> [ 245.551720] i40e 0000:02:00.0: added relay 162
> [root@host net-next]# echo dump switch > $CMD
> [root@host net-next]# dmesg -c
> [ 276.984371] i40e 0000:02:00.0: header: 4 reported 4 total
> [ 276.989779] i40e 0000:02:00.0: type=19 seid=392 uplink=160 downlink=16
> [ 276.996302] i40e 0000:02:00.0: type=17 seid=160 uplink=2 downlink=0
> [ 277.002569] i40e 0000:02:00.0: type=19 seid=390 uplink=160 downlink=16
> [ 277.009091] i40e 0000:02:00.0: type=17 seid=162 uplink=0 downlink=0
>
> 3) Add VMDQ2 VSI to this new VEB
> [root@host net-next]# echo add vsi 162 > $CMD
> [root@host net-next]# dmesg -c
> [ 332.314030] i40e 0000:02:00.0: added VSI 394 to relay 162
> [ 332.337486] enp2s0f0np0v0: NIC Link is Up, 40 Gbps Full Duplex, Flow Control: None
> [root@host net-next]# echo dump switch > $CMD
> [root@host net-next]# dmesg -c
> [ 387.284490] i40e 0000:02:00.0: header: 5 reported 5 total
> [ 387.289904] i40e 0000:02:00.0: type=19 seid=394 uplink=162 downlink=16
> [ 387.296446] i40e 0000:02:00.0: type=17 seid=162 uplink=0 downlink=0
> [ 387.302708] i40e 0000:02:00.0: type=19 seid=392 uplink=160 downlink=16
> [ 387.309234] i40e 0000:02:00.0: type=17 seid=160 uplink=2 downlink=0
> [ 387.315500] i40e 0000:02:00.0: type=19 seid=390 uplink=160 downlink=16
>
> 4) Try to delete the VEB
> [root@host net-next]# echo del relay 162 > $CMD
> [root@host net-next]# dmesg -c
> [ 428.749297] i40e 0000:02:00.0: deleting relay 162
> [ 428.754011] i40e 0000:02:00.0: can't remove VEB 162 with 1 VSIs left
>
> 5) Do PF reset and check switch status after rebuild
> [root@host net-next]# echo pfr > $CMD
> [root@host net-next]# echo dump switch > $CMD
> [root@host net-next]# dmesg -c
> [ 738.056172] i40e 0000:02:00.0: header: 5 reported 5 total
> [ 738.061577] i40e 0000:02:00.0: type=19 seid=394 uplink=162 downlink=16
> [ 738.068104] i40e 0000:02:00.0: type=17 seid=162 uplink=0 downlink=0
> [ 738.074367] i40e 0000:02:00.0: type=19 seid=392 uplink=160 downlink=16
> [ 738.080892] i40e 0000:02:00.0: type=17 seid=160 uplink=2 downlink=0
> [ 738.087160] i40e 0000:02:00.0: type=19 seid=390 uplink=160 downlink=16
>
> 6) Delete VSI and delete VEB
> [root@host net-next]# echo del vsi 394 > $CMD
> [root@host net-next]# echo del relay 162 > $CMD
> [root@host net-next]# echo dump switch > $CMD
> [root@host net-next]# dmesg -c
> [ 1233.081126] i40e 0000:02:00.0: deleting VSI 394
> [ 1239.345139] i40e 0000:02:00.0: deleting relay 162
> [ 1244.886920] i40e 0000:02:00.0: header: 3 reported 3 total
> [ 1244.892328] i40e 0000:02:00.0: type=19 seid=392 uplink=160 downlink=16
> [ 1244.898853] i40e 0000:02:00.0: type=17 seid=160 uplink=2 downlink=0
> [ 1244.905119] i40e 0000:02:00.0: type=19 seid=390 uplink=160 downlink=16
>
> Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2023-12-03 16:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-24 15:03 [PATCH iwl-next v5 0/5] i40e: Simplify VSI and VEB handling Ivan Vecera
2023-11-24 15:03 ` [PATCH v5 1/5] i40e: Use existing helper to find flow director VSI Ivan Vecera
2023-11-30 5:23 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-12-03 11:41 ` Simon Horman
2023-11-24 15:03 ` [PATCH v5 2/5] i40e: Introduce and use macros for iterating VSIs and VEBs Ivan Vecera
2023-11-30 5:23 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-12-03 11:41 ` Simon Horman
2023-11-24 15:03 ` [PATCH v5 3/5] i40e: Add helpers to find VSI and VEB by SEID and use them Ivan Vecera
2023-11-30 5:23 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-12-03 11:41 ` Simon Horman
2023-11-24 15:03 ` [PATCH v5 4/5] i40e: Fix broken support for floating VEBs Ivan Vecera
2023-11-27 8:43 ` Dan Carpenter
2023-11-29 8:38 ` Ivan Vecera
2023-11-30 5:23 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-12-03 16:22 ` Simon Horman [this message]
2023-11-24 15:03 ` [PATCH v5 5/5] i40e: Remove VEB recursion Ivan Vecera
2023-11-30 5:23 ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2023-12-03 16:22 ` Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231203162220.GI50400@kernel.org \
--to=horms@kernel.org \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=ivecera@redhat.com \
--cc=jacob.e.keller@intel.com \
--cc=jesse.brandeburg@intel.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mschmidt@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=wojciech.drewek@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox