* [PATCH net-next v3] e1000e: Be drop monitor friendly
@ 2017-08-26 1:14 Florian Fainelli
2017-09-06 7:06 ` [Intel-wired-lan] " Neftin, Sasha
2017-09-14 23:54 ` Brown, Aaron F
0 siblings, 2 replies; 3+ messages in thread
From: Florian Fainelli @ 2017-08-26 1:14 UTC (permalink / raw)
To: netdev
Cc: edumazet, davem, Florian Fainelli, Jeff Kirsher,
moderated list:INTEL ETHERNET DRIVERS, open list
e1000e_put_txbuf() can be called from normal reclamation path as well as
when a DMA mapping failure, so we need to differentiate these two cases
when freeing SKBs to be drop monitor friendly. e1000e_tx_hwtstamp_work()
and e1000_remove() are processing TX timestamped SKBs and those should
not be accounted as drops either.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v3:
- differentiate normal reclamation from TX DMA fragment mapping errors
- removed a few invalid dev_kfree_skb() replacements (those are already
drop monitor friendly)
Changes in v2:
- make it compile
drivers/net/ethernet/intel/e1000e/netdev.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 327dfe5bedc0..cfd21858c095 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -1071,7 +1071,8 @@ static bool e1000_clean_rx_irq(struct e1000_ring *rx_ring, int *work_done,
}
static void e1000_put_txbuf(struct e1000_ring *tx_ring,
- struct e1000_buffer *buffer_info)
+ struct e1000_buffer *buffer_info,
+ bool drop)
{
struct e1000_adapter *adapter = tx_ring->adapter;
@@ -1085,7 +1086,10 @@ static void e1000_put_txbuf(struct e1000_ring *tx_ring,
buffer_info->dma = 0;
}
if (buffer_info->skb) {
- dev_kfree_skb_any(buffer_info->skb);
+ if (drop)
+ dev_kfree_skb_any(buffer_info->skb);
+ else
+ dev_consume_skb_any(buffer_info->skb);
buffer_info->skb = NULL;
}
buffer_info->time_stamp = 0;
@@ -1199,7 +1203,7 @@ static void e1000e_tx_hwtstamp_work(struct work_struct *work)
wmb(); /* force write prior to skb_tstamp_tx */
skb_tstamp_tx(skb, &shhwtstamps);
- dev_kfree_skb_any(skb);
+ dev_consume_skb_any(skb);
} else if (time_after(jiffies, adapter->tx_hwtstamp_start
+ adapter->tx_timeout_factor * HZ)) {
dev_kfree_skb_any(adapter->tx_hwtstamp_skb);
@@ -1254,7 +1258,7 @@ static bool e1000_clean_tx_irq(struct e1000_ring *tx_ring)
}
}
- e1000_put_txbuf(tx_ring, buffer_info);
+ e1000_put_txbuf(tx_ring, buffer_info, false);
tx_desc->upper.data = 0;
i++;
@@ -2421,7 +2425,7 @@ static void e1000_clean_tx_ring(struct e1000_ring *tx_ring)
for (i = 0; i < tx_ring->count; i++) {
buffer_info = &tx_ring->buffer_info[i];
- e1000_put_txbuf(tx_ring, buffer_info);
+ e1000_put_txbuf(tx_ring, buffer_info, false);
}
netdev_reset_queue(adapter->netdev);
@@ -5614,7 +5618,7 @@ static int e1000_tx_map(struct e1000_ring *tx_ring, struct sk_buff *skb,
i += tx_ring->count;
i--;
buffer_info = &tx_ring->buffer_info[i];
- e1000_put_txbuf(tx_ring, buffer_info);
+ e1000_put_txbuf(tx_ring, buffer_info, true);
}
return 0;
@@ -7411,7 +7415,7 @@ static void e1000_remove(struct pci_dev *pdev)
if (adapter->flags & FLAG_HAS_HW_TIMESTAMP) {
cancel_work_sync(&adapter->tx_hwtstamp_work);
if (adapter->tx_hwtstamp_skb) {
- dev_kfree_skb_any(adapter->tx_hwtstamp_skb);
+ dev_consume_skb_any(adapter->tx_hwtstamp_skb);
adapter->tx_hwtstamp_skb = NULL;
}
}
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Intel-wired-lan] [PATCH net-next v3] e1000e: Be drop monitor friendly
2017-08-26 1:14 [PATCH net-next v3] e1000e: Be drop monitor friendly Florian Fainelli
@ 2017-09-06 7:06 ` Neftin, Sasha
2017-09-14 23:54 ` Brown, Aaron F
1 sibling, 0 replies; 3+ messages in thread
From: Neftin, Sasha @ 2017-09-06 7:06 UTC (permalink / raw)
To: Florian Fainelli, netdev
Cc: edumazet, open list, moderated list:INTEL ETHERNET DRIVERS, davem
On 8/26/2017 04:14, Florian Fainelli wrote:
> e1000e_put_txbuf() can be called from normal reclamation path as well as
> when a DMA mapping failure, so we need to differentiate these two cases
> when freeing SKBs to be drop monitor friendly. e1000e_tx_hwtstamp_work()
> and e1000_remove() are processing TX timestamped SKBs and those should
> not be accounted as drops either.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> Changes in v3:
>
> - differentiate normal reclamation from TX DMA fragment mapping errors
> - removed a few invalid dev_kfree_skb() replacements (those are already
> drop monitor friendly)
>
> Changes in v2:
>
> - make it compile
>
> drivers/net/ethernet/intel/e1000e/netdev.c | 18 +++++++++++-------
> 1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
> index 327dfe5bedc0..cfd21858c095 100644
> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
> @@ -1071,7 +1071,8 @@ static bool e1000_clean_rx_irq(struct e1000_ring *rx_ring, int *work_done,
> }
>
> static void e1000_put_txbuf(struct e1000_ring *tx_ring,
> - struct e1000_buffer *buffer_info)
> + struct e1000_buffer *buffer_info,
> + bool drop)
> {
> struct e1000_adapter *adapter = tx_ring->adapter;
>
> @@ -1085,7 +1086,10 @@ static void e1000_put_txbuf(struct e1000_ring *tx_ring,
> buffer_info->dma = 0;
> }
> if (buffer_info->skb) {
> - dev_kfree_skb_any(buffer_info->skb);
> + if (drop)
> + dev_kfree_skb_any(buffer_info->skb);
> + else
> + dev_consume_skb_any(buffer_info->skb);
> buffer_info->skb = NULL;
> }
> buffer_info->time_stamp = 0;
> @@ -1199,7 +1203,7 @@ static void e1000e_tx_hwtstamp_work(struct work_struct *work)
> wmb(); /* force write prior to skb_tstamp_tx */
>
> skb_tstamp_tx(skb, &shhwtstamps);
> - dev_kfree_skb_any(skb);
> + dev_consume_skb_any(skb);
> } else if (time_after(jiffies, adapter->tx_hwtstamp_start
> + adapter->tx_timeout_factor * HZ)) {
> dev_kfree_skb_any(adapter->tx_hwtstamp_skb);
> @@ -1254,7 +1258,7 @@ static bool e1000_clean_tx_irq(struct e1000_ring *tx_ring)
> }
> }
>
> - e1000_put_txbuf(tx_ring, buffer_info);
> + e1000_put_txbuf(tx_ring, buffer_info, false);
> tx_desc->upper.data = 0;
>
> i++;
> @@ -2421,7 +2425,7 @@ static void e1000_clean_tx_ring(struct e1000_ring *tx_ring)
>
> for (i = 0; i < tx_ring->count; i++) {
> buffer_info = &tx_ring->buffer_info[i];
> - e1000_put_txbuf(tx_ring, buffer_info);
> + e1000_put_txbuf(tx_ring, buffer_info, false);
> }
>
> netdev_reset_queue(adapter->netdev);
> @@ -5614,7 +5618,7 @@ static int e1000_tx_map(struct e1000_ring *tx_ring, struct sk_buff *skb,
> i += tx_ring->count;
> i--;
> buffer_info = &tx_ring->buffer_info[i];
> - e1000_put_txbuf(tx_ring, buffer_info);
> + e1000_put_txbuf(tx_ring, buffer_info, true);
> }
>
> return 0;
> @@ -7411,7 +7415,7 @@ static void e1000_remove(struct pci_dev *pdev)
> if (adapter->flags & FLAG_HAS_HW_TIMESTAMP) {
> cancel_work_sync(&adapter->tx_hwtstamp_work);
> if (adapter->tx_hwtstamp_skb) {
> - dev_kfree_skb_any(adapter->tx_hwtstamp_skb);
> + dev_consume_skb_any(adapter->tx_hwtstamp_skb);
> adapter->tx_hwtstamp_skb = NULL;
> }
> }
i am ok with this patch
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [Intel-wired-lan] [PATCH net-next v3] e1000e: Be drop monitor friendly
2017-08-26 1:14 [PATCH net-next v3] e1000e: Be drop monitor friendly Florian Fainelli
2017-09-06 7:06 ` [Intel-wired-lan] " Neftin, Sasha
@ 2017-09-14 23:54 ` Brown, Aaron F
1 sibling, 0 replies; 3+ messages in thread
From: Brown, Aaron F @ 2017-09-14 23:54 UTC (permalink / raw)
To: Florian Fainelli, netdev@vger.kernel.org
Cc: edumazet@gmail.com, open list,
moderated list:INTEL ETHERNET DRIVERS, davem@davemloft.net
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On Behalf
> Of Florian Fainelli
> Sent: Friday, August 25, 2017 6:14 PM
> To: netdev@vger.kernel.org
> Cc: edumazet@gmail.com; Florian Fainelli <f.fainelli@gmail.com>; open list
> <linux-kernel@vger.kernel.org>; moderated list:INTEL ETHERNET DRIVERS
> <intel-wired-lan@lists.osuosl.org>; davem@davemloft.net
> Subject: [Intel-wired-lan] [PATCH net-next v3] e1000e: Be drop monitor
> friendly
>
> e1000e_put_txbuf() can be called from normal reclamation path as well as
> when a DMA mapping failure, so we need to differentiate these two cases
> when freeing SKBs to be drop monitor friendly. e1000e_tx_hwtstamp_work()
> and e1000_remove() are processing TX timestamped SKBs and those should
> not be accounted as drops either.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> Changes in v3:
>
> - differentiate normal reclamation from TX DMA fragment mapping errors
> - removed a few invalid dev_kfree_skb() replacements (those are already
> drop monitor friendly)
>
> Changes in v2:
>
> - make it compile
>
> drivers/net/ethernet/intel/e1000e/netdev.c | 18 +++++++++++-------
> 1 file changed, 11 insertions(+), 7 deletions(-)
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-14 23:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-26 1:14 [PATCH net-next v3] e1000e: Be drop monitor friendly Florian Fainelli
2017-09-06 7:06 ` [Intel-wired-lan] " Neftin, Sasha
2017-09-14 23:54 ` Brown, Aaron F
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).