Aw: Re: RFC on writel and writel_relaxed

2018-03-28 Thread Lino Sanfilippo
Hi, > > Yeah so that other trick I'm talking about is also used for timing > accuracy. > > For example, let's say I have a device with a reset bit and the spec > says the reset bit needs to be set for at least 10us. > > This is wrong: > > writel(1, RESET_REG); > usleep(10); >

Aw: Re: [PATCH v7 0/7] netdev: intel: Eliminate duplicate barriers on weakly-ordered archs

2018-03-27 Thread Lino Sanfilippo
> > On 3/27/2018 10:04 AM, Lino Sanfilippo wrote: > > Hi, > > > >> Double sorry now. > >> > >> I don't know if you have been following "RFC on writel and writel_relaxed" > >> thread > >> or not but there are some new de

Re: Re: [PATCH v7 0/7] netdev: intel: Eliminate duplicate barriers on weakly-ordered archs

2018-03-27 Thread Lino Sanfilippo
Hi, > Double sorry now. > > I don't know if you have been following "RFC on writel and writel_relaxed" > thread > or not but there are some new developments about wmb() requirement. Just out of interest: Where can this thread be found? > > Basically, wmb() should never be used before

Re: [PATCH] net: fec: set dma_coherent_mask

2018-03-27 Thread Lino Sanfilippo
Hi, > > + dma_set_coherent_mask(>pdev->dev, DMA_BIT_MASK(32)); > + > for (i = 0; i < fep->num_tx_queues; i++) { > txq = kzalloc(sizeof(*txq), GFP_KERNEL); > if (!txq) { dma_set_coherent_mask() can fail, so the return value should be checked and a failure

Aw: Re: [PATCH] net: iucv: Free memory obtained by kzalloc

2018-02-28 Thread Lino Sanfilippo
Hi, > On Wednesday 28 February 2018 05:26 PM, Cornelia Huck wrote: > > On Wed, 28 Feb 2018 17:14:55 +0530 > > Arvind Yadav wrote: > > > >> On Wednesday 28 February 2018 04:00 PM, Cornelia Huck wrote: > >>> On Wed, 28 Feb 2018 15:24:16 +0530 > >>> Arvind Yadav

Re: [PATCH][V2] net: ethernet: slicoss: remove redundant initialization of idx

2017-10-31 Thread Lino Sanfilippo
buffer *buff; > unsigned int frames = 0; > unsigned int bytes = 0; > + unsigned int idx; > > /* Limit processing to SLIC_MAX_TX_COMPLETIONS frames to avoid that new >* completions during processing keeps the loop running endlessly. > Acked-by: Lino Sanfilippo <linosanfili...@gmx.de> Regards, Lino

Re: [PATCH] net: ethernet: slicoss: remove redundant initialization of idx

2017-10-30 Thread Lino Sanfilippo
On 30.10.2017 19:04, Jakub Kicinski wrote: > On Sun, 29 Oct 2017 13:38:09 +, Colin King wrote: >> From: Colin Ian King >> >> Variable idx is being initialized and later on over-written by >> a new value in a do-loop without the initial value ever being >> read. Hence

Re: [PATCH] net: ethernet: slicoss: remove redundant initialization of idx

2017-10-30 Thread Lino Sanfilippo
ned int idx; > struct slic_tx_buffer *buff; > unsigned int frames = 0; > unsigned int bytes = 0; > Acked-by: Lino Sanfilippo <linosanfili...@gmx.de> Regards, Lino

Re: [PATCH RESEND v7 net-next 17/17] net: qualcomm: add QCA7000 UART driver

2017-05-24 Thread Lino Sanfilippo
Hi, > This patch adds the Ethernet over UART driver for the > Qualcomm QCA7000 HomePlug GreenPHY. > > Signed-off-by: Stefan Wahren <stefan.wah...@i2se.com> > --- Reviewed-by: Lino Sanfilippo <linosanfili...@gmx.de> Regards, Lino

Aw: Re: [PATCH v6 net-next 17/17] net: qualcomm: add QCA7000 UART driver

2017-05-24 Thread Lino Sanfilippo
Hi, > Gesendet: Mittwoch, 24. Mai 2017 um 11:06 Uhr > Von: "Stefan Wahren" <stefan.wah...@i2se.com> > An: "Lino Sanfilippo" <linosanfili...@gmx.de>, "Rob Herring" > <robh...@kernel.org>, "Mark Rutland" <mark.rut

Re: [PATCH v6 net-next 17/17] net: qualcomm: add QCA7000 UART driver

2017-05-23 Thread Lino Sanfilippo
On 23.05.2017 21:38, Stefan Wahren wrote: > >> Lino Sanfilippo <linosanfili...@gmx.de> hat am 23. Mai 2017 um 20:16 >> geschrieben: >> >> >> Hi, >> >> On 23.05.2017 15:12, Stefan Wahren wrote: >> >> >>> +} >>> + >

Re: [PATCH v6 net-next 17/17] net: qualcomm: add QCA7000 UART driver

2017-05-23 Thread Lino Sanfilippo
Hi, On 23.05.2017 15:12, Stefan Wahren wrote: > +} > + > +static void qca_uart_remove(struct serdev_device *serdev) > +{ > + struct qcauart *qca = serdev_device_get_drvdata(serdev); > + > + netif_carrier_off(qca->net_dev); > + cancel_work_sync(>tx_work); > +

Re: [PATCH v5 17/17] net: qualcomm: add QCA7000 UART driver

2017-05-11 Thread Lino Sanfilippo
Hi, On 10.05.2017 10:53, Stefan Wahren wrote: > +static int qcauart_netdev_init(struct net_device *dev) > +{ > + struct qcauart *qca = netdev_priv(dev); > + size_t len; > + > + /* Finish setting up the device info. */ > + dev->mtu = QCAFRM_MAX_MTU; > + dev->type =

Re: [PATCH][V2] ethernet: aquantia: remove redundant checks on error status

2017-05-11 Thread Lino Sanfilippo
s err and the error exit label err_exit. > > Detected by CoverityScan, CID#1398313 and CID#1398306 ("Logically > dead code") > > Signed-off-by: Colin Ian King <colin.k...@canonical.com> FWIW: Reviewed-by: Lino Sanfilippo <linosanfili...@gmx.de> Regards, Lino

Re: [PATCH] sky2: Use seq_putc() in sky2_debug_show()

2017-05-08 Thread Lino Sanfilippo
Hi, On 08.05.2017 18:42, SF Markus Elfring wrote: > From: Markus Elfring > Date: Mon, 8 May 2017 18:38:17 +0200 > > A single character (line break) should be put into a sequence. Why? > Thus use the corresponding function "seq_putc". > > This issue was detected

Re: [PATCH] aquantia: Fix "ethtool -S" crash when adapter down.

2017-05-04 Thread Lino Sanfilippo
On 04.05.2017 20:37, Pavel Belous wrote: > > Yes, even adapter is in the down state user can still see statistics from the > HW. > For example (adapter is down): > > $ ethtool -S enp2s0 > NIC statistics: > InPackets: 3237727 > InUCast: 3237214 > InMCast: 391 > InBCast: 122

Re: [PATCH] aquantia: Fix "ethtool -S" crash when adapter down.

2017-05-04 Thread Lino Sanfilippo
Hi Pavel, On 04.05.2017 18:33, Pavel Belous wrote: > From: Pavel Belous > > This patch fixes the crash that happens when driver tries to collect > statistics > from already released "aq_vec" object. > > Fixes: 97bde5c4f909 ("net: ethernet: aquantia: Support for

Aw: Re: [Intel-wired-lan] [PATCH] ixgbe: initialize u64_stats_sync structures early at ixgbe_probe

2017-04-25 Thread Lino Sanfilippo
Hi, > This patch doesn't look right to me. I would suggest rejecting it. > > The call to initialize the stats should be done when the ring is > allocated, not in ixgbe_probe(). This should probably be done in > ixgbe_alloc_q_vector() instead. > AFAICS ixgbe_alloc_q_vector() is also called in

Re: [PATCH v2] net: ethernet: aquantia: set net_device mtu when mtu is changed

2017-03-09 Thread Lino Sanfilippo
Hi, On 09.03.2017 22:03, David Arcari wrote: > When the aquantia device mtu is changed the net_device structure is not > updated. As a result the ip command does not properly reflect the mtu change. > > Commit 5513e16421cb incorrectly assumed that __dev_set_mtu() was making the > assignment

Re: [PATCH net-next v4 12/12] net: ethernet: aquantia: Copying tx buffers is not needed.

2017-02-20 Thread Lino Sanfilippo
ff_ring[self->sw_tail], buffer, > -sizeof(buffer[0]) * first_part); > - > - memcpy(>buff_ring[0], [first_part], > -sizeof(buffer[0]) * second_part); > - } > -} > - > void aq_ring_tx_clean(struct aq_ring_s *self) > { > struct device *dev = aq_nic_get_dev(self->aq_nic); > diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ring.h > b/drivers/net/ethernet/aquantia/atlantic/aq_ring.h > index fb296b3..2572546 100644 > --- a/drivers/net/ethernet/aquantia/atlantic/aq_ring.h > +++ b/drivers/net/ethernet/aquantia/atlantic/aq_ring.h > @@ -146,9 +146,6 @@ struct aq_ring_s *aq_ring_rx_alloc(struct aq_ring_s *self, > int aq_ring_init(struct aq_ring_s *self); > void aq_ring_rx_deinit(struct aq_ring_s *self); > void aq_ring_free(struct aq_ring_s *self); > -void aq_ring_tx_append_buffs(struct aq_ring_s *ring, > - struct aq_ring_buff_s *buffer, > - unsigned int buffers); > void aq_ring_tx_clean(struct aq_ring_s *self); > int aq_ring_rx_clean(struct aq_ring_s *self, int *work_done, int budget); > int aq_ring_rx_fill(struct aq_ring_s *self); > Looks good. Reviewed-by: Lino Sanfilippo <linosanfili...@gmx.de> Regards, Lino

Re: [PATCH net-next v4 09/12] net: ethernet: aquantia: Call netdev_register after all initialized.

2017-02-20 Thread Lino Sanfilippo
err_exit: > return err; > } > @@ -293,7 +293,7 @@ void aq_nic_ndev_free(struct aq_nic_s *self) > if (!self->ndev) > goto err_exit; > > - if (self->is_ndev_registered) > + if (self->ndev->reg_state == NETREG_REGISTERED) >

Re: [PATCH net-next v4 03/12] net: ethernet: aquantia: Fixes for aq_ndev_change_mtu

2017-02-20 Thread Lino Sanfilippo
Hi, On 20.02.2017 20:36, Pavel Belous wrote: > From: Pavel Belous > > 1)Removed unnecessary comparsion "old_mtu == new_mtu". > This check is not needed. Function aq_ndev_change_mtu wont be called > if mtu has not changed. > > 2)Removed extra assignment ndev->mtu =

