Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next 1/2] tipc: fix excessive network event logging
From: David Miller @ 2015-01-27  1:04 UTC (permalink / raw)
  To: erik.hugne; +Cc: richard.alpe, netdev, jon.maloy, ying.xue, tipc-discussion
In-Reply-To: <1421943032-29924-1-git-send-email-erik.hugne@ericsson.com>

From: <erik.hugne@ericsson.com>
Date: Thu, 22 Jan 2015 17:10:31 +0100

> From: Erik Hugne <erik.hugne@ericsson.com>
> 
> If a large number of namespaces is spawned on a node and TIPC is
> enabled in each of these, the excessive printk tracing of network
> events will cause the system to grind down to a near halt.
> The traces are still of debug value, so instead of removing them
> completely we fix it by changing the link state and node availability
> logging debug traces.
> 
> Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>

Applied.

^ permalink raw reply

* [PATCH net-next] net: phy: Invalidate LP advertising flags when restarting or disabling AN
From: Ben Hutchings @ 2015-01-27  0:58 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: netdev, linux-kernel

It is possible to see the old value of the LP advertising flags
through ethtool after reconfiguring the PHY and before autonegotiation
completes.  If autonegotiation is turned off then the last value seen
will persist indefinitely.

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
---
 drivers/net/phy/phy.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 767cd11..cdcac6a 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -439,6 +439,9 @@ int phy_start_aneg(struct phy_device *phydev)
 	if (AUTONEG_DISABLE == phydev->autoneg)
 		phy_sanitize_settings(phydev);
 
+	/* Invalidate LP advertising flags */
+	phydev->lp_advertising = 0;
+
 	err = phydev->drv->config_aneg(phydev);
 	if (err < 0)
 		goto out_unlock;
-- 
1.7.10.4

^ permalink raw reply related

* Re: [PATCH net-next 2/2] flow_dissector: add tipc support
From: David Miller @ 2015-01-27  0:57 UTC (permalink / raw)
  To: eric.dumazet
  Cc: erik.hugne, richard.alpe, netdev, jon.maloy, ying.xue,
	tipc-discussion
In-Reply-To: <1421947751.3471.12.camel@edumazet-glaptop2.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 22 Jan 2015 09:29:11 -0800

