linux/drivers/net/ethernet/intel
Mateusz Palczewski 87dba256c7 iavf: refactor processing of VLAN V2 capability message
In order to handle the capability exchange necessary for
VIRTCHNL_VF_OFFLOAD_VLAN_V2, the driver must send
a VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS message. This must occur prior to
__IAVF_CONFIG_ADAPTER, and the driver must wait for the response from
the PF.

To handle this, the __IAVF_INIT_GET_OFFLOAD_VLAN_V2_CAPS state was
introduced. This state is intended to process the response from the VLAN
V2 caps message. This works ok, but is difficult to extend to adding
more extended capability exchange.

Existing (and future) AVF features are relying more and more on these
sort of extended ops for processing additional capabilities. Just like
VLAN V2, this exchange must happen prior to __IAVF_CONFIG_ADPATER.

Since we only send one outstanding AQ message at a time during init, it
is not clear where to place this state. Adding more capability specific
states becomes a mess. Instead of having the "previous" state send
a message and then transition into a capability-specific state,
introduce __IAVF_EXTENDED_CAPS state. This state will use a list of
extended_caps that determines what messages to send and receive. As long
as there are extended_caps bits still set, the driver will remain in
this state performing one send or one receive per state machine loop.

Refactor the VLAN V2 negotiation to use this new state, and remove the
capability-specific state. This makes it significantly easier to add
a new similar capability exchange going forward.

Extended capabilities are processed by having an associated SEND and
RECV extended capability bit. During __IAVF_EXTENDED_CAPS, the
driver checks these bits in order by feature, first the send bit for
a feature, then the recv bit for a feature. Each send flag will call
a function that sends the necessary response, while each receive flag
will wait for the response from the PF. If a given feature can't be
negotiated with the PF, the associated flags will be cleared in
order to skip processing of that feature.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2022-03-01 08:50:11 -08:00
..
e1000 e1000: switch to napi_build_skb() 2021-12-28 09:42:25 -08:00
e1000e Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-03 17:36:16 -08:00
fm10k fm10k: Fix syntax errors in comments 2021-12-21 09:17:47 -08:00
i40e Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-24 17:54:25 -08:00
iavf iavf: refactor processing of VLAN V2 capability message 2022-03-01 08:50:11 -08:00
ice Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-24 17:54:25 -08:00
igb igb: refactor XDP registration 2022-02-07 14:23:01 -08:00
igbvf igbvf: Remove useless DMA-32 fallback configuration 2022-01-27 08:58:24 -08:00
igc igc: avoid kernel warning when changing RX ring parameters 2022-02-07 14:23:01 -08:00
ixgb ixgb: Remove useless DMA-32 fallback configuration 2022-01-27 08:58:23 -08:00
ixgbe ixgbe: Remove non-inclusive language 2022-02-23 09:55:38 -08:00
ixgbevf ixgbevf: clean up some inconsistent indenting 2022-02-23 09:55:38 -08:00
e100.c ethtool: extend ringparam setting/getting API with rx_buf_len 2021-11-22 12:31:49 +00:00
Kconfig ice: support crosstimestamping on E822 devices if supported 2021-12-21 09:11:40 -08:00
Makefile