Re: [PATCH net-next 11/13] net: ethernet: aquantia: Refactoring buffers copying.

2017-02-19 Thread Lino Sanfilippo
Hi, On 16.02.2017 17:37, David Laight wrote: > From: Lino Sanfilippo >> Sent: 16 February 2017 16:02 > ... >> I was referring to the copy of tx descriptors, not the frames/fragments >> itself. >> I wrote "tx buffers" because in this driver a d

Re: [PATCH net-next v2 00/12] net: ethernet: aquantia: improvements and fixes

2017-02-18 Thread Lino Sanfilippo
Hi, On 17.02.2017 22:07, Pavel Belous wrote: > From: Pavel Belous <pavel.bel...@aquantia.com> > > The following patchset contains improvements and fixes for aQuantia > AQtion ethernet driver from net-next tree. > > Most fixes are based on the comments from Lino Sanfili

Re: [PATCH net-next v2 11/12] net: ethernet: aquantia: Fixed memory allocation if AQ_CFG_RX_FRAME_MAX > 1 page.

2017-02-18 Thread Lino Sanfilippo
Hi, On 17.02.2017 22:07, Pavel Belous wrote: > From: Pavel Belous > > We should allocate the number of pages based on the config parameter > AQ_CFG_RX_FRAME_MAX. > > Signed-off-by: Pavel Belous > do { > if

[PATCH] net: aquantia: remove function aq_ring_tx_deinit

2017-02-18 Thread Lino Sanfilippo
to void since it can never fail. Signed-off-by: Lino Sanfilippo <linosanfili...@gmx.de> --- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 33 +--- drivers/net/ethernet/aquantia/atlantic/aq_ring.h | 3 +-- drivers/net/ethernet/aquantia/atlantic/aq_vec.c | 14 ++-

[PATCH] net: ena: remove superfluous check in ena_remove()

2017-02-18 Thread Lino Sanfilippo
The check in ena_remove() for the pci driver data not being NULL is not needed, since it is always set in the probe() function. Remove the superfluous check. Signed-off-by: Lino Sanfilippo <linosanfili...@gmx.de> --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 6 -- 1 file chan

Re: RE: [PATCH net-next 11/13] net: ethernet: aquantia: Refactoring buffers copying.

2017-02-16 Thread Lino Sanfilippo
Hi, > ... > > Well, you should really try to avoid copying the tx buffers _at all_. > > E.g. by passing self->buff_ring to aq_ring_tx_append_buffs() instead of > > the temporary array. > > Copying can help for horridly fragmented frames or when iommu (etc) > setup is expensive. > At least some

Re: [PATCH net-next 10/13] net: ethernet: aquantia: Checking for success dma_map_single.

2017-02-15 Thread Lino Sanfilippo
On 15.02.2017 22:23, Lino Sanfilippo wrote: In case of this error you have to undo all mappings that you have done so far (i.e the complete frag list and the head buffer). And, since mapping failed, set ret = 0 and handle this case in the caller, too. Regards, Lino

Re: [PATCH net-next 11/13] net: ethernet: aquantia: Refactoring buffers copying.

2017-02-15 Thread Lino Sanfilippo
On 15.02.2017 21:01, Pavel Belous wrote: From: Pavel Belous This fix simplified copying data to the ring buffer. Also, there was an error in the code when the second memcpy is called with zero length. It didn't break the driver, but it's bad. Signed-off-by: Pavel

Re: [PATCH net-next 10/13] net: ethernet: aquantia: Checking for success dma_map_single.

2017-02-15 Thread Lino Sanfilippo
On 15.02.2017 21:01, Pavel Belous wrote: From: Pavel Belous Dma mapping can fail. We should check the result. Signed-off-by: Pavel Belous --- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 13 ++--- 1 file changed, 10

Re: [PATCH net-next 09/13] net: ethernet: aquantia: Call netdev_register after all initialized.

2017-02-15 Thread Lino Sanfilippo
xit: return err; } Reviewed-by: Lino Sanfilippo <linosanfili...@gmx.de> Regards, Lino

