Intel Wired LAN Driver Updates 2015-11-25
Subsystems (3)
This series contains updates to fm10k, i40e and i40evf.
Alex Duyck fixes up fm10k to use napi_schedule_irqoff() instead of napi_schedule() since the function it is called from runs from hard interrupt context or with interrupts already disabled in netpoll.
Shannon cleans up i40e and i40evf unused cd_tunneling parameter and any code comments that refer to it. Then clean up a few instances of BUG_ON, based on a Linux diatribe, especially when WARN_ON can be used.
Helin fixed a issue where using ethtool RXNFC command could let receive flow hash could be set on disabled queues, so resolve by returning the number of enabled queues before setting RXNFC.
Anjali fixes a MSS issue where the hardware/NVM sets a limit of no less than 256 bytes for MSS, yet the stack can send as low as 76 byte MSS. Fixed the issue by lowering the hardware limit to 64 bytes to avoid MDDs from firing and causing a reset when the MSS is lower than 256. Added a statistic to track how many times we forced to do a write back on transmit if the number of descriptors pending are less than a cache line.
Catherine fixes link status changes, where polling would only change link status changes in one direction depending on what the last old data saved off was. This was due to the watchdog only calling link_event and not handle_link_event.
Mitch cleans up and enhances error messages related to VF MAC/VLAN filters.
v2: Dropped patch "i40e: Properly cast type for arithmetic" patch
based on feedback from the community
The following are changes since commit 9458ceab49179b7fd2d5192fd9dcf316ca195dc0:
net: phy: bcm7xxx: Add entry for Broadcom BCM7435
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue master
Alexander Duyck (1):
fm10k: use napi_schedule_irqoff()
Anjali Singhai Jain (2):
i40e: Workaround fix for mss < 256 issue
i40e/i40evf: Add a stat to track how many times we have to do a force
WB
Catherine Sullivan (2):
i40e: Move the saving of old link info from handle_link_event to
link_event
i40e: Bump version to 1.4.2
Helin Zhang (4):
i40e/i40evf: Add comment to #endif
i40e: return the number of enabled queues for ETHTOOL_GRXRINGS
i40e: rework the functions to configure RSS with similar parameters
i40e: create a generic configure rss function
Mitch Williams (2):
i40e/i40evf: clean up error messages
i40evf: handle many MAC filters correctly
Shannon Nelson (4):
i40e/i40evf: remove unused tunnel parameter
i40e: Change BUG_ON to WARN_ON in service event complete
i40e: remove BUG_ON from feature string building
i40e: remove BUG_ON from FCoE setup
drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 2 +- drivers/net/ethernet/intel/i40e/i40e.h | 4 + drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 2 +- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 76 +++--- drivers/net/ethernet/intel/i40e/i40e_fcoe.c | 2 - drivers/net/ethernet/intel/i40e/i40e_main.c | 255 ++++++++++++++++----- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 15 +- drivers/net/ethernet/intel/i40e/i40e_txrx.h | 1 + drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 21 +- .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 2 +- drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 12 +- drivers/net/ethernet/intel/i40evf/i40e_txrx.h | 1 + .../net/ethernet/intel/i40evf/i40evf_virtchnl.c | 58 ++++- 13 files changed, 311 insertions(+), 140 deletions(-)
Signature · 1 line
2.5.0
PATCH v2 1/15 fm10k: use napi_schedule_irqoff()
From: Alexander Duyck <[email protected]>
The fm10k_msix_clean_rings function runs from hard interrupt context or with interrupts already disabled in netpoll.
It can use napi_schedule_irqoff() instead of napi_schedule()
--- drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/fm10k/fm10k_pci.c +1 -1
@@ -846,7 +846,7 @@ static irqreturn_t fm10k_msix_clean_rings(int __always_unused irq, void *data)struct fm10k_q_vector *q_vector = data;if (q_vector->rx.count || q_vector->tx.count) -napi_schedule (&q_vector->napi); +napi_schedule_irqoff (&q_vector->napi);return IRQ_HANDLED ; }
Signature · 1 line
2.5.0
PATCH v2 2/15 i40e/i40evf: remove unused tunnel parameter
In reply to Jeff KirsherFrom: Shannon Nelson <[email protected]>
Code was moved into a separate function some time ago.
--- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 11 ++++------- drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 8 +++----- 2 files changed, 7 insertions(+), 12 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +4 -7
@@ -2186,14 +2186,12 @@ out:* @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: ptr to u64 object -* @cd_tunneling: ptr to context descriptor bits +* @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, -u32 *cd_tunneling) +u8 *hdr_len,u64 *cd_type_cmd_tso_mss) {u32 cd_cmd, cd_tso_len, cd_mss;struct ipv6hdr *ipv6h;
@@ -2246,7 +2244,7 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb,* @tx_ring: ptr to the ring to send * @skb: ptr to the skb we're sending * @tx_flags: the collected send information -* @cd_type_cmd_tso_mss: ptr to u64 object +* @cd_type_cmd_tso_mss: Quad Word 1 * * Returns 0 if no Tx timestamp can happen and 1 if the timestamp will happen **/
@@ -2825,8 +2823,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, &cd_tunneling); + tso =i40e_tso (tx_ring, skb, &hdr_len, &cd_type_cmd_tso_mss);if (tso <0 ) goto out_drop;
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +3 -5
@@ -1436,13 +1436,12 @@ out:* @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_tunneling: ptr to context descriptor bits +* @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, -u32 *cd_tunneling) +u8 *hdr_len,u64 *cd_type_cmd_tso_mss) {u32 cd_cmd, cd_tso_len, cd_mss;struct ipv6hdr *ipv6h;
@@ -1979,8 +1978,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, &cd_tunneling); + tso =i40e_tso (tx_ring, skb, &hdr_len, &cd_type_cmd_tso_mss);if (tso <0 ) goto out_drop;
Signature · 1 line
2.5.0
PATCH v2 3/15 i40e: Change BUG_ON to WARN_ON in service event complete
In reply to Jeff KirsherFrom: Shannon Nelson <[email protected]>
There's no need to kill the thread and eventually the kernel in this case. In fact, the remainder of the code won't hurt anything anyway, so just complain that we're here and move along.
Prompted by a recent Linus diatribe.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
@@ -5738,7 +5738,7 @@ static void i40e_handle_lan_overflow_event(struct i40e_pf *pf,**/ static void i40e_service_event_complete (struct i40e_pf *pf) { -BUG_ON (!test_bit (__I40E_SERVICE_SCHED, &pf->state)); +WARN_ON (!test_bit (__I40E_SERVICE_SCHED, &pf->state));/* flush memory to make sure state is correct before next watchog */ smp_mb__before_atomic ();
Signature · 1 line
2.5.0
PATCH v2 4/15 i40e: remove BUG_ON from feature string building
In reply to Jeff KirsherFrom: Shannon Nelson <[email protected]>
There's really no reason to kill the kernel thread just because of a little info string. This reworks the code to use snprintf's limiting to assure that the string is never too long, and WARN_ON to still put out a warning that we might want to look at the feature list length.
Prompted by a recent Linus diatribe.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 34 +++++++++++++++-------------- 1 file changed, 18 insertions(+), 16 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +18 -16
@@ -10111,10 +10111,12 @@ static int i40e_setup_pf_filter_control(struct i40e_pf *pf) }#define INFO_STRING_LEN 255 +#define REMAIN (__x) (INFO_STRING_LEN - (__x))static void i40e_print_features (struct i40e_pf *pf) {struct i40e_hw *hw = &pf->hw;char *buf, *string; +int i =0 ; string =kzalloc (INFO_STRING_LEN ,GFP_KERNEL );if (!string) {
@@ -10124,42 +10126,42 @@ static void i40e_print_features(struct i40e_pf *pf) buf = string; - buf +=sprintf (string,"Features: PF-id[%d] " , hw->pf_id); + i +=snprintf (&buf[i],REMAIN (i),"Features: PF-id[%d] " , hw->pf_id);#ifdef CONFIG_PCI_IOV - buf +=sprintf (buf,"VFs: %d " , pf->num_req_vfs); + i +=snprintf (&buf[i],REMAIN (i),"VFs: %d " , pf->num_req_vfs);#endif - buf +=sprintf (buf,"VSIs: %d QP: %d RX: %s " , - pf->hw.func_caps.num_vsis, - pf->vsi[pf->lan_vsi]->num_queue_pairs, - pf->flags &I40E_FLAG_RX_PS_ENABLED ?"PS" :"1BUF" ); + i +=snprintf (&buf[i],REMAIN (i),"VSIs: %d QP: %d RX: %s " , + pf->hw.func_caps.num_vsis, + pf->vsi[pf->lan_vsi]->num_queue_pairs, + pf->flags &I40E_FLAG_RX_PS_ENABLED ?"PS" :"1BUF" );if (pf->flags &I40E_FLAG_RSS_ENABLED ) - buf +=sprintf (buf,"RSS " ); + i +=snprintf (&buf[i],REMAIN (i),"RSS " );if (pf->flags &I40E_FLAG_FD_ATR_ENABLED ) - buf +=sprintf (buf,"FD_ATR " ); + i +=snprintf (&buf[i],REMAIN (i),"FD_ATR " );if (pf->flags &I40E_FLAG_FD_SB_ENABLED ) { - buf +=sprintf (buf,"FD_SB " ); - buf +=sprintf (buf,"NTUPLE " ); + i +=snprintf (&buf[i],REMAIN (i),"FD_SB " ); + i +=snprintf (&buf[i],REMAIN (i),"NTUPLE " ); }if (pf->flags &I40E_FLAG_DCB_CAPABLE ) - buf +=sprintf (buf,"DCB " ); + i +=snprintf (&buf[i],REMAIN (i),"DCB " );#if IS_ENABLED (CONFIG_VXLAN ) - buf +=sprintf (buf,"VxLAN " ); + i +=snprintf (&buf[i],REMAIN (i),"VxLAN " );#endif if (pf->flags &I40E_FLAG_PTP ) - buf +=sprintf (buf,"PTP " ); + i +=snprintf (&buf[i],REMAIN (i),"PTP " );#ifdef I40E_FCOE if (pf->flags &I40E_FLAG_FCOE_ENABLED ) - buf +=sprintf (buf,"FCOE " ); + i +=snprintf (&buf[i],REMAIN (i),"FCOE " );#endif if (pf->flags &I40E_FLAG_VEB_MODE_ENABLED ) - buf +=sprintf (buf,"VEB " ); + i +=snprintf (&buf[i],REMAIN (i),"VEPA " );else buf +=sprintf (buf,"VEPA " ); -BUG_ON (buf > (string +INFO_STRING_LEN ));dev_info (&pf->pdev->dev,"%s\n" , string);kfree (string); +WARN_ON (i >INFO_STRING_LEN ); }/**
Signature · 1 line
2.5.0
Re: [net-next v2 04/15] i40e: remove BUG_ON from feature string building
Hello.
Quoted 21 lines · Jeff Kirsher
From: Shannon Nelson <[email protected]>
There's really no reason to kill the kernel thread just because of a little info string. This reworks the code to use snprintf's limiting to assure that the string is never too long, and
WARN_ONto still put out a warning that we might want to look at the feature list length.Prompted by a recent Linus diatribe.
Change-ID If52ba5ca1c2344d8bf454a31bbb805eb5d2c5802Signed-off-by Shannon Nelson <[email protected]>Tested-by Andrew Bowers <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e_main.c | 34 +++++++++++++++-------------- 1 file changed, 18 insertions(+), 16 deletions(-)drivers/net/ethernet/intel/i40e/i40e_main.c +0
-0
[...]
Quoted 39 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +12
-12@@ -10124,42 +10126,42 @@ static void i40e_print_features(struct i40e_pf *pf) buf = string; - buf +=sprintf (string,"Features: PF-id[%d] " , hw->pf_id); + i +=snprintf (&buf[i],REMAIN (i),"Features: PF-id[%d] " , hw->pf_id);#ifdef CONFIG_PCI_IOV - buf +=sprintf (buf,"VFs: %d " , pf->num_req_vfs); + i +=snprintf (&buf[i],REMAIN (i),"VFs: %d " , pf->num_req_vfs);#endif - buf +=sprintf (buf,"VSIs: %d QP: %d RX: %s " , - pf->hw.func_caps.num_vsis, - pf->vsi[pf->lan_vsi]->num_queue_pairs, - pf->flags &I40E_FLAG_RX_PS_ENABLED ?"PS" :"1BUF" ); + i +=snprintf (&buf[i],REMAIN (i),"VSIs: %d QP: %d RX: %s " , + pf->hw.func_caps.num_vsis, + pf->vsi[pf->lan_vsi]->num_queue_pairs, + pf->flags &I40E_FLAG_RX_PS_ENABLED ?"PS" :"1BUF" );if (pf->flags &I40E_FLAG_RSS_ENABLED ) - buf +=sprintf (buf,"RSS " ); + i +=snprintf (&buf[i],REMAIN (i),"RSS " );if (pf->flags &I40E_FLAG_FD_ATR_ENABLED ) - buf +=sprintf (buf,"FD_ATR " ); + i +=snprintf (&buf[i],REMAIN (i),"FD_ATR " );if (pf->flags &I40E_FLAG_FD_SB_ENABLED ) { - buf +=sprintf (buf,"FD_SB " ); - buf +=sprintf (buf,"NTUPLE " ); + i +=snprintf (&buf[i],REMAIN (i),"FD_SB " ); + i +=snprintf (&buf[i],REMAIN (i),"NTUPLE " ); }if (pf->flags &I40E_FLAG_DCB_CAPABLE ) - buf +=sprintf (buf,"DCB " ); + i +=snprintf (&buf[i],REMAIN (i),"DCB " );#if IS_ENABLED (CONFIG_VXLAN ) - buf +=sprintf (buf,"VxLAN " ); + i +=snprintf (&buf[i],REMAIN (i),"VxLAN " );#endif if (pf->flags &I40E_FLAG_PTP )
drivers/net/ethernet/intel/i40e/i40e_main.c static void i40e_print_features(struct i40e_pf *pf) · line 10158
Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +3
-3- buf +=sprintf (buf,"PTP " ); + i +=snprintf (&buf[i],REMAIN (i),"PTP " );#ifdef I40E_FCOE if (pf->flags &I40E_FLAG_FCOE_ENABLED ) - buf +=sprintf (buf,"FCOE " ); + i +=snprintf (&buf[i],REMAIN (i),"FCOE " );#endif if (pf->flags &I40E_FLAG_VEB_MODE_ENABLED ) - buf +=sprintf (buf,"VEB " ); + i +=snprintf (&buf[i],REMAIN (i),"VEPA " );
Not "VEB "?
drivers/net/ethernet/intel/i40e/i40e_main.c static void i40e_print_features(struct i40e_pf *pf) · line 10167
Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +1
-1else buf +=sprintf (buf,"VEPA " ); -BUG_ON (buf > (string +INFO_STRING_LEN ));dev_info (&pf->pdev->dev,"%s\n" , string);kfree (string); +WARN_ON (i >INFO_STRING_LEN ); }/**
MBR, Sergei
Re: [net-next v2 04/15] i40e: remove BUG_ON from feature string building
Quoted 84 lines · Sergei Shtylyov
Quoted 3 lines · Jeff Kirsher
From: Shannon Nelson <[email protected]>
There's really no reason to kill the kernel thread just because of
a
Quoted 1 line
little info string. This reworks the code to use snprintf's
limiting to
Quoted 1 line
assure that the string is never too long, and
WARN_ONto still putout
Quoted 10 lines
a warning that we might want to look at the feature list length.
Prompted by a recent Linus diatribe.
Change-ID If52ba5ca1c2344d8bf454a31bbb805eb5d2c5802Signed-off-by Shannon Nelson <[email protected]>Tested-by Andrew Bowers <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>---
drivers/net/ethernet/intel/i40e/i40e_main.c| 34 +++++++++++++++--------------
Review
Quoted 3 lines
1 file changed, 18 insertions(+), 16 deletions(-)(quoted diff) +0
-0
b/drivers/net/ethernet/intel/i40e/i40e_main.cQuoted 3 lines
index 7715c54..7a4595a 100644
drivers/net/ethernet/intel/i40e/i40e_main.c +0
-0[...]
drivers/net/ethernet/intel/i40e/i40e_main.c static void i40e_print_features(struct
Quoted 1 line
drivers/net/ethernet/intel/i40e/i40e_main.c +0
-0@@ -10124,42 +10126,42 @@ static void i40e_print_features(struct
i40e_pf*pf)Quoted 5 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +1
-1buf = string; - buf += sprintf(string, "Features: PF-id[%d] ", hw->pf_id); + i += snprintf(&buf[i], REMAIN(i), "Features: PF-id[%d] ", hw-drivers/net/ethernet/intel/i40e/i40e_main.c static void i40e_print_features(struct i40e_pf *pf)
Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +1
-5pf_id); #ifdef CONFIG_PCI_IOV - buf += sprintf(buf, "VFs: %d ", pf->num_req_vfs); + i += snprintf(&buf[i], REMAIN(i), "VFs: %d ", pf- num_req_vfs); #endif - buf += sprintf(buf, "VSIs: %d QP: %d RX: %s ", - pf->hw.func_caps.num_vsis, - pf->vsi[pf->lan_vsi]->num_queue_pairs, - pf->flags & I40E_FLAG_RX_PS_ENABLED ? "PS" :"1BUF");
drivers/net/ethernet/intel/i40e/i40e_main.c static void i40e_print_features(struct i40e_pf *pf)
Quoted 4 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +4
-0+ i += snprintf(&buf[i], REMAIN(i), "VSIs: %d QP: %d RX: %s ", + pf->hw.func_caps.num_vsis, + pf->vsi[pf->lan_vsi]->num_queue_pairs, + pf->flags & I40E_FLAG_RX_PS_ENABLED ? "PS" :"1BUF");
Quoted 21 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +6
-6if (pf->flags & I40E_FLAG_RSS_ENABLED) - buf += sprintf(buf, "RSS "); + i += snprintf(&buf[i], REMAIN(i), "RSS "); if (pf->flags & I40E_FLAG_FD_ATR_ENABLED) - buf += sprintf(buf, "FD_ATR "); + i += snprintf(&buf[i], REMAIN(i), "FD_ATR "); if (pf->flags & I40E_FLAG_FD_SB_ENABLED) { - buf += sprintf(buf, "FD_SB "); - buf += sprintf(buf, "NTUPLE "); + i += snprintf(&buf[i], REMAIN(i), "FD_SB "); + i += snprintf(&buf[i], REMAIN(i), "NTUPLE "); } if (pf->flags & I40E_FLAG_DCB_CAPABLE) - buf += sprintf(buf, "DCB "); + i += snprintf(&buf[i], REMAIN(i), "DCB "); #if IS_ENABLED(CONFIG_VXLAN) - buf += sprintf(buf, "VxLAN "); + i += snprintf(&buf[i], REMAIN(i), "VxLAN "); #endif if (pf->flags & I40E_FLAG_PTP)drivers/net/ethernet/intel/i40e/i40e_main.c static void i40e_print_features(struct i40e_pf *pf) · line 10158
Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +3
-3- buf += sprintf(buf, "PTP "); + i += snprintf(&buf[i], REMAIN(i), "PTP "); #ifdef I40E_FCOE if (pf->flags & I40E_FLAG_FCOE_ENABLED) - buf += sprintf(buf, "FCOE "); + i += snprintf(&buf[i], REMAIN(i), "FCOE "); #endif if (pf->flags & I40E_FLAG_VEB_MODE_ENABLED) - buf += sprintf(buf, "VEB "); + i += snprintf(&buf[i], REMAIN(i), "VEPA ");
Quoted 1 line
Not "VEB "?
Nice catch Sergei, I will wait a till this afternoon to respin the patch series, just in case there are other changes needed that our validation did not catch. :-)
Re: [net-next v2 04/15] i40e: remove BUG_ON from feature string building
Quoted 11 lines · Jeff Kirsher
Quoted 10 lines · Sergei Shtylyov
drivers/net/ethernet/intel/i40e/i40e_main.c
Quoted 8 lines · Jeff Kirsher
From: Shannon Nelson <[email protected]>
There's really no reason to kill the kernel thread just because of a little info string. This reworks the code to use snprintf's limiting to assure that the string is never too long, and
WARN_ONto still put out a warning that we might want to look at the feature list length.drivers/net/ethernet/intel/i40e/i40e_main.c +0
-0
[]
Quoted 9 lines
Quoted 5 lines
drivers/net/ethernet/intel/i40e/i40e_main.c static void i40e_print_features(struct i40e_pf *pf) · line 10158
Quoted 3 lines
if (pf->flags & I40E_FLAG_VEB_MODE_ENABLED)drivers/net/ethernet/intel/i40e/i40e_main.c +1
-1- buf +=sprintf (buf,"VEB " ); + i +=snprintf (&buf[i],REMAIN (i),"VEPA " );Not "VEB "?Nice catch Sergei, I will wait a till this afternoon to respin the patch series, just in case there are other changes needed that our validation did not catch. :-)
trivia:
If you redo these, it'd be nicer not to use " " after each fixed string, but use " " before each fixed string.
The final output string would be 1 byte shorter overall and not have an excess " " before the newline.
The declaration of i doesn't need initialization to 0:
i = snprintf(buf, INFO_STRING_LEN, "Features: PF-id[%d]", ...
would work.
Re: [net-next v2 04/15] i40e: remove BUG_ON from feature string building
Quoted 33 lines · Joe Perches
Quoted 14 lines · Jeff Kirsher
Quoted 13 lines · Sergei Shtylyov
Quoted 11 lines · Jeff Kirsher
From: Shannon Nelson <[email protected]>
There's really no reason to kill the kernel thread just because of a
little info string. This reworks the code to use snprintf's limiting to
assure that the string is never too long, andWARN_ONto still put out
a warning that we might want to look at the feature list length.Quoted 2 lines
Quoted 2 lines
drivers/net/ethernet/intel/i40e/i40e_main.c
Quoted 2 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +0
-0[]
Quoted 9 lines
Quoted 5 lines
drivers/net/ethernet/intel/i40e/i40e_main.c
Quoted 3 lines
if (pf->flags & I40E_FLAG_VEB_MODE_ENABLED)drivers/net/ethernet/intel/i40e/i40e_main.c +1
-1- buf +=sprintf (buf,"VEB " ); + i +=snprintf (&buf[i],REMAIN (i),"VEPA " );Not "VEB "?Nice catch Sergei, I will wait a till this afternoon to respin the patch series, just in case there are other changes needed that our validation did not catch. :-)
trivia:
If you redo these, it'd be nicer not to use " " after each fixed string, but use " " before each fixed string.
Quoted 8 lines
The final output string would be 1 byte shorter overall and not have an excess " " before the newline.
The declaration of i doesn't need initialization to 0:
i = snprintf(buf, INFO_STRING_LEN, "Features: PF-id[%d]", ...would work.
Maybe something like this patch (net-next)
Fix I40E_FLAG_VEB_MODE_ENABLED output of VEB
Miscellanea:
o Remove unnecessary string variable
o Add space before not after fixed strings
o Use kmalloc not kzalloc
o Don't initialize i to 0, use result of first snprintf
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 42 +++++++++++++---------------- 1 file changed, 19 insertions(+), 23 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +19 -23
@@ -10240,52 +10240,48 @@ static int i40e_setup_pf_filter_control(struct i40e_pf *pf)static void i40e_print_features (struct i40e_pf *pf) {struct i40e_hw *hw = &pf->hw; -char *buf, *string; -int i =0 ; +char *buf; +int i; - string =kzalloc (INFO_STRING_LEN ,GFP_KERNEL ); -if (!string) { -dev_err (&pf->pdev->dev,"Features string allocation failed\n" ); + buf =kmalloc (INFO_STRING_LEN ,GFP_KERNEL ); +if (!buf)return ; - } - - buf = string; - i +=snprintf (&buf[i],REMAIN (i),"Features: PF-id[%d] " , hw->pf_id); + i =snprintf (buf,INFO_STRING_LEN ,"Features: PF-id[%d]" , hw->pf_id);#ifdef CONFIG_PCI_IOV - i +=snprintf (&buf[i],REMAIN (i),"VFs: %d " , pf->num_req_vfs); + i +=snprintf (&buf[i],REMAIN (i)," VFs: %d" , pf->num_req_vfs);#endif - i +=snprintf (&buf[i],REMAIN (i),"VSIs: %d QP: %d RX: %s " , + i +=snprintf (&buf[i],REMAIN (i)," VSIs: %d QP: %d RX: %s" , pf->hw.func_caps.num_vsis, pf->vsi[pf->lan_vsi]->num_queue_pairs, pf->flags &I40E_FLAG_RX_PS_ENABLED ?"PS" :"1BUF" );if (pf->flags &I40E_FLAG_RSS_ENABLED ) - i +=snprintf (&buf[i],REMAIN (i),"RSS " ); + i +=snprintf (&buf[i],REMAIN (i)," RSS" );if (pf->flags &I40E_FLAG_FD_ATR_ENABLED ) - i +=snprintf (&buf[i],REMAIN (i),"FD_ATR " ); + i +=snprintf (&buf[i],REMAIN (i)," FD_ATR" );if (pf->flags &I40E_FLAG_FD_SB_ENABLED ) { - i +=snprintf (&buf[i],REMAIN (i),"FD_SB " ); - i +=snprintf (&buf[i],REMAIN (i),"NTUPLE " ); + i +=snprintf (&buf[i],REMAIN (i)," FD_SB" ); + i +=snprintf (&buf[i],REMAIN (i)," NTUPLE" ); }if (pf->flags &I40E_FLAG_DCB_CAPABLE ) - i +=snprintf (&buf[i],REMAIN (i),"DCB " ); + i +=snprintf (&buf[i],REMAIN (i)," DCB" );#if IS_ENABLED (CONFIG_VXLAN ) - i +=snprintf (&buf[i],REMAIN (i),"VxLAN " ); + i +=snprintf (&buf[i],REMAIN (i)," VxLAN" );#endif if (pf->flags &I40E_FLAG_PTP ) - i +=snprintf (&buf[i],REMAIN (i),"PTP " ); + i +=snprintf (&buf[i],REMAIN (i)," PTP" );#ifdef I40E_FCOE if (pf->flags &I40E_FLAG_FCOE_ENABLED ) - i +=snprintf (&buf[i],REMAIN (i),"FCOE " ); + i +=snprintf (&buf[i],REMAIN (i)," FCOE" );#endif if (pf->flags &I40E_FLAG_VEB_MODE_ENABLED ) - i +=snprintf (&buf[i],REMAIN (i),"VEPA " ); + i +=snprintf (&buf[i],REMAIN (i)," VEB" );else - buf +=sprintf (buf,"VEPA " ); + i +=snprintf (&buf[i],REMAIN (i)," VEPA" ); -dev_info (&pf->pdev->dev,"%s\n" , string); -kfree (string); +dev_info (&pf->pdev->dev,"%s\n" , buf); +kfree (buf);WARN_ON (i >INFO_STRING_LEN ); }
Re: [net-next v2 04/15] i40e: remove BUG_ON from feature string building
Quoted 57 lines · Joe Perches
Quoted 7 lines · Joe Perches
Quoted 6 lines · Jeff Kirsher
Quoted 5 lines · Sergei Shtylyov
Quoted 3 lines · Jeff Kirsher
From: Shannon Nelson <[email protected]>
There's really no reason to kill the kernel thread just
because
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
of a
little info string. This reworks the code to use snprintf's limiting to
assure that the string is never too long, andWARN_ONtostill
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
put out
a warning that we might want to look at the feature list length.Quoted 10 lines
Quoted 2 lines
Quoted 2 lines
drivers/net/ethernet/intel/i40e/i40e_main.c
Quoted 2 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +0
-0[]
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
if (
pf->flags&I40E_FLAG_VEB_MODE_ENABLED) - buf +=sprintf(buf, "VEB ");
+ i +=snprintf(&buf[i], REMAIN(i), "VEPA ");Not "VEB "?
Nice catch Sergei, I will wait a till this afternoon to respin
the
Quoted 1 line
Quoted 1 line
patch series, just in case there are other changes needed that
our
Quoted 7 lines
Quoted 1 line
validation did not catch. :-)
trivia:
If you redo these, it'd be nicer not to use " " after each fixed string, but use " " before each fixed string.
Quoted 8 lines
The final output string would be 1 byte shorter overall and not have an excess " " before the newline.
The declaration of i doesn't need initialization to 0:
i = snprintf(buf,
INFO_STRING_LEN, "Features: PF-id[%d]", ...would work.
Maybe something like this patch (net-next)
Fix
I40E_FLAG_VEB_MODE_ENABLEDoutput of VEBMiscellanea:
o Remove unnecessary string variable
o Add space before not after fixed strings
o Use kmalloc not kzalloc
o Don't initialize i to 0, use result of first snprintf
Quoted 4 lines
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 42 +++++++++++++----
------------1 file changed, 19 insertions(+), 23 deletions(-)
Looks fine Joe, can you send to [email protected] mailin g list? That way I can get it added to my queue and the other developers can properly review the change.
PATCH 1/1 i40e: Fix i40e_print_features() VEB mode output
Commit 7fd89545f337 ("i40e: remove BUG_ON from feature string building") added defective output when I40E_FLAG_VEB_MODE_ENABLED was set in function i40e_print_features.
Fix it.
Miscellanea:
o Remove unnecessary string variable
o Add space before not after fixed strings
o Use kmalloc not kzalloc
o Don't initialize i to 0, use result of first snprintf
---
?drivers/net/ethernet/intel/i40e/i40e_main.c | 42 +++++++++++++---------------- ?1 file changed, 19 insertions(+), 23 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +0 -0
@@ -10240,52 +10240,48 @@ static int i40e_setup_pf_filter_control(struct i40e_pf *pf)
?static void i40e_print_features(struct i40e_pf *pf) ?{
? struct i40e_hw *hw = &pf->hw;
- char *buf, *string;
- int i = 0;
+ char *buf;
+ int i;
?
- string = kzalloc(INFO_STRING_LEN, GFP_KERNEL);
- if (!string) {
- dev_err(&pf->pdev->dev, "Features string allocation failed\n");
+ buf = kmalloc(INFO_STRING_LEN, GFP_KERNEL);
+ if (!buf)
? return;
- }
-
- buf = string;
?
- i += snprintf(&buf[i], REMAIN(i), "Features: PF-id[%d] ", hw->pf_id);
+ i = snprintf(buf, INFO_STRING_LEN, "Features: PF-id[%d]", hw->pf_id);
?#ifdef CONFIG_PCI_IOV
- i += snprintf(&buf[i], REMAIN(i), "VFs: %d ", pf->num_req_vfs);
+ i += snprintf(&buf[i], REMAIN(i), " VFs: %d", pf->num_req_vfs);
?#endif
- i += snprintf(&buf[i], REMAIN(i), "VSIs: %d QP: %d RX: %s ",
+ i += snprintf(&buf[i], REMAIN(i), " VSIs: %d QP: %d RX: %s",
? ??????pf->hw.func_caps.num_vsis,
? ??????pf->vsi[pf->lan_vsi]->num_queue_pairs,
? ??????pf->flags & I40E_FLAG_RX_PS_ENABLED ? "PS" : "1BUF");
?
? if (pf->flags & I40E_FLAG_RSS_ENABLED)
- i += snprintf(&buf[i], REMAIN(i), "RSS ");
+ i += snprintf(&buf[i], REMAIN(i), " RSS");
? if (pf->flags & I40E_FLAG_FD_ATR_ENABLED)
- i += snprintf(&buf[i], REMAIN(i), "FD_ATR ");
+ i += snprintf(&buf[i], REMAIN(i), " FD_ATR");
? if (pf->flags & I40E_FLAG_FD_SB_ENABLED) {
- i += snprintf(&buf[i], REMAIN(i), "FD_SB ");
- i += snprintf(&buf[i], REMAIN(i), "NTUPLE ");
+ i += snprintf(&buf[i], REMAIN(i), " FD_SB");
+ i += snprintf(&buf[i], REMAIN(i), " NTUPLE");
? }
? if (pf->flags & I40E_FLAG_DCB_CAPABLE)
- i += snprintf(&buf[i], REMAIN(i), "DCB ");
+ i += snprintf(&buf[i], REMAIN(i), " DCB");
?#if IS_ENABLED(CONFIG_VXLAN)
- i += snprintf(&buf[i], REMAIN(i), "VxLAN ");
+ i += snprintf(&buf[i], REMAIN(i), " VxLAN");
?#endif
? if (pf->flags & I40E_FLAG_PTP)
- i += snprintf(&buf[i], REMAIN(i), "PTP ");
+ i += snprintf(&buf[i], REMAIN(i), " PTP");
?#ifdef I40E_FCOE
? if (pf->flags & I40E_FLAG_FCOE_ENABLED)
- i += snprintf(&buf[i], REMAIN(i), "FCOE ");
+ i += snprintf(&buf[i], REMAIN(i), " FCOE");
?#endif
? if (pf->flags & I40E_FLAG_VEB_MODE_ENABLED)
- i += snprintf(&buf[i], REMAIN(i), "VEPA ");
+ i += snprintf(&buf[i], REMAIN(i), " VEB");
? else
- buf += sprintf(buf, "VEPA ");
+ i += snprintf(&buf[i], REMAIN(i), " VEPA");
?
- dev_info(&pf->pdev->dev, "%s\n", string);
- kfree(string);
+ dev_info(&pf->pdev->dev, "%s\n", buf);
+ kfree(buf);
? WARN_ON(i > INFO_STRING_LEN);
?}
?
Re: [PATCH] i40e: Fix i40e_print_features() VEB mode output
Quoted 7 lines · Joe Perches
Commit
7fd89545f337("i40e: removeBUG_ONfrom feature string building")
added defective output whenI40E_FLAG_VEB_MODE_ENABLEDwas set in functioni40e_print_features.Fix it.
Quoted 8 lines
Miscellanea:
o Remove unnecessary string variable
o Add space before not after fixed strings
o Use kmalloc not kzalloc
o Don't initialize i to 0, use result of first snprintfNoticed-by Sergei Shtylyov <[email protected]>
Don't you mean Reported-by? ?I am not aware of Noticed-by as being a recognized signature.
Quoted 5 lines
Signed-off-by Joe Perches <[email protected]>---
?drivers/net/ethernet/intel/i40e/i40e_main.c | 42 +++++++++++++----
------------
?1 file changed, 19 insertions(+), 23 deletions(-)
-------------- 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/20151202/7301bf93/attachment-0001.asc>
Re: [PATCH] i40e: Fix i40e_print_features() VEB mode output
Quoted 15 lines · Jeff Kirsher
Quoted 14 lines · Joe Perches
Commit
7fd89545f337("i40e: removeBUG_ONfrom feature string building")
added defective output whenI40E_FLAG_VEB_MODE_ENABLEDwas set in functioni40e_print_features.Fix it.
Miscellanea:
o Remove unnecessary string variable
o Add space before not after fixed strings
o Use kmalloc not kzalloc
o Don't initialize i to 0, use result of first snprintf
Quoted 4 lines
Quoted 1 line
Noticed-by Sergei Shtylyov <[email protected]>Don't you mean Reported-by? ?I am not aware of Noticed-by as being a recognized signature.
At least for the get_maintainer script, "<anything>-by:" is a signature
David Miller
maintainerRe: [PATCH] i40e: Fix i40e_print_features() VEB mode output
From: Joe Perches <[email protected]>
Date: Wed, 02 Dec 2015 02:12:29 -0800
Quoted 16 lines · Jeff Kirsher
Quoted 15 lines · Joe Perches
Quoted 14 lines
Commit
7fd89545f337("i40e: removeBUG_ONfrom feature string building")
added defective output whenI40E_FLAG_VEB_MODE_ENABLEDwas set in functioni40e_print_features.Fix it.
Miscellanea:
o Remove unnecessary string variable
o Add space before not after fixed strings
o Use kmalloc not kzalloc
o Don't initialize i to 0, use result of first snprintf
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Noticed-by Sergei Shtylyov <[email protected]>Don't you mean Reported-by? ?I am not aware of Noticed-by as being a recognized signature.
At least for the
get_maintainerscript, "<anything>-by:" is a signature
Is patchwork using the same regexp? If not, for the time being don't user non-standard tags, and furthermore please ask the patchwork folks to use something similar to getmaintainer.pl
Thanks.
Re: [PATCH] i40e: Fix i40e_print_features() VEB mode output
Quoted 10 lines · David Miller
From: Joe Perches <[email protected]> 02 Dec 2015 02:12:29 -0800
Quoted 6 lines · Jeff Kirsher
Quoted 4 lines · Joe Perches
Quoted 1 line
Noticed-by Sergei Shtylyov <[email protected]>?Don't you mean Reported-by? ?I am not aware of Noticed-by as being a recognized signature.?
At least for the
get_maintainerscript, "-by:" is a signatureIs patchwork using the same regexp?? If not, for the time being don't user non-standard tags, and furthermore please ask the patchwork folks to use something similar to getmaintainer.pl
It doesn't seem so.
????response_re = re.compile( ????????r'^(Tested|Reviewed|Acked|Signed-off|Nacked|Reported)-by: .*$', ????????re.M | re.I)
patchwork also doesn't seem very forgiving of misformatted signatures. (btw: Junio Hamano seems to prefer calling them trailers)
And patchwork doesn't seem to handle "cc: " markers either.
Re: [PATCH] i40e: Fix i40e_print_features() VEB mode output
In reply to Joe PerchesQuoted 14 lines · Joe Perches
Commit
7fd89545f337("i40e: removeBUG_ONfrom feature string building")
added defective output whenI40E_FLAG_VEB_MODE_ENABLEDwas set in functioni40e_print_features.Fix it.
Miscellanea:
o Remove unnecessary string variable
o Add space before not after fixed strings
o Use kmalloc not kzalloc
o Don't initialize i to 0, use result of first snprintf
Quoted 6 lines
Noticed-by Sergei Shtylyov <[email protected]>Signed-off-by Joe Perches <[email protected]>---
?drivers/net/ethernet/intel/i40e/i40e_main.c | 42 +++++++++++++----
------------
?1 file changed, 19 insertions(+), 23 deletions(-)
Your patch does not apply cleanly, it appears you used Dave's net-next tree to generate your patch, versus my next-queue tree (dev-queue branch) which has a number of i40e patches already applied.
As a one-time only reminder, I have gone ahead and applied your patch
by hand. ?I will send your updated patch out here in just a minute.
-------------- 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/20151203/a43bd7a2/attachment.asc>
PATCH v2 5/15 i40e: remove BUG_ON from FCoE setup
In reply to Jeff KirsherFrom: Shannon Nelson <[email protected]>
There's no need to kill the kernel thread here. If this condition was true, the probe() would have died long before we got here. In any case, we'll get the same result when this code tries to use the VSI pointer being checked.
Prompted by a recent Linus diatribe.
--- drivers/net/ethernet/intel/i40e/i40e_fcoe.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_fcoe.c +0 -2
@@ -1544,8 +1544,6 @@ void i40e_fcoe_vsi_setup(struct i40e_pf *pf)if (!(pf->flags &I40E_FLAG_FCOE_ENABLED ))return ; -BUG_ON (!pf->vsi[pf->lan_vsi]); -for (i =0 ; i < pf->num_alloc_vsi; i++) { vsi = pf->vsi[i];if (vsi && vsi->type ==I40E_VSI_FCOE ) {
Signature · 1 line
2.5.0
PATCH v2 6/15 i40e: Workaround fix for mss < 256 issue
In reply to Jeff KirsherFrom: Anjali Singhai Jain <[email protected]>
HW/NVM sets a limit of no less than 256 bytes for MSS. Stack can send as low as 76 bytes MSS. This patch lowers the HW limit to 64 bytes to avoid MDDs from firing and causing a reset when the MSS is lower than 256.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +27 -0
@@ -6685,6 +6685,7 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)struct i40e_hw *hw = &pf->hw;u8 set_fc_aq_fail =0 ;i40e_status ret; +u32 val;u32 v;/* Now we wait for GRST to settle out.
@@ -6823,6 +6824,20 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit) } } +/* Reconfigure hardware for allowing smaller MSS in the case +* of TSO, so that we avoid the MDD being fired and causing +* a reset in the case of small MSS+TSO. +*/ +#define I40E_REG_MSS 0x000E64DC +#define I40E_REG_MSS_MIN_MASK 0x3FF0000 +#define I40E_64BYTE_MSS 0x400000 + val =rd32 (hw,I40E_REG_MSS ); +if ((val &I40E_REG_MSS_MIN_MASK ) >I40E_64BYTE_MSS ) { + val &= ~I40E_REG_MSS_MIN_MASK ; + val |=I40E_64BYTE_MSS ; +wr32 (hw,I40E_REG_MSS , val); + } +if (((pf->hw.aq.fw_maj_ver ==4 ) && (pf->hw.aq.fw_min_ver <33 )) || (pf->hw.aq.fw_maj_ver <4 )) {msleep (75 );
@@ -10185,6 +10200,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)u16 link_status;int err;u32 len; +u32 val;u32 i;u8 set_fc_aq_fail;
@@ -10489,6 +10505,17 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)i40e_stat_str (&pf->hw, err), i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); +/* Reconfigure hardware for allowing smaller MSS in the case +* of TSO, so that we avoid the MDD being fired and causing +* a reset in the case of small MSS+TSO. +*/ + val =rd32 (hw,I40E_REG_MSS ); +if ((val &I40E_REG_MSS_MIN_MASK ) >I40E_64BYTE_MSS ) { + val &= ~I40E_REG_MSS_MIN_MASK ; + val |=I40E_64BYTE_MSS ; +wr32 (hw,I40E_REG_MSS , val); + } +if (((pf->hw.aq.fw_maj_ver ==4 ) && (pf->hw.aq.fw_min_ver <33 )) || (pf->hw.aq.fw_maj_ver <4 )) {msleep (75 );
Signature · 1 line
2.5.0
PATCH v2 7/15 i40e/i40evf: Add a stat to track how many times we have to do a force WB
In reply to Jeff KirsherFrom: Anjali Singhai Jain <[email protected]>
When in NAPI with interrupts disabled, the HW needs to be forced to do a write back on TX if the number of descriptors pending are less than a cache line.
This stat helps keep track of how many times we get into this situation.
--- drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 1 + drivers/net/ethernet/intel/i40e/i40e_main.c | 5 ++++- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 4 +++- drivers/net/ethernet/intel/i40e/i40e_txrx.h | 1 + drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 4 +++- drivers/net/ethernet/intel/i40evf/i40e_txrx.h | 1 + 7 files changed, 14 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +1 -0
@@ -487,6 +487,7 @@ struct i40e_vsi {u32 tx_restart;u32 tx_busy;u64 tx_linearize; +u64 tx_force_wb;u32 rx_buf_failed;u32 rx_page_failed;
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +1 -0
@@ -88,6 +88,7 @@ static const struct i40e_stats i40e_gstrings_misc_stats[] = {I40E_VSI_STAT ("tx_broadcast" , eth_stats.tx_broadcast),I40E_VSI_STAT ("rx_unknown_protocol" , eth_stats.rx_unknown_protocol),I40E_VSI_STAT ("tx_linearize" , tx_linearize), + I40E_VSI_STAT("tx_force_wb", tx_force_wb), };/* These PF_STATs might look like duplicates of some NETDEV_STATs,
drivers/net/ethernet/intel/i40e/i40e_main.c +4 -1
@@ -881,6 +881,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)u64 bytes, packets;unsigned int start;u64 tx_linearize; +u64 tx_force_wb;u64 rx_p, rx_b;u64 tx_p, tx_b;u16 q;
@@ -899,7 +900,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)*/ rx_b = rx_p =0 ; tx_b = tx_p =0 ; - tx_restart = tx_busy = tx_linearize =0 ; + tx_restart = tx_busy = tx_linearize = tx_force_wb =0 ; rx_page =0 ; rx_buf =0 ;rcu_read_lock ();
@@ -917,6 +918,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi) tx_restart += p->tx_stats.restart_queue; tx_busy += p->tx_stats.tx_busy; tx_linearize += p->tx_stats.tx_linearize; + tx_force_wb += p->tx_stats.tx_force_wb;/* Rx queue is part of the same block as Tx queue */ p = &p[1 ];
@@ -934,6 +936,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi) vsi->tx_restart = tx_restart; vsi->tx_busy = tx_busy; vsi->tx_linearize = tx_linearize; + vsi->tx_force_wb = tx_force_wb; vsi->rx_page_failed = rx_page; vsi->rx_buf_failed = rx_buf;
drivers/net/ethernet/intel/i40e/i40e_txrx.c +3 -1
@@ -1925,8 +1925,10 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)/* If work not completed, return budget and polling will return */ if (!clean_complete) { tx_only: -if (arm_wb) +if (arm_wb) { + q_vector->tx.ring[0 ].tx_stats.tx_force_wb++;i40e_force_wb (vsi, q_vector); + }return budget; }
drivers/net/ethernet/intel/i40e/i40e_txrx.h +1 -0
@@ -202,6 +202,7 @@ struct i40e_tx_queue_stats {u64 tx_busy;u64 tx_done_old;u64 tx_linearize; +u64 tx_force_wb; };struct i40e_rx_queue_stats {
drivers/net/ethernet/intel/i40evf/i40e_txrx.c +3 -1
@@ -1363,8 +1363,10 @@ int i40evf_napi_poll(struct napi_struct *napi, int budget)/* If work not completed, return budget and polling will return */ if (!clean_complete) { tx_only: -if (arm_wb) +if (arm_wb) { + q_vector->tx.ring[0 ].tx_stats.tx_force_wb++;i40evf_force_wb (vsi, q_vector); + }return budget; }
drivers/net/ethernet/intel/i40evf/i40e_txrx.h +1 -0
@@ -201,6 +201,7 @@ struct i40e_tx_queue_stats {u64 tx_busy;u64 tx_done_old;u64 tx_linearize; +u64 tx_force_wb; };struct i40e_rx_queue_stats {
Signature · 1 line
2.5.0
PATCH v2 8/15 i40e: Move the saving of old link info from handle_link_event to link_event
In reply to Jeff KirsherFrom: Catherine Sullivan <[email protected]>
The watchdog only calls link_event not handle_link_event which means that we need to save the old information in link_event.
Previously when polling we were comparing current data to the old data saved the last time we actually received a link event. This means that the polling would only fix link status changes in one direction depending on what the last old data saved off was.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +3 -4
@@ -6016,6 +6016,9 @@ static void i40e_link_event(struct i40e_pf *pf)i40e_status status;bool new_link, old_link; +/* save off old link status information */ + pf->hw.phy.link_info_old = pf->hw.phy.link_info; +/* set this to force the get_link_status call to refresh state */ pf->hw.phy.get_link_info = true;
@@ -6150,13 +6153,9 @@ unlock:static void i40e_handle_link_event (struct i40e_pf *pf,struct i40e_arq_event_info *e) { -struct i40e_hw *hw = &pf->hw;struct i40e_aqc_get_link_status *status = (struct i40e_aqc_get_link_status *)&e->desc.params.raw; -/* save off old link status information */ - hw->phy.link_info_old = hw->phy.link_info; -/* Do a new status request to re-enable LSE reporting * and load new status information into the hw struct * This completely ignores any state information
Signature · 1 line
2.5.0
PATCH v2 9/15 i40e/i40evf: Add comment to #endif
In reply to Jeff KirsherFrom: Helin Zhang <[email protected]>
Add a comment to the #endif to more easily match it with its #if.
--- drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 2 +- drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +1 -1
@@ -2403,4 +2403,4 @@ struct i40e_aqc_debug_modify_internals {I40E_CHECK_CMD_LENGTH (i40e_aqc_debug_modify_internals); -#endif +#endif /* _I40E_ADMINQ_CMD_H_ */
drivers/net/ethernet/intel/i40evf/i40e_adminq_cmd.h +1 -1
@@ -2311,4 +2311,4 @@ struct i40e_aqc_debug_modify_internals {I40E_CHECK_CMD_LENGTH (i40e_aqc_debug_modify_internals); -#endif +#endif /* _I40E_ADMINQ_CMD_H_ */
Signature · 1 line
2.5.0
PATCH v2 10/15 i40e/i40evf: clean up error messages
In reply to Jeff KirsherFrom: Mitch Williams <[email protected]>
Clean up and enhance error messages related to VF MAC/VLAN filters. Indicate which VF is having issues, and if possible indicate the MAC address or VLAN involved.
Also, when an error is returned from the PF driver, print useful information about what went wrong, for the most likely cases.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 21 +++++++++-------- .../net/ethernet/intel/i40evf/i40evf_virtchnl.c | 26 +++++++++++++++++++--- 2 files changed, 35 insertions(+), 12 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +12 -9
@@ -1623,7 +1623,8 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)if (!f) {dev_err (&pf->pdev->dev, -"Unable to add VF MAC filter\n" ); +"Unable to add MAC filter %pM for VF %d\n" , + al->list[i].addr, vf->vf_id); ret =I40E_ERR_PARAM ;spin_unlock_bh (&vsi->mac_filter_list_lock); goto error_param;
@@ -1633,7 +1634,8 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)/* program the updated filter list */ if (i40e_sync_vsi_filters (vsi, false)) -dev_err (&pf->pdev->dev,"Unable to program VF MAC filters\n" ); +dev_err (&pf->pdev->dev,"Unable to program VF %d MAC filters\n" , + vf->vf_id); error_param:/* send the response to the VF */
@@ -1669,8 +1671,8 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)for (i =0 ; i < al->num_elements; i++) {if (is_broadcast_ether_addr (al->list[i].addr) ||is_zero_ether_addr (al->list[i].addr)) { -dev_err (&pf->pdev->dev,"invalid VF MAC addr %pM\n" , - al->list[i].addr); +dev_err (&pf->pdev->dev,"Invalid MAC addr %pM for VF %d\n" , + al->list[i].addr, vf->vf_id); ret =I40E_ERR_INVALID_MAC_ADDR ; goto error_param; }
@@ -1686,7 +1688,8 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)/* program the updated filter list */ if (i40e_sync_vsi_filters (vsi, false)) -dev_err (&pf->pdev->dev,"Unable to program VF MAC filters\n" ); +dev_err (&pf->pdev->dev,"Unable to program VF %d MAC filters\n" , + vf->vf_id); error_param:/* send the response to the VF */
@@ -1740,8 +1743,8 @@ static int i40e_vc_add_vlan_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)if (ret)dev_err (&pf->pdev->dev, -"Unable to add VF vlan filter %d, error %d\n" , - vfl->vlan_id[i], ret); +"Unable to add VLAN filter %d for VF %d, error %d\n" , + vfl->vlan_id[i], vf->vf_id, ret); } error_param:
@@ -1792,8 +1795,8 @@ static int i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)if (ret)dev_err (&pf->pdev->dev, -"Unable to delete VF vlan filter %d, error %d\n" , - vfl->vlan_id[i], ret); +"Unable to delete VLAN filter %d for VF %d, error %d\n" , + vfl->vlan_id[i], vf->vf_id, ret); } error_param:
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c +23 -3
@@ -724,9 +724,29 @@ void i40evf_virtchnl_completion(struct i40evf_adapter *adapter,return ; }if (v_retval) { -dev_err (&adapter->pdev->dev,"PF returned error %d (%s) to our request %d\n" , - v_retval,i40evf_stat_str (&adapter->hw, v_retval), - v_opcode); +switch (v_opcode) { +case I40E_VIRTCHNL_OP_ADD_VLAN : +dev_err (&adapter->pdev->dev,"Failed to add VLAN filter, error %s\n" , +i40evf_stat_str (&adapter->hw, v_retval)); +break ; +case I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS : +dev_err (&adapter->pdev->dev,"Failed to add MAC filter, error %s\n" , +i40evf_stat_str (&adapter->hw, v_retval)); +break ; +case I40E_VIRTCHNL_OP_DEL_VLAN : +dev_err (&adapter->pdev->dev,"Failed to delete VLAN filter, error %s\n" , +i40evf_stat_str (&adapter->hw, v_retval)); +break ; +case I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS : +dev_err (&adapter->pdev->dev,"Failed to delete MAC filter, error %s\n" , +i40evf_stat_str (&adapter->hw, v_retval)); +break ; +default : +dev_err (&adapter->pdev->dev,"PF returned error %d (%s) to our request %d\n" , + v_retval, +i40evf_stat_str (&adapter->hw, v_retval), + v_opcode); + } }switch (v_opcode) {case I40E_VIRTCHNL_OP_GET_STATS : {
Signature · 1 line
2.5.0
PATCH v2 11/15 i40evf: handle many MAC filters correctly
In reply to Jeff KirsherFrom: Mitch Williams <[email protected]>
When a lot (many hundreds) of MAC or VLAN filters are added at one time, we can overflow the Admin Queue buffer size with all the requests. Unfortunately, the driver would then calculate the message size incorrectly, causing it to be rejected by the PF. Furthermore, there was no mechanism to trigger another request to allow for configuring the rest of the filters that didn't fit into the first request.
To fix this, recalculate the correct buffer size when we detect the overflow condition instead of just assuming the max buffer size. Also, don't clear the request bit in adapter->aq_required when we have an overflow, so that the rest of the filters can be processed later.
--- .../net/ethernet/intel/i40evf/i40evf_virtchnl.c | 32 ++++++++++++++++------ 1 file changed, 24 insertions(+), 8 deletions(-)
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c +24 -8
@@ -391,6 +391,7 @@ void i40evf_add_ether_addrs(struct i40evf_adapter *adapter)struct i40e_virtchnl_ether_addr_list *veal;int len, i =0 , count =0 ;struct i40evf_mac_filter *f; +bool more = false;if (adapter->current_op !=I40E_VIRTCHNL_OP_UNKNOWN ) {/* bail because we already have a command pending */
@@ -415,7 +416,9 @@ void i40evf_add_ether_addrs(struct i40evf_adapter *adapter) count = (I40EVF_MAX_AQ_BUF_SIZE -sizeof (struct i40e_virtchnl_ether_addr_list )) /sizeof (struct i40e_virtchnl_ether_addr ); - len =I40EVF_MAX_AQ_BUF_SIZE ; + len =sizeof (struct i40e_virtchnl_ether_addr_list ) + + (count *sizeof (struct i40e_virtchnl_ether_addr )); + more = true; } veal =kzalloc (len,GFP_ATOMIC );
@@ -431,7 +434,8 @@ void i40evf_add_ether_addrs(struct i40evf_adapter *adapter) f->add = false; } } - adapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_MAC_FILTER ; +if (!more) + adapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_MAC_FILTER ;i40evf_send_pf_msg (adapter,I40E_VIRTCHNL_OP_ADD_ETHER_ADDRESS , (u8 *)veal, len);kfree (veal);
@@ -450,6 +454,7 @@ void i40evf_del_ether_addrs(struct i40evf_adapter *adapter)struct i40e_virtchnl_ether_addr_list *veal;struct i40evf_mac_filter *f, *ftmp;int len, i =0 , count =0 ; +bool more = false;if (adapter->current_op !=I40E_VIRTCHNL_OP_UNKNOWN ) {/* bail because we already have a command pending */
@@ -474,7 +479,9 @@ void i40evf_del_ether_addrs(struct i40evf_adapter *adapter) count = (I40EVF_MAX_AQ_BUF_SIZE -sizeof (struct i40e_virtchnl_ether_addr_list )) /sizeof (struct i40e_virtchnl_ether_addr ); - len =I40EVF_MAX_AQ_BUF_SIZE ; + len =sizeof (struct i40e_virtchnl_ether_addr_list ) + + (count *sizeof (struct i40e_virtchnl_ether_addr )); + more = true; } veal =kzalloc (len,GFP_ATOMIC );if (!veal)
@@ -490,7 +497,8 @@ void i40evf_del_ether_addrs(struct i40evf_adapter *adapter)kfree (f); } } - adapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_MAC_FILTER ; +if (!more) + adapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_MAC_FILTER ;i40evf_send_pf_msg (adapter,I40E_VIRTCHNL_OP_DEL_ETHER_ADDRESS , (u8 *)veal, len);kfree (veal);
@@ -509,6 +517,7 @@ void i40evf_add_vlans(struct i40evf_adapter *adapter)struct i40e_virtchnl_vlan_filter_list *vvfl;int len, i =0 , count =0 ;struct i40evf_vlan_filter *f; +bool more = false;if (adapter->current_op !=I40E_VIRTCHNL_OP_UNKNOWN ) {/* bail because we already have a command pending */
@@ -534,7 +543,9 @@ void i40evf_add_vlans(struct i40evf_adapter *adapter) count = (I40EVF_MAX_AQ_BUF_SIZE -sizeof (struct i40e_virtchnl_vlan_filter_list )) /sizeof (u16); - len =I40EVF_MAX_AQ_BUF_SIZE ; + len =sizeof (struct i40e_virtchnl_vlan_filter_list ) + + (count *sizeof (u16)); + more = true; } vvfl =kzalloc (len,GFP_ATOMIC );if (!vvfl)
@@ -549,7 +560,8 @@ void i40evf_add_vlans(struct i40evf_adapter *adapter) f->add = false; } } - adapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_VLAN_FILTER ; +if (!more) + adapter->aq_required &= ~I40EVF_FLAG_AQ_ADD_VLAN_FILTER ;i40evf_send_pf_msg (adapter,I40E_VIRTCHNL_OP_ADD_VLAN , (u8 *)vvfl, len);kfree (vvfl); }
@@ -567,6 +579,7 @@ void i40evf_del_vlans(struct i40evf_adapter *adapter)struct i40e_virtchnl_vlan_filter_list *vvfl;struct i40evf_vlan_filter *f, *ftmp;int len, i =0 , count =0 ; +bool more = false;if (adapter->current_op !=I40E_VIRTCHNL_OP_UNKNOWN ) {/* bail because we already have a command pending */
@@ -592,7 +605,9 @@ void i40evf_del_vlans(struct i40evf_adapter *adapter) count = (I40EVF_MAX_AQ_BUF_SIZE -sizeof (struct i40e_virtchnl_vlan_filter_list )) /sizeof (u16); - len =I40EVF_MAX_AQ_BUF_SIZE ; + len =sizeof (struct i40e_virtchnl_vlan_filter_list ) + + (count *sizeof (u16)); + more = true; } vvfl =kzalloc (len,GFP_ATOMIC );if (!vvfl)
@@ -608,7 +623,8 @@ void i40evf_del_vlans(struct i40evf_adapter *adapter)kfree (f); } } - adapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_VLAN_FILTER ; +if (!more) + adapter->aq_required &= ~I40EVF_FLAG_AQ_DEL_VLAN_FILTER ;i40evf_send_pf_msg (adapter,I40E_VIRTCHNL_OP_DEL_VLAN , (u8 *)vvfl, len);kfree (vvfl); }
Signature · 1 line
2.5.0
PATCH v2 12/15 i40e: return the number of enabled queues for ETHTOOL_GRXRINGS
In reply to Jeff KirsherFrom: Helin Zhang <[email protected]>
This patch fixes a problem where using ethtool rxnfc command could let RX flow hash be set on disabled queues. This patch fixes the problem by returning the number of enabled queues before setting rxnfc.
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +1 -1
@@ -2111,7 +2111,7 @@ static int i40e_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,switch (cmd->cmd) {case ETHTOOL_GRXRINGS : - cmd->data = vsi->alloc_queue_pairs; + cmd->data = vsi->num_queue_pairs; ret =0 ;break ;case ETHTOOL_GRXFH :
Signature · 1 line
2.5.0
PATCH v2 13/15 i40e: rework the functions to configure RSS with similar parameters
In reply to Jeff KirsherFrom: Helin Zhang <[email protected]>
Adjust the RSS configure functions so that there is a generic way to hook to ethtool hooks.
--- drivers/net/ethernet/intel/i40e/i40e.h | 1 + drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 1 - drivers/net/ethernet/intel/i40e/i40e_main.c | 95 +++++++++++++++++++------- 3 files changed, 71 insertions(+), 26 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +1 -0
@@ -187,6 +187,7 @@ struct i40e_lump_tracking {#define I40E_FDIR_BUFFER_HEAD_ROOM_FOR_ATR (I40E_FDIR_BUFFER_HEAD_ROOM * 4)#define I40E_HKEY_ARRAY_SIZE ((I40E_PFQF_HKEY_MAX_INDEX + 1) * 4) +#define I40E_HLUT_ARRAY_SIZE ((I40E_PFQF_HLUT_MAX_INDEX + 1) * 4)enum i40e_fd_stat_idx {I40E_FD_STAT_ATR ,
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +0 -1
@@ -2584,7 +2584,6 @@ static int i40e_set_channels(struct net_device *dev,return -EINVAL ; } -#define I40E_HLUT_ARRAY_SIZE ((I40E_PFQF_HLUT_MAX_INDEX + 1) * 4)/** * i40e_get_rxfh_key_size - get the RSS hash key size * @netdev: network interface device structure
drivers/net/ethernet/intel/i40e/i40e_main.c +70 -25
151 lines not on this page · raw message
Signature · 1 line
2.5.0
PATCH v2 14/15 i40e: create a generic configure rss function
In reply to Jeff KirsherFrom: Helin Zhang <[email protected]>
This patch renames the old pf-specific function in order to clarify its scope. This patch also creates a more generic configure RSS function with the old name.
This patch also creates a new more generic function to get RSS configuration, using the appropriate method.
--- drivers/net/ethernet/intel/i40e/i40e.h | 2 + drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 72 ++++++++++------------ drivers/net/ethernet/intel/i40e/i40e_main.c | 85 ++++++++++++++++++++++---- 3 files changed, 107 insertions(+), 52 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +2 -0
@@ -670,6 +670,8 @@ extern const char i40e_driver_name[];extern const char i40e_driver_version_str[];void i40e_do_reset_safe (struct i40e_pf *pf,u32 reset_flags);void i40e_do_reset (struct i40e_pf *pf,u32 reset_flags); +int i40e_config_rss (struct i40e_vsi *vsi,u8 *seed,u8 *lut,u16 lut_size); +int i40e_get_rss (struct i40e_vsi *vsi,u8 *seed,u8 *lut,u16 lut_size);struct i40e_vsi *i40e_find_vsi_from_id (struct i40e_pf *pf,u16 id);void i40e_update_stats (struct i40e_vsi *vsi);void i40e_update_eth_stats (struct i40e_vsi *vsi);
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +31 -41
99 lines not on this page · raw message
drivers/net/ethernet/intel/i40e/i40e_main.c +74 -11
129 lines not on this page · raw message
Signature · 1 line
2.5.0
PATCH v2 15/15 i40e: Bump version to 1.4.2
In reply to Jeff KirsherFrom: Catherine Sullivan <[email protected]>
Bump.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -2
@@ -38,8 +38,8 @@ static const char i40e_driver_string[] =#define DRV_KERN "-k"#define DRV_VERSION_MAJOR 1 -#define DRV_VERSION_MINOR 3 -#define DRV_VERSION_BUILD 46 +#define DRV_VERSION_MINOR 4 +#define DRV_VERSION_BUILD 2#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \ __stringify(DRV_VERSION_MINOR) "." \ __stringify(DRV_VERSION_BUILD) DRV_KERN
Signature · 1 line
2.5.0
David Miller
maintainerFrom: Jeff Kirsher <[email protected]>
Date: Wed, 25 Nov 2015 10:21:04 -0800
Quoted 1 line
This series contains updates to fm10k, i40e and i40evf.
...
Quoted 7 lines
v2: Dropped patch "i40e: Properly cast type for arithmetic" patch
based on feedback from the communityThe following are changes since commit
9458ceab49179b7fd2d5192fd9dcf316ca195dc0:
net: phy: bcm7xxx: Add entry for Broadcom BCM7435
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queuemaster
Pulled, thanks Jeff.