> On Thu, 2015-01-22 at 17:10 +0100, erik.hugne@ericsson.com wrote:
>> From: Erik Hugne <erik.hugne@ericsson.com>
>> 
>> The flows are hashed on the sending node address, which allows us
>> to spread out the TIPC link processing to RPS enabled cores. There
>> is no point to include the destination address in the hash as that
>> will always be the same for all inbound links. We have experimented
>> with a 3-tuple hash over [srcnode, sport, dport], but this showed to
>> give slightly lower performance because of increased lock contention
>> when the same link was handled by multiple cores.
>> 
>> Signed-off-by: Ying Xue <ying.xue@windriver.com>
>> Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
>> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
>> ---
>>  net/core/flow_dissector.c | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>> 
>> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
>> index 4508493..beb83d1 100644
>> --- a/net/core/flow_dissector.c
>> +++ b/net/core/flow_dissector.c
>> @@ -178,6 +178,20 @@ ipv6:
>>  			return false;
>>  		}
>>  	}
>> +	case htons(ETH_P_TIPC): {
>> +		struct {
>> +			__be32 pre[3];
>> +			__be32 srcnode;
>> +		} *hdr, _hdr;
> 
> Is this header defined somewhere in an include file ?
> 
> This looks a bit ugly to locally define the format...

I'd like this situation improved but I plan to apply this as-is for
now.

^ permalink raw reply

* Re: [Linux-kernel] [PATCH kernel 0/4] Fixes for sh_eth #3
From: Ben Hutchings @ 2015-01-27  0:51 UTC (permalink / raw)
  To: David S.Miller
  Cc: linux-kernel, Yoshihiro Kaneko, Mitsuhiro Kimura, netdev,
	Hisashi Nakamura, Nobuhiro Iwamatsu
In-Reply-To: <1422319232.3524.14.camel@xylophone.i.decadent.org.uk>

On Tue, 2015-01-27 at 00:40 +0000, Ben Hutchings wrote:
> I'm continuing review and testing of Ethernet support on the R-Car H2
> chip.  This series fixes the last of the more serious issues I've found.
> 
> These are not tested on any of the other supported chips.

Excuse me, that subject prefix should be 'PATCH net'.

Ben.

^ permalink raw reply

* [PATCH kernel 4/4] sh_eth: Fix DMA-API usage for RX buffers
From: Ben Hutchings @ 2015-01-27  0:50 UTC (permalink / raw)
  To: David S.Miller
  Cc: netdev, linux-kernel, Nobuhiro Iwamatsu, Mitsuhiro Kimura,
	Hisashi Nakamura, Yoshihiro Kaneko
In-Reply-To: <1422319232.3524.14.camel@xylophone.i.decadent.org.uk>

- Use the return value of dma_map_single(), rather than calling
  virt_to_page() separately
- Check for mapping failue
- Call dma_unmap_single() rather than dma_sync_single_for_cpu()

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
---
 drivers/net/ethernet/renesas/sh_eth.c |   34 ++++++++++++++++++++++-----------
 1 file changed, 23 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 48610ed..4da8bd2 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1123,6 +1123,7 @@ static void sh_eth_ring_format(struct net_device *ndev)
 	int rx_ringsize = sizeof(*rxdesc) * mdp->num_rx_ring;
 	int tx_ringsize = sizeof(*txdesc) * mdp->num_tx_ring;
 	int skbuff_size = mdp->rx_buf_sz + SH_ETH_RX_ALIGN - 1;
+	dma_addr_t dma_addr;
 
 	mdp->cur_rx = 0;
 	mdp->cur_tx = 0;
@@ -1136,7 +1137,6 @@ static void sh_eth_ring_format(struct net_device *ndev)
 		/* skb */
 		mdp->rx_skbuff[i] = NULL;
 		skb = netdev_alloc_skb(ndev, skbuff_size);
-		mdp->rx_skbuff[i] = skb;
 		if (skb == NULL)
 			break;
 		sh_eth_set_receive_align(skb);
@@ -1145,9 +1145,15 @@ static void sh_eth_ring_format(struct net_device *ndev)
 		rxdesc = &mdp->rx_ring[i];
 		/* The size of the buffer is a multiple of 16 bytes. */
 		rxdesc->buffer_length = ALIGN(mdp->rx_buf_sz, 16);
-		dma_map_single(&ndev->dev, skb->data, rxdesc->buffer_length,
-			       DMA_FROM_DEVICE);
-		rxdesc->addr = virt_to_phys(skb->data);
+		dma_addr = dma_map_single(&ndev->dev, skb->data,
+					  rxdesc->buffer_length,
+					  DMA_FROM_DEVICE);
+		if (dma_mapping_error(&ndev->dev, dma_addr)) {
+			kfree_skb(skb);
+			break;
+		}
+		mdp->rx_skbuff[i] = skb;
+		rxdesc->addr = dma_addr;
 		rxdesc->status = cpu_to_edmac(mdp, RD_RACT | RD_RFP);
 
 		/* Rx descriptor address set */
@@ -1432,6 +1438,7 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
 	u16 pkt_len = 0;
 	u32 desc_status;
 	int skbuff_size = mdp->rx_buf_sz + SH_ETH_RX_ALIGN - 1;
+	dma_addr_t dma_addr;
 
 	boguscnt = min(boguscnt, *quota);
 	limit = boguscnt;
@@ -1479,9 +1486,9 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
 			mdp->rx_skbuff[entry] = NULL;
 			if (mdp->cd->rpadir)
 				skb_reserve(skb, NET_IP_ALIGN);
-			dma_sync_single_for_cpu(&ndev->dev, rxdesc->addr,
-						ALIGN(mdp->rx_buf_sz, 16),
-						DMA_FROM_DEVICE);
+			dma_unmap_single(&ndev->dev, rxdesc->addr,
+					 ALIGN(mdp->rx_buf_sz, 16),
+					 DMA_FROM_DEVICE);
 			skb_put(skb, pkt_len);
 			skb->protocol = eth_type_trans(skb, ndev);
 			netif_receive_skb(skb);
@@ -1501,15 +1508,20 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
 
 		if (mdp->rx_skbuff[entry] == NULL) {
 			skb = netdev_alloc_skb(ndev, skbuff_size);
-			mdp->rx_skbuff[entry] = skb;
 			if (skb == NULL)
 				break;	/* Better luck next round. */
 			sh_eth_set_receive_align(skb);
-			dma_map_single(&ndev->dev, skb->data,
-				       rxdesc->buffer_length, DMA_FROM_DEVICE);
+			dma_addr = dma_map_single(&ndev->dev, skb->data,
+						  rxdesc->buffer_length,
+						  DMA_FROM_DEVICE);
+			if (dma_mapping_error(&ndev->dev, dma_addr)) {
+				kfree_skb(skb);
+				break;
+			}
+			mdp->rx_skbuff[entry] = skb;
 
 			skb_checksum_none_assert(skb);
-			rxdesc->addr = virt_to_phys(skb->data);
+			rxdesc->addr = dma_addr;
 		}
 		if (entry >= mdp->num_rx_ring - 1)
 			rxdesc->status |=
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH kernel 3/4] sh_eth: Check for DMA mapping errors on transmit
From: Ben Hutchings @ 2015-01-27  0:49 UTC (permalink / raw)
  To: David S.Miller
  Cc: netdev, linux-kernel, Nobuhiro Iwamatsu, Mitsuhiro Kimura,
	Hisashi Nakamura, Yoshihiro Kaneko
In-Reply-To: <1422319232.3524.14.camel@xylophone.i.decadent.org.uk>

dma_map_single() may fail if an IOMMU or swiotlb is in use, so
we need to check for this.

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
---
 drivers/net/ethernet/renesas/sh_eth.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index e43c9ce..48610ed 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2174,6 +2174,10 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 				 skb->len + 2);
 	txdesc->addr = dma_map_single(&ndev->dev, skb->data, skb->len,
 				      DMA_TO_DEVICE);
+	if (dma_mapping_error(&ndev->dev, txdesc->addr)) {
+		kfree_skb(skb);
+		return NETDEV_TX_OK;
+	}
 	txdesc->buffer_length = skb->len;
 
 	if (entry >= mdp->num_tx_ring - 1)
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH kernel 2/4] sh_eth: Ensure DMA engines are stopped before freeing buffers
From: Ben Hutchings @ 2015-01-27  0:49 UTC (permalink / raw)
  To: David S.Miller
  Cc: netdev, linux-kernel, Nobuhiro Iwamatsu, Mitsuhiro Kimura,
	Hisashi Nakamura, Yoshihiro Kaneko
In-Reply-To: <1422319232.3524.14.camel@xylophone.i.decadent.org.uk>

Currently we try to clear EDRRR and EDTRR and immediately continue to
free buffers.  This is unsafe because:

- In general, register writes are not serialised with DMA, so we still
  have to wait for DMA to complete somehow