Re: [PATCH net-next 08/13] net: ethernet: aquantia: Null pointer check for aq_nic_ndev_alloc.

2017-02-15 Thread Lino Sanfilippo
rr = -ENOMEM; goto err_exit; } + self = netdev_priv(ndev); + ndev->netdev_ops = ndev_ops; ndev->ethtool_ops = et_ops; Reviewed-by: Lino Sanfilippo <linosanfili...@gmx.de> Regards, Lino

Re: [PATCH net-next 07/13] net: ethernet: aquantia: Using NETDEV_TX_OK instead 0.

2017-02-15 Thread Lino Sanfilippo
q_ring_buff_s buffers[AQ_CFG_SKB_FRAGS_MAX]; Reviewed-by: Lino Sanfilippo <linosanfili...@gmx.de> Regards, Lino

Re: [PATCH net-next 06/13] net: ethernet: aquantia: Fixed missing rtnl_unlock.

2017-02-15 Thread Lino Sanfilippo
return err; } Reviewed-by: Lino Sanfilippo <linosanfili...@gmx.de> Regards, Lino

Re: [PATCH net-next 05/13] net: ethernet: aquantia: Superfluous initialization of "err".

2017-02-15 Thread Lino Sanfilippo
xit; -err_exit: - return err; + return aq_nic_xmit(aq_nic, skb); } static int aq_ndev_change_mtu(struct net_device *ndev, int new_mtu) Just a nitpick: Now that ndev_start_xmit() is only an empty wrapper for aq_nic_xmit() you can toss it completely and call aq_nic_xmit directly. Reviewed-by:

