i40evf: Do not clear MSI-X PBA manually
Subsystems (2)
PATCH 1/9 i40evf: Do not clear MSI-X PBA manually
From: Alexander Duyck <[email protected]>
We should not be clearing the pending bit array for each vector manually. The documentation for the hardware states that when in MSI-X mode the pending bit array wil be cleared automatically. Us clearing it ourselves just results in multiple opportunities for us to drop an interrupt.
--- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +5 -13
@@ -276,8 +276,7 @@ void i40evf_irq_enable_queues(struct i40evf_adapter *adapter, u32 mask)if (mask &BIT (i -1 )) {wr32 (hw,I40E_VFINT_DYN_CTLN1 (i -1 ),I40E_VFINT_DYN_CTLN1_INTENA_MASK | -I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK | -I40E_VFINT_DYN_CTLN1_CLEARPBA_MASK ); +I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK ); } } }
@@ -296,16 +295,14 @@ static void i40evf_fire_sw_int(struct i40evf_adapter *adapter, u32 mask)if (mask &1 ) { dyn_ctl =rd32 (hw,I40E_VFINT_DYN_CTL01 ); dyn_ctl |=I40E_VFINT_DYN_CTLN1_SWINT_TRIG_MASK | -I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK | -I40E_VFINT_DYN_CTLN1_CLEARPBA_MASK ; +I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK ;wr32 (hw,I40E_VFINT_DYN_CTL01 , dyn_ctl); }for (i =1 ; i < adapter->num_msix_vectors; i++) {if (mask &BIT (i)) { dyn_ctl =rd32 (hw,I40E_VFINT_DYN_CTLN1 (i -1 )); dyn_ctl |=I40E_VFINT_DYN_CTLN1_SWINT_TRIG_MASK | -I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK | -I40E_VFINT_DYN_CTLN1_CLEARPBA_MASK ; +I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK ;wr32 (hw,I40E_VFINT_DYN_CTLN1 (i -1 ), dyn_ctl); } }
@@ -337,15 +334,10 @@ static irqreturn_t i40evf_msix_aq(int irq, void *data)struct net_device *netdev = data;struct i40evf_adapter *adapter =netdev_priv (netdev);struct i40e_hw *hw = &adapter->hw; -u32 val;/* handle non-queue interrupts, these reads clear the registers */ - val =rd32 (hw,I40E_VFINT_ICR01 ); - val =rd32 (hw,I40E_VFINT_ICR0_ENA1 ); - - val =rd32 (hw,I40E_VFINT_DYN_CTL01 ) | -I40E_VFINT_DYN_CTL01_CLEARPBA_MASK ; -wr32 (hw,I40E_VFINT_DYN_CTL01 , val); +rd32 (hw,I40E_VFINT_ICR01 ); +rd32 (hw,I40E_VFINT_ICR0_ENA1 );/* schedule work on the private workqueue */ schedule_work (&adapter->adminq_task);
Signature · 1 line
2.9.5
PATCH 2/9 i40evf: Clean-up flags for promisc mode to avoid high polling rate
From: Alexander Duyck <[email protected]>
If you enabled and disabled promiscuous mode on a VF you could easily put it into a state where it would start firing interrupts on all queues at a rate of 50+ interrupts per second even though there was no traffic present. The issue seems to have been a stray admin queue feature flag set that was leaving us in a high polling rate for the adminq task.
--- drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c +4 -2
@@ -739,8 +739,10 @@ void i40evf_set_promiscuous(struct i40evf_adapter *adapter, int flags) }if (!flags) { - adapter->flags &= ~I40EVF_FLAG_PROMISC_ON ; - adapter->aq_required &= ~I40EVF_FLAG_AQ_RELEASE_PROMISC ; + adapter->flags &= ~(I40EVF_FLAG_PROMISC_ON | +I40EVF_FLAG_ALLMULTI_ON ); + adapter->aq_required &= ~(I40EVF_FLAG_AQ_RELEASE_PROMISC | +I40EVF_FLAG_AQ_RELEASE_ALLMULTI );dev_info (&adapter->pdev->dev,"Leaving promiscuous mode\n" ); }
Signature · 1 line
2.9.5
Bowers
PATCH 2/9 i40evf: Clean-up flags for promisc mode to avoid high polling rate
Quoted 17 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Tuesday, November 14, 2017 4:01 AM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S82-V4 2/9] i40evf: Clean-up flags for promisc mode to avoid high polling rateFrom: Alexander Duyck <[email protected]>
If you enabled and disabled promiscuous mode on a VF you could easily put it into a state where it would start firing interrupts on all queues at a rate of 50+ interrupts per second even though there was no traffic present.
The issue seems to have been a stray admin queue feature flag set that was leaving us in a high polling rate for the adminq task.
Quoted 4 lines
Signed-off-by Alexander Duyck <[email protected]>--- drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
PATCH 3/9 i40evf: Drop i40evf_fire_sw_int as it is prone to races
In reply to Alice MichaelFrom: Alexander Duyck <[email protected]>
Having the interrupts firing while we are polling causes extra overhead and isn't needed for most systems out there. If an interrupt is lost us experiencing a 2s latency spike before recovering is still not acceptable and masks the issue. We are better off just identifying systems that lose interrupts and instead enable workarounds for those systems.
To that end I am dropping the code that was strobing the interrupts as there is a narrow window where having them enabled can actually cause race issues anyway where a few stray packets might get misses if the interrupt is re-enabled and fires before we call napi_complete.
Also replace one line where we were using bit 31 instead of the define for the bit to represent masking the interrupt enable bit.
--- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 34 ------------------------- 1 file changed, 34 deletions(-)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +0 -34
@@ -282,33 +282,6 @@ void i40evf_irq_enable_queues(struct i40evf_adapter *adapter, u32 mask) }/** -* i40evf_fire_sw_int - Generate SW interrupt for specified vectors -* @adapter: board private structure -* @mask: bitmap of vectors to trigger -**/ -static void i40evf_fire_sw_int (struct i40evf_adapter *adapter,u32 mask) -{ -struct i40e_hw *hw = &adapter->hw; -int i; -u32 dyn_ctl; - -if (mask &1 ) { - dyn_ctl =rd32 (hw,I40E_VFINT_DYN_CTL01 ); - dyn_ctl |=I40E_VFINT_DYN_CTLN1_SWINT_TRIG_MASK | -I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK ; -wr32 (hw,I40E_VFINT_DYN_CTL01 , dyn_ctl); - } -for (i =1 ; i < adapter->num_msix_vectors; i++) { -if (mask &BIT (i)) { - dyn_ctl =rd32 (hw,I40E_VFINT_DYN_CTLN1 (i -1 )); - dyn_ctl |=I40E_VFINT_DYN_CTLN1_SWINT_TRIG_MASK | -I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK ; -wr32 (hw,I40E_VFINT_DYN_CTLN1 (i -1 ), dyn_ctl); - } - } -} - -/** * i40evf_irq_enable - Enable default interrupt generation settings * @adapter: board private structure * @flush: boolean value whether to run rd32()
@@ -1743,13 +1716,6 @@ static void i40evf_watchdog_task(struct work_struct *work)if (adapter->state == __I40EVF_RUNNING)i40evf_request_stats (adapter); watchdog_done: -if (adapter->state == __I40EVF_RUNNING) { -i40evf_irq_enable_queues (adapter, ~0 ); -i40evf_fire_sw_int (adapter,0xFF ); - }else { -i40evf_fire_sw_int (adapter,0x1 ); - } -clear_bit (__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section); restart_watchdog:if (adapter->state == __I40EVF_REMOVE)
Signature · 1 line
2.9.5
PATCH 3/9 i40evf: Drop i40evf_fire_sw_int as it is prone to races
Quoted 8 lines · Alice Michael
From: Alexander Duyck <[email protected]>
Having the interrupts firing while we are polling causes extra overhead and isn't needed for most systems out there. If an interrupt is lost us experiencing a 2s latency spike before recovering is still not acceptable and masks the issue. We are better off just identifying systems that lose interrupts and instead enable workarounds for those systems.
Quoted 7 lines
To that end I am dropping the code that was strobing the interrupts as there is a narrow window where having them enabled can actually cause race issues anyway where a few stray packets might get misses if the interrupt is re-enabled and fires before we call
napi_complete.Also replace one line where we were using bit 31 instead of the define for the bit to represent masking the interrupt enable bit.
I still don't see a line replaced, only lines removed. I would guess it got stripped out of the upstream code?
sln
Quoted 59 lines
Signed-off-by Alexander Duyck <[email protected]>--- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 34 ------------------------- 1 file changed, 34 deletions(-)drivers/net/ethernet/intel/i40evf/i40evf_main.c +0
-34@@ -282,33 +282,6 @@ void i40evf_irq_enable_queues(struct i40evf_adapter *adapter, u32 mask) }/** -* i40evf_fire_sw_int - Generate SW interrupt for specified vectors -* @adapter: board private structure -* @mask: bitmap of vectors to trigger -**/ -static void i40evf_fire_sw_int (struct i40evf_adapter *adapter,u32 mask) -{ -struct i40e_hw *hw = &adapter->hw; -int i; -u32 dyn_ctl; - -if (mask &1 ) { - dyn_ctl =rd32 (hw,I40E_VFINT_DYN_CTL01 ); - dyn_ctl |=I40E_VFINT_DYN_CTLN1_SWINT_TRIG_MASK | -I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK ; -wr32 (hw,I40E_VFINT_DYN_CTL01 , dyn_ctl); - } -for (i =1 ; i < adapter->num_msix_vectors; i++) { -if (mask &BIT (i)) { - dyn_ctl =rd32 (hw,I40E_VFINT_DYN_CTLN1 (i -1 )); - dyn_ctl |=I40E_VFINT_DYN_CTLN1_SWINT_TRIG_MASK | -I40E_VFINT_DYN_CTLN1_ITR_INDX_MASK ; -wr32 (hw,I40E_VFINT_DYN_CTLN1 (i -1 ), dyn_ctl); - } - } -} - -/** * i40evf_irq_enable - Enable default interrupt generation settings * @adapter: board private structure * @flush: boolean value whether to run rd32() @@ -1743,13 +1716,6 @@ static void i40evf_watchdog_task(struct work_struct *work)if (adapter->state == __I40EVF_RUNNING)i40evf_request_stats (adapter); watchdog_done: -if (adapter->state == __I40EVF_RUNNING) { -i40evf_irq_enable_queues (adapter, ~0 ); -i40evf_fire_sw_int (adapter,0xFF ); - }else { -i40evf_fire_sw_int (adapter,0x1 ); - } -clear_bit (__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section); restart_watchdog:if (adapter->state == __I40EVF_REMOVE)
Bowers
PATCH 3/9 i40evf: Drop i40evf_fire_sw_int as it is prone to races
In reply to Alice MichaelQuoted 22 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Tuesday, November 14, 2017 4:01 AM
To: Michael, Alice <[email protected]>; intel-wired- lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S82-V4 3/9] i40evf: Dropi40evf_fire_sw_intas it is prone to racesFrom: Alexander Duyck <[email protected]>
Having the interrupts firing while we are polling causes extra overhead and isn't needed for most systems out there. If an interrupt is lost us experiencing a 2s latency spike before recovering is still not acceptable and masks the issue. We are better off just identifying systems that lose interrupts and instead enable workarounds for those systems.
To that end I am dropping the code that was strobing the interrupts as there is a narrow window where having them enabled can actually cause race issues anyway where a few stray packets might get misses if the interrupt is re-enabled and fires before we call
napi_complete.
Quoted 7 lines
Also replace one line where we were using bit 31 instead of the define for the bit to represent masking the interrupt enable bit.
Signed-off-by Alexander Duyck <[email protected]>--- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 34 ------------------------- 1 file changed, 34 deletions(-)
PATCH 4/9 i40e: change ppp name to ddp
In reply to Alice MichaelFrom: Jingjing Wu <[email protected]>
PPP name was going to be confusing since PPP already means point to point protocol. It is decided to change pipeline personalization profile(ppp) to dynamic device personalization(ddp).
--- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 10 ++++---- drivers/net/ethernet/intel/i40e/i40e_common.c | 22 ++++++++--------- drivers/net/ethernet/intel/i40e/i40e_prototype.h | 10 ++++---- drivers/net/ethernet/intel/i40e/i40e_type.h | 28 +++++++++++----------- .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 10 ++++---- drivers/net/ethernet/intel/i40evf/i40e_common.c | 24 +++++++++---------- drivers/net/ethernet/intel/i40evf/i40e_prototype.h | 10 ++++---- drivers/net/ethernet/intel/i40evf/i40e_type.h | 28 +++++++++++----------- 8 files changed, 73 insertions(+), 69 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +5 -5
@@ -198,7 +198,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_add_mirror_rule =0x0260 , i40e_aqc_opc_delete_mirror_rule =0x0261 , -/* Pipeline Personalization Profile */ +/* Dynamic Device Personalization */ i40e_aqc_opc_write_personalization_profile =0x0270 , i40e_aqc_opc_get_personalization_profile_list = 0x0271,
@@ -1594,7 +1594,7 @@ struct i40e_aqc_add_delete_mirror_rule_completion {I40E_CHECK_CMD_LENGTH (i40e_aqc_add_delete_mirror_rule_completion); -/* Pipeline Personalization Profile */ +/* Dynamic Device Personalization */ struct i40e_aqc_write_personalization_profile {u8 flags;u8 reserved[3 ];
@@ -1605,7 +1605,7 @@ struct i40e_aqc_write_personalization_profile {I40E_CHECK_CMD_LENGTH (i40e_aqc_write_personalization_profile); -struct i40e_aqc_write_ppp_resp { +struct i40e_aqc_write_ddp_resp {__le32 error_offset;__le32 error_info;__le32 addr_high;
@@ -1614,8 +1614,8 @@ struct i40e_aqc_write_ppp_resp {struct i40e_aqc_get_applied_profiles {u8 flags; -#define I40E_AQC_GET_PPP_GET_CONF 0x1 -#define I40E_AQC_GET_PPP_GET_RDPU_CONF 0x2 +#define I40E_AQC_GET_DDP_GET_CONF 0x1 +#define I40E_AQC_GET_DDP_GET_RDPU_CONF 0x2u8 rsv[3 ];__le32 reserved;__le32 addr_high;
drivers/net/ethernet/intel/i40e/i40e_common.c +11 -11
@@ -5229,7 +5229,7 @@ i40e_status i40e_aq_get_phy_register(struct i40e_hw *hw, }/** -* i40e_aq_write_ppp - Write pipeline personalization profile (ppp) +* i40e_aq_write_ddp - Write dynamic device personalization (ddp) * @hw: pointer to the hw struct * @buff: command buffer (size in bytes = buff_size) * @buff_size: buffer size in bytes
@@ -5239,7 +5239,7 @@ i40e_status i40e_aq_get_phy_register(struct i40e_hw *hw,* @cmd_details: pointer to command details structure or NULL **/ enum -i40e_status_code i40e_aq_write_ppp (struct i40e_hw *hw,void *buff, +i40e_status_code i40e_aq_write_ddp (struct i40e_hw *hw,void *buff,u16 buff_size,u32 track_id,u32 *error_offset,u32 *error_info,struct i40e_asq_cmd_details *cmd_details)
@@ -5248,7 +5248,7 @@ i40e_status_code i40e_aq_write_ppp(struct i40e_hw *hw, void *buff,struct i40e_aqc_write_personalization_profile *cmd = (struct i40e_aqc_write_personalization_profile *) &desc.params.raw; -struct i40e_aqc_write_ppp_resp *resp; +struct i40e_aqc_write_ddp_resp *resp;i40e_status status; i40e_fill_default_direct_cmd_desc(&desc,
@@ -5264,7 +5264,7 @@ i40e_status_code i40e_aq_write_ppp(struct i40e_hw *hw, void *buff, status =i40e_asq_send_command (hw, &desc, buff, buff_size, cmd_details);if (!status) { - resp = (struct i40e_aqc_write_ppp_resp *)&desc.params.raw; + resp = (struct i40e_aqc_write_ddp_resp *)&desc.params.raw;if (error_offset) *error_offset =le32_to_cpu (resp->error_offset);if (error_info)
@@ -5275,14 +5275,14 @@ i40e_status_code i40e_aq_write_ppp(struct i40e_hw *hw, void *buff, }/** -* i40e_aq_get_ppp_list - Read pipeline personalization profile (ppp) +* i40e_aq_get_ddp_list - Read dynamic device personalization (ddp) * @hw: pointer to the hw struct * @buff: command buffer (size in bytes = buff_size) * @buff_size: buffer size in bytes * @cmd_details: pointer to command details structure or NULL **/ enum -i40e_status_code i40e_aq_get_ppp_list (struct i40e_hw *hw,void *buff, +i40e_status_code i40e_aq_get_ddp_list (struct i40e_hw *hw,void *buff,u16 buff_size,u8 flags,struct i40e_asq_cmd_details *cmd_details) {
@@ -5371,7 +5371,7 @@ i40e_write_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile,break ; }if (i == dev_cnt) { -i40e_debug (hw,I40E_DEBUG_PACKAGE ,"Device doesn't support PPP" ); +i40e_debug (hw,I40E_DEBUG_PACKAGE ,"Device doesn't support DDP" );return I40E_ERR_DEVICE_NOT_SUPPORTED ; }
@@ -5390,7 +5390,7 @@ i40e_write_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile,sizeof (struct i40e_profile_section_header );/* Write profile */ - status =i40e_aq_write_ppp (hw, (void *)sec, (u16 )section_size, + status =i40e_aq_write_ddp (hw, (void *)sec, (u16 )section_size, track_id, &offset, &info,NULL );if (status) { i40e_debug(hw, I40E_DEBUG_PACKAGE,
@@ -5432,10 +5432,10 @@ i40e_add_pinfo_to_list(struct i40e_hw *hw, sec->section.offset); pinfo->track_id = track_id; pinfo->version = profile->version; - pinfo->op =I40E_PPP_ADD_TRACKID ; -memcpy (pinfo->name, profile->name,I40E_PPP_NAME_SIZE ); + pinfo->op =I40E_DDP_ADD_TRACKID ; +memcpy (pinfo->name, profile->name,I40E_DDP_NAME_SIZE ); - status =i40e_aq_write_ppp (hw, (void *)sec, sec->data_end, + status =i40e_aq_write_ddp (hw, (void *)sec, sec->data_end, track_id, &offset, &info,NULL );return status;
drivers/net/ethernet/intel/i40e/i40e_prototype.h +6 -4
@@ -431,13 +431,15 @@ i40e_status i40e_write_phy_register(struct i40e_hw *hw, u8 page, u16 reg,u8 i40e_get_phy_address (struct i40e_hw *hw,u8 dev_num);i40e_status i40e_blink_phy_link_led (struct i40e_hw *hw,u32 time,u32 interval); -i40e_status i40e_aq_write_ppp (struct i40e_hw *hw,void *buff, +i40e_status i40e_aq_write_ddp (struct i40e_hw *hw,void *buff,u16 buff_size,u32 track_id,u32 *error_offset,u32 *error_info, -struct i40e_asq_cmd_details *cmd_details); -i40e_status i40e_aq_get_ppp_list (struct i40e_hw *hw,void *buff, +struct i40e_asq_cmd_details * + cmd_details); +i40e_status i40e_aq_get_ddp_list (struct i40e_hw *hw,void *buff,u16 buff_size,u8 flags, -struct i40e_asq_cmd_details *cmd_details); +struct i40e_asq_cmd_details * + cmd_details);struct i40e_generic_seg_header *i40e_find_segment_in_package (u32 segment_type,struct i40e_package_header *pkg_header);
drivers/net/ethernet/intel/i40e/i40e_type.h +14 -14
@@ -1502,19 +1502,19 @@ struct i40e_lldp_variables {#define I40E_FLEX_57_SHIFT 6#define I40E_FLEX_57_MASK (0x1ULL << I40E_FLEX_57_SHIFT) -/* Version format for PPP */ -struct i40e_ppp_version { +/* Version format for Dynamic Device Personalization(DDP) */ +struct i40e_ddp_version {u8 major;u8 minor;u8 update;u8 draft; }; -#define I40E_PPP_NAME_SIZE 32 +#define I40E_DDP_NAME_SIZE 32/* Package header */ struct i40e_package_header { -struct i40e_ppp_version version; +struct i40e_ddp_version version;u32 segment_count;u32 segment_offset[1 ]; };
@@ -1526,16 +1526,16 @@ struct i40e_generic_seg_header {#define SEGMENT_TYPE_I40E 0x00000011#define SEGMENT_TYPE_X722 0x00000012u32 type; -struct i40e_ppp_version version; +struct i40e_ddp_version version;u32 size; -char name[I40E_PPP_NAME_SIZE ]; +char name[I40E_DDP_NAME_SIZE ]; };struct i40e_metadata_segment {struct i40e_generic_seg_header header; -struct i40e_ppp_version version; +struct i40e_ddp_version version;u32 track_id; -char name[I40E_PPP_NAME_SIZE ]; +char name[I40E_DDP_NAME_SIZE ]; };struct i40e_device_id_entry {
@@ -1545,8 +1545,8 @@ struct i40e_device_id_entry {struct i40e_profile_segment {struct i40e_generic_seg_header header; -struct i40e_ppp_version version; -char name[I40E_PPP_NAME_SIZE ]; +struct i40e_ddp_version version; +char name[I40E_DDP_NAME_SIZE ];u32 device_table_count;struct i40e_device_id_entry device_table[1 ]; };
@@ -1573,11 +1573,11 @@ struct i40e_profile_section_header {struct i40e_profile_info {u32 track_id; -struct i40e_ppp_version version; +struct i40e_ddp_version version;u8 op; -#define I40E_PPP_ADD_TRACKID 0x01 -#define I40E_PPP_REMOVE_TRACKID 0x02 +#define I40E_DDP_ADD_TRACKID 0x01 +#define I40E_DDP_REMOVE_TRACKID 0x02u8 reserved[7 ]; -u8 name[I40E_PPP_NAME_SIZE ]; +u8 name[I40E_DDP_NAME_SIZE ]; };#endif /* _I40E_TYPE_H_ */
drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h +5 -5
@@ -198,7 +198,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_add_mirror_rule =0x0260 , i40e_aqc_opc_delete_mirror_rule =0x0261 , -/* Pipeline Personalization Profile */ +/* Dynamic Device Personalization */ i40e_aqc_opc_write_personalization_profile =0x0270 , i40e_aqc_opc_get_personalization_profile_list = 0x0271,
@@ -1562,7 +1562,7 @@ struct i40e_aqc_add_delete_mirror_rule_completion {I40E_CHECK_CMD_LENGTH (i40e_aqc_add_delete_mirror_rule_completion); -/* Pipeline Personalization Profile */ +/* Dynamic Device Personalization */ struct i40e_aqc_write_personalization_profile {u8 flags;u8 reserved[3 ];
@@ -1573,7 +1573,7 @@ struct i40e_aqc_write_personalization_profile {I40E_CHECK_CMD_LENGTH (i40e_aqc_write_personalization_profile); -struct i40e_aqc_write_ppp_resp { +struct i40e_aqc_write_ddp_resp {__le32 error_offset;__le32 error_info;__le32 addr_high;
@@ -1582,8 +1582,8 @@ struct i40e_aqc_write_ppp_resp {struct i40e_aqc_get_applied_profiles {u8 flags; -#define I40E_AQC_GET_PPP_GET_CONF 0x1 -#define I40E_AQC_GET_PPP_GET_RDPU_CONF 0x2 +#define I40E_AQC_GET_DDP_GET_CONF 0x1 +#define I40E_AQC_GET_DDP_GET_RDPU_CONF 0x2u8 rsv[3 ];__le32 reserved;__le32 addr_high;
drivers/net/ethernet/intel/i40evf/i40e_common.c +12 -12
@@ -1202,7 +1202,7 @@ i40e_status i40e_vf_reset(struct i40e_hw *hw) }/** -* i40evf_aq_write_ppp - Write pipeline personalization profile (ppp) +* i40evf_aq_write_ddp - Write dynamic device personalization (ddp) * @hw: pointer to the hw struct * @buff: command buffer (size in bytes = buff_size) * @buff_size: buffer size in bytes
@@ -1212,7 +1212,7 @@ i40e_status i40e_vf_reset(struct i40e_hw *hw)* @cmd_details: pointer to command details structure or NULL **/ enum -i40e_status_code i40evf_aq_write_ppp (struct i40e_hw *hw,void *buff, +i40e_status_code i40evf_aq_write_ddp (struct i40e_hw *hw,void *buff,u16 buff_size,u32 track_id,u32 *error_offset,u32 *error_info,struct i40e_asq_cmd_details *cmd_details)
@@ -1221,7 +1221,7 @@ i40e_status_code i40evf_aq_write_ppp(struct i40e_hw *hw, void *buff,struct i40e_aqc_write_personalization_profile *cmd = (struct i40e_aqc_write_personalization_profile *) &desc.params.raw; -struct i40e_aqc_write_ppp_resp *resp; +struct i40e_aqc_write_ddp_resp *resp;i40e_status status; i40evf_fill_default_direct_cmd_desc(&desc,
@@ -1237,7 +1237,7 @@ i40e_status_code i40evf_aq_write_ppp(struct i40e_hw *hw, void *buff, status =i40evf_asq_send_command (hw, &desc, buff, buff_size, cmd_details);if (!status) { - resp = (struct i40e_aqc_write_ppp_resp *)&desc.params.raw; + resp = (struct i40e_aqc_write_ddp_resp *)&desc.params.raw;if (error_offset) *error_offset =le32_to_cpu (resp->error_offset);if (error_info)
@@ -1248,16 +1248,16 @@ i40e_status_code i40evf_aq_write_ppp(struct i40e_hw *hw, void *buff, }/** -* i40evf_aq_get_ppp_list - Read pipeline personalization profile (ppp) +* i40evf_aq_get_ddp_list - Read dynamic device personalization (ddp) * @hw: pointer to the hw struct * @buff: command buffer (size in bytes = buff_size) * @buff_size: buffer size in bytes * @cmd_details: pointer to command details structure or NULL **/ enum -i40e_status_code i40evf_aq_get_ppp_list (struct i40e_hw *hw,void *buff, +i40e_status_code i40evf_aq_get_ddp_list (struct i40e_hw *hw,void *buff,u16 buff_size,u8 flags, -struct i40e_asq_cmd_details *cmd_details) +struct i40e_asq_cmd_details *cmd_details) {struct i40e_aq_desc desc; struct i40e_aqc_get_applied_profiles *cmd =
@@ -1344,7 +1344,7 @@ i40evf_write_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile,break ; }if (i == dev_cnt) { -i40e_debug (hw,I40E_DEBUG_PACKAGE ,"Device doesn't support PPP" ); +i40e_debug (hw,I40E_DEBUG_PACKAGE ,"Device doesn't support DDP" );return I40E_ERR_DEVICE_NOT_SUPPORTED ; }
@@ -1363,7 +1363,7 @@ i40evf_write_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile,sizeof (struct i40e_profile_section_header );/* Write profile */ - status =i40evf_aq_write_ppp (hw, (void *)sec, (u16 )section_size, + status =i40evf_aq_write_ddp (hw, (void *)sec, (u16 )section_size, track_id, &offset, &info,NULL );if (status) { i40e_debug(hw, I40E_DEBUG_PACKAGE,
@@ -1405,10 +1405,10 @@ i40evf_add_pinfo_to_list(struct i40e_hw *hw, sec->section.offset); pinfo->track_id = track_id; pinfo->version = profile->version; - pinfo->op =I40E_PPP_ADD_TRACKID ; -memcpy (pinfo->name, profile->name,I40E_PPP_NAME_SIZE ); + pinfo->op =I40E_DDP_ADD_TRACKID ; +memcpy (pinfo->name, profile->name,I40E_DDP_NAME_SIZE ); - status =i40evf_aq_write_ppp (hw, (void *)sec, sec->data_end, + status =i40evf_aq_write_ddp (hw, (void *)sec, sec->data_end, track_id, &offset, &info,NULL );return status; }
drivers/net/ethernet/intel/i40evf/i40e_prototype.h +6 -4
@@ -131,13 +131,15 @@ i40e_status i40e_write_phy_register(struct i40e_hw *hw, u8 page, u16 reg,u8 i40e_get_phy_address (struct i40e_hw *hw,u8 dev_num);i40e_status i40e_blink_phy_link_led (struct i40e_hw *hw,u32 time,u32 interval); -i40e_status i40evf_aq_write_ppp (struct i40e_hw *hw,void *buff, +i40e_status i40evf_aq_write_ddp (struct i40e_hw *hw,void *buff,u16 buff_size,u32 track_id,u32 *error_offset,u32 *error_info, -struct i40e_asq_cmd_details *cmd_details); -i40e_status i40evf_aq_get_ppp_list (struct i40e_hw *hw,void *buff, +struct i40e_asq_cmd_details * + cmd_details); +i40e_status i40evf_aq_get_ddp_list (struct i40e_hw *hw,void *buff,u16 buff_size,u8 flags, -struct i40e_asq_cmd_details *cmd_details); +struct i40e_asq_cmd_details * + cmd_details);struct i40e_generic_seg_header *i40evf_find_segment_in_package (u32 segment_type,struct i40e_package_header *pkg_header);
drivers/net/ethernet/intel/i40evf/i40e_type.h +14 -14
@@ -1422,19 +1422,19 @@ enum i40e_reset_type {#define I40E_FD_INSET_FLEX_WORD57_MASK (0x1ULL << \ I40E_FD_INSET_FLEX_WORD57_SHIFT) -/* Version format for PPP */ -struct i40e_ppp_version { +/* Version format for Dynamic Device Personalization(DDP) */ +struct i40e_ddp_version {u8 major;u8 minor;u8 update;u8 draft; }; -#define I40E_PPP_NAME_SIZE 32 +#define I40E_DDP_NAME_SIZE 32/* Package header */ struct i40e_package_header { -struct i40e_ppp_version version; +struct i40e_ddp_version version;u32 segment_count;u32 segment_offset[1 ]; };
@@ -1446,16 +1446,16 @@ struct i40e_generic_seg_header {#define SEGMENT_TYPE_I40E 0x00000011#define SEGMENT_TYPE_X722 0x00000012u32 type; -struct i40e_ppp_version version; +struct i40e_ddp_version version;u32 size; -char name[I40E_PPP_NAME_SIZE ]; +char name[I40E_DDP_NAME_SIZE ]; };struct i40e_metadata_segment {struct i40e_generic_seg_header header; -struct i40e_ppp_version version; +struct i40e_ddp_version version;u32 track_id; -char name[I40E_PPP_NAME_SIZE ]; +char name[I40E_DDP_NAME_SIZE ]; };struct i40e_device_id_entry {
@@ -1465,8 +1465,8 @@ struct i40e_device_id_entry {struct i40e_profile_segment {struct i40e_generic_seg_header header; -struct i40e_ppp_version version; -char name[I40E_PPP_NAME_SIZE ]; +struct i40e_ddp_version version; +char name[I40E_DDP_NAME_SIZE ];u32 device_table_count;struct i40e_device_id_entry device_table[1 ]; };
@@ -1493,11 +1493,11 @@ struct i40e_profile_section_header {struct i40e_profile_info {u32 track_id; -struct i40e_ppp_version version; +struct i40e_ddp_version version;u8 op; -#define I40E_PPP_ADD_TRACKID 0x01 -#define I40E_PPP_REMOVE_TRACKID 0x02 +#define I40E_DDP_ADD_TRACKID 0x01 +#define I40E_DDP_REMOVE_TRACKID 0x02u8 reserved[7 ]; -u8 name[I40E_PPP_NAME_SIZE ]; +u8 name[I40E_DDP_NAME_SIZE ]; };#endif /* _I40E_TYPE_H_ */
Signature · 1 line
2.9.5
Bowers
PATCH 4/9 i40e: change ppp name to ddp
Quoted 17 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Tuesday, November 14, 2017 4:01 AM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Cc: Wu, Jingjing <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S82-V4 4/9] i40e: change ppp name to ddpFrom: Jingjing Wu <[email protected]>
PPP name was going to be confusing since PPP already means point to point protocol. It is decided to change pipeline personalization profile(ppp) to dynamic device personalization(ddp).
Signed-off-by Jingjing Wu <[email protected]>
Quoted 12 lines
--- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 10 ++++---- drivers/net/ethernet/intel/i40e/i40e_common.c | 22 ++++++++--------- drivers/net/ethernet/intel/i40e/i40e_prototype.h | 10 ++++---- drivers/net/ethernet/intel/i40e/i40e_type.h | 28 +++++++++++----------- .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 10 ++++---- drivers/net/ethernet/intel/i40evf/i40e_common.c | 24 +++++++++--------- - drivers/net/ethernet/intel/i40evf/i40e_prototype.h | 10 ++++---- drivers/net/ethernet/intel/i40evf/i40e_type.h | 28 +++++++++++--------- -- 8 files changed, 73 insertions(+), 69 deletions(-)
PATCH 5/9 i40e: track id can be 0
In reply to Alice MichaelFrom: Jingjing Wu <[email protected]>
track_id == 0 is valid for ?read only? profiles when profile does not have any ?write? commands.
--- drivers/net/ethernet/intel/i40e/i40e_common.c | 5 ----- drivers/net/ethernet/intel/i40evf/i40e_common.c | 5 ----- 2 files changed, 10 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_common.c +0 -5
@@ -5357,11 +5357,6 @@ i40e_write_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile,u32 offset =0 , info =0 ;u32 i; -if (!track_id) { -i40e_debug (hw,I40E_DEBUG_PACKAGE ,"Track_id can't be 0." ); -return I40E_NOT_SUPPORTED ; - } - dev_cnt = profile->device_table_count;for (i =0 ; i < dev_cnt; i++) {
drivers/net/ethernet/intel/i40evf/i40e_common.c +0 -5
@@ -1330,11 +1330,6 @@ i40evf_write_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile,u32 offset =0 , info =0 ;u32 i; -if (!track_id) { -i40e_debug (hw,I40E_DEBUG_PACKAGE ,"Track_id can't be 0." ); -return I40E_NOT_SUPPORTED ; - } - dev_cnt = profile->device_table_count;for (i =0 ; i < dev_cnt; i++) {
Signature · 1 line
2.9.5
Bowers
PATCH 5/9 i40e: track id can be 0
Quoted 11 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Tuesday, November 14, 2017 4:01 AM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Cc: Wu, Jingjing <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S82-V4 5/9] i40e: track id can be 0From: Jingjing Wu <[email protected]>
Quoted 8 lines
track_id== 0 is valid for ?read only? profiles when profile does not have any ?write? commands.Signed-off-by Jingjing Wu <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_common.c | 5 ----- drivers/net/ethernet/intel/i40evf/i40e_common.c | 5 ----- 2 files changed, 10 deletions(-)
PATCH 6/9 i40e: Fix FLR reset timeout issue
In reply to Alice MichaelFrom: Filip Sadowski <[email protected]>
This patch allows detection of upcoming core reset in case NIC gets stuck while performing FLR reset. The i40e_pf_reset() function returns I40E_ERR_NOT_READY when global reset was detected.
--- drivers/net/ethernet/intel/i40e/i40e_common.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_common.c +7 -0
@@ -1269,6 +1269,7 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw)* we don't need to do the PF Reset */ if (!cnt) { +u32 reg2 =0 ;if (hw->revision_id ==0 ) cnt =I40E_PF_RESET_WAIT_COUNT_A0 ;else
@@ -1280,6 +1281,12 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw) reg =rd32 (hw,I40E_PFGEN_CTRL );if (!(reg &I40E_PFGEN_CTRL_PFSWR_MASK ))break ; + reg2 =rd32 (hw,I40E_GLGEN_RSTAT ); +if (reg2 &I40E_GLGEN_RSTAT_DEVSTATE_MASK ) { +hw_dbg (hw,"Core reset upcoming. Skipping PF reset request.\n" ); +hw_dbg (hw,"I40E_GLGEN_RSTAT = 0x%x\n" , reg2); +return I40E_ERR_NOT_READY ; + }usleep_range (1000 ,2000 ); }if (reg &I40E_PFGEN_CTRL_PFSWR_MASK ) {
Signature · 1 line
2.9.5
Bowers
PATCH 6/9 i40e: Fix FLR reset timeout issue
Quoted 12 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Tuesday, November 14, 2017 4:01 AM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Cc: Sadowski, Filip <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S82-V4 6/9] i40e: Fix FLR reset timeout issueFrom: Filip Sadowski <[email protected]>
Quoted 8 lines
This patch allows detection of upcoming core reset in case NIC gets stuck while performing FLR reset. The
i40e_pf_reset()function returnsI40E_ERR_NOT_READYwhen global reset was detected.Signed-off-by Filip Sadowski <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_common.c | 7 +++++++ 1 file changed, 7 insertions(+)
PATCH 7/9 i40e: link_down_on_close private flag support
In reply to Alice MichaelFrom: Mariusz Stachura <[email protected]>
This patch introduces new ethtool private flag used for forcing true link state. Function i40e_force_link_state that implements this functionality was added, it sets phy_type = 0 in order to work-around firmware's LESM. False positive error messages were suppressed.
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 + drivers/net/ethernet/intel/i40e/i40e_main.c | 71 ++++++++++++++++++++++++++ 2 files changed, 73 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +2 -0
@@ -230,6 +230,8 @@ static const struct i40e_priv_flags i40e_gstrings_priv_flags[] = {I40E_PRIV_FLAG ("flow-director-atr" ,I40E_FLAG_FD_ATR_ENABLED ,0 ),I40E_PRIV_FLAG ("veb-stats" ,I40E_FLAG_VEB_STATS_ENABLED ,0 ),I40E_PRIV_FLAG ("hw-atr-eviction" ,I40E_FLAG_HW_ATR_EVICT_ENABLED ,0 ), +I40E_PRIV_FLAG ("link-down-on-close" , +I40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED ,0 ),I40E_PRIV_FLAG ("legacy-rx" ,I40E_FLAG_LEGACY_RX ,0 ),I40E_PRIV_FLAG ("disable-source-pruning" , I40E_FLAG_SOURCE_PRUNING_DISABLED, 0),
drivers/net/ethernet/intel/i40e/i40e_main.c +71 -0
89 lines not on this page · raw message
Signature · 1 line
2.9.5
Bowers
PATCH 7/9 i40e: link_down_on_close private flag support
Quoted 17 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Tuesday, November 14, 2017 4:01 AM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Cc: Stachura, Mariusz <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S82-V4 7/9] i40e:link_down_on_closeprivate flag supportFrom: Mariusz Stachura <[email protected]>
This patch introduces new ethtool private flag used for forcing true link state. Function
i40e_force_link_statethat implements this functionality was added, it setsphy_type= 0 in order to work-around firmware's LESM. False positive error messages were suppressed.
Quoted 7 lines
Signed-off-by Mariusz Stachura <[email protected]>Signed-off-by Mitch Williams <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 + drivers/net/ethernet/intel/i40e/i40e_main.c | 71 ++++++++++++++++++++++++++ 2 files changed, 73 insertions(+)
PATCH 8/9 i40evf: fix client notify of l2 params
In reply to Alice MichaelFrom: Alan Brady <[email protected]>
The current method for notifying clients of l2 parameters is broken because we fail to copy the new parameters to the client instance struct, we need to do the notification before the client 'open' function pointer gets called, and lastly we should set the l2 parameters when first adding a client instance.
This patch first introduces the i40evf_client_get_params function to prevent code duplication in the i40evf_client_add_instance and the i40evf_notify_client_l2_params functions. We then fix the notify l2 params function to actually copy the parameters to client instance struct and do the same in the *_add_instance' function. Lastly this patch reorganizes the priority in which client tasks fire so that if the flag for notifying l2 params is set, it will trigger before the open because the client needs these new parameters as part of a client open task.
--- drivers/net/ethernet/intel/i40evf/i40evf_client.c | 38 ++++++++++++++++------- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 10 +++--- 2 files changed, 31 insertions(+), 17 deletions(-)
drivers/net/ethernet/intel/i40evf/i40evf_client.c +26 -12
@@ -25,6 +25,26 @@ static struct i40e_ops i40evf_lan_ops = { };/** +* i40evf_client_get_params - retrieve relevant client parameters +* @vsi: VSI with parameters +* @params: client param struct +**/ +static +void i40evf_client_get_params (struct i40e_vsi *vsi,struct i40e_params *params) +{ +int i; + +memset (params,0 ,sizeof (struct i40e_params )); + params->mtu = vsi->netdev->mtu; + params->link_up = vsi->back->link_up; + +for (i =0 ; i <I40E_MAX_USER_PRIORITY ; i++) { + params->qos.prio_qos[i].tc =0 ; + params->qos.prio_qos[i].qs_handle = vsi->qs_handle; + } +} + +/** * i40evf_notify_client_message - call the client message receive callback * @vsi: the VSI associated with this client * @msg: message buffer
@@ -65,10 +85,6 @@ void i40evf_notify_client_l2_params(struct i40e_vsi *vsi)return ; cinst = vsi->back->cinst; -memset (¶ms,0 ,sizeof (params)); - params.mtu = vsi->netdev->mtu; - params.link_up = vsi->back->link_up; - params.qos.prio_qos[0 ].qs_handle = vsi->qs_handle;if (!cinst || !cinst->client || !cinst->client->ops || !cinst->client->ops->l2_param_change) {
@@ -76,6 +92,8 @@ void i40evf_notify_client_l2_params(struct i40e_vsi *vsi) "Cannot locate client instance l2_param_change function\n");return ; } +i40evf_client_get_params (vsi, ¶ms); + cinst->lan_info.params = params; cinst->client->ops->l2_param_change (&cinst->lan_info, cinst->client, ¶ms); }
@@ -165,9 +183,9 @@ static struct i40e_client_instance * i40evf_client_add_instance(struct i40evf_adapter *adapter) {struct i40e_client_instance *cinst =NULL ; -struct netdev_hw_addr *mac =NULL ;struct i40e_vsi *vsi = &adapter->vsi; -int i; +struct netdev_hw_addr *mac =NULL ; +struct i40e_params params;if (!vf_registered_client) goto out;
@@ -191,18 +209,14 @@ i40evf_client_add_instance(struct i40evf_adapter *adapter) cinst->lan_info.version.major =I40EVF_CLIENT_VERSION_MAJOR ; cinst->lan_info.version.minor =I40EVF_CLIENT_VERSION_MINOR ; cinst->lan_info.version.build =I40EVF_CLIENT_VERSION_BUILD ; +i40evf_client_get_params (vsi, ¶ms); + cinst->lan_info.params = params;set_bit (__I40E_CLIENT_INSTANCE_NONE, &cinst->state); cinst->lan_info.msix_count = adapter->num_iwarp_msix; cinst->lan_info.msix_entries = &adapter->msix_entries[adapter->iwarp_base_vector]; -for (i =0 ; i <I40E_MAX_USER_PRIORITY ; i++) { - cinst->lan_info.params.qos.prio_qos[i].tc =0 ; - cinst->lan_info.params.qos.prio_qos[i].qs_handle = - vsi->qs_handle; - } - mac =list_first_entry (&cinst->lan_info.netdev->dev_addrs.list, struct netdev_hw_addr, list);if (mac)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +5 -5
@@ -2074,6 +2074,11 @@ static void i40evf_client_task(struct work_struct *work) adapter->flags &= ~I40EVF_FLAG_SERVICE_CLIENT_REQUESTED ; goto out; } +if (adapter->flags &I40EVF_FLAG_CLIENT_NEEDS_L2_PARAMS ) { +i40evf_notify_client_l2_params (&adapter->vsi); + adapter->flags &= ~I40EVF_FLAG_CLIENT_NEEDS_L2_PARAMS ; + goto out; + }if (adapter->flags &I40EVF_FLAG_CLIENT_NEEDS_CLOSE ) {i40evf_notify_client_close (&adapter->vsi, false); adapter->flags &= ~I40EVF_FLAG_CLIENT_NEEDS_CLOSE ;
@@ -2082,11 +2087,6 @@ static void i40evf_client_task(struct work_struct *work)if (adapter->flags &I40EVF_FLAG_CLIENT_NEEDS_OPEN ) {i40evf_notify_client_open (&adapter->vsi); adapter->flags &= ~I40EVF_FLAG_CLIENT_NEEDS_OPEN ; - goto out; - } -if (adapter->flags &I40EVF_FLAG_CLIENT_NEEDS_L2_PARAMS ) { -i40evf_notify_client_l2_params (&adapter->vsi); - adapter->flags &= ~I40EVF_FLAG_CLIENT_NEEDS_L2_PARAMS ; } out:clear_bit (__I40EVF_IN_CLIENT_TASK, &adapter->crit_section);
Signature · 1 line
2.9.5
Bowers
PATCH 8/9 i40evf: fix client notify of l2 params
Quoted 25 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Tuesday, November 14, 2017 4:01 AM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S82-V4 8/9] i40evf: fix client notify of l2 paramsFrom: Alan Brady <[email protected]>
The current method for notifying clients of l2 parameters is broken because we fail to copy the new parameters to the client instance struct, we need to do the notification before the client 'open' function pointer gets called, and lastly we should set the l2 parameters when first adding a client instance.
This patch first introduces the
i40evf_client_get_paramsfunction to prevent code duplication in thei40evf_client_add_instanceand thei40evf_notify_client_l2_paramsfunctions. We then fix the notify l2 params function to actually copy the parameters to client instance struct and do the same in the*_add_instance' function. Lastly this patch reorganizes the priority in which client tasks fire so that if the flag for notifying l2 params is set, it will trigger before the open because the client needs these new parameters as part of a client open task.
Quoted 6 lines
Signed-off-by Alan Brady <[email protected]>--- drivers/net/ethernet/intel/i40evf/i40evf_client.c | 38 ++++++++++++++++- ------ drivers/net/ethernet/intel/i40evf/i40evf_main.c | 10 +++--- 2 files changed, 31 insertions(+), 17 deletions(-)
PATCH 9/9 i40e: restore promiscuous after reset
In reply to Alice MichaelFrom: Alan Brady <[email protected]>
After a reset we rebuild the VSIs which is going to clobber any promiscuous settings we had before reset. This makes it so that we restore the promiscuous settings we had before reset.
---
Testing-hints:
Set promiscuous mode, force a reset (ethtool -K <iface> ntuple off/on should work), check if promiscuous traffic is still received after reset.
v2:
- Fix whitespace on i40e_aq_str lines
- Add error message if i40e_set_promiscuous fails after reset
drivers/net/ethernet/intel/i40e/i40e_main.c | 155 +++++++++++++++------------- 1 file changed, 83 insertions(+), 72 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +83 -72
@@ -2167,6 +2167,73 @@ i40e_aqc_broadcast_filter(struct i40e_vsi *vsi, const char *vsi_name, }/** +* i40e_set_promiscuous - set promiscuous mode +* @pf: board private structure +* @promisc: promisc on or off +* +* There are different ways of setting promiscuous mode on a PF depending on +* what state/environment we're in. This identifies and sets it appropriately. +* Returns 0 on success. +**/ +static int i40e_set_promiscuous (struct i40e_pf *pf,bool promisc) +{ +struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi]; +struct i40e_hw *hw = &pf->hw; +i40e_status aq_ret; + +if (vsi->type ==I40E_VSI_MAIN && + pf->lan_veb !=I40E_NO_VEB && + !(pf->flags &I40E_FLAG_MFP_ENABLED )) { +/* set defport ON for Main VSI instead of true promisc +* this way we will get all unicast/multicast and VLAN +* promisc behavior but will not get VF or VMDq traffic +* replicated on the Main VSI. +*/ +if (promisc) + aq_ret =i40e_aq_set_default_vsi (hw, + vsi->seid, +NULL ); +else + aq_ret =i40e_aq_clear_default_vsi (hw, + vsi->seid, +NULL ); +if (aq_ret) { +dev_info (&pf->pdev->dev, +"Set default VSI failed, err %s, aq_err %s\n" , +i40e_stat_str (hw, aq_ret), +i40e_aq_str (hw, hw->aq.asq_last_status)); + } + }else { + aq_ret =i40e_aq_set_vsi_unicast_promiscuous ( + hw, + vsi->seid, + promisc,NULL , + true); +if (aq_ret) { +dev_info (&pf->pdev->dev, +"set unicast promisc failed, err %s, aq_err %s\n" , +i40e_stat_str (hw, aq_ret), +i40e_aq_str (hw, hw->aq.asq_last_status)); + } + aq_ret =i40e_aq_set_vsi_multicast_promiscuous ( + hw, + vsi->seid, + promisc,NULL ); +if (aq_ret) { +dev_info (&pf->pdev->dev, +"set multicast promisc failed, err %s, aq_err %s\n" , +i40e_stat_str (hw, aq_ret), +i40e_aq_str (hw, hw->aq.asq_last_status)); + } + } + +if (!aq_ret) + pf->cur_promisc = promisc; + +return aq_ret; +} + +/** * i40e_sync_vsi_filters - Update the VSI filter list to the HW * @vsi: ptr to the VSI *
@@ -2467,81 +2534,16 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi) cur_promisc = (!!(vsi->current_netdev_flags &IFF_PROMISC ) ||test_bit (__I40E_VSI_OVERFLOW_PROMISC, vsi->state)); -if ((vsi->type ==I40E_VSI_MAIN ) && - (pf->lan_veb !=I40E_NO_VEB ) && - !(pf->flags &I40E_FLAG_MFP_ENABLED )) { -/* set defport ON for Main VSI instead of true promisc -* this way we will get all unicast/multicast and VLAN -* promisc behavior but will not get VF or VMDq traffic -* replicated on the Main VSI. -*/ -if (pf->cur_promisc != cur_promisc) { - pf->cur_promisc = cur_promisc; -if (cur_promisc) - aq_ret = -i40e_aq_set_default_vsi (hw, - vsi->seid, -NULL ); -else - aq_ret = -i40e_aq_clear_default_vsi (hw, - vsi->seid, -NULL ); -if (aq_ret) { - retval =i40e_aq_rc_to_posix (aq_ret, - hw->aq.asq_last_status); -dev_info (&pf->pdev->dev, -"Set default VSI failed on %s, err %s, aq_err %s\n" , - vsi_name, -i40e_stat_str (hw, aq_ret), -i40e_aq_str (hw, - hw->aq.asq_last_status)); - } - } - }else { - aq_ret =i40e_aq_set_vsi_unicast_promiscuous ( - hw, - vsi->seid, - cur_promisc,NULL , - true); -if (aq_ret) { - retval = -i40e_aq_rc_to_posix (aq_ret, - hw->aq.asq_last_status); -dev_info (&pf->pdev->dev, -"set unicast promisc failed on %s, err %s, aq_err %s\n" , - vsi_name, -i40e_stat_str (hw, aq_ret), -i40e_aq_str (hw, - hw->aq.asq_last_status)); - } - aq_ret =i40e_aq_set_vsi_multicast_promiscuous ( - hw, - vsi->seid, - cur_promisc,NULL ); -if (aq_ret) { - retval = -i40e_aq_rc_to_posix (aq_ret, - hw->aq.asq_last_status); -dev_info (&pf->pdev->dev, -"set multicast promisc failed on %s, err %s, aq_err %s\n" , - vsi_name, -i40e_stat_str (hw, aq_ret), -i40e_aq_str (hw, - hw->aq.asq_last_status)); - } - } - aq_ret =i40e_aq_set_vsi_broadcast (&vsi->back->hw, - vsi->seid, - cur_promisc,NULL ); + aq_ret =i40e_set_promiscuous (pf, cur_promisc);if (aq_ret) { retval =i40e_aq_rc_to_posix (aq_ret, - pf->hw.aq.asq_last_status); + hw->aq.asq_last_status);dev_info (&pf->pdev->dev, -"set brdcast promisc failed, err %s, aq_err %s\n" , -i40e_stat_str (hw, aq_ret), -i40e_aq_str (hw, - hw->aq.asq_last_status)); +"Setting promiscuous %s failed on %s, err %s aq_err %s\n" , + cur_promisc ?"on" :"off" , + vsi_name, +i40e_stat_str (hw, aq_ret), +i40e_aq_str (hw, hw->aq.asq_last_status)); } } out:
@@ -9500,6 +9502,15 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)if (!lock_acquired)rtnl_unlock (); +/* Restore promiscuous settings */ + ret =i40e_set_promiscuous (pf, pf->cur_promisc); +if (ret) +dev_warn (&pf->pdev->dev, +"Failed to restore promiscuous setting: %s, err %s aq_err %s\n" , + pf->cur_promisc ?"on" :"off" , +i40e_stat_str (&pf->hw, ret), +i40e_aq_str (&pf->hw, pf->hw.aq.asq_last_status)); +i40e_reset_all_vfs (pf, true);/* tell the firmware that we're starting */
Signature · 1 line
2.9.5
Bowers
PATCH 9/9 i40e: restore promiscuous after reset
Quoted 21 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Tuesday, November 14, 2017 4:01 AM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S82-V4 9/9] i40e: restore promiscuous after resetFrom: Alan Brady <[email protected]>
After a reset we rebuild the VSIs which is going to clobber any promiscuous settings we had before reset. This makes it so that we restore the promiscuous settings we had before reset.
Signed-off-by Alan Brady <[email protected]>---
Testing-hints:
Set promiscuous mode, force a reset (ethtool -K <iface> ntuple off/on should work), check if promiscuous traffic is still received after reset.
Quoted 7 lines
v2:
- Fix whitespace oni40e_aq_strlines
- Add error message ifi40e_set_promiscuousfails after resetdrivers/net/ethernet/intel/i40e/i40e_main.c | 155 +++++++++++++++------- ------ 1 file changed, 83 insertions(+), 72 deletions(-)
Bowers
PATCH 1/9 i40evf: Do not clear MSI-X PBA manually
In reply to Alice MichaelQuoted 16 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alice Michael
Sent: Tuesday, November 14, 2017 4:01 AM
To: Michael, Alice <[email protected]>; intel-wired-
lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S82-V4 1/9] i40evf: Do not clear MSI-X PBA manuallyFrom: Alexander Duyck <[email protected]>
We should not be clearing the pending bit array for each vector manually. The documentation for the hardware states that when in MSI-X mode the pending bit array wil be cleared automatically. Us clearing it ourselves just results in multiple opportunities for us to drop an interrupt.
Quoted 4 lines
Signed-off-by Alexander Duyck <[email protected]>--- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-)