- The R8A7790 (R-Car H2) manual states that the TX running flag cannot
  be cleared by writing to EDTRR
- The same manual states that clearing the RX running flag only stops
  RX DMA at the next packet boundary

I applied this patch to the driver to detect DMA writes to freed
buffers:

> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -1098,7 +1098,14 @@ static void sh_eth_ring_free(struct net_device *ndev)
>  	/* Free Rx skb ringbuffer */
>  	if (mdp->rx_skbuff) {
>  		for (i = 0; i < mdp->num_rx_ring; i++)
> +			memcpy(mdp->rx_skbuff[i]->data,
> +			       "Hello, world", 12);
> +		msleep(100);
> +		for (i = 0; i < mdp->num_rx_ring; i++) {
> +			WARN_ON(memcmp(mdp->rx_skbuff[i]->data,
> +				       "Hello, world", 12));
>  			dev_kfree_skb(mdp->rx_skbuff[i]);
> +		}
>  	}
>  	kfree(mdp->rx_skbuff);
>  	mdp->rx_skbuff = NULL;

then ran the loop:

    while ethtool -G eth0 rx 128 ; ethtool -G eth0 rx 64; do echo -n .; done

and 'ping -f' toward the sh_eth port from another machine.  The
warning fired several times a minute.

To fix these issues:

- Deactivate all TX descriptors rather than writing to EDTRR
- As there seems to be no way of telling when RX DMA is stopped,
  perform a soft reset to ensure that both DMA enginess are stopped
- To reduce the possibility of the reset truncating a transmitted
  frame, disable egress and wait a reasonable time to reach a
  packet boundary before resetting
- Update statistics before resetting

(The 'reasonable time' does not allow for CS/CD in half-duplex
mode, but half-duplex no longer seems reasonable!)

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
---
I would prefer to find a way to wait for the DMA engines to stop, so
that it's only necessary to reset if they fail to do so within some time
limit.  But I just don't see it.

Ben.

 drivers/net/ethernet/renesas/sh_eth.c |   39 +++++++++++++++++++++++++++------
 1 file changed, 32 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 3b49375..e43c9ce 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -396,6 +396,9 @@ static const u16 sh_eth_offset_fast_sh3_sh2[SH_ETH_MAX_REGISTER_OFFSET] = {
 	[TSU_ADRL31]	= 0x01fc,
 };
 
+static void sh_eth_rcv_snd_disable(struct net_device *ndev);
+static struct net_device_stats *sh_eth_get_stats(struct net_device *ndev);
+
 static bool sh_eth_is_gether(struct sh_eth_private *mdp)
 {
 	return mdp->reg_offset == sh_eth_offset_gigabit;
@@ -1358,6 +1361,33 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
 	return ret;
 }
 
