All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH S53 01/15] virtchnl: Use pad byte in virtchnl_ether_addr to specify MAC type
@ 2020-09-17 20:13 Tony Nguyen
  2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 02/15] ice: Manage VF's MAC address for both legacy and new cases Tony Nguyen
                   ` (13 more replies)
  0 siblings, 14 replies; 25+ messages in thread
From: Tony Nguyen @ 2020-09-17 20:13 UTC (permalink / raw)
  To: intel-wired-lan

From: Brett Creeley <brett.creeley@intel.com>

Currently, there is no way for a VF driver to specify that it wants to
change its device/primary unicast MAC address. This makes it
difficult/impossible for the PF driver to track the VF's device/primary
unicast MAC address, which is used for VM/VF reboot and displaying on
the host. Fix this by using 2 bits of a pad byte in the
virtchnl_ether_addr structure so the VF can specify what type of MAC
it's adding/deleting.

Below are the values that should be used by all VF drivers going
forward.

VIRTCHNL_ETHER_ADDR_LEGACY(0):
	- The type should only ever be 0 for legacy AVF drivers (i.e.
	  drivers that don't support the new type bits). The PF drivers
	  will track VF's device/primary unicast MAC, but this will only
	  be a best effort.

VIRTCHNL_ETHER_ADDR_PRIMARY(1):
	- This type should only be used when the VF is changing their
	  device/primary unicast MAC. It should be used for both delete
	  and add cases related to the device/primary unicast MAC.

VIRTCHNL_ETHER_ADDR_EXTRA(2):
	- This type should be used when the VF is adding and/or deleting
	  MAC addresses that are not the device/primary unicast MAC. For
	  example, extra unicast addresses and multicast addresses
	  assuming the PF supports "extra" addresses at all.

If a PF is parsing the type field of the virtchnl_ether_addr, then it
should use the VIRTCHNL_ETHER_ADDR_TYPE_MASK to mask the first two bits
of the type field since 0, 1, and 2 are the only valid values.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
---
 include/linux/avf/virtchnl.h | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/include/linux/avf/virtchnl.h b/include/linux/avf/virtchnl.h
index 40bad71865ea..e49a063d0f14 100644
--- a/include/linux/avf/virtchnl.h
+++ b/include/linux/avf/virtchnl.h
@@ -403,9 +403,36 @@ VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_queue_select);
  * PF removes the filters and returns status.
  */
 
+/* VIRTCHNL_ETHER_ADDR_LEGACY
+ * Prior to adding the @type member to virtchnl_ether_addr, there were 2 pad
+ * bytes. Moving forward all VF drivers should not set type to
+ * VIRTCHNL_ETHER_ADDR_LEGACY. This is only here to not break previous/legacy
+ * behavior. The control plane function (i.e. PF) can use a best effort method
+ * of tracking the primary/device unicast in this case, but there is no
+ * guarantee and functionality depends on the implementation of the PF.
+ */
+
+/* VIRTCHNL_ETHER_ADDR_PRIMARY
+ * All VF drivers should set @type to VIRTCHNL_ETHER_ADDR_PRIMARY for the
+ * primary/device unicast MAC address filter for VIRTCHNL_OP_ADD_ETH_ADDR and
+ * VIRTCHNL_OP_DEL_ETH_ADDR. This allows for the underlying control plane
+ * function (i.e. PF) to accurately track and use this MAC address for
+ * displaying on the host and for VM/function reset.
+ */
+
+/* VIRTCHNL_ETHER_ADDR_EXTRA
+ * All VF drivers should set @type to VIRTCHNL_ETHER_ADDR_EXTRA for any extra
+ * unicast and/or multicast filters that are being added/deleted via
+ * VIRTCHNL_OP_DEL_ETH_ADDR/VIRTCHNL_OP_ADD_ETH_ADDR respectively.
+ */
 struct virtchnl_ether_addr {
 	u8 addr[ETH_ALEN];
-	u8 pad[2];
+	u8 type;
+#define VIRTCHNL_ETHER_ADDR_LEGACY	0
+#define VIRTCHNL_ETHER_ADDR_PRIMARY	1
+#define VIRTCHNL_ETHER_ADDR_EXTRA	2
+#define VIRTCHNL_ETHER_ADDR_TYPE_MASK	3 /* first two bits of type are valid */
+	u8 pad;
 };
 
 VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_ether_addr);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2021-05-27 17:27 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 20:13 [Intel-wired-lan] [PATCH S53 01/15] virtchnl: Use pad byte in virtchnl_ether_addr to specify MAC type Tony Nguyen
2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 02/15] ice: Manage VF's MAC address for both legacy and new cases Tony Nguyen
2021-05-27 15:22   ` Jankowski, Konrad0
2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 03/15] ice: Save VF's MAC across reboot Tony Nguyen
2021-05-27 17:27   ` Jankowski, Konrad0
2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 04/15] ice: log message when trusted VF goes in/out of promisc mode Tony Nguyen
2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 05/15] ice: Set trusted VF as default VSI when setting allmulti on Tony Nguyen
2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 06/15] ice: Account for port VLAN in VF max packet size calculation Tony Nguyen
2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 07/15] ice: implement new LLDP filter command Tony Nguyen
2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 08/15] ice: don't always return an error for Get PHY Abilities AQ command Tony Nguyen
2020-10-12 21:38   ` Brown, Aaron F
2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 09/15] ice: Enable Support for FW Override (E82X) Tony Nguyen
2020-10-12 21:28   ` Brown, Aaron F
2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 10/15] ice: Remove gate to OROM init Tony Nguyen
2020-10-12 21:21   ` Brown, Aaron F
2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 11/15] ice: Remove vlan_ena from vsi structure Tony Nguyen
2020-10-12 21:16   ` Brown, Aaron F
2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 12/15] ice: cleanup misleading comment Tony Nguyen
2020-10-12 20:53   ` Brown, Aaron F
2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 13/15] ice: silence static analysis warning Tony Nguyen
2020-10-12 20:49   ` Brown, Aaron F
2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 14/15] ice: join format strings to same line as ice_debug Tony Nguyen
2020-10-12 20:46   ` Brown, Aaron F
2020-09-17 20:13 ` [Intel-wired-lan] [PATCH S53 15/15] ice: Add space to unknown speed Tony Nguyen
2020-10-12 20:40   ` Brown, Aaron F

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.