Re: [PATCH net-next 04/13] net: ethernet: aquantia: Using module_pci_driver.

2017-02-15 Thread Lino Sanfilippo
r; -} - -static void __exit aq_module_exit(void) -{ - pci_unregister_driver(_pci_ops); -} - -module_init(aq_module_init); -module_exit(aq_module_exit); +module_pci_driver(aq_pci_ops); Reviewed-by: Lino Sanfilippo <linosanfili...@gmx.de> Regards, Lino

Re: [PATCH net-next 03/13] net: ethernet: aquantia: Removed unnecessary comparsion "old_mtu == new_mtu".

2017-02-15 Thread Lino Sanfilippo
if (new_mtu < 68) { err = -EINVAL; goto err_exit; } + err = aq_nic_set_mtu(aq_nic, new_mtu + ETH_HLEN); if (err < 0) goto err_exit; + ndev->mtu = new_mtu; if (netif_running(ndev)) { Revi

Re: [PATCH net-next 02/13] net: ethernet: aquantia: Removed busy_count field.

2017-02-15 Thread Lino Sanfilippo
/net/ethernet/aquantia/atlantic/aq_utils.h +++ b/drivers/net/ethernet/aquantia/atlantic/aq_utils.h @@ -19,7 +19,6 @@ struct aq_obj_s { spinlock_t lock; /* spinlock for nic/rings processing */ atomic_t flags; - atomic_t busy_count; }; static inline void aq_utils_obj_set

Re: [PATCH net-next 01/13] net: ethernet: aquantia: Removed extra assignment for skb->dev.

2017-02-15 Thread Lino Sanfilippo
s *self, int *work_done, int budget) goto err_exit; } - skb->dev = ndev; skb_put(skb, buff->len); } else { skb = netdev_alloc_skb(ndev, ETH_HLEN);

Aw: RE: [PATCH net] net: hns: Fix the device being used for dma mapping during TX

2017-02-10 Thread Lino Sanfilippo
> Gesendet: Donnerstag, 09. Februar 2017 um 12:30 Uhr > Von: "Salil Mehta" <salil.me...@huawei.com> > An: "Lino Sanfilippo" <linosanfili...@gmx.de> > Cc: "da...@davemloft.net" <da...@davemloft.net>, "Zhuangyuzeng (Yisen)" &g

Re: [PATCH net] net: hns: Fix the device being used for dma mapping during TX

2017-02-09 Thread Lino Sanfilippo
Hi, > From: Kejian Yan > > This patch fixes the device being used to DMA map skb->data. > Erroneous device assignment causes the crash when SMMU is enabled. > This happens during TX since buffer gets DMA mapped with device > correspondign to net_device and gets unmapped

Re: [PATCH stable v1 05/13] net: ethernet: aquantia: Support for NIC-specific code

2017-01-29 Thread Lino Sanfilippo
On 29.01.2017 06:09, Alexander Loktionov wrote: + +static int aq_ndev_start_xmit(struct sk_buff *skb, struct net_device *ndev) +{ + struct aq_nic_s *aq_nic = netdev_priv(ndev); + int err = 0; + + err = aq_nic_xmit(aq_nic, skb); Initialization of err is superfluous. +

Re: [PATCH stable v1 04/13] net: ethernet: aquantia: Low-level hardware interfaces

2017-01-29 Thread Lino Sanfilippo
On 29.01.2017 06:09, Alexander Loktionov wrote: +void itr_irq_map_en_rx_set(struct aq_hw_s *aq_hw, u32 irq_map_en_rx, u32 rx) +{ +/* register address for bitfield imr_rx{r}_en */ + static u32 itr_imr_rxren_adr[32] = { + 0x2100U, 0x2100U, 0x2104U,

Re: [PATCH stable v1 03/13] net: ethernet: aquantia: Add ring support code

2017-01-29 Thread Lino Sanfilippo
Hi, On 29.01.2017 06:09, Alexander Loktionov wrote: + +void aq_ring_tx_append_buffs(struct aq_ring_s *self, +struct aq_ring_buff_s *buffer, +unsigned int buffers) +{ + if (likely(self->sw_tail + buffers < self->size)) { +

Re: [PATCH V3 net-next 02/14] net/ena: fix error handling when probe fails

2017-01-27 Thread Lino Sanfilippo
Hi, On 26.01.2017 23:18, Netanel Belgazal wrote: When driver fails in probe, it will release all resources, including adapter. In case of probe failure, ena_remove should not try to free the adapter resources. Signed-off-by: Netanel Belgazal ---

Re: [PATCH] [net-next][v2] net: qcom/emac: claim the irq only when the device is opened

2017-01-21 Thread Lino Sanfilippo
-irqreturn_t emac_isr(int irq, void *data); void emac_set_ethtool_ops(struct net_device *netdev); void emac_update_hw_stats(struct emac_adapter *adpt); looks good now. Reviewed-by: Lino Sanfilippo <linosanfili...@gmx.de> Regards, Lino

Re: [PATCH] net: qcom/emac: claim the irq only when the device is opened

2017-01-20 Thread Lino Sanfilippo
On 20.01.2017 22:36, Timur Tabi wrote: On 01/20/2017 03:31 PM, Lino Sanfilippo wrote: In emac_mac_down() however we need synchronize_irq(), since it ensures that the irq handler is not running any more when it (synchronize_irq) returns. So in general, if a driver disables a interrupt

Re: [PATCH] net: qcom/emac: claim the irq only when the device is opened

2017-01-20 Thread Lino Sanfilippo
On 20.01.2017 22:05, Timur Tabi wrote: On 01/20/2017 02:44 PM, Lino Sanfilippo wrote: On 18.01.2017 22:42, Timur Tabi wrote: @@ -1029,8 +1017,6 @@ void emac_mac_down(struct emac_adapter *adpt) */ writel(DIS_INT, adpt->base + EMAC_INT_STATUS); writel(0, adpt-&g

Re: [PATCH] net: qcom/emac: claim the irq only when the device is opened

2017-01-20 Thread Lino Sanfilippo
Hi, On 18.01.2017 22:42, Timur Tabi wrote: @@ -1029,8 +1017,6 @@ void emac_mac_down(struct emac_adapter *adpt) */ writel(DIS_INT, adpt->base + EMAC_INT_STATUS); writel(0, adpt->base + EMAC_INT_MASK); - synchronize_irq(adpt->irq.irq); There is no reason to remove

Re: Re: [PATCH] rtlwifi: rtl8192x: Enabling and disabling hardware interrupts after enabling local irq flags

2017-01-20 Thread Lino Sanfilippo
Hi, > > > This patch should be enhanced with the smb_xx() calls as suggested by by Lino. > If you do this, please place the smp_rmb() before the if condition in the irq handler like smp_rmb(); if (rtlpci->irq_enabled == 0) { return ret; as I think that the suggestion I made before was

Re: [PATCH] rtlwifi: rtl8192x: Enabling and disabling hardware interrupts after enabling local irq flags

2017-01-19 Thread Lino Sanfilippo
Hi, On 19.01.2017 19:08, Larry Finger wrote: On 01/19/2017 08:35 AM, Lino Sanfilippo wrote: Hi, altek/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c index a47be73..143766c4 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c +++ b/drivers/net

Re: [PATCH] rtlwifi: rtl8192x: Enabling and disabling hardware interrupts after enabling local irq flags

2017-01-19 Thread Lino Sanfilippo
Hi, altek/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c > index a47be73..143766c4 100644 > --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c > +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c > @@ -1306,9 +1306,9 @@ void

Re: [EXT] Re: [PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-12 Thread Lino Sanfilippo
Hi, On 12.01.2017 17:37, Sergei Shtylyov wrote: External Email -- On 01/12/2017 04:23 PM, Lino Sanfilippo wrote: + +for (; priv->cur_tx[q] - priv->dirty_tx[q] > 0; priv->dirty_tx[q]++) { BTW: How c

Re: [PATCH/RFC v2 net-next] ravb: unmap descriptors when freeing rings

2017-01-12 Thread Lino Sanfilippo
Hi, On 12.01.2017 10:11, Simon Horman wrote: + + for (; priv->cur_tx[q] - priv->dirty_tx[q] > 0; priv->dirty_tx[q]++) { BTW: How can this work correctly when cur_tx wraps and dirty_tx is greater? Regards, Lino

Re: [PATCH v2 03/12] net: ethernet: aquantia: Add ring support code

2017-01-06 Thread Lino Sanfilippo
On 06.01.2017 09:06, Alexander Loktionov wrote: From: David VomLehn Add code to support the transmit and receive ring buffers. Signed-off-by: Alexander Loktionov Signed-off-by: Dmitrii Tarakanov

Re: [PATCH v2 02/12] net: ethernet: aquantia: Common functions and definitions

2017-01-06 Thread Lino Sanfilippo
Hi, On 06.01.2017 09:06, Alexander Loktionov wrote: + +#define TXT(_T_) #_T_ +#define TXTTXT(_T_) TXT(_T_) do you really need these (IMHO ugly) macros? AFAICS you only use them to build the driver version string. + +#define AQ_CFG_DRV_AUTHOR "aQuantia" +#define AQ_CFG_DRV_DESC

Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-19 Thread Lino Sanfilippo
Hi, On 18.12.2016 19:30, Pavel Machek wrote: > Hi! > >> > - e1efa87241272104d6a12c8b9fcdc4f62634d447 >> >> Yep, a sync of the dma descriptors before the hardware gets ownership of the >> tx tail >> idx is missing in the stmmac, too. > > I can reproduce failure with 4.4 fairly easily. I tried

Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-18 Thread Lino Sanfilippo
Hi, On 18.12.2016 01:15, Francois Romieu wrote: > Pavel Machek : > [...] >> Won't this up/down the interface, in a way userspace can observe? > > It won't up/down the interface as it doesn't exactly mimic what the > network code does (there's more than rtnl_lock). > Right.

Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-15 Thread Lino Sanfilippo
On 15.12.2016 22:32, Lino Sanfilippo wrote: > Ah ok. Then maybe priv->hw->dma->stop_tx() does not do the job correctly > (stop the > tx path properly) and the HW is still active on the tx path while the tx > buffers are > freed. OTOH stmmac_release() also stops the p

Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-15 Thread Lino Sanfilippo
On 15.12.2016 22:03, Pavel Machek wrote: > > I actually did experiment with adding locking there, too, and no, no > luck. It seems stmmac_tx_err() is more broken than just locking. > Ah ok. Then maybe priv->hw->dma->stop_tx() does not do the job correctly (stop the tx path properly) and the

Re: [PATCH v2 2/2] net: ethernet: stmmac: remove private tx queue lock

2016-12-15 Thread Lino Sanfilippo
Hi, On 15.12.2016 10:45, Pavel Machek wrote: > Hi! > >> The driver uses a private lock for synchronization of the xmit function and >> the xmit completion handler, but since the NETIF_F_LLTX flag is not set, >> the xmit function is also called with the xmit_lock held. >> >> On the other hand

Re: [PATCH v2 2/2] net: ethernet: stmmac: remove private tx queue lock

2016-12-15 Thread Lino Sanfilippo
Hi, On 15.12.2016 19:52, Niklas Cassel wrote: > Since v1 of this patch has already been merged to net-next, I think that > you should create a new patch on top of that, rather than submitting a v2. > >

Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-15 Thread Lino Sanfilippo
Hi Pavel, sorry for the late reply. On 11.12.2016 21:11, Pavel Machek wrote: > > Do you understand what stmmac_tx_err(priv); is supposed to do? In > particular, if it is called while the driver is working ok -- should > the driver survive that? As far as I understood it is supposed to fixup an

Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-09 Thread Lino Sanfilippo
Hi, On 09.12.2016 12:21, Pavel Machek wrote: > On Fri 2016-12-09 00:19:43, Francois Romieu wrote: >> Lino Sanfilippo <linosanfili...@gmx.de> : >> [...] >> > OTOH Pavel said that he actually could produce a deadlock. Now I wonder if >> > this is caused

[PATCH v2 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-08 Thread Lino Sanfilippo
the private lock and (in case that the tx queue had been stopped) then the xmit_lock. Improve the locking by removing the private lock and using only the xmit_lock for synchronization instead. Signed-off-by: Lino Sanfilippo <linosanfili...@gmx.de> --- drivers/net/ethernet/samsung

[PATCH v2 2/2] net: ethernet: stmmac: remove private tx queue lock

2016-12-08 Thread Lino Sanfilippo
the private lock and (in case that the tx queue had been stopped) then the xmit_lock. Improve the locking by removing the private lock and using only the xmit_lock for synchronization instead. Signed-off-by: Lino Sanfilippo <linosanfili...@gmx.de> --- drivers/net/ethernet/stmicro/stmmac/st

Remove private tx queue locks

2016-12-08 Thread Lino Sanfilippo
Hi, this patch series removes unnecessary private locks in the sxgbe and the stmmac driver. v2: - adjust commit message

Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-08 Thread Lino Sanfilippo
On 08.12.2016 23:18, Pavel Machek wrote: > On Thu 2016-12-08 23:12:10, Lino Sanfilippo wrote: >> Hi, >> >> On 08.12.2016 22:54, Pavel Machek wrote: >> > On Thu 2016-12-08 21:32:12, Lino Sanfilippo wrote: >> >> Hi, >> >> >> >> O

Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-08 Thread Lino Sanfilippo
Hi, On 08.12.2016 22:54, Pavel Machek wrote: > On Thu 2016-12-08 21:32:12, Lino Sanfilippo wrote: >> Hi, >> >> On 08.12.2016 00:15, Francois Romieu wrote: >> > Lino Sanfilippo <linosanfili...@gmx.de> : >> >> The driver uses a private lock for

Re: [PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-08 Thread Lino Sanfilippo
Hi, On 08.12.2016 00:15, Francois Romieu wrote: > Lino Sanfilippo <linosanfili...@gmx.de> : >> The driver uses a private lock for synchronization between the xmit >> function and the xmit completion handler, but since the NETIF_F_LLTX flag >> is not set, the x

Re: [PATCH 2/2] net: ethernet: stmmac: remove private tx queue lock

2016-12-07 Thread Lino Sanfilippo
On 07.12.2016 22:43, Lino Sanfilippo wrote: > Hi Pavel, > > On 07.12.2016 22:37, Pavel Machek wrote: >> On Wed 2016-12-07 21:05:38, Lino Sanfilippo wrote: >>> The driver uses a private lock for synchronization between the xmit >>> function and the x

Re: [PATCH 2/2] net: ethernet: stmmac: remove private tx queue lock

2016-12-07 Thread Lino Sanfilippo
Hi Pavel, On 07.12.2016 22:37, Pavel Machek wrote: > On Wed 2016-12-07 21:05:38, Lino Sanfilippo wrote: >> The driver uses a private lock for synchronization between the xmit >> function and the xmit completion handler, but since the NETIF_F_LLTX flag >> is not set, the

Re: [PATCH] net: ethernet: slicoss: use module_pci_driver()

2016-12-07 Thread Lino Sanfilippo
- pci_unregister_driver(_driver); > -} > - > -module_init(slic_init_module); > -module_exit(slic_cleanup_module); > +module_pci_driver(slic_driver); > > MODULE_DESCRIPTION("Alacritech non-accelerated SLIC driver"); > MODULE_AUTHOR("Lino Sanfilippo <linosanfili...@gmx.de>"); > Yes, makes sense. Acked-by: Lino Sanfilippo <linosanfili...@gmx.de> Thanks, Lino

[PATCH 2/2] net: ethernet: stmmac: remove private tx queue lock

2016-12-07 Thread Lino Sanfilippo
the now unnecessary double check for a stopped tx queue. Signed-off-by: Lino Sanfilippo <linosanfili...@gmx.de> --- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 - drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 28 +-- 2 files changed, 6 insertions(+), 23 del

[PATCH 1/2] net: ethernet: sxgbe: remove private tx queue lock

2016-12-07 Thread Lino Sanfilippo
the now unnecessary double check for a stopped tx queue. Signed-off-by: Lino Sanfilippo <linosanfili...@gmx.de> --- drivers/net/ethernet/samsung/sxgbe/sxgbe_common.h | 1 - drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 27 +-- 2 files changed, 6 insertions(+), 22 del

Remove private locks to avoid possible deadlock

2016-12-07 Thread Lino Sanfilippo
Hi, these patches fix possible deadlock situations in the sxgbe and stmmac driver. Please note that the patches are only compile tested so it would be great if someone could do tests with the concerning HW. Regards, Lino

Re: [PATCH 1/1] ixgbe: write flush vfta registers

2016-12-07 Thread Lino Sanfilippo
Hi Zhu, On 07.12.2016 04:05, zhuyj wrote: > After several week tests, your advice still make this bug appear. But > my patch make this bug disappear. > > Zhu Yanjun > In your commit message you wrote "Sometimes vfta registers can not be written successfully in dcb mode." Do you mean that the

Re: [RFC] Re: Re: stmmac ethernet in kernel 4.9-rc6: coalescing related pauses.

2016-12-07 Thread Lino Sanfilippo
Hi, On 07.12.2016 13:31, Pavel Machek wrote: On Fri 2016-12-02 15:05:21, Lino Sanfilippo wrote: Hi, There's nothing that protect stmmac_poll() from running concurently with stmmac_dma_interrupt(), right? could it be that there is also another issue concerned locking?: The tx completion

Re: Gigabit ethernet driver for Alacritechs SLIC devices (v4)

2016-12-06 Thread Lino Sanfilippo
On 06.12.2016 17:30, David Miller wrote: > From: Lino Sanfilippo <linosanfili...@gmx.de> > Date: Mon, 5 Dec 2016 23:07:15 +0100 > >> this is the forth version of the slicoss gigabit ethernet driver (which is a >> rework of the driver from Alacritech which can currentl

Re: Avoid deadlock situation due to use of xmit_lock

2016-12-06 Thread Lino Sanfilippo
Hi, On 06.12.2016 16:06, David Miller wrote: > From: Lino Sanfilippo <linosanfili...@gmx.de> > Date: Sat, 3 Dec 2016 00:06:04 +0100 > >> after stumbling over a potential deadlock situation in the altera driver >> (see http://marc.info/?l=linux-netdev=148054615230447

Re: stmmac ethernet in kernel 4.9-rc6: coalescing related pauses.

2016-12-05 Thread Lino Sanfilippo
> > You mean stmmac_xmit()? Thats also softirq AFAICT, its the TX softirq > > Regards, > Lino > > Hmm. netdevices.txt says: ndo_start_xmit: ... Context: Process with BHs disabled or BH (timer), will be called with interrupts disabled by netconsole.

Re: stmmac ethernet in kernel 4.9-rc6: coalescing related pauses.

2016-12-05 Thread Lino Sanfilippo
On 05.12.2016 23:40, Pavel Machek wrote: > On Mon 2016-12-05 23:37:09, Lino Sanfilippo wrote: >> Hi Pavel, >> >> On 05.12.2016 23:02, Pavel Machek wrote: >> > >> > we need spin_lock_bh at minimum, as we are locking user context >

Re: stmmac ethernet in kernel 4.9-rc6: coalescing related pauses.

2016-12-05 Thread Lino Sanfilippo
Hi Pavel, On 05.12.2016 23:02, Pavel Machek wrote: > > we need spin_lock_bh at minimum, as we are locking user context > against timer. > > Best regards, > Pavel > I was referring to stmmac_tx_clean() which AFAICS is only

[PATCH v4 net-next 2/2] MAINTAINERS: add entry for slicoss ethernet driver

2016-12-05 Thread Lino Sanfilippo
Add myself as maintainer for the slicoss ethernet driver. Signed-off-by: Lino Sanfilippo <linosanfili...@gmx.de> --- MAINTAINERS | 5 + 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 6781a3f..bb9af28 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -562,6 +

[PATCH v4 net-next 1/2] net: ethernet: slicoss: add slicoss gigabit ethernet driver

2016-12-05 Thread Lino Sanfilippo
) copper and fiber - Kalahari cards (dual and quad port PCI-e Gigabit) copper and fiber Signed-off-by: Lino Sanfilippo <linosanfili...@gmx.de> --- drivers/net/ethernet/Kconfig |1 + drivers/net/ethernet/Makefile |1 + drivers/net/ethernet/alacritech/Kconfig

Gigabit ethernet driver for Alacritechs SLIC devices (v4)

2016-12-05 Thread Lino Sanfilippo
Hi, this is the forth version of the slicoss gigabit ethernet driver (which is a rework of the driver from Alacritech which can currently be found under drivers/staging/slicoss). The driver is supposed to support Mojave, Oasis and Kalahari cards, for both copper and fiber. If this code is

Re: stmmac ethernet in kernel 4.9-rc6: coalescing related pauses.

2016-12-05 Thread Lino Sanfilippo
Hi, > > Actually, I was wrong. irqlock protection is needed, since > stmmac_tx_clean() is called from timer, and that's interrupt context, > as you can confirm using BUG_ON(in_interrupt()); > in_interrupt() can mean both softirq and hardirq context. In this case it means softirq. So I guess

Re: [PATCH 1/1] net: ethernet: 3com: set error code on failures

2016-12-03 Thread Lino Sanfilippo
Hi, On 03.12.2016 14:24, Pan Bian wrote: > From: Pan Bian > > In function typhoon_init_one(), returns the value of variable err on > errors. However, on some error paths, variable err is not set to a > negative errno. This patch assigns "-EIO" to err on those paths. > >

Avoid deadlock situation due to use of xmit_lock

2016-12-02 Thread Lino Sanfilippo
Hi, after stumbling over a potential deadlock situation in the altera driver (see http://marc.info/?l=linux-netdev=148054615230447=2), I checked all other ethernet drivers for the same issue and actually found it in 2 more, namely stmmac, and sxgbe. Please see the commit messages for a

[PATCH 1/2] net: ethernet: sxgbe: do not use xmit_lock in tx completion handler

2016-12-02 Thread Lino Sanfilippo
an unnecessary double check for a stopped tx queue. Signed-off-by: Lino Sanfilippo <linosanfili...@gmx.de> --- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) Please note that this patch is only compile tested. diff

[PATCH 2/2] net: ethernet: stmmac: do not use xmit_lock in tx completion handler

2016-12-02 Thread Lino Sanfilippo
an unnecessary double check for a stopped tx queue. Signed-off-by: Lino Sanfilippo <linosanfili...@gmx.de> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) Please note that this patch is only compile tested. diff

Aw: Re: stmmac ethernet in kernel 4.9-rc6: coalescing related pauses.

2016-12-02 Thread Lino Sanfilippo
Hi, > > There's nothing that protect stmmac_poll() from running concurently > with stmmac_dma_interrupt(), right? > could it be that there is also another issue concerned locking?: The tx completion handler takes the xmit_lock in case that the netif_queue is stopped. This is AFAICS

[PATCH 2/2] net: ethernet: altera: TSE: do not use tx queue lock in tx completion handler

2016-11-30 Thread Lino Sanfilippo
while xmit completion handler does the reverse, first take the private lock, then the xmit_lock. Fix these issues by not taking the xmit_lock in the tx completion handler. Signed-off-by: Lino Sanfilippo <linosanfili...@gmx.de> --- drivers/net/ethernet/altera/altera_tse_main.c | 2 -- 1 file c

[PATCH 1/2] net: ethernet: altera: TSE: Remove unneeded dma sync for tx buffers

2016-11-30 Thread Lino Sanfilippo
An explicit dma sync for device directly after mapping as well as an explicit dma sync for cpu directly before unmapping is unnecessary and costly on the hotpath. So remove these calls. Signed-off-by: Lino Sanfilippo <linosanfili...@gmx.de> --- drivers/net/ethernet/altera/altera_tse_main.

Re: [PATCH v3 net-next 1/2] net: ethernet: slicoss: add slicoss gigabit ethernet driver

2016-11-30 Thread Lino Sanfilippo
On 29.11.2016 18:14, Florian Fainelli wrote: > On 11/28/2016 01:41 PM, Lino Sanfilippo wrote: >> The problem is that the HW does not provide a tx completion index. Instead >> we have to >> iterate the status descriptors until we get an invali

Re: Aw: Re: [PATCH] mlx4: give precise rx/tx bytes/packets counters

2016-11-28 Thread Lino Sanfilippo
Hi Eric, On 25.11.2016 20:19, Eric Dumazet wrote: > On Fri, 2016-11-25 at 17:30 +0100, Lino Sanfilippo wrote: >> Hi, >> >> >> > >> > The READ_ONCE() are documenting the fact that no lock is taken to fetch >> > the stats, while another cpus might

Re: [PATCH v3 net-next 1/2] net: ethernet: slicoss: add slicoss gigabit ethernet driver

2016-11-28 Thread Lino Sanfilippo
Hi Florian, On 28.11.2016 05:56, Florian Fainelli wrote: > On 11/26/2016 04:20 AM, Lino Sanfilippo wrote: >> Add driver for Alacritech gigabit ethernet cards with SLIC (session-layer >> interface control) technology. The driver provides basic support without >> SLIC for

Re: [PATCH v3 net-next 1/2] net: ethernet: slicoss: add slicoss gigabit ethernet driver

2016-11-28 Thread Lino Sanfilippo
Hi Markus, On 27.11.2016 18:59, Markus Böhme wrote: > Hello Lino, > > just some things barely worth mentioning: > > > I found a bunch of unused #defines in slic.h. I cannot judge if they are > worth keeping: > > SLIC_VRHSTATB_LONGE > SLIC_VRHSTATB_PREA > SLIC_ISR_IO >

Re: stmmac ethernet in kernel 4.4: coalescing related pauses?

2016-11-28 Thread Lino Sanfilippo
On 28.11.2016 17:30, David Miller wrote: From: Lino Sanfilippo <lsan...@marvell.com> Date: Mon, 28 Nov 2016 16:57:35 +0100 I wonder if the best fix would be indeed to deactivate irq coalescing completely. Does it make any sense at all to use it if a driver uses NAPI already? It abso

  1   2   >