+static void sh_eth_dev_exit(struct net_device *ndev)
+{
+	struct sh_eth_private *mdp = netdev_priv(ndev);
+	int i;
+
+	/* Deactivate all TX descriptors, so DMA should stop at next
+	 * packet boundary if it's currently running
+	 */
+	for (i = 0; i < mdp->num_tx_ring; i++)
+		mdp->tx_ring[i].status &= ~cpu_to_edmac(mdp, TD_TACT);
+
+	/* Disable TX FIFO egress to MAC */
+	sh_eth_rcv_snd_disable(ndev);
+
+	/* Stop RX DMA at next packet boundary */
+	sh_eth_write(ndev, 0, EDRRR);
+
+	/* Aside from TX DMA, we can't tell when the hardware is
+	 * really stopped, so we need to reset to make sure.
+	 * Before doing that, wait for long enough to *probably*
+	 * finish transmitting the last packet and poll stats.
+	 */
+	msleep(2); /* max frame time at 10 Mbps < 1250 us */
+	sh_eth_get_stats(ndev);
+	sh_eth_reset(ndev);
+}
+
 /* free Tx skb function */
 static int sh_eth_txfree(struct net_device *ndev)
 {
@@ -1986,9 +2016,7 @@ static int sh_eth_set_ringparam(struct net_device *ndev,
 		napi_synchronize(&mdp->napi);
 		sh_eth_write(ndev, 0x0000, EESIPR);
 
-		/* Stop the chip's Tx and Rx processes. */
-		sh_eth_write(ndev, 0, EDTRR);
-		sh_eth_write(ndev, 0, EDRRR);
+		sh_eth_dev_exit(ndev);
 
 		/* Free all the skbuffs in the Rx queue. */
 		sh_eth_ring_free(ndev);
@@ -2207,11 +2235,8 @@ static int sh_eth_close(struct net_device *ndev)
 	napi_disable(&mdp->napi);
 	sh_eth_write(ndev, 0x0000, EESIPR);
 
-	/* Stop the chip's Tx and Rx processes. */
-	sh_eth_write(ndev, 0, EDTRR);
-	sh_eth_write(ndev, 0, EDRRR);
+	sh_eth_dev_exit(ndev);
 
-	sh_eth_get_stats(ndev);
 	/* PHY Disconnect */
 	if (mdp->phydev) {
 		phy_stop(mdp->phydev);
-- 
1.7.10.4

^ permalink raw reply related

* Re: [PATCH net-next v2 0/5] bonding: various 802.3ad fixes
From: Andy Gospodarek @ 2015-01-27  0:49 UTC (permalink / raw)
  To: Jonathan Toppins; +Cc: Jay Vosburgh, Veaceslav Falico, netdev
In-Reply-To: <1422253021-3798-1-git-send-email-jtoppins@cumulusnetworks.com>

On Mon, Jan 26, 2015 at 01:16:56AM -0500, Jonathan Toppins wrote:
> This patch series is a forward porting of patches we (Cumulus) are shipping
> in our 3.2 series kernels. These fixes attempt to make 802.3ad bonding mode
> more predictable in certian state machine transtions in addition to fixing
> 802.3ad bond carrier determination when bonding min_links option is changed.
> Specific notes are contained within each patch.
> 
> For this patch series there are no userspace facing changes, a diff between
> the modinfo output showed no difference. However, there are behavioral
> facing changes, primarily in the bond carrier state. Please make sure to
> review carefully.
> 
> v2:
>  * fixed some style issues
>  * dropped a portion of patch 1 in favor of more testing on my side
> 
> Jonathan Toppins (2):
>   bonding: update bond carrier state when min_links option changes
>   bonding: cleanup and remove dead code
> 
> Satish Ashok (1):
>   bonding: fix LACP PDU not sent on slave port sometimes
> 
> Wilson Kok (2):
>   bonding: fix bond_open() don't always set slave active flag
>   bonding: fix incorrect lacp mux state when agg not active
> 
>  drivers/net/bonding/bond_3ad.c     |   55 +++++++++++++++++++++++++++---------
>  drivers/net/bonding/bond_main.c    |    6 ++--
>  drivers/net/bonding/bond_options.c |    1 +
>  include/net/bond_3ad.h             |    1 -
>  include/net/bonding.h              |    1 +
>  5 files changed, 47 insertions(+), 17 deletions(-)

Great work on this, Jon.

For the series:

Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com>

^ permalink raw reply

* Re: [PATCH net-next v2 5/5] bonding: cleanup and remove dead code
From: Jay Vosburgh @ 2015-01-27  0:46 UTC (permalink / raw)
  To: Jonathan Toppins; +Cc: Veaceslav Falico, Andy Gospodarek, netdev
In-Reply-To: <1422253021-3798-6-git-send-email-jtoppins@cumulusnetworks.com>

Jonathan Toppins <jtoppins@cumulusnetworks.com> wrote:

>fix sparse warning about non-static function
>
>drivers/net/bonding/bond_main.c:3737:5: warning: symbol
>'bond_3ad_xor_xmit' was not declared. Should it be static?
>
>Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com>
>Signed-off-by: Jonathan Toppins <jtoppins@cumulusnetworks.com>

Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>

>---
> drivers/net/bonding/bond_main.c |    2 +-
> include/net/bond_3ad.h          |    1 -
> 2 files changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index c475d90..67437f3 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -3734,7 +3734,7 @@ out:
>  * usable slave array is formed in the control path. The xmit function
>  * just calculates hash and sends the packet out.
>  */
>-int bond_3ad_xor_xmit(struct sk_buff *skb, struct net_device *dev)
>+static int bond_3ad_xor_xmit(struct sk_buff *skb, struct net_device *dev)
> {
> 	struct bonding *bond = netdev_priv(dev);
> 	struct slave *slave;
>diff --git a/include/net/bond_3ad.h b/include/net/bond_3ad.h
>index e01d903..f04cdbb 100644
>--- a/include/net/bond_3ad.h
>+++ b/include/net/bond_3ad.h
>@@ -274,7 +274,6 @@ void bond_3ad_handle_link_change(struct slave *slave, char link);
> int  bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info);
> int  __bond_3ad_get_active_agg_info(struct bonding *bond,
> 				    struct ad_info *ad_info);
>-int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev);
> int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
> 			 struct slave *slave);
> int bond_3ad_set_carrier(struct bonding *bond);
>-- 
>1.7.10.4
>

^ permalink raw reply

* Re: [PATCH net-next v2 4/5] bonding: fix LACP PDU not sent on slave port sometimes
From: Jay Vosburgh @ 2015-01-27  0:45 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Jonathan Toppins, Veaceslav Falico, Andy Gospodarek, netdev,
	Satish Ashok, Andy Gospodarek
In-Reply-To: <54C62D5E.9030200@cogentembedded.com>

Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> wrote:

>Hello.
>
>On 1/26/2015 9:17 AM, Jonathan Toppins wrote:
>
>> From: Satish Ashok <sashok@cumulusnetworks.com>
>
>> When a slave is added to a bond and it is not in full duplex mode,
>> AD_PORT_LACP_ENABLED flag is cleared, due to this LACP PDU is not sent
>
>   s/is not/not being/.

	I don't have an issue with the original text, or the updating of
nearby debug messages to include the device name (below).  Worst case
would be to respin and add a mention of this to the commit message.

	-J

Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>


>> on slave. When the duplex is changed to full, the flag needs to be set
>> to send LACP PDU.
>
>> Cc: Andy Gospodarek <gospo@cumulusnetworks.com>
>> Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com>
>> Signed-off-by: Satish Ashok <sashok@cumulusnetworks.com>
>> Signed-off-by: Jonathan Toppins <jtoppins@cumulusnetworks.com>
>> ---
>>   drivers/net/bonding/bond_3ad.c |   11 ++++++++---
>>   1 file changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>> index e3c96b2..cfc4a9c 100644
>> --- a/drivers/net/bonding/bond_3ad.c
>> +++ b/drivers/net/bonding/bond_3ad.c
>> @@ -2219,8 +2219,10 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave,
>>   		switch (lacpdu->subtype) {
>>   		case AD_TYPE_LACPDU:
>>   			ret = RX_HANDLER_CONSUMED;
>> -			netdev_dbg(slave->bond->dev, "Received LACPDU on port %d\n",
>> -				   port->actor_port_number);
>> +			netdev_dbg(slave->bond->dev,
>> +				   "Received LACPDU on port %d slave %s\n",
>> +				   port->actor_port_number,
>> +				   slave->dev->name);
>>   			/* Protect against concurrent state machines */
>>   			spin_lock(&slave->bond->mode_lock);
>>   			ad_rx_machine(lacpdu, port);
>> @@ -2312,7 +2314,10 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave)
>>   	port->actor_admin_port_key &= ~AD_DUPLEX_KEY_MASKS;
>>   	port->actor_oper_port_key = port->actor_admin_port_key |=
>>   		__get_duplex(port);
>> -	netdev_dbg(slave->bond->dev, "Port %d changed duplex\n", port->actor_port_number);
>> +	netdev_dbg(slave->bond->dev, "Port %d slave %s changed duplex\n",
>> +		   port->actor_port_number, slave->dev->name);
>
>   The above 2 changes seem unrelated/undocumented in the change log...
>
>[...]
>
>WBR, Sergei
>

---
	-Jay Vosburgh, jay.vosburgh@canonical.com

^ permalink raw reply

* Re: [PATCH 0/2] sh_eth: massage PM code
From: David Miller @ 2015-01-26 23:27 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: netdev, linux-sh
In-Reply-To: <5608250.lrFkJTjgSf@wasted.cogentembedded.com>

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Thu, 22 Jan 2015 01:16:54 +0300

>    Here's a set of 2 patches against DaveM's 'net-next.git' repo. We're adding
> the support for suspend/hibernation as well as somewhat changing the existing
> code. There are still MDIO-related issue with suspend (kernel exception), we've
> been working on it and shall address it with a separate patch...

Series applied, thanks.

^ permalink raw reply

* [PATCH kernel 1/4] sh_eth: Remove RX overflow log messages
From: Ben Hutchings @ 2015-01-27  0:41 UTC (permalink / raw)
  To: David S.Miller
  Cc: netdev, linux-kernel, Nobuhiro Iwamatsu, Mitsuhiro Kimura,
	Hisashi Nakamura, Yoshihiro Kaneko
In-Reply-To: <1422319232.3524.14.camel@xylophone.i.decadent.org.uk>

If RX traffic is overflowing the FIFO or DMA ring, logging every time
this happens just makes things worse.  These errors are visible in the
statistics anyway.

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
---
 drivers/net/ethernet/renesas/sh_eth.c |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 2c4820a..3b49375 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1575,7 +1575,6 @@ ignore_link:
 		if (intr_status & EESR_RFRMER) {
 			/* Receive Frame Overflow int */
 			ndev->stats.rx_frame_errors++;
-			netif_err(mdp, rx_err, ndev, "Receive Abort\n");
 		}
 	}
 
