i40e/i40evf updates
Subsystems (2)
cover i40e/i40evf updates
Akeem G Abodunrin moves the HW flush to avoid problems in pass-through routines.
Anjali Singhai Jain adds a hook to support trusted VF.
Deepthi Kavalur adds capability to display HW information.
Harshitha Ramamurthy bumps i40e/i40evf from 1.5.2 to 1.5.5.
Jesse Brandeburg moves a stack variable deeper, drops unused tx_ring arguments and makes RX faster via avoiding FCOE.
Kiran Patil defines input set mask constants for RSS, flow director,flex bytes and renames defines for the input set mask.
Mitch Williams adds RSS configuration to the virtual channel.
Shannon Nelson ensures device capabilities do not get printed when not needed, adds code to restrict VF poll mode to only single function mode devices, moves NVM variable out of AQ struct and moves nvm event wait check to nvm code.
drivers/net/ethernet/intel/i40e/i40e_adminq.c | 33 +------------- drivers/net/ethernet/intel/i40e/i40e_adminq.h | 1 - drivers/net/ethernet/intel/i40e/i40e_common.c | 3 ++ drivers/net/ethernet/intel/i40e/i40e_main.c | 4 +- drivers/net/ethernet/intel/i40e/i40e_nvm.c | 43 +++++++++++++++--- drivers/net/ethernet/intel/i40e/i40e_prototype.h | 1 + drivers/net/ethernet/intel/i40e/i40e_txrx.c | 17 ++++--- drivers/net/ethernet/intel/i40e/i40e_txrx.h | 10 ++++ drivers/net/ethernet/intel/i40e/i40e_type.h | 30 ++++++++++++ drivers/net/ethernet/intel/i40e/i40e_virtchnl.h | 45 ++++++++++++++++-- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 53 +++++++++++++++++++++- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 2 + drivers/net/ethernet/intel/i40evf/i40e_adminq.h | 1 - drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 13 +++--- drivers/net/ethernet/intel/i40evf/i40e_txrx.h | 10 ++++ drivers/net/ethernet/intel/i40evf/i40e_type.h | 30 ++++++++++++ drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h | 45 ++++++++++++++++-- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +- 18 files changed, 281 insertions(+), 62 deletions(-)
Signature · 1 line
2.4.3
PATCH 1/14 i40e: Inserting a HW capability display info
From: Deepthi Kavalur <[email protected]>
Display MSIx vector count for HW capabilities.
--- drivers/net/ethernet/intel/i40e/i40e_common.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_common.c +3 -0
@@ -3080,6 +3080,9 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,break ;case I40E_AQ_CAP_ID_MSIX : p->num_msix_vectors = number; +i40e_debug (hw,I40E_DEBUG_INIT , +"HW Capability: MSIX vector count = %d\n" , + p->num_msix_vectors);break ;case I40E_AQ_CAP_ID_VF_MSIX : p->num_msix_vectors_vf = number;
Signature · 1 line
2.4.3
PATCH 2/14 i40e: Leave debug_mask cleared at init
In reply to Harshitha RamamurthyFrom: Shannon Nelson <[email protected]>
Don't set our internal debug_mask at startup unless we get specific signal to from the debug module parameter.
This should take care of the issue with all the device capabilities getting printed even when we hadn't asked for the debug info.
---
Testing Hints:
Force a PFR and see that the extra debug message don't show up
enable debug with
ethtool -i <ethX> msglvl 0xf0000001
then force a PFR, and see that the debug message *do* show up
disable debug with
ethtool -i <ethX> msglvl 0xf0000000
then force a PFR, and see that the debug message do *not* show up
drivers/net/ethernet/intel/i40e/i40e_main.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +0 -1
@@ -8379,7 +8379,6 @@ static int i40e_sw_init(struct i40e_pf *pf) pf->msg_enable =netif_msg_init (I40E_DEFAULT_MSG_ENABLE , (NETIF_MSG_DRV |NETIF_MSG_PROBE |NETIF_MSG_LINK )); - pf->hw.debug_mask = pf->msg_enable |I40E_DEBUG_DIAG ;if (debug !=-1 && debug !=I40E_DEFAULT_MSG_ENABLE ) {if (I40E_DEBUG_USER & debug) pf->hw.debug_mask = debug;
Signature · 1 line
2.4.3
PATCH 3/14 i40e: Move HW flush
In reply to Harshitha RamamurthyFrom: Akeem G Abodunrin <[email protected]>
This patch moves the HW flush routine to the end of the reset flow, after the completion of writing to the device VFLR registers- the benefit is to avoid problems in the passthrough routines.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +1 -0
@@ -811,6 +811,7 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr) reg_idx = (hw->func_caps.vf_base_id + vf->vf_id) /32 ; bit_idx = (hw->func_caps.vf_base_id + vf->vf_id) %32 ;wr32 (hw,I40E_GLGEN_VFLRSTAT (reg_idx),BIT (bit_idx)); +i40e_flush (hw);if (i40e_quiesce_vf_pci (vf)) dev_err(&pf->pdev->dev, "VF %d PCI transactions stuck\n",
Signature · 1 line
2.4.3
PATCH 4/14 i40e/i40evf: Move stack var deeper
In reply to Harshitha RamamurthyFrom: Jesse Brandeburg <[email protected]>
A local variable could move down inside the context where it is used.
---
Testing Hints : Compile test, no functional change.
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 ++- drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +2 -1
@@ -2408,7 +2408,7 @@ static int i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,unsigned char *hdr; } l4;unsigned char *exthdr; -u32 offset, cmd =0 , tunnel =0 ; +u32 offset, cmd =0 ;__be16 frag_off;u8 l4_proto =0 ;
@@ -2422,6 +2422,7 @@ static int i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags, offset = ((ip.hdr - skb->data) /2 ) <<I40E_TX_DESC_LENGTH_MACLEN_SHIFT ;if (skb->encapsulation) { +u32 tunnel =0 ;/* define outer network header type */ if (*tx_flags &I40E_TX_FLAGS_IPV4 ) { tunnel |= (*tx_flags & I40E_TX_FLAGS_TSO) ?
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +2 -1
@@ -1633,7 +1633,7 @@ static int i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,unsigned char *hdr; } l4;unsigned char *exthdr; -u32 offset, cmd =0 , tunnel =0 ; +u32 offset, cmd =0 ;__be16 frag_off;u8 l4_proto =0 ;
@@ -1647,6 +1647,7 @@ static int i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags, offset = ((ip.hdr - skb->data) /2 ) <<I40E_TX_DESC_LENGTH_MACLEN_SHIFT ;if (skb->encapsulation) { +u32 tunnel =0 ;/* define outer network header type */ if (*tx_flags &I40E_TX_FLAGS_IPV4 ) { tunnel |= (*tx_flags & I40E_TX_FLAGS_TSO) ?
Signature · 1 line
2.4.3
PATCH 5/14 i40e/i40evf: Drop unused tx_ring argument
In reply to Harshitha RamamurthyFrom: Jesse Brandeburg <[email protected]>
Some of the tx_ring arguments can be deleted since they are not used.
---
Testing Hints: Compile test, no functional change.
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 6 ++---- drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +2 -4
@@ -2252,15 +2252,13 @@ out:/** * i40e_tso - set up the tso context descriptor -* @tx_ring: ptr to the ring to send * @skb: ptr to the skb we're sending * @hdr_len: ptr to the size of the packet header * @cd_type_cmd_tso_mss: Quad Word 1 * * Returns 0 if no TSO can happen, 1 if tso is going, or error **/ -static int i40e_tso (struct i40e_ring *tx_ring,struct sk_buff *skb, -u8 *hdr_len,u64 *cd_type_cmd_tso_mss) +static int i40e_tso (struct sk_buff *skb,u8 *hdr_len,u64 *cd_type_cmd_tso_mss) {u64 cd_cmd, cd_tso_len, cd_mss;union {
@@ -2932,7 +2930,7 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,else if (protocol ==htons (ETH_P_IPV6 )) tx_flags |=I40E_TX_FLAGS_IPV6 ; - tso =i40e_tso (tx_ring, skb, &hdr_len, &cd_type_cmd_tso_mss); + tso =i40e_tso (skb, &hdr_len, &cd_type_cmd_tso_mss);if (tso <0 ) goto out_drop;
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +2 -4
@@ -1519,15 +1519,13 @@ out:/** * i40e_tso - set up the tso context descriptor -* @tx_ring: ptr to the ring to send * @skb: ptr to the skb we're sending * @hdr_len: ptr to the size of the packet header * @cd_type_cmd_tso_mss: Quad Word 1 * * Returns 0 if no TSO can happen, 1 if tso is going, or error **/ -static int i40e_tso (struct i40e_ring *tx_ring,struct sk_buff *skb, -u8 *hdr_len,u64 *cd_type_cmd_tso_mss) +static int i40e_tso (struct sk_buff *skb,u8 *hdr_len,u64 *cd_type_cmd_tso_mss) {u64 cd_cmd, cd_tso_len, cd_mss;union {
@@ -2150,7 +2148,7 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,else if (protocol ==htons (ETH_P_IPV6 )) tx_flags |=I40E_TX_FLAGS_IPV6 ; - tso =i40e_tso (tx_ring, skb, &hdr_len, &cd_type_cmd_tso_mss); + tso =i40e_tso (skb, &hdr_len, &cd_type_cmd_tso_mss);if (tso <0 ) goto out_drop;
Signature · 1 line
2.4.3
PATCH 6/14 i40e/i40evf: Faster RX via avoiding fcoe
In reply to Harshitha RamamurthyFrom: Jesse Brandeburg <[email protected]>
As it turns out, calling into other files from hot path hurts performance a lot. In this case the majority of the time we call "check fcoe" and the packet is *not* fcoe, but this call was taking 5% of our total cycles spent on receive.
---
Testing Hints: Make sure rx still works, and that perf top doesn't show i40e_handle_fcoe_status.
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 8 ++++++-- drivers/net/ethernet/intel/i40e/i40e_txrx.h | 10 ++++++++++ drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 4 +++- drivers/net/ethernet/intel/i40evf/i40e_txrx.h | 10 ++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +6 -2
@@ -1703,7 +1703,9 @@ static int i40e_clean_rx_irq_ps(struct i40e_ring *rx_ring, const int budget) ?le16_to_cpu (rx_desc->wb.qword0.lo_dword.l2tag1) :0 ;#ifdef I40E_FCOE -if (!i40e_fcoe_handle_offload (rx_ring, rx_desc, skb)) { +if (unlikely ( +i40e_rx_is_fcoe (rx_ptype) && + !i40e_fcoe_handle_offload (rx_ring, rx_desc, skb))) {dev_kfree_skb_any (skb);continue ; }
@@ -1834,7 +1836,9 @@ static int i40e_clean_rx_irq_1buf(struct i40e_ring *rx_ring, int budget) ?le16_to_cpu (rx_desc->wb.qword0.lo_dword.l2tag1) :0 ;#ifdef I40E_FCOE -if (!i40e_fcoe_handle_offload (rx_ring, rx_desc, skb)) { +if (unlikely ( +i40e_rx_is_fcoe (rx_ptype) && + !i40e_fcoe_handle_offload (rx_ring, rx_desc, skb))) {dev_kfree_skb_any (skb);continue ; }
drivers/net/ethernet/intel/i40e/i40e_txrx.h +10 -0
@@ -448,4 +448,14 @@ static inline bool i40e_chk_linearize(struct sk_buff *skb, int count) return __i40e_chk_linearize(skb); } + +/** +* i40e_rx_is_fcoe - returns true if the rx packet type is FCoE +* @ptype: the packet type field from rx descriptor write-back +**/ +static inline bool i40e_rx_is_fcoe (u16 ptype) +{ +return (ptype >=I40E_RX_PTYPE_L2_FCOE_PAY3 ) && + (ptype <=I40E_RX_PTYPE_L2_FCOE_VFT_FCOTHER ); +}#endif /* _I40E_TXRX_H_ */
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +3 -1
@@ -1160,7 +1160,9 @@ static int i40e_clean_rx_irq_ps(struct i40e_ring *rx_ring, const int budget) ?le16_to_cpu (rx_desc->wb.qword0.lo_dword.l2tag1) :0 ;#ifdef I40E_FCOE -if (!i40e_fcoe_handle_offload (rx_ring, rx_desc, skb)) { +if (unlikely ( +i40e_rx_is_fcoe (rx_ptype) && + !i40e_fcoe_handle_offload (rx_ring, rx_desc, skb))) {dev_kfree_skb_any (skb);continue ; }
drivers/net/ethernet/intel/i40evf/i40e_txrx.h +10 -0
@@ -430,4 +430,14 @@ static inline bool i40e_chk_linearize(struct sk_buff *skb, int count) return __i40evf_chk_linearize(skb); } + +/** +* i40e_rx_is_fcoe - returns true if the rx packet type is FCoE +* @ptype: the packet type field from rx descriptor write-back +**/ +static inline bool i40e_rx_is_fcoe (u16 ptype) +{ +return (ptype >=I40E_RX_PTYPE_L2_FCOE_PAY3 ) && + (ptype <=I40E_RX_PTYPE_L2_FCOE_VFT_FCOTHER ); +}#endif /* _I40E_TXRX_H_ */
Signature · 1 line
2.4.3
PATCH 7/14 i40e: Patch to support trusted VF
In reply to Harshitha RamamurthyFrom: Anjali Singhai Jain <[email protected]>
This patch adds hook to support changing a VF from not-trusted to trusted and vice-versa. Fixed the wrappers and function prototype. Changed the dmesg to reflex the current state better. This patch also disables turning on/off trusted VF in MFP mode.
---
Testing Hints : Test the feature with ip link set dev eth0 vf 1 trust on or ip link set dev eth0 vf 1 trust off.
drivers/net/ethernet/intel/i40e/i40e_main.c | 1 + drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 42 ++++++++++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 2 ++ 3 files changed, 45 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -0
@@ -9004,6 +9004,7 @@ static const struct net_device_ops i40e_netdev_ops = { .ndo_get_vf_config = i40e_ndo_get_vf_config, .ndo_set_vf_link_state = i40e_ndo_set_vf_link_state, .ndo_set_vf_spoofchk = i40e_ndo_set_vf_spoofchk, + .ndo_set_vf_trust = i40e_ndo_set_vf_trust, #if IS_ENABLED(CONFIG_VXLAN) .ndo_add_vxlan_port = i40e_add_vxlan_port, .ndo_del_vxlan_port = i40e_del_vxlan_port,
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +42 -0
45 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +2 -0
@@ -86,6 +86,7 @@ struct i40e_vf {struct i40e_virtchnl_ether_addr default_fcoe_addr;u16 port_vlan_id;bool pf_set_mac;/* The VMM admin set the VF MAC address */ +bool trusted;/* VSI indices - actual VSI pointers are maintained in the PF structure * When assigned, these will be non-zero, because VSI 0 is always
@@ -123,6 +124,7 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos);int i40e_ndo_set_vf_bw (struct net_device *netdev,int vf_id,int min_tx_rate,int max_tx_rate); +int i40e_ndo_set_vf_trust (struct net_device *netdev,int vf_id,bool setting);int i40e_ndo_get_vf_config (struct net_device *netdev,int vf_id,struct ifla_vf_info *ivi);int i40e_ndo_set_vf_link_state (struct net_device *netdev,int vf_id,int link);
Signature · 1 line
2.4.3
PATCH 8/14 i40e: Restrict VF poll mode to only single function mode devices
In reply to Harshitha RamamurthyFrom: Shannon Nelson <[email protected]>
The VFs can request their queues to be set up into polling mode, rather than interrupt mode, which works well for supporting things like DPDK, but this should not be available when working in an multi-function support device.
---
Testing Hints:
case 1:
set up a DPDK VF in an NPAR environment
the VF polling request should be failed and a message logged
case 2:
set up a DPDK VF in an SFP environment
the VF polling request should succeed
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +9 -1
@@ -1226,8 +1226,16 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)I40E_VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2 ; } -if (vf->driver_caps &I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING ) +if (vf->driver_caps &I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING ) { +if (pf->flags &I40E_FLAG_MFP_ENABLED ) { +dev_err (&pf->pdev->dev, +"VF %d requested polling mode: this feature is supported only when the device is running in single function per port (SFP) mode\n" , + vf->vf_id); + ret =I40E_ERR_PARAM ; + goto err; + } vfres->vf_offload_flags |=I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING ; + }if (pf->flags &I40E_FLAG_WB_ON_ITR_CAPABLE ) {if (vf->driver_caps &I40E_VIRTCHNL_VF_OFFLOAD_WB_ON_ITR )
Signature · 1 line
2.4.3
PATCH 9/14 i40e: Move NVM variable out of AQ struct
In reply to Harshitha RamamurthyFrom: Shannon Nelson <[email protected]>
The NVM update status info should stay collected together, not spread across different structs.
---
Testing Hints :
Compile code and run an NVM update
drivers/net/ethernet/intel/i40e/i40e_adminq.c | 6 +++--- drivers/net/ethernet/intel/i40e/i40e_adminq.h | 1 - drivers/net/ethernet/intel/i40e/i40e_nvm.c | 12 ++++++------ drivers/net/ethernet/intel/i40e/i40e_type.h | 1 + drivers/net/ethernet/intel/i40evf/i40e_adminq.h | 1 - drivers/net/ethernet/intel/i40evf/i40e_type.h | 1 + 6 files changed, 11 insertions(+), 11 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_adminq.c +3 -3
@@ -624,7 +624,7 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw)/* pre-emptive resource lock release */ i40e_aq_release_resource (hw,I40E_NVM_RESOURCE_ID ,0 ,NULL ); - hw->aq.nvm_release_on_done = false; + hw->nvm_release_on_done = false; hw->nvmupd_state =I40E_NVMUPD_STATE_INIT ; ret_code = i40e_aq_set_hmc_resource_profile(hw,
@@ -1024,9 +1024,9 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw, hw->aq.arq.next_to_use = ntu;if (i40e_is_nvm_update_op (&e->desc)) { -if (hw->aq.nvm_release_on_done) { +if (hw->nvm_release_on_done) {i40e_release_nvm (hw); - hw->aq.nvm_release_on_done = false; + hw->nvm_release_on_done = false; }switch (hw->nvmupd_state) {
drivers/net/ethernet/intel/i40e/i40e_adminq.h +0 -1
@@ -97,7 +97,6 @@ struct i40e_adminq_info {u32 fw_build;/* firmware build number */ u16 api_maj_ver;/* api major version */ u16 api_min_ver;/* api minor version */ -bool nvm_release_on_done;struct mutex asq_mutex;/* Send queue lock */ struct mutex arq_mutex;/* Receive queue lock */
drivers/net/ethernet/intel/i40e/i40e_nvm.c +6 -6
@@ -696,7 +696,7 @@ i40e_status i40e_nvmupd_command(struct i40e_hw *hw,i40e_debug (hw,I40E_DEBUG_NVM ,"%s state %d nvm_release_on_hold %d cmd 0x%08x config 0x%08x offset 0x%08x data_size 0x%08x\n" , i40e_nvm_update_state_str[upd_cmd], hw->nvmupd_state, - hw->aq.nvm_release_on_done, + hw->nvm_release_on_done, cmd->command, cmd->config, cmd->offset, cmd->data_size);if (upd_cmd ==I40E_NVMUPD_INVALID ) {
@@ -799,7 +799,7 @@ static i40e_status i40e_nvmupd_state_init(struct i40e_hw *hw,if (status) {i40e_release_nvm (hw); }else { - hw->aq.nvm_release_on_done = true; + hw->nvm_release_on_done = true; hw->nvmupd_state =I40E_NVMUPD_STATE_INIT_WAIT ; } }
@@ -815,7 +815,7 @@ static i40e_status i40e_nvmupd_state_init(struct i40e_hw *hw,if (status) {i40e_release_nvm (hw); }else { - hw->aq.nvm_release_on_done = true; + hw->nvm_release_on_done = true; hw->nvmupd_state =I40E_NVMUPD_STATE_INIT_WAIT ; } }
@@ -849,7 +849,7 @@ static i40e_status i40e_nvmupd_state_init(struct i40e_hw *hw, -EIO ;i40e_release_nvm (hw); }else { - hw->aq.nvm_release_on_done = true; + hw->nvm_release_on_done = true; hw->nvmupd_state =I40E_NVMUPD_STATE_INIT_WAIT ; } }
@@ -953,7 +953,7 @@ retry: -EIO ; hw->nvmupd_state =I40E_NVMUPD_STATE_INIT ; }else { - hw->aq.nvm_release_on_done = true; + hw->nvm_release_on_done = true; hw->nvmupd_state =I40E_NVMUPD_STATE_INIT_WAIT ; }break ;
@@ -980,7 +980,7 @@ retry: -EIO ; hw->nvmupd_state =I40E_NVMUPD_STATE_INIT ; }else { - hw->aq.nvm_release_on_done = true; + hw->nvm_release_on_done = true; hw->nvmupd_state =I40E_NVMUPD_STATE_INIT_WAIT ; }break ;
drivers/net/ethernet/intel/i40e/i40e_type.h +1 -0
@@ -548,6 +548,7 @@ struct i40e_hw {enum i40e_nvmupd_state nvmupd_state;struct i40e_aq_desc nvm_wb_desc;struct i40e_virt_mem nvm_buff; +bool nvm_release_on_done;/* HMC info */ struct i40e_hmc_info hmc;/* HMC info struct */
drivers/net/ethernet/intel/i40evf/i40e_adminq.h +0 -1
@@ -97,7 +97,6 @@ struct i40e_adminq_info {u32 fw_build;/* firmware build number */ u16 api_maj_ver;/* api major version */ u16 api_min_ver;/* api minor version */ -bool nvm_release_on_done;struct mutex asq_mutex;/* Send queue lock */ struct mutex arq_mutex;/* Receive queue lock */
drivers/net/ethernet/intel/i40evf/i40e_type.h +1 -0
@@ -522,6 +522,7 @@ struct i40e_hw {enum i40e_nvmupd_state nvmupd_state;struct i40e_aq_desc nvm_wb_desc;struct i40e_virt_mem nvm_buff; +bool nvm_release_on_done;/* HMC info */ struct i40e_hmc_info hmc;/* HMC info struct */
Signature · 1 line
2.4.3
PATCH 10/14 i40e: Add RSS configuration to virtual channel
In reply to Harshitha RamamurthyFrom: Mitch Williams <[email protected]>
Add opcodes and structures to support RSS configuration by PF driver on behalf of the VF drivers. This reduces complexity in the VF driver and allows us to support future hardware designs without modifying the VF driver.
---
Testing Hints : Compile code and make sure there are no warnings. There's no actual code here.
drivers/net/ethernet/intel/i40e/i40e_virtchnl.h | 45 +++++++++++++++++++++-- drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h | 45 +++++++++++++++++++++-- 2 files changed, 84 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl.h +42 -3
@@ -80,7 +80,12 @@ enum i40e_virtchnl_ops {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_EVENT =17 ,/* must ALWAYS be 17 */ +I40E_VIRTCHNL_OP_CONFIG_RSS_KEY =23 , +I40E_VIRTCHNL_OP_CONFIG_RSS_LUT =24 , +I40E_VIRTCHNL_OP_GET_RSS_HENA_CAPS =25 , + I40E_VIRTCHNL_OP_SET_RSS_HENA = 26, + };/* Virtual channel message descriptor. This overlays the admin queue
@@ -154,6 +159,7 @@ struct i40e_virtchnl_vsi_resource {#define I40E_VIRTCHNL_VF_OFFLOAD_VLAN 0x00010000#define I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING 0x00020000#define I40E_VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2 0x00040000 +#define I40E_VIRTCHNL_VF_OFFLOAD_RSS_PF 0X00080000struct i40e_virtchnl_vf_resource {u16 num_vsis;
@@ -162,8 +168,8 @@ struct i40e_virtchnl_vf_resource {u16 max_mtu;u32 vf_offload_flags; -u32 max_fcoe_contexts; -u32 max_fcoe_filters; +u32 rss_key_size; +u32 rss_lut_size;struct i40e_virtchnl_vsi_resource vsi_res[1 ]; };
@@ -322,6 +328,39 @@ struct i40e_virtchnl_promisc_info {* PF replies with struct i40e_eth_stats in an external buffer. */ +/* I40E_VIRTCHNL_OP_CONFIG_RSS_KEY +* I40E_VIRTCHNL_OP_CONFIG_RSS_LUT +* VF sends these messages to configure RSS. Only supported if both PF +* and VF drivers set the I40E_VIRTCHNL_VF_OFFLOAD_RSS_PF bit during +* configuration negotiation. If this is the case, then the rss fields in +* the vf resource struct are valid. +* Both the key and LUT are initialized to 0 by the PF, meaning that +* RSS is effectively disabled until set up by the VF. +*/ +struct i40e_virtchnl_rss_key { +u16 vsi_id; +u16 key_len; +u8 key[1 ];/* RSS hash key, packed bytes */ +}; + +struct i40e_virtchnl_rss_lut { +u16 vsi_id; +u16 lut_entries; +u8 lut[1 ];/* RSS lookup table*/ +}; + +/* I40E_VIRTCHNL_OP_GET_RSS_HENA_CAPS +* I40E_VIRTCHNL_OP_SET_RSS_HENA +* VF sends these messages to get and set the hash filter enable bits for RSS. +* By default, the PF sets these to all possible traffic types that the +* hardware supports. The VF can query this value if it wants to change the +* traffic types that are hashed by the hardware. +* Traffic types are defined in the i40e_filter_pctype enum in i40e_type.h +*/ +struct i40e_virtchnl_rss_hena { +u64 hena; +}; +/* I40E_VIRTCHNL_OP_EVENT * PF sends this message to inform the VF driver of events that may affect it. * No direct response is expected from the VF, though it may generate other
drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h +42 -3
69 lines not on this page · raw message
Signature · 1 line
2.4.3
PATCH 11/14 i40e: Move NVM event wait check to NVM code
In reply to Harshitha RamamurthyFrom: Shannon Nelson <[email protected]>
The logic that checks AQ events for NVM done events is better kept in nvm.c with the rest of the nvmupdate handling code.
---
Testing Hints:
Compile code and run nvmupdate
drivers/net/ethernet/intel/i40e/i40e_adminq.c | 31 +----------------------- drivers/net/ethernet/intel/i40e/i40e_nvm.c | 31 ++++++++++++++++++++++++ drivers/net/ethernet/intel/i40e/i40e_prototype.h | 1 + 3 files changed, 33 insertions(+), 30 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_adminq.c +1 -30
@@ -33,16 +33,6 @@static void i40e_resume_aq (struct i40e_hw *hw);/** -* i40e_is_nvm_update_op - return true if this is an NVM update operation -* @desc: API request descriptor -**/ -static inline bool i40e_is_nvm_update_op (struct i40e_aq_desc *desc) -{ -return (desc->opcode ==cpu_to_le16 (i40e_aqc_opc_nvm_erase)) || - (desc->opcode ==cpu_to_le16 (i40e_aqc_opc_nvm_update)); -} - -/** * i40e_adminq_init_regs - Initialize AdminQ registers * @hw: pointer to the hardware structure *
@@ -1023,26 +1013,7 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw, hw->aq.arq.next_to_clean = ntc; hw->aq.arq.next_to_use = ntu; -if (i40e_is_nvm_update_op (&e->desc)) { -if (hw->nvm_release_on_done) { -i40e_release_nvm (hw); - hw->nvm_release_on_done = false; - } - -switch (hw->nvmupd_state) { -case I40E_NVMUPD_STATE_INIT_WAIT : - hw->nvmupd_state =I40E_NVMUPD_STATE_INIT ; -break ; - -case I40E_NVMUPD_STATE_WRITE_WAIT : - hw->nvmupd_state =I40E_NVMUPD_STATE_WRITING ; -break ; - -default : -break ; - } - } - +i40e_nvmupd_check_wait_event (hw,le16_to_cpu (e->desc.opcode)); clean_arq_element_out:/* Set pending if needed, unlock and return */ if (pending)
drivers/net/ethernet/intel/i40e/i40e_nvm.c +31 -0
@@ -1030,6 +1030,37 @@ retry: }/** +* i40e_nvmupd_check_wait_event - handle NVM update operation events +* @hw: pointer to the hardware structure +* @opcode: the event that just happened +**/ +void i40e_nvmupd_check_wait_event (struct i40e_hw *hw,u16 opcode) +{ +if (opcode == i40e_aqc_opc_nvm_erase || + opcode == i40e_aqc_opc_nvm_update) { +i40e_debug (hw,I40E_DEBUG_NVM , +"NVMUPD: clearing wait on opcode 0x%04x\n" , opcode); +if (hw->nvm_release_on_done) { +i40e_release_nvm (hw); + hw->nvm_release_on_done = false; + } + +switch (hw->nvmupd_state) { +case I40E_NVMUPD_STATE_INIT_WAIT : + hw->nvmupd_state =I40E_NVMUPD_STATE_INIT ; +break ; + +case I40E_NVMUPD_STATE_WRITE_WAIT : + hw->nvmupd_state =I40E_NVMUPD_STATE_WRITING ; +break ; + +default : +break ; + } + } +} + +/** * i40e_nvmupd_validate_command - Validate given command * @hw: pointer to hardware structure * @cmd: pointer to nvm update command buffer
drivers/net/ethernet/intel/i40e/i40e_prototype.h +1 -0
@@ -308,6 +308,7 @@ i40e_status i40e_validate_nvm_checksum(struct i40e_hw *hw,i40e_status i40e_nvmupd_command (struct i40e_hw *hw,struct i40e_nvm_access *cmd,u8 *bytes,int *); +void i40e_nvmupd_check_wait_event (struct i40e_hw *hw,u16 opcode);void i40e_set_pci_config_data (struct i40e_hw *hw,u16 link_status);extern struct i40e_rx_ptype_decoded i40e_ptype_lookup[];
Signature · 1 line
2.4.3
PATCH 12/14 i40e: Input set mask constants for RSS, flow director, and flex bytes
In reply to Harshitha RamamurthyFrom: Kiran Patil <[email protected]>
Defines for input set mask (RSS, flow director, flex payload)
---
Testing Hints: This patch applies and compiles
cleanly. Preparation patch for implementing features such as changing input set mask for RSS, and flow director.
drivers/net/ethernet/intel/i40e/i40e_type.h | 42 +++++++++++++++++++++++++++ drivers/net/ethernet/intel/i40evf/i40e_type.h | 42 +++++++++++++++++++++++++++ 2 files changed, 84 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_type.h +42 -0
@@ -1533,4 +1533,46 @@ struct i40e_lldp_variables {/* RSS Hash Table Size */ #define I40E_PFQF_CTL_0_HASHLUTSIZE_512 0x00010000 + +/* INPUT SET MASK for RSS, flow director and flexible payload */ +#define I40E_FD_INSET_L3_SRC_SHIFT 47 +#define I40E_FD_INSET_L3_SRC_WORD_MASK (0x3ULL << \ + I40E_FD_INSET_L3_SRC_SHIFT) +#define I40E_FD_INSET_L3_DST_SHIFT 35 +#define I40E_FD_INSET_L3_DST_WORD_MASK (0x3ULL << \ + I40E_FD_INSET_L3_DST_SHIFT) +#define I40E_FD_INSET_L4_SRC_SHIFT 34 +#define I40E_FD_INSET_L4_SRC_WORD_MASK (0x1ULL << \ + I40E_FD_INSET_L4_SRC_SHIFT) +#define I40E_FD_INSET_L4_DST_SHIFT 33 +#define I40E_FD_INSET_L4_DST_WORD_MASK (0x1ULL << \ + I40E_FD_INSET_L4_DST_SHIFT) +#define I40E_FD_INSET_VERIFY_TAG_SHIFT 31 +#define I40E_FD_INSET_VERIFY_TAG_WORD_MASK (0x3ULL << \ + I40E_FD_INSET_VERIFY_TAG_SHIFT) + +#define I40E_FD_INSET_FLEX_WORD50_SHIFT 17 +#define I40E_FD_INSET_FLEX_WORD50_MASK (0x1ULL << \ + I40E_FD_INSET_FLEX_WORD50_SHIFT) +#define I40E_FD_INSET_FLEX_WORD51_SHIFT 16 +#define I40E_FD_INSET_FLEX_WORD51_MASK (0x1ULL << \ + I40E_FD_INSET_FLEX_WORD51_SHIFT) +#define I40E_FD_INSET_FLEX_WORD52_SHIFT 15 +#define I40E_FD_INSET_FLEX_WORD52_MASK (0x1ULL << \ + I40E_FD_INSET_FLEX_WORD52_SHIFT) +#define I40E_FD_INSET_FLEX_WORD53_SHIFT 14 +#define I40E_FD_INSET_FLEX_WORD53_MASK (0x1ULL << \ + I40E_FD_INSET_FLEX_WORD53_SHIFT) +#define I40E_FD_INSET_FLEX_WORD54_SHIFT 13 +#define I40E_FD_INSET_FLEX_WORD54_MASK (0x1ULL << \ + I40E_FD_INSET_FLEX_WORD54_SHIFT) +#define I40E_FD_INSET_FLEX_WORD55_SHIFT 12 +#define I40E_FD_INSET_FLEX_WORD55_MASK (0x1ULL << \ + I40E_FD_INSET_FLEX_WORD55_SHIFT) +#define I40E_FD_INSET_FLEX_WORD56_SHIFT 11 +#define I40E_FD_INSET_FLEX_WORD56_MASK (0x1ULL << \ + I40E_FD_INSET_FLEX_WORD56_SHIFT) +#define I40E_FD_INSET_FLEX_WORD57_SHIFT 10 +#define I40E_FD_INSET_FLEX_WORD57_MASK (0x1ULL << \ + I40E_FD_INSET_FLEX_WORD57_SHIFT)#endif /* _I40E_TYPE_H_ */
drivers/net/ethernet/intel/i40evf/i40e_type.h +42 -0
46 lines not on this page · raw message
Signature · 1 line
2.4.3
PATCH 13/14 i40e: Rename defines for input set mask
In reply to Harshitha RamamurthyFrom: Kiran Patil <[email protected]>
Rename defines related to INPUT set mask (which is meant to be used for both: RSS and flow director).
---
Testing Hints : This patch applies and compiles
cleanly.
drivers/net/ethernet/intel/i40e/i40e_type.h | 69 +++++++++++---------------- drivers/net/ethernet/intel/i40evf/i40e_type.h | 69 +++++++++++---------------- 2 files changed, 56 insertions(+), 82 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_type.h +28 -41
@@ -1534,45 +1534,32 @@ struct i40e_lldp_variables {/* RSS Hash Table Size */ #define I40E_PFQF_CTL_0_HASHLUTSIZE_512 0x00010000 -/* INPUT SET MASK for RSS, flow director and flexible payload */ -#define I40E_FD_INSET_L3_SRC_SHIFT 47 -#define I40E_FD_INSET_L3_SRC_WORD_MASK (0x3ULL << \ - I40E_FD_INSET_L3_SRC_SHIFT) -#define I40E_FD_INSET_L3_DST_SHIFT 35 -#define I40E_FD_INSET_L3_DST_WORD_MASK (0x3ULL << \ - I40E_FD_INSET_L3_DST_SHIFT) -#define I40E_FD_INSET_L4_SRC_SHIFT 34 -#define I40E_FD_INSET_L4_SRC_WORD_MASK (0x1ULL << \ - I40E_FD_INSET_L4_SRC_SHIFT) -#define I40E_FD_INSET_L4_DST_SHIFT 33 -#define I40E_FD_INSET_L4_DST_WORD_MASK (0x1ULL << \ - I40E_FD_INSET_L4_DST_SHIFT) -#define I40E_FD_INSET_VERIFY_TAG_SHIFT 31 -#define I40E_FD_INSET_VERIFY_TAG_WORD_MASK (0x3ULL << \ - I40E_FD_INSET_VERIFY_TAG_SHIFT) - -#define I40E_FD_INSET_FLEX_WORD50_SHIFT 17 -#define I40E_FD_INSET_FLEX_WORD50_MASK (0x1ULL << \ - I40E_FD_INSET_FLEX_WORD50_SHIFT) -#define I40E_FD_INSET_FLEX_WORD51_SHIFT 16 -#define I40E_FD_INSET_FLEX_WORD51_MASK (0x1ULL << \ - I40E_FD_INSET_FLEX_WORD51_SHIFT) -#define I40E_FD_INSET_FLEX_WORD52_SHIFT 15 -#define I40E_FD_INSET_FLEX_WORD52_MASK (0x1ULL << \ - I40E_FD_INSET_FLEX_WORD52_SHIFT) -#define I40E_FD_INSET_FLEX_WORD53_SHIFT 14 -#define I40E_FD_INSET_FLEX_WORD53_MASK (0x1ULL << \ - I40E_FD_INSET_FLEX_WORD53_SHIFT) -#define I40E_FD_INSET_FLEX_WORD54_SHIFT 13 -#define I40E_FD_INSET_FLEX_WORD54_MASK (0x1ULL << \ - I40E_FD_INSET_FLEX_WORD54_SHIFT) -#define I40E_FD_INSET_FLEX_WORD55_SHIFT 12 -#define I40E_FD_INSET_FLEX_WORD55_MASK (0x1ULL << \ - I40E_FD_INSET_FLEX_WORD55_SHIFT) -#define I40E_FD_INSET_FLEX_WORD56_SHIFT 11 -#define I40E_FD_INSET_FLEX_WORD56_MASK (0x1ULL << \ - I40E_FD_INSET_FLEX_WORD56_SHIFT) -#define I40E_FD_INSET_FLEX_WORD57_SHIFT 10 -#define I40E_FD_INSET_FLEX_WORD57_MASK (0x1ULL << \ - I40E_FD_INSET_FLEX_WORD57_SHIFT) +/* INPUT SET MASK for RSS, flow director, and flexible payload */ +#define I40E_L3_SRC_SHIFT 47 +#define I40E_L3_SRC_MASK (0x3ULL << I40E_L3_SRC_SHIFT) +#define I40E_L3_DST_SHIFT 35 +#define I40E_L3_DST_MASK (0x3ULL << I40E_L3_DST_SHIFT) +#define I40E_L4_SRC_SHIFT 34 +#define I40E_L4_SRC_MASK (0x1ULL << I40E_L4_SRC_SHIFT) +#define I40E_L4_DST_SHIFT 33 +#define I40E_L4_DST_MASK (0x1ULL << I40E_L4_DST_SHIFT) +#define I40E_VERIFY_TAG_SHIFT 31 +#define I40E_VERIFY_TAG_MASK (0x3ULL << I40E_VERIFY_TAG_SHIFT) + +#define I40E_FLEX_50_SHIFT 17 +#define I40E_FLEX_50_MASK (0x1ULL << I40E_FLEX_50_SHIFT) +#define I40E_FLEX_51_SHIFT 16 +#define I40E_FLEX_51_MASK (0x1ULL << I40E_FLEX_51_SHIFT) +#define I40E_FLEX_52_SHIFT 15 +#define I40E_FLEX_52_MASK (0x1ULL << I40E_FLEX_52_SHIFT) +#define I40E_FLEX_53_SHIFT 14 +#define I40E_FLEX_53_MASK (0x1ULL << I40E_FLEX_53_SHIFT) +#define I40E_FLEX_54_SHIFT 13 +#define I40E_FLEX_54_MASK (0x1ULL << I40E_FLEX_54_SHIFT) +#define I40E_FLEX_55_SHIFT 12 +#define I40E_FLEX_55_MASK (0x1ULL << I40E_FLEX_55_SHIFT) +#define I40E_FLEX_56_SHIFT 11 +#define I40E_FLEX_56_MASK (0x1ULL << I40E_FLEX_56_SHIFT) +#define I40E_FLEX_57_SHIFT 10 +#define I40E_FLEX_57_MASK (0x1ULL << I40E_FLEX_57_SHIFT)#endif /* _I40E_TYPE_H_ */
drivers/net/ethernet/intel/i40evf/i40e_type.h +28 -41
73 lines not on this page · raw message
Signature · 1 line
2.4.3
PATCH 14/14 i40e/i40evf: Bump patch from 1.5.2 to 1.5.5
In reply to Harshitha Ramamurthy--- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
@@ -46,7 +46,7 @@ static const char i40e_driver_string[] =#define DRV_VERSION_MAJOR 1#define DRV_VERSION_MINOR 5 -#define DRV_VERSION_BUILD 2 +#define DRV_VERSION_BUILD 5#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \ __stringify(DRV_VERSION_MINOR) "." \ __stringify(DRV_VERSION_BUILD) DRV_KERN
drivers/net/ethernet/intel/i40evf/i40evf_main.c +1 -1
@@ -38,7 +38,7 @@ static const char i40evf_driver_string[] =#define DRV_VERSION_MAJOR 1#define DRV_VERSION_MINOR 5 -#define DRV_VERSION_BUILD 2 +#define DRV_VERSION_BUILD 5#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \ __stringify(DRV_VERSION_MINOR) "." \ __stringify(DRV_VERSION_BUILD) \
Signature · 1 line
2.4.3
cover i40e/i40evf updates
In reply to Harshitha RamamurthyQuoted 16 lines · Harshitha Ramamurthy
Akeem G Abodunrin moves the HW flush to avoid problems in pass-through routines.?
Anjali Singhai Jain adds a hook to support trusted VF.
Deepthi Kavalur adds capability to display HW information.
Harshitha Ramamurthy bumps i40e/i40evf from 1.5.2 to 1.5.5.
Jesse Brandeburg moves a stack variable deeper, drops unused?
tx_ringarguments and makes RX faster via avoiding FCOE.Kiran Patil defines input set mask constants for RSS, flow director,flex bytes and renames defines for the input set mask.
Quoted 7 lines
Mitch Williams adds RSS configuration to the virtual channel.
Shannon Nelson ensures device capabilities do not get printed? when not needed, adds code to restrict VF poll mode to only? single function mode devices, moves NVM variable out of AQ? struct and moves nvm event wait check to nvm code.
I am dropping this whole series for the following reasons:
patch 7 does not compile at all
patch 10 does not apply
you request that patch 13 be dropped from the series
Please resolve the three issues above and resubmit v2 please.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20160328/4be1117c/attachment.asc>