]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
i40e/i40evf: restrict VC opcodes to their initial values
authorNicholas Nunley <nicholas.d.nunley@intel.com>
Sat, 24 Jan 2015 09:58:37 +0000 (09:58 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 24 Feb 2015 01:11:56 +0000 (17:11 -0800)
Until the time a more robust versioning scheme is needed/implemented all
established virtual channel opcode values should remain consistent between
updates to the opcode enum.

This patch repositions I40E_VIRTCHNL_OP_CONFIG_RSS to the end of the enum. In
its current position this opcode displaces the initial value of
I40E_VIRTCHNL_OP_EVENT and will cause PF/VF compatibility issues.

Going forward the expectation is either:
a) All future opcode additions will be added as the last element of the
enum. Once VF drivers start making use of the new commands the virtual
channel version will need to be incremented and drivers will need to
implement a simple version check whereby VF drivers can only load on
PFs with a >= version.
b) or, if needed, design and implement a more complicated API
negotiation capability.

In either case PF drivers should always maintain backwards compatibility with
earlier VF driver versions.

Change-ID: Ie245daa09a231b6680ed793d648bdcc76caefe58
Signed-off-by: Nicholas Nunley <nicholas.d.nunley@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_virtchnl.h
drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h

index 61dd1b18762476fd34312c2eafced083c2c86bfb..2d20af290fbf20bc9fc0dbdc88486fea61ec978f 100644 (file)
  * of the virtchnl_msg structure.
  */
 enum i40e_virtchnl_ops {
-/* VF sends req. to pf for the following
- * ops.
+/* The PF sends status change events to VFs using
+ * the I40E_VIRTCHNL_OP_EVENT opcode.
+ * VFs send requests to the PF using the other ops.
  */
        I40E_VIRTCHNL_OP_UNKNOWN = 0,
        I40E_VIRTCHNL_OP_VERSION = 1, /* must ALWAYS be 1 */
-       I40E_VIRTCHNL_OP_RESET_VF,
-       I40E_VIRTCHNL_OP_GET_VF_RESOURCES,
-       I40E_VIRTCHNL_OP_CONFIG_TX_QUEUE,
-       I40E_VIRTCHNL_OP_CONFIG_RX_QUEUE,
-       I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES,
-       I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP,
-       I40E_VIRTCHNL_OP_ENABLE_QUEUES,
-       I40E_VIRTCHNL_OP_DISABLE_QUEUES,
-       I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS,
-       I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS,
-       I40E_VIRTCHNL_OP_ADD_VLAN,
-       I40E_VIRTCHNL_OP_DEL_VLAN,
-       I40E_VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE,
-       I40E_VIRTCHNL_OP_GET_STATS,
-       I40E_VIRTCHNL_OP_FCOE,
-       I40E_VIRTCHNL_OP_CONFIG_RSS,
-/* PF sends status change events to vfs using
- * the following op.
- */
-       I40E_VIRTCHNL_OP_EVENT,
+       I40E_VIRTCHNL_OP_RESET_VF = 2,
+       I40E_VIRTCHNL_OP_GET_VF_RESOURCES = 3,
+       I40E_VIRTCHNL_OP_CONFIG_TX_QUEUE = 4,
+       I40E_VIRTCHNL_OP_CONFIG_RX_QUEUE = 5,
+       I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES = 6,
+       I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP = 7,
+       I40E_VIRTCHNL_OP_ENABLE_QUEUES = 8,
+       I40E_VIRTCHNL_OP_DISABLE_QUEUES = 9,
+       I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS = 10,
+       I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS = 11,
+       I40E_VIRTCHNL_OP_ADD_VLAN = 12,
+       I40E_VIRTCHNL_OP_DEL_VLAN = 13,
+       I40E_VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE = 14,
+       I40E_VIRTCHNL_OP_GET_STATS = 15,
+       I40E_VIRTCHNL_OP_FCOE = 16,
+       I40E_VIRTCHNL_OP_EVENT = 17,
+       I40E_VIRTCHNL_OP_CONFIG_RSS = 18,
 };
 
 /* Virtual channel message descriptor. This overlays the admin queue
index e0c8208138f4e45171bf47863b225e53dd994b27..59f62f0e65dd3ecaf230d2aa433452cc68bfa8d2 100644 (file)
  * of the virtchnl_msg structure.
  */
 enum i40e_virtchnl_ops {
-/* VF sends req. to pf for the following
- * ops.
+/* The PF sends status change events to VFs using
+ * the I40E_VIRTCHNL_OP_EVENT opcode.
+ * VFs send requests to the PF using the other ops.
  */
        I40E_VIRTCHNL_OP_UNKNOWN = 0,
        I40E_VIRTCHNL_OP_VERSION = 1, /* must ALWAYS be 1 */
-       I40E_VIRTCHNL_OP_RESET_VF,
-       I40E_VIRTCHNL_OP_GET_VF_RESOURCES,
-       I40E_VIRTCHNL_OP_CONFIG_TX_QUEUE,
-       I40E_VIRTCHNL_OP_CONFIG_RX_QUEUE,
-       I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES,
-       I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP,
-       I40E_VIRTCHNL_OP_ENABLE_QUEUES,
-       I40E_VIRTCHNL_OP_DISABLE_QUEUES,
-       I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS,
-       I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS,
-       I40E_VIRTCHNL_OP_ADD_VLAN,
-       I40E_VIRTCHNL_OP_DEL_VLAN,
-       I40E_VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE,
-       I40E_VIRTCHNL_OP_GET_STATS,
-       I40E_VIRTCHNL_OP_FCOE,
-       I40E_VIRTCHNL_OP_CONFIG_RSS,
-/* PF sends status change events to vfs using
- * the following op.
- */
-       I40E_VIRTCHNL_OP_EVENT,
+       I40E_VIRTCHNL_OP_RESET_VF = 2,
+       I40E_VIRTCHNL_OP_GET_VF_RESOURCES = 3,
+       I40E_VIRTCHNL_OP_CONFIG_TX_QUEUE = 4,
+       I40E_VIRTCHNL_OP_CONFIG_RX_QUEUE = 5,
+       I40E_VIRTCHNL_OP_CONFIG_VSI_QUEUES = 6,
+       I40E_VIRTCHNL_OP_CONFIG_IRQ_MAP = 7,
+       I40E_VIRTCHNL_OP_ENABLE_QUEUES = 8,
+       I40E_VIRTCHNL_OP_DISABLE_QUEUES = 9,
+       I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS = 10,
+       I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS = 11,
+       I40E_VIRTCHNL_OP_ADD_VLAN = 12,
+       I40E_VIRTCHNL_OP_DEL_VLAN = 13,
+       I40E_VIRTCHNL_OP_CONFIG_PROMISCUOUS_MODE = 14,
+       I40E_VIRTCHNL_OP_GET_STATS = 15,
+       I40E_VIRTCHNL_OP_FCOE = 16,
+       I40E_VIRTCHNL_OP_EVENT = 17,
+       I40E_VIRTCHNL_OP_CONFIG_RSS = 18,
 };
 
 /* Virtual channel message descriptor. This overlays the admin queue