@@ -1594,13 +1593,11 @@ ignore_link:
 	if (intr_status & EESR_RDE) {
 		/* Receive Descriptor Empty int */
 		ndev->stats.rx_over_errors++;
-		netif_err(mdp, rx_err, ndev, "Receive Descriptor Empty\n");
 	}
 
 	if (intr_status & EESR_RFE) {
 		/* Receive FIFO Overflow int */
 		ndev->stats.rx_fifo_errors++;
-		netif_err(mdp, rx_err, ndev, "Receive FIFO Overflow\n");
 	}
 
 	if (!mdp->cd->no_ade && (intr_status & EESR_ADE)) {
-- 
1.7.10.4

^ permalink raw reply related

* [PATCH kernel 0/4] Fixes for sh_eth #3
From: Ben Hutchings @ 2015-01-27  0:40 UTC (permalink / raw)
  To: David S.Miller
  Cc: netdev, linux-kernel, Nobuhiro Iwamatsu, Mitsuhiro Kimura,
	Hisashi Nakamura, Yoshihiro Kaneko

I'm continuing review and testing of Ethernet support on the R-Car H2
chip.  This series fixes the last of the more serious issues I've found.

These are not tested on any of the other supported chips.

Ben.

Ben Hutchings (4):
  sh_eth: Remove RX overflow log messages
  sh_eth: Ensure DMA engines are stopped before freeing buffers
  sh_eth: Check for DMA mapping errors on transmit
  sh_eth: Fix DMA-API usage for RX buffers

 drivers/net/ethernet/renesas/sh_eth.c |   80 ++++++++++++++++++++++++---------
 1 file changed, 59 insertions(+), 21 deletions(-)

-- 
1.7.10.4

^ permalink raw reply

* Re: Anyone have working cable for Intel 40GB Ethernet NIC?
From: Greg Rose @ 2015-01-27  0:39 UTC (permalink / raw)
  To: Ben Greear; +Cc: netdev
In-Reply-To: <54C6D5E7.30906@candelatech.com>

On Mon, Jan 26, 2015 at 4:03 PM, Ben Greear <greearb@candelatech.com> wrote:
> I cannot find info on a direct-attached cable that is known to work..and the
> one I bought is not accepted by the driver/NIC.
>
> If anyone knows of a cable that works, please let me know
> so I can order one.
>
> Thanks,
> Ben

The cable I'm using here is a QSFP+ DA cable made by Amphenol.  The
part # G47684-001.

Hope that helps.

- Greg Rose
Intel Corp.
Networking Division
<gregory.v.rose@intel.com>

>
> --
> Ben Greear <greearb@candelatech.com>
> Candela Technologies Inc  http://www.candelatech.com
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH net-next v2 2/5] bonding: fix bond_open() don't always set slave active flag
From: Jay Vosburgh @ 2015-01-27  0:33 UTC (permalink / raw)
  To: Jonathan Toppins
  Cc: Veaceslav Falico, Andy Gospodarek, netdev, Wilson Kok,
	Andy Gospodarek
