From: Karthik Sundaravel <ksundara@redhat.com>
To: jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, intel-wired-lan@lists.osuosl.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: pmenzel@molgen.mpg.de, jiri@resnulli.us,
michal.swiatkowski@linux.intel.com, rjarry@redhat.com,
aharivel@redhat.com, vchundur@redhat.com, ksundara@redhat.com,
cfontain@redhat.com
Subject: [PATCH v2] ice: Add get/set hw address for VFs using devlink commands
Date: Thu, 8 Feb 2024 13:54:54 +0530 [thread overview]
Message-ID: <20240208082455.66726-1-ksundara@redhat.com> (raw)
Thanks for the review comments and suggestions.
In the V2 version of the patch, I have called ice_set_vf_mac() directly from the devlink port function handlers.
I did the following testing to verify the changes.
root@10:~# ethtool -i enp8s0f0np0 | grep bus
bus-info: 0000:08:00.0
root@10:~# devlink dev eswitch set pci/0000:08:00.0 mode switchdev
Warning: ice: Changed eswitch mode to switchdev.
root@10:~# echo 4 > /sys/class/net/enp8s0f0np0/device/sriov_numvfs
root@10:~# devlink port show
pci/0000:08:00.0/0: type eth netdev enp8s0f0np0 flavour physical port 0 splittable true lanes 8
pci/0000:08:00.0/2: type eth netdev enp8s0f0npf0vf0 flavour pcivf controller 0 pfnum 0 vfnum 0 external false splittable false
function:
hw_addr 1a:33:f2:e7:64:d8
pci/0000:08:00.0/3: type eth netdev enp8s0f0npf0vf3 flavour pcivf controller 0 pfnum 0 vfnum 3 external false splittable false
function:
hw_addr 4e:ef:ca:9e:e7:5d
pci/0000:08:00.0/4: type eth netdev enp8s0f0npf0vf1 flavour pcivf controller 0 pfnum 0 vfnum 1 external false splittable false
function:
hw_addr 5a:f0:e3:f8:41:93
pci/0000:08:00.0/5: type eth netdev enp8s0f0npf0vf2 flavour pcivf controller 0 pfnum 0 vfnum 2 external false splittable false
function:
hw_addr 1a:62:c6:4b:d2:f0
pci/0000:08:00.1/0: type eth netdev enp8s0f1np1 flavour physical port 1 splittable false
root@10:~# devlink port function set pci/0000:08:00.0/5 hw_addr 00:11:22:33:44:55
root@10:~# devlink port show
pci/0000:08:00.0/0: type eth netdev enp8s0f0np0 flavour physical port 0 splittable true lanes 8
pci/0000:08:00.0/2: type eth netdev enp8s0f0npf0vf0 flavour pcivf controller 0 pfnum 0 vfnum 0 external false splittable false
function:
hw_addr 1a:33:f2:e7:64:d8
pci/0000:08:00.0/3: type eth netdev enp8s0f0npf0vf3 flavour pcivf controller 0 pfnum 0 vfnum 3 external false splittable false
function:
hw_addr 4e:ef:ca:9e:e7:5d
pci/0000:08:00.0/4: type eth netdev enp8s0f0npf0vf1 flavour pcivf controller 0 pfnum 0 vfnum 1 external false splittable false
function:
hw_addr 5a:f0:e3:f8:41:93
pci/0000:08:00.0/5: type eth netdev enp8s0f0npf0vf2 flavour pcivf controller 0 pfnum 0 vfnum 2 external false splittable false
function:
hw_addr 00:11:22:33:44:55
pci/0000:08:00.1/0: type eth netdev enp8s0f1np1 flavour physical port 1 splittable false
root@10:~# ip link show enp8s0f0np0
12: enp8s0f0np0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 40:a6:b7:18:dd:68 brd ff:ff:ff:ff:ff:ff
vf 0 link/ether 1a:33:f2:e7:64:d8 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state enable, trust off
vf 1 link/ether 5a:f0:e3:f8:41:93 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state enable, trust off
vf 2 link/ether 00:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state enable, trust off
vf 3 link/ether 4e:ef:ca:9e:e7:5d brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state enable, trust off
root@10:~# ip link set dev enp8s0f0np0 vf 2 mac AA:BB:CC:DD:EE:FF
root@10:~# ip link show enp8s0f0np0
12: enp8s0f0np0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 40:a6:b7:18:dd:68 brd ff:ff:ff:ff:ff:ff
vf 0 link/ether 1a:33:f2:e7:64:d8 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state enable, trust off
vf 1 link/ether 5a:f0:e3:f8:41:93 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state enable, trust off
vf 2 link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state enable, trust off
vf 3 link/ether 4e:ef:ca:9e:e7:5d brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state enable, trust off
root@10:~# devlink port show
pci/0000:08:00.0/0: type eth netdev enp8s0f0np0 flavour physical port 0 splittable true lanes 8
pci/0000:08:00.0/2: type eth netdev enp8s0f0npf0vf0 flavour pcivf controller 0 pfnum 0 vfnum 0 external false splittable false
function:
hw_addr 1a:33:f2:e7:64:d8
pci/0000:08:00.0/3: type eth netdev enp8s0f0npf0vf3 flavour pcivf controller 0 pfnum 0 vfnum 3 external false splittable false
function:
hw_addr 4e:ef:ca:9e:e7:5d
pci/0000:08:00.0/4: type eth netdev enp8s0f0npf0vf1 flavour pcivf controller 0 pfnum 0 vfnum 1 external false splittable false
function:
hw_addr 5a:f0:e3:f8:41:93
pci/0000:08:00.0/5: type eth netdev enp8s0f0npf0vf2 flavour pcivf controller 0 pfnum 0 vfnum 2 external false splittable false
function:
hw_addr aa:bb:cc:dd:ee:ff
pci/0000:08:00.1/0: type eth netdev enp8s0f1np1 flavour physical port 1 splittable false
next reply other threads:[~2024-02-08 8:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-08 8:24 Karthik Sundaravel [this message]
2024-02-08 8:24 ` Karthik Sundaravel
2024-02-08 11:26 ` Jiri Pirko
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=20240208082455.66726-1-ksundara@redhat.com \
--to=ksundara@redhat.com \
--cc=aharivel@redhat.com \
--cc=anthony.l.nguyen@intel.com \
--cc=cfontain@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.swiatkowski@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pmenzel@molgen.mpg.de \
--cc=rjarry@redhat.com \
--cc=vchundur@redhat.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
all inboxes | Powered by JetHome®