In-Reply-To: <1422253021-3798-3-git-send-email-jtoppins@cumulusnetworks.com>

Jonathan Toppins <jtoppins@cumulusnetworks.com> wrote:

>From: Wilson Kok <wkok@cumulusnetworks.com>
>
>Mode 802.3ad, fix incorrect bond slave active state when slave is not in
>active aggregator. During bond_open(), the bonding driver always sets
>the slave active flag to true if the bond is not in active-backup, alb,
>or tlb modes. Bonding should let the aggregator selection logic set the
>active flag when in 802.3ad mode.
>
>Cc: Andy Gospodarek <gospo@cumulusnetworks.com>
>Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com>
>Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com>
>Signed-off-by: Jonathan Toppins <jtoppins@cumulusnetworks.com>

Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>

>---
> drivers/net/bonding/bond_main.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 02ffedb..c475d90 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -3066,7 +3066,7 @@ static int bond_open(struct net_device *bond_dev)
> 			    slave != rcu_access_pointer(bond->curr_active_slave)) {
> 				bond_set_slave_inactive_flags(slave,
> 							      BOND_SLAVE_NOTIFY_NOW);
>-			} else {
>+			} else if (BOND_MODE(bond) != BOND_MODE_8023AD) {
> 				bond_set_slave_active_flags(slave,
> 							    BOND_SLAVE_NOTIFY_NOW);
> 			}
>-- 
>1.7.10.4
>

^ permalink raw reply

* [PATCH net-next 4/4] net: phy: avoid suspending twice a PHY
From: Florian Fainelli @ 2015-01-27  0:31 UTC (permalink / raw)
  To: netdev; +Cc: davem, s.hauer, b38611, Florian Fainelli
In-Reply-To: <1422318673-9418-1-git-send-email-f.fainelli@gmail.com>

As part of a call to ndo_close() a netdevice driver may call
phy_disconnect() -> phy_detach() -> phy_suspend(), such that the PHY is
suspsended at this point and a netdevice driver may clock gate the
backing peripheral providing MDIO bus accessses as well.

Update mdio_bus_phy_may_suspend() to return whether a PHY is allowed to
be suspended and conversely resumed if and only if it was not previously
suspended before while it is currently in detached (netdev pointer is
NULL) state.

This fixes bus errors seen during S2/S3 suspend/resume cycles for
netdevice drivers such as GENET which clock gates the entire Ethernet
MAC, including the MDIO bus block.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/phy/mdio_bus.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 20447741893a..095ef3fe369a 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -443,9 +443,13 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev)
 	if (!drv || !phydrv->suspend)
 		return false;
 
-	/* PHY not attached? May suspend. */
+	/* PHY not attached? May suspend if the PHY has not already been
+	 * suspended as part of a prior call to phy_disconnect() ->
+	 * phy_detach() -> phy_suspend() because the parent netdev might be the
+	 * MDIO bus driver and clock gated at this point.
+	 */
 	if (!netdev)
-		return true;
+		return !phydev->suspended;
 
 	/* Don't suspend PHY if the attched netdev parent may wakeup.
 	 * The parent may point to a PCI device, as in tg3 driver.
-- 
2.1.0

^ permalink raw reply related

* [PATCH net-next 3/4] net: phy: keep track of the PHY suspend state
From: Florian Fainelli @ 2015-01-27  0:31 UTC (permalink / raw)
  To: netdev; +Cc: davem, s.hauer, b38611, Florian Fainelli
In-Reply-To: <1422318673-9418-1-git-send-email-f.fainelli@gmail.com>

In order to avoid double calls to phydev->drv->suspend and resume, keep
track of whether the PHY has already been suspended as a consequence of
a successful call to phy_suspend(). We will use this in our MDIO bus
suspend/resume hooks to avoid a double suspend call.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/phy/phy_device.c | 22 ++++++++++++++++++----
 include/linux/phy.h          |  2 ++
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 3fc91e89f5a5..c90cecc0fe15 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -699,6 +699,7 @@ int phy_suspend(struct phy_device *phydev)
 {
 	struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver);
 	struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };
+	int ret = 0;
 
 	/* If the device has WOL enabled, we cannot suspend the PHY */
 	phy_ethtool_get_wol(phydev, &wol);
@@ -706,18 +707,31 @@ int phy_suspend(struct phy_device *phydev)
 		return -EBUSY;
 
 	if (phydrv->suspend)
-		return phydrv->suspend(phydev);
-	return 0;
+		ret = phydrv->suspend(phydev);
+
+	if (ret)
+		return ret;
+
+	phydev->suspended = true;
+
+	return ret;
 }
 EXPORT_SYMBOL(phy_suspend);
 
 int phy_resume(struct phy_device *phydev)
 {
 	struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver);
+	int ret;
 
 	if (phydrv->resume)
-		return phydrv->resume(phydev);
-	return 0;
+		ret = phydrv->resume(phydev);
+
+	if (ret)
+		return ret;
+
+	phydev->suspended = false;
+
+	return ret;
 }
 EXPORT_SYMBOL(phy_resume);
 
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 1b3690b597d5..685809835b5c 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -328,6 +328,7 @@ struct phy_c45_device_ids {
  * is_c45:  Set to true if this phy uses clause 45 addressing.
  * is_internal: Set to true if this phy is internal to a MAC.
  * has_fixups: Set to true if this phy has fixups/quirks.
+ * suspended: Set to true if this phy has been suspended successfully.
  * state: state of the PHY for management purposes
  * dev_flags: Device-specific flags used by the PHY driver.
  * addr: Bus address of PHY
@@ -365,6 +366,7 @@ struct phy_device {
 	bool is_c45;
 	bool is_internal;
 	bool has_fixups;
+	bool suspended;
 
 	enum phy_state state;
 
-- 
2.1.0

^ permalink raw reply related

* [PATCH net-next 2/4] net: phy: document has_fixups field
From: Florian Fainelli @ 2015-01-27  0:31 UTC (permalink / raw)
  To: netdev; +Cc: davem, s.hauer, b38611, Florian Fainelli
In-Reply-To: <1422318673-9418-1-git-send-email-f.fainelli@gmail.com>

has_fixups was introduced to help keeping track of fixups/quirks running
on a PHY device, but we did not update the comment above struct
phy_device accordingly.

Fixes: b0ae009f3dc14 (net: phy: add "has_fixups" boolean property")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 include/linux/phy.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/phy.h b/include/linux/phy.h
index 9c189a1fa3a2..1b3690b597d5 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -327,6 +327,7 @@ struct phy_c45_device_ids {
  * c45_ids: 802.3-c45 Device Identifers if is_c45.
  * is_c45:  Set to true if this phy uses clause 45 addressing.
  * is_internal: Set to true if this phy is internal to a MAC.
+ * has_fixups: Set to true if this phy has fixups/quirks.
  * state: state of the PHY for management purposes
  * dev_flags: Device-specific flags used by the PHY driver.
  * addr: Bus address of PHY
-- 
2.1.0

^ permalink raw reply related

* [PATCH net-next 1/4] net: phy: utilize phy_suspend and phy_resume
From: Florian Fainelli @ 2015-01-27  0:31 UTC (permalink / raw)
  To: netdev; +Cc: davem, s.hauer, b38611, Florian Fainelli
In-Reply-To: <1422318673-9418-1-git-send-email-f.fainelli@gmail.com>

phy_suspend and phy_resume are an abstraction on top of the PHY device
driver suspend and resume callbacks, utilize those since they are the
proper interface to suspending and resuming a PHY device.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/phy/mdio_bus.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 50051f271b10..20447741893a 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -465,7 +465,6 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev)
 
 static int mdio_bus_suspend(struct device *dev)
 {
-	struct phy_driver *phydrv = to_phy_driver(dev->driver);
 	struct phy_device *phydev = to_phy_device(dev);
 
 	/* We must stop the state machine manually, otherwise it stops out of
@@ -479,19 +478,18 @@ static int mdio_bus_suspend(struct device *dev)
 	if (!mdio_bus_phy_may_suspend(phydev))
 		return 0;
 
-	return phydrv->suspend(phydev);
+	return phy_suspend(phydev);
 }
 
 static int mdio_bus_resume(struct device *dev)
 {
-	struct phy_driver *phydrv = to_phy_driver(dev->driver);
 	struct phy_device *phydev = to_phy_device(dev);
 	int ret;
 
 	if (!mdio_bus_phy_may_suspend(phydev))
 		goto no_resume;
 
-	ret = phydrv->resume(phydev);
+	ret = phy_resume(phydev);
 	if (ret < 0)
 		return ret;
 
-- 
2.1.0

^ permalink raw reply related

* [PATCH net-next 0/4] net: phy: prevent double suspend
From: Florian Fainelli @ 2015-01-27  0:31 UTC (permalink / raw)
  To: netdev; +Cc: davem, s.hauer, b38611, Florian Fainelli

Hi David, Fugang,

This patch series addresses a problem that Fugang and I observed on different
platforms where a given PHY device might end-up being suspended twice.

Once as part of the call from ndo_open() all the way down to phy_detach() and
phy_suspend() and a second time when the generic platform device/driver
suspend/resume callbacks are called in drivers/net/phy/mdio_bus.c.

Fugang, please test this as an alternative to your submission, since it did
break for me on GENET at least. Thanks!

Florian Fainelli (4):
  net: phy: utilize phy_suspend and phy_resume
  net: phy: document has_fixups field
  net: phy: keep track of the PHY suspend state
  net: phy: avoid suspending twice a PHY

 drivers/net/phy/mdio_bus.c   | 14 ++++++++------
 drivers/net/phy/phy_device.c | 22 ++++++++++++++++++----
 include/linux/phy.h          |  3 +++
 3 files changed, 29 insertions(+), 10 deletions(-)

-- 
2.1.0

^ permalink raw reply

* Re: [PATCH net-next v2 1/5] bonding: update bond carrier state when min_links option changes
From: Jay Vosburgh @ 2015-01-27  0:29 UTC (permalink / raw)
  To: Jonathan Toppins
  Cc: Veaceslav Falico, Andy Gospodarek, netdev, Andy Gospodarek
In-Reply-To: <1422253021-3798-2-git-send-email-jtoppins@cumulusnetworks.com>

Jonathan Toppins <jtoppins@cumulusnetworks.com> wrote:

>Cc: Andy Gospodarek <gospo@cumulusnetworks.com>
>Signed-off-by: Jonathan Toppins <jtoppins@cumulusnetworks.com>

Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>


> drivers/net/bonding/bond_main.c    |    2 +-
> drivers/net/bonding/bond_options.c |    1 +
> include/net/bonding.h              |    1 +
> 3 files changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 0dceba1..02ffedb 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -334,7 +334,7 @@ static int bond_vlan_rx_kill_vid(struct net_device *bond_dev,
>  *
>  * Returns zero if carrier state does not change, nonzero if it does.
>  */
>-static int bond_set_carrier(struct bonding *bond)
>+int bond_set_carrier(struct bonding *bond)
> {
> 	struct list_head *iter;
> 	struct slave *slave;
>diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
>index 9bd538d4..4df2894 100644
>--- a/drivers/net/bonding/bond_options.c
>+++ b/drivers/net/bonding/bond_options.c
>@@ -1181,6 +1181,7 @@ static int bond_option_min_links_set(struct bonding *bond,
> 	netdev_info(bond->dev, "Setting min links value to %llu\n",
> 		    newval->value);
> 	bond->params.min_links = newval->value;
>+	bond_set_carrier(bond);
> 
> 	return 0;
> }
>diff --git a/include/net/bonding.h b/include/net/bonding.h
>index 983a94b..29f53ea 100644
>--- a/include/net/bonding.h
>+++ b/include/net/bonding.h
>@@ -525,6 +525,7 @@ void bond_sysfs_slave_del(struct slave *slave);
> int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev);
> int bond_release(struct net_device *bond_dev, struct net_device *slave_dev);
> u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb);
>+int bond_set_carrier(struct bonding *bond);
> void bond_select_active_slave(struct bonding *bond);
> void bond_change_active_slave(struct bonding *bond, struct slave *new_active);
> void bond_create_debugfs(void);
>-- 
>1.7.10.4
>

^ permalink raw reply

* Re: [PATCH 1/3] stmmac: if force_thresh_dma_mode is set, pass tc to both txmode and rxmode in tx_hard_error_bump_tc interrupt
From: David Miller @ 2015-01-26 23:48 UTC (permalink / raw)
  To: sonic.adi; +Cc: peppe.cavallaro, netdev, adi-buildroot-devel, sonic.zhang
In-Reply-To: <1421909758-31359-1-git-send-email-sonic.adi@gmail.com>

From: Sonic Zhang <sonic.adi@gmail.com>
Date: Thu, 22 Jan 2015 14:55:56 +0800

> From: Sonic Zhang <sonic.zhang@analog.com>
> 
> Dont' pass SF_DMA_MODE to rxmode in this case.
> 
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

Applied.

^ permalink raw reply

* Re: [PATCH 2/3] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set
From: David Miller @ 2015-01-26 23:48 UTC (permalink / raw)
  To: sonic.adi; +Cc: peppe.cavallaro, netdev, adi-buildroot-devel, sonic.zhang
In-Reply-To: <1421909758-31359-2-git-send-email-sonic.adi@gmail.com>

From: Sonic Zhang <sonic.adi@gmail.com>
Date: Thu, 22 Jan 2015 14:55:57 +0800

> From: Sonic Zhang <sonic.zhang@analog.com>
> 
> Clear the TX COE bit when force_thresh_dma_mode is set even hardware
> dma capability says support.
> 
> Tested on BF609.
> 
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

Applied.

^ permalink raw reply

* Re: [PATCH 3/3] stmmac: Add an optional device tree property "snps,burst_len"
From: David Miller @ 2015-01-26 23:48 UTC (permalink / raw)
  To: sonic.adi; +Cc: peppe.cavallaro, netdev, adi-buildroot-devel, sonic.zhang
In-Reply-To: <1421909758-31359-3-git-send-email-sonic.adi@gmail.com>

From: Sonic Zhang <sonic.adi@gmail.com>
Date: Thu, 22 Jan 2015 14:55:58 +0800

> From: Sonic Zhang <sonic.zhang@analog.com>
> 
> This property define the AXI bug lenth.
> 
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

Applied.

^ permalink raw reply

* Re: [PATCH 1/5] PCI: Add defines for max read request sizes
From: Bjorn Helgaas @ 2015-01-27  0:20 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: linux-pci, Matt Porter, Alexandre Bounine, Chris Metcalf,
	Bradley Grove, linux-scsi, Realtek linux nic maintainers, netdev
In-Reply-To: <1422291922-12324-1-git-send-email-zajec5@gmail.com>

On Mon, Jan 26, 2015 at 06:05:22PM +0100, Rafał Miłecki wrote:
> There are few drivers using magic numbers when operating with PCIe
> capabilities and PCI_EXP_DEVCTL_READRQ. Define known values to allow
> cleaning their code a bit.
> 
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

I applied this whole series, with acks from Alexandre and Chris, to
pci/misc for v3.20, thanks!

> ---
>  include/uapi/linux/pci_regs.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
> index 4a1d0cc..efe3443 100644
> --- a/include/uapi/linux/pci_regs.h
> +++ b/include/uapi/linux/pci_regs.h
> @@ -451,6 +451,10 @@
>  #define  PCI_EXP_DEVCTL_AUX_PME	0x0400	/* Auxiliary Power PM Enable */
>  #define  PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800  /* Enable No Snoop */
>  #define  PCI_EXP_DEVCTL_READRQ	0x7000	/* Max_Read_Request_Size */
> +#define  PCI_EXP_DEVCTL_READRQ_128B  0x0000 /* 128 Bytes */
> +#define  PCI_EXP_DEVCTL_READRQ_256B  0x1000 /* 256 Bytes */
> +#define  PCI_EXP_DEVCTL_READRQ_512B  0x2000 /* 512 Bytes */
> +#define  PCI_EXP_DEVCTL_READRQ_1024B 0x3000 /* 1024 Bytes */
>  #define  PCI_EXP_DEVCTL_BCR_FLR 0x8000  /* Bridge Configuration Retry / FLR */
>  #define PCI_EXP_DEVSTA		10	/* Device Status */
>  #define  PCI_EXP_DEVSTA_CED	0x0001	/* Correctable Error Detected */
> -- 
> 1.8.4.5
> 

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox