* [PATCH V2 net 4/6] net: hns: adds uc match for debug port
From: Daode Huang @ 2016-03-11 9:10 UTC (permalink / raw)
To: davem
Cc: liguozhu, Yisen.Zhuang, linux-kernel, linux-arm-kernel, netdev,
linuxarm, salil.mehta, huangdaode, kenneth-lee-2012, xuwei5,
lisheng011, yankejian
In-Reply-To: <1457687446-109867-1-git-send-email-huangdaode@hisilicon.com>
This patch adds uc match for debug port by:
1)Enables uc match of debug port when initializing gmac
2)Enables uc match of mac address register2
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
---
changlog:
v2: fix the SoB name and code sytle according to Sergei .
---
drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c | 18 +++++++++++++++++-
drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h | 2 ++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c
index b8517b0..2591a51 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c
@@ -290,6 +290,16 @@ static int hns_gmac_adjust_link(void *mac_drv, enum mac_speed speed,
return 0;
}
+static void hns_gmac_set_uc_match(void *mac_drv, u16 en)
+{
+ struct mac_driver *drv = (struct mac_driver *)mac_drv;
+
+ dsaf_set_dev_bit(drv, GMAC_REC_FILT_CONTROL_REG,
+ GMAC_UC_MATCH_EN_B, !en);
+ dsaf_set_dev_bit(drv, GMAC_STATION_ADDR_HIGH_2_REG,
+ GMAC_ADDR_EN_B, !en);
+}
+
static void hns_gmac_init(void *mac_drv)
{
u32 port;
@@ -305,6 +315,8 @@ static void hns_gmac_init(void *mac_drv)
mdelay(10);
hns_gmac_disable(mac_drv, MAC_COMM_MODE_RX_AND_TX);
hns_gmac_tx_loop_pkt_dis(mac_drv);
+ if (drv->mac_cb->mac_type == HNAE_PORT_DEBUG)
+ hns_gmac_set_uc_match(mac_drv, 0);
}
void hns_gmac_update_stats(void *mac_drv)
@@ -407,8 +419,12 @@ static void hns_gmac_set_mac_addr(void *mac_drv, char *mac_addr)
u32 low_val = mac_addr[5] | (mac_addr[4] << 8)
| (mac_addr[3] << 16) | (mac_addr[2] << 24);
+
+ u32 val = dsaf_read_dev(drv, GMAC_STATION_ADDR_HIGH_2_REG);
+ u32 sta_addr_en = dsaf_get_bit(val, GMAC_ADDR_EN_B);
dsaf_write_dev(drv, GMAC_STATION_ADDR_LOW_2_REG, low_val);
- dsaf_write_dev(drv, GMAC_STATION_ADDR_HIGH_2_REG, high_val);
+ dsaf_write_dev(drv, GMAC_STATION_ADDR_HIGH_2_REG,
+ high_val | (sta_addr_en << GMAC_ADDR_EN_B));
}
}
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
index 60d695d..bf62687 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
@@ -922,6 +922,8 @@
#define GMAC_LP_REG_CF2MI_LP_EN_B 2
#define GMAC_MODE_CHANGE_EB_B 0
+#define GMAC_UC_MATCH_EN_B 0
+#define GMAC_ADDR_EN_B 16
#define GMAC_RECV_CTRL_STRIP_PAD_EN_B 3
#define GMAC_RECV_CTRL_RUNT_PKT_EN_B 4
--
1.9.1
^ permalink raw reply related
* [PATCH V2 net 3/6] net: hns: fixed portid bug in sending manage pkt
From: Daode Huang @ 2016-03-11 9:10 UTC (permalink / raw)
To: davem
Cc: liguozhu, Yisen.Zhuang, linux-kernel, linux-arm-kernel, netdev,
linuxarm, salil.mehta, huangdaode, kenneth-lee-2012, xuwei5,
lisheng011, yankejian
In-Reply-To: <1457687446-109867-1-git-send-email-huangdaode@hisilicon.com>
In V2 chip, when sending mamagement packets, the driver should
config the port id to BD descs.
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Signed-off-by: Sheng Li <lisheng011@huawei.com>
---
v2: add space after /* and before */.
---
drivers/net/ethernet/hisilicon/hns/hnae.h | 3 +++
drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | 1 +
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 6 +++++-
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hnae.h b/drivers/net/ethernet/hisilicon/hns/hnae.h
index 1cbcb9f..37d0cce 100644
--- a/drivers/net/ethernet/hisilicon/hns/hnae.h
+++ b/drivers/net/ethernet/hisilicon/hns/hnae.h
@@ -147,6 +147,8 @@ enum hnae_led_state {
#define HNSV2_TXD_BUFNUM_S 0
#define HNSV2_TXD_BUFNUM_M (0x7 << HNSV2_TXD_BUFNUM_S)
+#define HNSV2_TXD_PORTID_S 4
+#define HNSV2_TXD_PORTID_M (0X7 << HNSV2_TXD_PORTID_S)
#define HNSV2_TXD_RI_B 1
#define HNSV2_TXD_L4CS_B 2
#define HNSV2_TXD_L3CS_B 3
@@ -516,6 +518,7 @@ struct hnae_handle {
int q_num;
int vf_id;
u32 eport_id;
+ u32 dport_id; /* v2 tx bd should fill the dport_id */
enum hnae_port_type port_type;
struct list_head node; /* list to hnae_ae_dev->handle_list */
struct hnae_buf_ops *bops; /* operation for the buffer */
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
index d4f92ed..90352d6 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c
@@ -175,6 +175,7 @@ struct hnae_handle *hns_ae_get_handle(struct hnae_ae_dev *dev,
ae_handle->phy_node = vf_cb->mac_cb->phy_node;
ae_handle->if_support = vf_cb->mac_cb->if_support;
ae_handle->port_type = vf_cb->mac_cb->mac_type;
+ ae_handle->dport_id = port_idx;
return ae_handle;
vf_id_err:
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 6250a42..cb16b50 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -65,10 +65,14 @@ static void fill_v2_desc(struct hnae_ring *ring, void *priv,
desc->addr = cpu_to_le64(dma);
desc->tx.send_size = cpu_to_le16((u16)size);
- /*config bd buffer end */
+ /* config bd buffer end */
hnae_set_bit(rrcfv, HNSV2_TXD_VLD_B, 1);
hnae_set_field(bn_pid, HNSV2_TXD_BUFNUM_M, 0, buf_num - 1);
+ /* fill port_id in the tx bd for sending management pkts */
+ hnae_set_field(bn_pid, HNSV2_TXD_PORTID_M,
+ HNSV2_TXD_PORTID_S, ring->q->handle->dport_id);
+
if (type == DESC_TYPE_SKB) {
skb = (struct sk_buff *)priv;
--
1.9.1
^ permalink raw reply related
* [PATCH V2 net 2/6] net: hns: fixes the hw interrupt bug in using napi
From: Daode Huang @ 2016-03-11 9:10 UTC (permalink / raw)
To: davem
Cc: lisheng011, salil.mehta, yankejian, kenneth-lee-2012, liguozhu,
linuxarm, xuwei5, linux-kernel, huangdaode, netdev, Yisen.Zhuang,
linux-arm-kernel
In-Reply-To: <1457687446-109867-1-git-send-email-huangdaode@hisilicon.com>
In V1 chip, common_poll should check and clean fbd pkts, because it
can not pend irq to clean them if there is no new pkt comes in.
But V2 chip hw fixes this bug, and will pend irq itself to do this.
So, for V2 chip, we set ring_data->fini_process to NULL.
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Signed-off-by: Sheng Li <lisheng011@huawei.com>
---
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 9d46d57..6250a42 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -946,8 +946,8 @@ static int hns_nic_common_poll(struct napi_struct *napi, int budget)
napi_complete(napi);
ring_data->ring->q->handle->dev->ops->toggle_ring_irq(
ring_data->ring, 0);
-
- ring_data->fini_process(ring_data);
+ if (ring_data->fini_process)
+ ring_data->fini_process(ring_data);
return 0;
}
@@ -1710,6 +1710,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv)
{
struct hnae_handle *h = priv->ae_handle;
struct hns_nic_ring_data *rd;
+ bool is_ver1 = AE_IS_VER1(priv->enet_ver);
int i;
if (h->q_num > NIC_MAX_Q_PER_VF) {
@@ -1727,7 +1728,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv)
rd->queue_index = i;
rd->ring = &h->qs[i]->tx_ring;
rd->poll_one = hns_nic_tx_poll_one;
- rd->fini_process = hns_nic_tx_fini_pro;
+ rd->fini_process = is_ver1 ? hns_nic_tx_fini_pro : NULL;
netif_napi_add(priv->netdev, &rd->napi,
hns_nic_common_poll, NIC_TX_CLEAN_MAX_NUM);
@@ -1739,7 +1740,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv)
rd->ring = &h->qs[i - h->q_num]->rx_ring;
rd->poll_one = hns_nic_rx_poll_one;
rd->ex_process = hns_nic_rx_up_pro;
- rd->fini_process = hns_nic_rx_fini_pro;
+ rd->fini_process = is_ver1 ? hns_nic_rx_fini_pro : NULL;
netif_napi_add(priv->netdev, &rd->napi,
hns_nic_common_poll, NIC_RX_CLEAN_MAX_NUM);
--
1.9.1
^ permalink raw reply related
* [PATCH V2 net 1/6] net: hns: bug fix about the overflow of mss
From: Daode Huang @ 2016-03-11 9:10 UTC (permalink / raw)
To: davem
Cc: lisheng011, salil.mehta, yankejian, kenneth-lee-2012, liguozhu,
linuxarm, xuwei5, linux-kernel, huangdaode, netdev, Yisen.Zhuang,
linux-arm-kernel
In-Reply-To: <1457687446-109867-1-git-send-email-huangdaode@hisilicon.com>
When set MTU to the minimum value 68, there are increasing number
of error packets occur, which is caused by the overflowed value of
mss. This patch fix the bug.
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
---
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 3f77ff7..9d46d57 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -48,7 +48,6 @@ static void fill_v2_desc(struct hnae_ring *ring, void *priv,
struct iphdr *iphdr;
struct ipv6hdr *ipv6hdr;
struct sk_buff *skb;
- int skb_tmp_len;
__be16 protocol;
u8 bn_pid = 0;
u8 rrcfv = 0;
@@ -90,13 +89,13 @@ static void fill_v2_desc(struct hnae_ring *ring, void *priv,
hnae_set_bit(rrcfv, HNSV2_TXD_L4CS_B, 1);
/* check for tcp/udp header */
- if (iphdr->protocol == IPPROTO_TCP) {
+ if (iphdr->protocol == IPPROTO_TCP &&
+ skb_is_gso(skb)) {
hnae_set_bit(tvsvsn,
HNSV2_TXD_TSE_B, 1);
- skb_tmp_len = SKB_TMP_LEN(skb);
l4_len = tcp_hdrlen(skb);
- mss = mtu - skb_tmp_len - ETH_FCS_LEN;
- paylen = skb->len - skb_tmp_len;
+ mss = skb_shinfo(skb)->gso_size;
+ paylen = skb->len - SKB_TMP_LEN(skb);
}
} else if (skb->protocol == htons(ETH_P_IPV6)) {
hnae_set_bit(tvsvsn, HNSV2_TXD_IPV6_B, 1);
@@ -104,13 +103,13 @@ static void fill_v2_desc(struct hnae_ring *ring, void *priv,
hnae_set_bit(rrcfv, HNSV2_TXD_L4CS_B, 1);
/* check for tcp/udp header */
- if (ipv6hdr->nexthdr == IPPROTO_TCP) {
+ if (ipv6hdr->nexthdr == IPPROTO_TCP &&
+ skb_is_gso(skb) && skb_is_gso_v6(skb)) {
hnae_set_bit(tvsvsn,
HNSV2_TXD_TSE_B, 1);
- skb_tmp_len = SKB_TMP_LEN(skb);
l4_len = tcp_hdrlen(skb);
- mss = mtu - skb_tmp_len - ETH_FCS_LEN;
- paylen = skb->len - skb_tmp_len;
+ mss = skb_shinfo(skb)->gso_size;
+ paylen = skb->len - SKB_TMP_LEN(skb);
}
}
desc->tx.ip_offset = ip_offset;
--
1.9.1
^ permalink raw reply related
* [PATCH V2 net 0/6] net: hns: hns driver updates
From: Daode Huang @ 2016-03-11 9:10 UTC (permalink / raw)
To: davem
Cc: lisheng011, salil.mehta, yankejian, kenneth-lee-2012, liguozhu,
linuxarm, xuwei5, linux-kernel, huangdaode, netdev, Yisen.Zhuang,
linux-arm-kernel
Hi Dave,
This patch series are hisilicon network driver bug fix.
please merge them to the net repo.
Thanks
Daode Huang
---
changlog
v2: some minor change according to
MBR Sergei <sergei.shtylyov@cogentembedded.com> in
[patch 3/6] [patch 4/6].
v1: initial version.
Daode Huang (6):
net: hns: bug fix about the overflow of mss
net: hns: fixes the hw interrupt bug in using napi
net: hns: fixed portid bug in sending manage pkt
net: hns: adds uc match for debug port
net: hns: fixed service-ges setting MAC-addr bug
net: hns: bug fix of getting hilink status
drivers/net/ethernet/hisilicon/hns/hnae.h | 3 ++
drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | 1 +
drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c | 29 +++++++++++----
drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c | 41 ++++++++++++----------
drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h | 4 +++
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 32 +++++++++--------
6 files changed, 70 insertions(+), 40 deletions(-)
--
1.9.1
^ permalink raw reply
* [PATCH] net: mvneta: Add missing hotplug notifier transition
From: Anna-Maria Gleixner @ 2016-03-11 9:10 UTC (permalink / raw)
To: linux-kernel; +Cc: rt, Anna-Maria Gleixner, Thomas Petazzoni, netdev
The mvneta_percpu_notifier() hotplug callback lacks handling of the
CPU_DOWN_FAILED case. That means, if CPU_DOWN_PREPARE failes, the
driver is not well configured on the CPU.
Add handling for CPU_DOWN_FAILED[_FROZEN] hotplug notifier transition
to setup the driver.
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
drivers/net/ethernet/marvell/mvneta.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2920,6 +2920,8 @@ static int mvneta_percpu_notifier(struct
switch (action) {
case CPU_ONLINE:
case CPU_ONLINE_FROZEN:
+ case CPU_DOWN_FAILED:
+ case CPU_DOWN_FAILED_FROZEN:
spin_lock(&pp->lock);
/* Configuring the driver for a new CPU while the
* driver is stopping is racy, so just avoid it.
^ permalink raw reply
* Re: [PATCH v3 0/8] arm64: rockchip: Initial GeekBox enablement
From: Giuseppe CAVALLARO @ 2016-03-11 9:09 UTC (permalink / raw)
To: Dinh Nguyen, Tomeu Vizoso
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Heiko Stübner, netdev-u79uwXL29TY76Z2rM5mHXA, LKML,
Frank Schäfer, open list:ARM/Rockchip SoC...,
Gabriel Fernandez, Fabrice GASNIER, Andreas Färber, LAKML,
Alexandre TORGUE
In-Reply-To: <CADhT+wd=vcph2y_OxkGNO5EwHvN=kBy-BrfZHmNjZHww4LxmTg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2790 bytes --]
On 3/10/2016 5:47 PM, Dinh Nguyen wrote:
> On Thu, Mar 10, 2016 at 3:13 AM, Giuseppe CAVALLARO
> <peppe.cavallaro-qxv4g6HH51o@public.gmane.org> wrote:
>> On 3/9/2016 5:31 PM, Dinh Nguyen wrote:
>>>
>>> On Wed, Mar 9, 2016 at 8:53 AM, Giuseppe CAVALLARO
>>> <peppe.cavallaro-qxv4g6HH51o@public.gmane.org> wrote:
>>>>
>>>> Hi Tomeu, Dinh, Andreas
>>>>
>>>> I need a sum and help from you to go ahead on the
>>>> tx timeout.
>>>>
>>>> The "stmmac: MDIO fixes" seems to be the candidate to
>>>> fix the phy connection and I will send the V2 asap (Andreas' comment).
>>>>
>>>> So, supposing the probe is ok and phy is connected,
>>>> I need your input ...
>>>>
>>>> Tomeu: after revering the 0e80bdc9a72d (stmmac: first frame
>>>> prep at the end of xmit routine) the network is
>>>> not stable and there is a timeout after a while.
>>>> The box has 3.50 with normal desc settings.
>>>>
>>>> Dinh: the network is ok, I wonder if you can share a boot
>>>> log just to understand if the normal or enhanced
>>>> descriptors are used.
>>>>
>>>
>>> Here it is:
>>
>> ...
>>>
>>> [ 0.850523] stmmac - user ID: 0x10, Synopsys ID: 0x37
>>> [ 0.855570] Ring mode enabled
>>> [ 0.858611] DMA HW capability register supported
>>> [ 0.863128] Enhanced/Alternate descriptors
>>> [ 0.867482] Enabled extended descriptors
>>> [ 0.871482] RX Checksum Offload Engine supported (type 2)
>>> [ 0.876948] TX Checksum insertion supported
>>> [ 0.881204] Enable RX Mitigation via HW Watchdog Timer
>>> [ 0.886863] socfpga-dwmac ff702000.ethernet eth0: No MDIO subnode found
>>> [ 0.899090] libphy: stmmac: probed
>>> [ 0.902484] eth0: PHY ID 00221611 at 4 IRQ POLL (stmmac-0:04) active
>>
>>
>> Thx Dinh, so you are using the Enhanced/Alternate descriptors
>> I am debugging on my side on a setup with normal descriptors, I let you
>> know
>>
>
> Doesn't the printout "Enhanced/Alternate descriptors" mean that I'm using
> Enhanced/Alternate descriptors?
yes this means that you have the Databook 3.70a and, from the HW
capability register, the driver will use the Enhanced/Alternate
descriptors. This is the same HW I am using on my side where the
stmmac is working fine.
In the case where it is failing on net-next, although on Databook 3.50a,
the HW capability register says that there is no enhanced descriptors
and the driver uses the normal ones.
Tomeu, I kindly ask you to try the patch attached. I found a bug on Tx
path for normal descriptors. Please let me know if this help.
Also let me know if we actually need to revert the 0e80bdc9a72d.
I am trying to find some HW where test the normal descriptors to
speed-up the tests on my side directly.
Let me know and thx in advance.
Regards,
Peppe
>
> Dinh
>
[-- Attachment #2: 0001-stmmac-fix-tx-prepare-for-normal-desc.patch --]
[-- Type: text/x-patch, Size: 1265 bytes --]
>From ed3e38befc5500e05f46e1d52ea20a0b8d3829f3 Mon Sep 17 00:00:00 2001
From: Giuseppe Cavallaro <peppe.cavallaro-qxv4g6HH51o@public.gmane.org>
Date: Thu, 10 Mar 2016 14:57:48 +0100
Subject: [PATCH (linux-sti-4.1)] stmmac: fix tx prepare for normal desc
This patch fixes a bug inside when use the normal descriptors.
While preparing the tx descriptor the frame size was not
properly set.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro-qxv4g6HH51o@public.gmane.org>
---
drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
index e13228f..432b3f1 100644
--- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
@@ -197,13 +197,15 @@ static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len,
bool csum_flag, int mode, bool tx_own,
bool ls)
{
- unsigned int tdes1 = p->des1;
+ unsigned int tdes1;
if (mode == STMMAC_CHAIN_MODE)
norm_set_tx_desc_len_on_chain(p, len);
else
norm_set_tx_desc_len_on_ring(p, len);
+ tdes1 = p->des1;
+
if (is_fs)
tdes1 |= TDES1_FIRST_SEGMENT;
else
--
1.7.4.4
[-- Attachment #3: Type: text/plain, Size: 200 bytes --]
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related
* [PATCH net-next] net/flower: Fix pointer cast
From: Amir Vadai @ 2016-03-11 9:08 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Amir Vadai
Cast pointer to unsigned long instead of u64, to fix compilation warning
on 32 bit arch, spotted by 0day build.
Fixes: 5b33f48 ("net/flower: Introduce hardware offload support")
Signed-off-by: Amir Vadai <amir@vadai.me>
---
include/net/pkt_cls.h | 2 +-
net/sched/cls_flower.c | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 5b4e8f0..caa5e18 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -416,7 +416,7 @@ enum tc_fl_command {
struct tc_cls_flower_offload {
enum tc_fl_command command;
- u64 cookie;
+ unsigned long cookie;
struct flow_dissector *dissector;
struct fl_flow_key *mask;
struct fl_flow_key *key;
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c
index 25d8766..2181ffc 100644
--- a/net/sched/cls_flower.c
+++ b/net/sched/cls_flower.c
@@ -165,7 +165,7 @@ static void fl_destroy_filter(struct rcu_head *head)
kfree(f);
}
-static void fl_hw_destroy_filter(struct tcf_proto *tp, u64 cookie)
+static void fl_hw_destroy_filter(struct tcf_proto *tp, unsigned long cookie)
{
struct net_device *dev = tp->q->dev_queue->dev;
struct tc_cls_flower_offload offload = {0};
@@ -188,7 +188,7 @@ static void fl_hw_replace_filter(struct tcf_proto *tp,
struct fl_flow_key *mask,
struct fl_flow_key *key,
struct tcf_exts *actions,
- u64 cookie, u32 flags)
+ unsigned long cookie, u32 flags)
{
struct net_device *dev = tp->q->dev_queue->dev;
struct tc_cls_flower_offload offload = {0};
@@ -219,7 +219,7 @@ static bool fl_destroy(struct tcf_proto *tp, bool force)
return false;
list_for_each_entry_safe(f, next, &head->filters, list) {
- fl_hw_destroy_filter(tp, (u64)f);
+ fl_hw_destroy_filter(tp, (unsigned long)f);
list_del_rcu(&f->list);
call_rcu(&f->rcu, fl_destroy_filter);
}
@@ -554,13 +554,13 @@ static int fl_change(struct net *net, struct sk_buff *in_skb,
&mask.key,
&fnew->key,
&fnew->exts,
- (u64)fnew,
+ (unsigned long)fnew,
flags);
if (fold) {
rhashtable_remove_fast(&head->ht, &fold->ht_node,
head->ht_params);
- fl_hw_destroy_filter(tp, (u64)fold);
+ fl_hw_destroy_filter(tp, (unsigned long)fold);
}
*arg = (unsigned long) fnew;
@@ -588,7 +588,7 @@ static int fl_delete(struct tcf_proto *tp, unsigned long arg)
rhashtable_remove_fast(&head->ht, &f->ht_node,
head->ht_params);
list_del_rcu(&f->list);
- fl_hw_destroy_filter(tp, (u64)f);
+ fl_hw_destroy_filter(tp, (unsigned long)f);
tcf_unbind_filter(tp, &f->res);
call_rcu(&f->rcu, fl_destroy_filter);
return 0;
--
2.7.0
^ permalink raw reply related
* Re: [PATCH v3 net-next 0/2] net: hns: get and set RSS indirection table by using ethtool
From: Andy Shevchenko @ 2016-03-11 9:01 UTC (permalink / raw)
To: Kejian Yan, davem
Cc: yisen.zhuang, salil.mehta, liguozhu, huangdaode, arnd, andrew,
chenny.xu, ivecera, lisheng011, fengguang.wu, haifeng.wei, netdev,
linux-kernel, linux-arm-kernel, linuxarm
In-Reply-To: <1457666747-244953-1-git-send-email-yankejian@huawei.com>
On Fri, 2016-03-11 at 11:25 +0800, Kejian Yan wrote:
> When we use ethtool to retrieves or configure the receive flow hash
> indirection table, ethtool needs to call .get_rxnfc to get the ring
> number
> so this patchset implements the .get_rxnfc and fixes the bug that we
> can
> not get the tatal table each time.
>
FWIW:
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> change log:
> PATCH v3:
> - This patchset fixes the building warning and error
>
> PATCH v2:
> - This patchset fixes the comments provided by Andy Shevchenko <Andy
> Shevchenko>
>
> PATCH v1:
> - first submit
>
> Kejian Yan (2):
> net: hns: fix return value of the function about rss
> net: hns: fixes a bug of RSS
>
> drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c | 8 ++++---
> drivers/net/ethernet/hisilicon/hns/hns_dsaf_ppe.c | 2 +-
> drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 28
> ++++++++++++++++-------
> 3 files changed, 26 insertions(+), 12 deletions(-)
>
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
^ permalink raw reply
* Re: [PATCHv2 (net.git) 2/2] stmmac: fix MDIO settings
From: Giuseppe CAVALLARO @ 2016-03-11 8:54 UTC (permalink / raw)
To: Phil Reid, netdev
Cc: gabriel.fernandez, afaerber, fschaefer.oss, dinh.linux, davem
In-Reply-To: <56E27EEC.10005@electromag.com.au>
On 3/11/2016 9:16 AM, Phil Reid wrote:
> G'day Giuseppe,
>
> Sorry for delay in responding.
> I feel responsible for starting the changes breaking this.
>
> See below.
>
> On 11/03/2016 3:44 PM, Giuseppe Cavallaro wrote:
>> Initially the phy_bus_name was added to manipulate the
>> driver name but It was recently just used to manage the
>> fixed-link and then to take some decision at run-time
>> inside the main (for example to skip EEE).
>> So the patch uses the is_pseudo_fixed_link and removes
>> removes the phy_bus_name variable not necessary anymore.
>>
>> The driver can manage the mdio registration by using phy-handle,
>> dwmac-mdio and own parameter e.g. snps,phy-addr.
>> This patch takes care about all these possible configurations
>> and fixes the mdio registration in case of there is a real
>> transceiver or a switch (that needs to be managed by using
>> fixed-link).
>>
>> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
>> Reviewed-by: Andreas Färber <afaerber@suse.de>
>> Tested-by: Frank Schäfer <fschaefer.oss@googlemail.com>
>> Cc: Gabriel Fernandez <gabriel.fernandez@linaro.org>
>> Cc: Dinh Nguyen <dinh.linux@gmail.com>
>> Cc: David S. Miller <davem@davemloft.net>
>> ---
>>
>> V2: use is_pseudo_fixed_link
>>
>> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++--------
>> .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 14
>> +++++---------
>> include/linux/stmmac.h | 1 -
>> 3 files changed, 8 insertions(+), 18 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> index c21015b..389d7d0 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> @@ -271,7 +271,6 @@ static void stmmac_eee_ctrl_timer(unsigned long arg)
>> */
>> bool stmmac_eee_init(struct stmmac_priv *priv)
>> {
>> - char *phy_bus_name = priv->plat->phy_bus_name;
>> unsigned long flags;
>> bool ret = false;
>>
>> @@ -283,7 +282,7 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
>> goto out;
>>
>> /* Never init EEE in case of a switch is attached */
>> - if (phy_bus_name && (!strcmp(phy_bus_name, "fixed")))
>> + if (priv->phydev->is_pseudo_fixed_link)
>> goto out;
>>
>> /* MAC core supports the EEE feature. */
>> @@ -820,12 +819,8 @@ static int stmmac_init_phy(struct net_device *dev)
>> phydev = of_phy_connect(dev, priv->plat->phy_node,
>> &stmmac_adjust_link, 0, interface);
>> } else {
>> - if (priv->plat->phy_bus_name)
>> - snprintf(bus_id, MII_BUS_ID_SIZE, "%s-%x",
>> - priv->plat->phy_bus_name, priv->plat->bus_id);
>> - else
>> - snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
>> - priv->plat->bus_id);
>> + snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
>> + priv->plat->bus_id);
>>
>> snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id,
>> priv->plat->phy_addr);
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>> b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>> index 6a52fa1..ed33920 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
>> @@ -138,7 +138,11 @@ stmmac_probe_config_dt(struct platform_device
>> *pdev, const char **mac)
>> return ERR_PTR(-ENODEV);
>>
>> plat->phy_node = of_node_get(np);
>> - }
>> + } else
>> + plat->mdio_bus_data =
>> + devm_kzalloc(&pdev->dev,
>> + sizeof(struct stmmac_mdio_bus_data),
>> + GFP_KERNEL);
>
> This breaks my use case where I have a fixed link but also need the mdio
> bus for
> talking to a dsa switch. stmmac_mdio_register bails out because
> mdio_bus_data is
> never allocated here at this point when a fixed link exists with no
> phy-handle
> property. Removing the else solves my use.
ok I get the point.
>
> Possibly it could be allocated in stmmac_mdio_register if snps,dwmac-mdio
> is found and not already allocated.
> With the
> if (!mdio_bus_data)
> return 0;
> to after the device tree query.
this is a way. Let me do some tests and I send the V3.
Thx for your feedback
peppe
>
>
>>
>> /* "snps,phy-addr" is not a standard property. Mark it as
>> deprecated
>> * and warn of its use. Remove this when phy node support is added.
>> @@ -146,14 +150,6 @@ stmmac_probe_config_dt(struct platform_device
>> *pdev, const char **mac)
>> if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr)
>> == 0)
>> dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
>>
>> - if ((plat->phy_node && !of_phy_is_fixed_link(np)) ||
>> plat->phy_bus_name)
>> - plat->mdio_bus_data = NULL;
>> - else
>> - plat->mdio_bus_data =
>> - devm_kzalloc(&pdev->dev,
>> - sizeof(struct stmmac_mdio_bus_data),
>> - GFP_KERNEL);
>> -
>> of_property_read_u32(np, "tx-fifo-depth", &plat->tx_fifo_size);
>>
>> of_property_read_u32(np, "rx-fifo-depth", &plat->rx_fifo_size);
>> diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
>> index eead8ab..1b4884c 100644
>> --- a/include/linux/stmmac.h
>> +++ b/include/linux/stmmac.h
>> @@ -94,7 +94,6 @@ struct stmmac_dma_cfg {
>> };
>>
>> struct plat_stmmacenet_data {
>> - char *phy_bus_name;
>> int bus_id;
>> int phy_addr;
>> int interface;
>>
>
>
^ permalink raw reply
* [PATCH V2 net 6/6] net: hns: bug fix of getting hilink status
From: Daode Huang @ 2016-03-11 9:10 UTC (permalink / raw)
To: davem
Cc: liguozhu, Yisen.Zhuang, linux-kernel, linux-arm-kernel, netdev,
linuxarm, salil.mehta, huangdaode, kenneth-lee-2012, xuwei5,
lisheng011, yankejian
In-Reply-To: <1457687446-109867-1-git-send-email-huangdaode@hisilicon.com>
There are some differences in hilink status defination between
v1 and v2 chips.
for v1 chip, all ports connected to the same hilink share the same
hilink status register bit.
but for v2, all ports have separately hilink status register bit. And
the register addr is also changed.
So this patch fixes the bug.
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Signed-off-by: Sheng Li <lisheng011@huawei.com>
---
drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c | 41 ++++++++++++----------
drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h | 2 ++
2 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c
index 607c3be..8c32ff6 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c
@@ -240,35 +240,38 @@ void hns_ppe_com_srst(struct ppe_common_cb *ppe_common, u32 val)
/**
* hns_mac_get_sds_mode - get phy ifterface form serdes mode
* @mac_cb: mac control block
- * retuen phy interface
+ * return phy interface
*/
phy_interface_t hns_mac_get_phy_if(struct hns_mac_cb *mac_cb)
{
- u32 hilink3_mode;
- u32 hilink4_mode;
+ u32 reg, mode, shift;
void __iomem *sys_ctl_vaddr = mac_cb->sys_ctl_vaddr;
- int dev_id = mac_cb->mac_id;
+ int mac_id = mac_cb->mac_id;
phy_interface_t phy_if = PHY_INTERFACE_MODE_NA;
+ bool is_ver1 = AE_IS_VER1(mac_cb->dsaf_dev->dsaf_ver);
- hilink3_mode = dsaf_read_reg(sys_ctl_vaddr, HNS_MAC_HILINK3_REG);
- hilink4_mode = dsaf_read_reg(sys_ctl_vaddr, HNS_MAC_HILINK4_REG);
- if (dev_id >= 0 && dev_id <= 3) {
- if (hilink4_mode == 0)
- phy_if = PHY_INTERFACE_MODE_SGMII;
- else
+ /* for hip05 soc, port6,7 only support ge mode */
+ if (is_ver1 && (mac_id >= 6 && mac_id <= 7)) {
+ phy_if = PHY_INTERFACE_MODE_SGMII;
+ } else if (mac_id >= 0 && mac_id <= 3) {
+ reg = is_ver1 ? HNS_MAC_HILINK4_REG : HNS_MAC_HILINK4V2_REG;
+ mode = dsaf_read_reg(sys_ctl_vaddr, reg);
+ /* mac_id 0, 1, 2, 3 ---> hilink4 lane 0, 1, 2, 3 */
+ shift = is_ver1 ? 0 : mac_id;
+ if (dsaf_get_bit(mode, shift))
phy_if = PHY_INTERFACE_MODE_XGMII;
- } else if (dev_id >= 4 && dev_id <= 5) {
- if (hilink3_mode == 0)
- phy_if = PHY_INTERFACE_MODE_SGMII;
else
+ phy_if = PHY_INTERFACE_MODE_SGMII;
+ } else if (mac_id >= 4 && mac_id <= 7) {
+ reg = is_ver1 ? HNS_MAC_HILINK3_REG : HNS_MAC_HILINK3V2_REG;
+ mode = dsaf_read_reg(sys_ctl_vaddr, reg);
+ /* mac_id 4, 5, 6, 7 ---> hilink3 lane 2, 3, 0, 1 */
+ shift = is_ver1 ? 0 : (mac_id <= 5 ? mac_id - 2 : mac_id - 6);
+ if (dsaf_get_bit(mode, shift))
phy_if = PHY_INTERFACE_MODE_XGMII;
- } else {
- phy_if = PHY_INTERFACE_MODE_SGMII;
+ else
+ phy_if = PHY_INTERFACE_MODE_SGMII;
}
-
- dev_dbg(mac_cb->dev,
- "hilink3_mode=%d, hilink4_mode=%d dev_id=%d, phy_if=%d\n",
- hilink3_mode, hilink4_mode, dev_id, phy_if);
return phy_if;
}
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
index bf62687..e2206f9 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h
@@ -103,6 +103,8 @@
/*serdes offset**/
#define HNS_MAC_HILINK3_REG DSAF_SUB_SC_HILINK3_CRG_CTRL0_REG
#define HNS_MAC_HILINK4_REG DSAF_SUB_SC_HILINK4_CRG_CTRL0_REG
+#define HNS_MAC_HILINK3V2_REG DSAF_SUB_SC_HILINK3_CRG_CTRL1_REG
+#define HNS_MAC_HILINK4V2_REG DSAF_SUB_SC_HILINK4_CRG_CTRL1_REG
#define HNS_MAC_LANE0_CTLEDFE_REG 0x000BFFCCULL
#define HNS_MAC_LANE1_CTLEDFE_REG 0x000BFFBCULL
#define HNS_MAC_LANE2_CTLEDFE_REG 0x000BFFACULL
--
1.9.1
^ permalink raw reply related
* [net-next PATCH V4 3/3] mlx5: use napi_consume_skb API to get bulk free operations
From: Jesper Dangaard Brouer @ 2016-03-11 8:44 UTC (permalink / raw)
To: netdev, David S. Miller
Cc: sergei.shtylyov, eugenia, Alexander Duyck, alexei.starovoitov,
saeedm, Jesper Dangaard Brouer, gerlitz.or
In-Reply-To: <20160311084245.5207.70640.stgit@firesoul>
Bulk free of SKBs happen transparently by the API call napi_consume_skb().
The napi budget parameter is needed by napi_consume_skb() to detect
if called from netpoll.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 4 ++--
drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index 9c0e80e64b43..a0708782eb78 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -619,7 +619,7 @@ netdev_tx_t mlx5e_xmit(struct sk_buff *skb, struct net_device *dev);
void mlx5e_completion_event(struct mlx5_core_cq *mcq);
void mlx5e_cq_error_event(struct mlx5_core_cq *mcq, enum mlx5_event event);
int mlx5e_napi_poll(struct napi_struct *napi, int budget);
-bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq);
+bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget);
int mlx5e_poll_rx_cq(struct mlx5e_cq *cq, int budget);
bool mlx5e_post_rx_wqes(struct mlx5e_rq *rq);
struct mlx5_cqe64 *mlx5e_get_cqe(struct mlx5e_cq *cq);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
index c34f4f3e9537..996b13a5042f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -336,7 +336,7 @@ netdev_tx_t mlx5e_xmit(struct sk_buff *skb, struct net_device *dev)
return mlx5e_sq_xmit(sq, skb);
}
-bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq)
+bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget)
{
struct mlx5e_sq *sq;
u32 dma_fifo_cc;
@@ -412,7 +412,7 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq)
npkts++;
nbytes += wi->num_bytes;
sqcc += wi->num_wqebbs;
- dev_kfree_skb(skb);
+ napi_consume_skb(skb, napi_budget);
} while (!last_wqe);
}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
index 4ac8d716dbdd..d244acee63a5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
@@ -60,7 +60,7 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget)
clear_bit(MLX5E_CHANNEL_NAPI_SCHED, &c->flags);
for (i = 0; i < c->num_tc; i++)
- busy |= mlx5e_poll_tx_cq(&c->sq[i].cq);
+ busy |= mlx5e_poll_tx_cq(&c->sq[i].cq, budget);
work_done = mlx5e_poll_rx_cq(&c->rq.cq, budget);
busy |= work_done == budget;
^ permalink raw reply related
* [net-next PATCH V4 2/3] mlx4: use napi_consume_skb API to get bulk free operations
From: Jesper Dangaard Brouer @ 2016-03-11 8:44 UTC (permalink / raw)
To: netdev, David S. Miller
Cc: sergei.shtylyov, eugenia, Alexander Duyck, alexei.starovoitov,
saeedm, Jesper Dangaard Brouer, gerlitz.or
In-Reply-To: <20160311084245.5207.70640.stgit@firesoul>
Bulk free of SKBs happen transparently by the API call napi_consume_skb().
The napi budget parameter is usually needed by napi_consume_skb()
to detect if called from netpoll. In this patch it has an extra meaning.
For mlx4 driver, the mlx4_en_stop_port() call is done outside
NAPI/softirq context, and cleanup the entire TX ring via
mlx4_en_free_tx_buf(). The code mlx4_en_free_tx_desc() for
freeing SKBs are shared with NAPI calls.
To handle this shared use the zero budget indication is reused,
and handled appropriately in napi_consume_skb(). To reflect this,
variable is called napi_mode for the function call that needed
this distinction.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
index e0946ab22010..c0d7b7296236 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
@@ -276,7 +276,8 @@ static void mlx4_en_stamp_wqe(struct mlx4_en_priv *priv,
static u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
struct mlx4_en_tx_ring *ring,
- int index, u8 owner, u64 timestamp)
+ int index, u8 owner, u64 timestamp,
+ int napi_mode)
{
struct mlx4_en_tx_info *tx_info = &ring->tx_info[index];
struct mlx4_en_tx_desc *tx_desc = ring->buf + index * TXBB_SIZE;
@@ -347,7 +348,8 @@ static u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
}
}
}
- dev_consume_skb_any(skb);
+ napi_consume_skb(skb, napi_mode);
+
return tx_info->nr_txbb;
}
@@ -371,7 +373,8 @@ int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring)
while (ring->cons != ring->prod) {
ring->last_nr_txbb = mlx4_en_free_tx_desc(priv, ring,
ring->cons & ring->size_mask,
- !!(ring->cons & ring->size), 0);
+ !!(ring->cons & ring->size), 0,
+ 0 /* Non-NAPI caller */);
ring->cons += ring->last_nr_txbb;
cnt++;
}
@@ -385,7 +388,7 @@ int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring)
}
static bool mlx4_en_process_tx_cq(struct net_device *dev,
- struct mlx4_en_cq *cq)
+ struct mlx4_en_cq *cq, int napi_budget)
{
struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_cq *mcq = &cq->mcq;
@@ -451,7 +454,7 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev,
last_nr_txbb = mlx4_en_free_tx_desc(
priv, ring, ring_index,
!!((ring_cons + txbbs_skipped) &
- ring->size), timestamp);
+ ring->size), timestamp, napi_budget);
mlx4_en_stamp_wqe(priv, ring, stamp_index,
!!((ring_cons + txbbs_stamp) &
@@ -511,7 +514,7 @@ int mlx4_en_poll_tx_cq(struct napi_struct *napi, int budget)
struct mlx4_en_priv *priv = netdev_priv(dev);
int clean_complete;
- clean_complete = mlx4_en_process_tx_cq(dev, cq);
+ clean_complete = mlx4_en_process_tx_cq(dev, cq, budget);
if (!clean_complete)
return budget;
^ permalink raw reply related
* [net-next PATCH V4 1/3] net: adjust napi_consume_skb to handle non-NAPI callers
From: Jesper Dangaard Brouer @ 2016-03-11 8:43 UTC (permalink / raw)
To: netdev, David S. Miller
Cc: sergei.shtylyov, eugenia, Alexander Duyck, alexei.starovoitov,
saeedm, Jesper Dangaard Brouer, gerlitz.or
In-Reply-To: <20160311084245.5207.70640.stgit@firesoul>
Some drivers reuse/share code paths that free SKBs between NAPI
and non-NAPI calls. Adjust napi_consume_skb to handle this
use-case.
Before, calls from netpoll (w/ IRQs disabled) was handled and
indicated with a budget zero indication. Use the same zero
indication to handle calls not originating from NAPI/softirq.
Simply handled by using dev_consume_skb_any().
This adds an extra branch+call for the netpoll case (checking
in_irq() + irqs_disabled()), but that is okay as this is a slowpath.
Suggested-by: Alexander Duyck <aduyck@mirantis.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
net/core/skbuff.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 7af7ec635d90..cf63a6000405 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -801,9 +801,9 @@ void napi_consume_skb(struct sk_buff *skb, int budget)
if (unlikely(!skb))
return;
- /* if budget is 0 assume netpoll w/ IRQs disabled */
+ /* Zero budget indicate non-NAPI context called us, like netpoll */
if (unlikely(!budget)) {
- dev_consume_skb_irq(skb);
+ dev_consume_skb_any(skb);
return;
}
^ permalink raw reply related
* [net-next PATCH V4 0/3] net: bulk free adjustment and two driver use-cases
From: Jesper Dangaard Brouer @ 2016-03-11 8:43 UTC (permalink / raw)
To: netdev, David S. Miller
Cc: sergei.shtylyov, eugenia, Alexander Duyck, alexei.starovoitov,
saeedm, Jesper Dangaard Brouer, gerlitz.or
In-Reply-To: <20160311084549.1b011723@redhat.com>
I've split out the bulk free adjustments, from the bulk alloc patches,
as I want the adjustment to napi_consume_skb be in same kernel cycle
the API was introduced.
Adjustments based on discussion:
Subj: "mlx4: use napi_consume_skb API to get bulk free operations"
http://thread.gmane.org/gmane.linux.network/402503/focus=403386
Patchset based on net-next at commit 3ebeac1d0295
V4: more nitpicks from Sergei
V3: spelling fixes from Sergei
---
Jesper Dangaard Brouer (3):
net: adjust napi_consume_skb to handle non-NAPI callers
mlx4: use napi_consume_skb API to get bulk free operations
mlx5: use napi_consume_skb API to get bulk free operations
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 15 +++++++++------
drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 4 ++--
drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c | 2 +-
net/core/skbuff.c | 4 ++--
5 files changed, 15 insertions(+), 12 deletions(-)
^ permalink raw reply
* Re: [RFC/RFT] mac80211: implement fq_codel for software queuing
From: Michal Kazior @ 2016-03-11 8:32 UTC (permalink / raw)
To: Dave Taht
Cc: linux-wireless, Johannes Berg, netdev@vger.kernel.org,
Eric Dumazet, Emmanuel Grumbach, Felix Fietkau, Tim Shepard
In-Reply-To: <CAA93jw47wtioiUUD8ZTm4hFSVL7Uc8ubpSG5urHtWQhfAo1nmQ@mail.gmail.com>
On 10 March 2016 at 19:57, Dave Taht <dave.taht@gmail.com> wrote:
>>> regular fq_codel uses 1024 and there has not been much reason to
>>> change it. In the case of an AP which has more limited memory, 256 or
>>> 1024 would be a good setting, per station. I'd stick to 1024 for now.
>>
>> Do note that the 4096 is shared _across_ station-tid queues. It is not
>> per-station. If you have 10 stations you still have 4096 flows
>> (actually 4096 + 16*10, because each tid - and there are 16 - has it's
>> own fallback flow in case of hash collision on the global flowmap to
>> maintain per-sta-tid queuing).
>
> I have to admit I didn't parse this well - still haven't, I think I
> need to draw. (got a picture?)
No picture, sorry. Let me rehash instead:
- there's a pool of 4096 tubes (flows),
- tubes in the pool are empty,
- each tube has an id sticker (0,1,2,3,...),
- each wi-fi station has 16 boxes (tids) for tubes as well,
- each station box has 1 extra immovable tube (flow),
- packets are hashed into tube id stickers,
- matching tube can be:
- in the pool;
- move the tube into station-box the packet is associated with
- put the packet into tube
- in the station-box the packet is associated with
- just put the packet into tube
- in a station-box different from the one the packet is associated with
- (this is the collision case for fallback flow)
- put the packet into the immovable tube of station box the
packet is associated with
- whenever a tube becomes empty it is moved back to the pool
> Where is this part happening in the code (or firmware?)
It's in the ieee80211_txq_enqueue(). My patch originally contains a
mistake (pointed out by Felix) and the function should actually look
like this:
> static void ieee80211_txq_enqueue(struct ieee80211_local *local,
> struct txq_info *txqi,
> struct sk_buff *skb)
> {
> struct ieee80211_fq *fq = &local->fq;
> struct ieee80211_hw *hw = &local->hw;
> struct txq_flow *flow;
> struct txq_flow *i;
> size_t idx = fq_hash(fq, skb);
>
> flow = &fq->flows[idx];
>
> if (flow->txqi && flow->txqi != txqi)
> flow = &txqi->flow;
[...]
> I assembled a few of the patches to date (your fq_codel patch, avery's
> and tims ath9k stuff) and tested them, to no measurable effect,
> against linus's tree a day or two back. I also acquired an ath10k card
> - would one of these suit?
>
> http://www.amazon.com/gp/product/B011SIMFR8?psc=1&redirect=true&ref_=oh_aui_detailpage_o08_s00
I haven't used this particular card. It's an older chip (no MU-MIMO)
but otherwise should work fine.
Michał
^ permalink raw reply
* Re: [PATCHv2 (net.git) 2/2] stmmac: fix MDIO settings
From: Phil Reid @ 2016-03-11 8:16 UTC (permalink / raw)
To: Giuseppe Cavallaro, netdev
Cc: gabriel.fernandez, afaerber, fschaefer.oss, dinh.linux, davem
In-Reply-To: <1457682245-22746-3-git-send-email-peppe.cavallaro@st.com>
G'day Giuseppe,
Sorry for delay in responding.
I feel responsible for starting the changes breaking this.
See below.
On 11/03/2016 3:44 PM, Giuseppe Cavallaro wrote:
> Initially the phy_bus_name was added to manipulate the
> driver name but It was recently just used to manage the
> fixed-link and then to take some decision at run-time
> inside the main (for example to skip EEE).
> So the patch uses the is_pseudo_fixed_link and removes
> removes the phy_bus_name variable not necessary anymore.
>
> The driver can manage the mdio registration by using phy-handle,
> dwmac-mdio and own parameter e.g. snps,phy-addr.
> This patch takes care about all these possible configurations
> and fixes the mdio registration in case of there is a real
> transceiver or a switch (that needs to be managed by using
> fixed-link).
>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Reviewed-by: Andreas Färber <afaerber@suse.de>
> Tested-by: Frank Schäfer <fschaefer.oss@googlemail.com>
> Cc: Gabriel Fernandez <gabriel.fernandez@linaro.org>
> Cc: Dinh Nguyen <dinh.linux@gmail.com>
> Cc: David S. Miller <davem@davemloft.net>
> ---
>
> V2: use is_pseudo_fixed_link
>
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++--------
> .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 14 +++++---------
> include/linux/stmmac.h | 1 -
> 3 files changed, 8 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index c21015b..389d7d0 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -271,7 +271,6 @@ static void stmmac_eee_ctrl_timer(unsigned long arg)
> */
> bool stmmac_eee_init(struct stmmac_priv *priv)
> {
> - char *phy_bus_name = priv->plat->phy_bus_name;
> unsigned long flags;
> bool ret = false;
>
> @@ -283,7 +282,7 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
> goto out;
>
> /* Never init EEE in case of a switch is attached */
> - if (phy_bus_name && (!strcmp(phy_bus_name, "fixed")))
> + if (priv->phydev->is_pseudo_fixed_link)
> goto out;
>
> /* MAC core supports the EEE feature. */
> @@ -820,12 +819,8 @@ static int stmmac_init_phy(struct net_device *dev)
> phydev = of_phy_connect(dev, priv->plat->phy_node,
> &stmmac_adjust_link, 0, interface);
> } else {
> - if (priv->plat->phy_bus_name)
> - snprintf(bus_id, MII_BUS_ID_SIZE, "%s-%x",
> - priv->plat->phy_bus_name, priv->plat->bus_id);
> - else
> - snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
> - priv->plat->bus_id);
> + snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
> + priv->plat->bus_id);
>
> snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id,
> priv->plat->phy_addr);
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index 6a52fa1..ed33920 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -138,7 +138,11 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
> return ERR_PTR(-ENODEV);
>
> plat->phy_node = of_node_get(np);
> - }
> + } else
> + plat->mdio_bus_data =
> + devm_kzalloc(&pdev->dev,
> + sizeof(struct stmmac_mdio_bus_data),
> + GFP_KERNEL);
This breaks my use case where I have a fixed link but also need the mdio bus for
talking to a dsa switch. stmmac_mdio_register bails out because mdio_bus_data is
never allocated here at this point when a fixed link exists with no phy-handle
property. Removing the else solves my use.
Possibly it could be allocated in stmmac_mdio_register if snps,dwmac-mdio
is found and not already allocated.
With the
if (!mdio_bus_data)
return 0;
to after the device tree query.
>
> /* "snps,phy-addr" is not a standard property. Mark it as deprecated
> * and warn of its use. Remove this when phy node support is added.
> @@ -146,14 +150,6 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
> if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
> dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
>
> - if ((plat->phy_node && !of_phy_is_fixed_link(np)) || plat->phy_bus_name)
> - plat->mdio_bus_data = NULL;
> - else
> - plat->mdio_bus_data =
> - devm_kzalloc(&pdev->dev,
> - sizeof(struct stmmac_mdio_bus_data),
> - GFP_KERNEL);
> -
> of_property_read_u32(np, "tx-fifo-depth", &plat->tx_fifo_size);
>
> of_property_read_u32(np, "rx-fifo-depth", &plat->rx_fifo_size);
> diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
> index eead8ab..1b4884c 100644
> --- a/include/linux/stmmac.h
> +++ b/include/linux/stmmac.h
> @@ -94,7 +94,6 @@ struct stmmac_dma_cfg {
> };
>
> struct plat_stmmacenet_data {
> - char *phy_bus_name;
> int bus_id;
> int phy_addr;
> int interface;
>
--
Regards
Phil Reid
^ permalink raw reply
* Re: [net-next PATCH V3 1/3] net: adjust napi_consume_skb to handle none-NAPI callers
From: Jesper Dangaard Brouer @ 2016-03-11 7:45 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: netdev, David S. Miller, eugenia, Alexander Duyck,
alexei.starovoitov, saeedm, gerlitz.or, brouer
In-Reply-To: <56E1AD33.3020507@cogentembedded.com>
On Thu, 10 Mar 2016 20:21:55 +0300
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> wrote:
> > --- a/net/core/skbuff.c
> > +++ b/net/core/skbuff.c
> > @@ -801,9 +801,9 @@ void napi_consume_skb(struct sk_buff *skb, int budget)
> > if (unlikely(!skb))
> > return;
> >
> > - /* if budget is 0 assume netpoll w/ IRQs disabled */
> > + /* Zero budget indicate none-NAPI context called us, like netpoll */
>
> Non-NAPI?
Okay, I'll send a V4. Hope there are no more nitpicking changes...
I'll also adjust the subj none-NAPI -> non-NAPI, and hope that does not
disturb patchwork.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* [PATCHv2 (net.git) 2/2] stmmac: fix MDIO settings
From: Giuseppe Cavallaro @ 2016-03-11 7:44 UTC (permalink / raw)
To: netdev
Cc: gabriel.fernandez, afaerber, fschaefer.oss, dinh.linux, davem,
Giuseppe Cavallaro
In-Reply-To: <1457682245-22746-1-git-send-email-peppe.cavallaro@st.com>
Initially the phy_bus_name was added to manipulate the
driver name but It was recently just used to manage the
fixed-link and then to take some decision at run-time
inside the main (for example to skip EEE).
So the patch uses the is_pseudo_fixed_link and removes
removes the phy_bus_name variable not necessary anymore.
The driver can manage the mdio registration by using phy-handle,
dwmac-mdio and own parameter e.g. snps,phy-addr.
This patch takes care about all these possible configurations
and fixes the mdio registration in case of there is a real
transceiver or a switch (that needs to be managed by using
fixed-link).
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Tested-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Cc: Gabriel Fernandez <gabriel.fernandez@linaro.org>
Cc: Dinh Nguyen <dinh.linux@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
---
V2: use is_pseudo_fixed_link
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++--------
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 14 +++++---------
include/linux/stmmac.h | 1 -
3 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index c21015b..389d7d0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -271,7 +271,6 @@ static void stmmac_eee_ctrl_timer(unsigned long arg)
*/
bool stmmac_eee_init(struct stmmac_priv *priv)
{
- char *phy_bus_name = priv->plat->phy_bus_name;
unsigned long flags;
bool ret = false;
@@ -283,7 +282,7 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
goto out;
/* Never init EEE in case of a switch is attached */
- if (phy_bus_name && (!strcmp(phy_bus_name, "fixed")))
+ if (priv->phydev->is_pseudo_fixed_link)
goto out;
/* MAC core supports the EEE feature. */
@@ -820,12 +819,8 @@ static int stmmac_init_phy(struct net_device *dev)
phydev = of_phy_connect(dev, priv->plat->phy_node,
&stmmac_adjust_link, 0, interface);
} else {
- if (priv->plat->phy_bus_name)
- snprintf(bus_id, MII_BUS_ID_SIZE, "%s-%x",
- priv->plat->phy_bus_name, priv->plat->bus_id);
- else
- snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
- priv->plat->bus_id);
+ snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
+ priv->plat->bus_id);
snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id,
priv->plat->phy_addr);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 6a52fa1..ed33920 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -138,7 +138,11 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
return ERR_PTR(-ENODEV);
plat->phy_node = of_node_get(np);
- }
+ } else
+ plat->mdio_bus_data =
+ devm_kzalloc(&pdev->dev,
+ sizeof(struct stmmac_mdio_bus_data),
+ GFP_KERNEL);
/* "snps,phy-addr" is not a standard property. Mark it as deprecated
* and warn of its use. Remove this when phy node support is added.
@@ -146,14 +150,6 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
- if ((plat->phy_node && !of_phy_is_fixed_link(np)) || plat->phy_bus_name)
- plat->mdio_bus_data = NULL;
- else
- plat->mdio_bus_data =
- devm_kzalloc(&pdev->dev,
- sizeof(struct stmmac_mdio_bus_data),
- GFP_KERNEL);
-
of_property_read_u32(np, "tx-fifo-depth", &plat->tx_fifo_size);
of_property_read_u32(np, "rx-fifo-depth", &plat->rx_fifo_size);
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index eead8ab..1b4884c 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -94,7 +94,6 @@ struct stmmac_dma_cfg {
};
struct plat_stmmacenet_data {
- char *phy_bus_name;
int bus_id;
int phy_addr;
int interface;
--
1.7.4.4
^ permalink raw reply related
* [PATCHv2 (net.git) 0/2] stmmac: MDIO fixes
From: Giuseppe Cavallaro @ 2016-03-11 7:44 UTC (permalink / raw)
To: netdev
Cc: gabriel.fernandez, afaerber, fschaefer.oss, dinh.linux, davem,
Giuseppe Cavallaro
These two patches are to fix the recent regressions raised
when test the stmmac on some platforms due to broken MDIO
management.
V2: use is_pseudo_fixed_link
Giuseppe Cavallaro (2):
Revert "stmmac: Fix 'eth0: No PHY found' regression"
stmmac: fix MDIO settings
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 ++-------
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 11 +++++++++-
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 21 ++++---------------
include/linux/stmmac.h | 2 -
4 files changed, 18 insertions(+), 27 deletions(-)
--
1.7.4.4
^ permalink raw reply
* [PATCHv2 (net.git) 1/2] Revert "stmmac: Fix 'eth0: No PHY found' regression"
From: Giuseppe Cavallaro @ 2016-03-11 7:44 UTC (permalink / raw)
To: netdev
Cc: gabriel.fernandez, afaerber, fschaefer.oss, dinh.linux, davem,
Giuseppe Cavallaro
In-Reply-To: <1457682245-22746-1-git-send-email-peppe.cavallaro@st.com>
This reverts commit 88f8b1bb41c6208f81b6a480244533ded7b59493.
due to problems on GeekBox and Banana Pi M1 board when
connected to a real transceiver instead of a switch via
fixed-link.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Gabriel Fernandez <gabriel.fernandez@linaro.org>
Cc: Andreas Färber <afaerber@suse.de>
Cc: Frank Schäfer <fschaefer.oss@googlemail.com>
Cc: Dinh Nguyen <dinh.linux@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 11 ++++++++++-
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 9 +--------
include/linux/stmmac.h | 1 -
3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index efb54f3..0faf163 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -199,12 +199,21 @@ int stmmac_mdio_register(struct net_device *ndev)
struct stmmac_priv *priv = netdev_priv(ndev);
struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data;
int addr, found;
- struct device_node *mdio_node = priv->plat->mdio_node;
+ struct device_node *mdio_node = NULL;
+ struct device_node *child_node = NULL;
if (!mdio_bus_data)
return 0;
if (IS_ENABLED(CONFIG_OF)) {
+ for_each_child_of_node(priv->device->of_node, child_node) {
+ if (of_device_is_compatible(child_node,
+ "snps,dwmac-mdio")) {
+ mdio_node = child_node;
+ break;
+ }
+ }
+
if (mdio_node) {
netdev_dbg(ndev, "FOUND MDIO subnode\n");
} else {
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 4514ba7..6a52fa1 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -110,7 +110,6 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
struct device_node *np = pdev->dev.of_node;
struct plat_stmmacenet_data *plat;
struct stmmac_dma_cfg *dma_cfg;
- struct device_node *child_node = NULL;
plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
if (!plat)
@@ -141,19 +140,13 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
plat->phy_node = of_node_get(np);
}
- for_each_child_of_node(np, child_node)
- if (of_device_is_compatible(child_node, "snps,dwmac-mdio")) {
- plat->mdio_node = child_node;
- break;
- }
-
/* "snps,phy-addr" is not a standard property. Mark it as deprecated
* and warn of its use. Remove this when phy node support is added.
*/
if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
- if ((plat->phy_node && !of_phy_is_fixed_link(np)) || !plat->mdio_node)
+ if ((plat->phy_node && !of_phy_is_fixed_link(np)) || plat->phy_bus_name)
plat->mdio_bus_data = NULL;
else
plat->mdio_bus_data =
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 881a79d..eead8ab 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -100,7 +100,6 @@ struct plat_stmmacenet_data {
int interface;
struct stmmac_mdio_bus_data *mdio_bus_data;
struct device_node *phy_node;
- struct device_node *mdio_node;
struct stmmac_dma_cfg *dma_cfg;
int clk_csr;
int has_gmac;
--
1.7.4.4
^ permalink raw reply related
* RE: [PATCH v2] can: rcar_canfd: Add Renesas R-Car CAN FD driver
From: Ramesh Shanmugasundaram @ 2016-03-11 7:14 UTC (permalink / raw)
To: Oliver Hartkopp, Marc Kleine-Budde, wg@grandegger.com,
robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
corbet@lwn.net
Cc: linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
linux-can@vger.kernel.org, netdev@vger.kernel.org,
linux-doc@vger.kernel.org, geert+renesas@glider.be,
Chris Paterson
In-Reply-To: <56DF0900.6090906@hartkopp.net>
Hi Oliver, Marc,
> On 03/08/2016 01:48 PM, Ramesh Shanmugasundaram wrote:
>
> >> In fact you provided a CAN driver which is "CAN-FD-only".
> >
> > Yes. That's the status of current submission.
(...)
> >
> > I did try this option earlier but there are two problems with this
> method.
> >
> > 1) Below configuration is not possible
> >
> > ip link set can0 up type can bitrate 1000000 dbitrate 1000000 fd on
> >
> > "fd on" -> This is not allowed because CAN_CTRLMODE_FD bit is not set in
> ctrlmode_supported.
> >
> > 2) If I ignore "fd on", my interface MTU stays as CAN_MTU only. If I
> have to change the MTU alone to CANFD_MTU using another netlink message,
> it again checks ctrlmode_supported where it would fail. I have the option
> of providing my own change_mtu function & ignore this check but two
> configuration messages are required for my driver alone :-(.
> >
> > Both these anomalies are addressed with the current check I have.
>
> Oh - you are right with complaining about this inconsistency.
>
> Can you check my RFC patch for Linux stable I just sent on the mailing
> list?
> http://marc.info/?l=linux-can&m=145745724917976&w=2
As we are fixing this issue in CAN dev.c, I'll remove this check in ndo_open and set CAN_CTRLMODE_FD flag in ctrlmode & remove the flag in ctrlmode_supported in the next v3 version of the patch.
Are there any further comments on v2 patch please?
Thanks,
Ramesh
^ permalink raw reply
* RE: [PATCH net v2 0/2] qlcnic fixes
From: Rajesh Borundia @ 2016-03-11 6:40 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Dept-GE Linux NIC Dev
In-Reply-To: <20160310.161635.432267926229064181.davem@davemloft.net>
>-----Original Message-----
>From: David Miller [mailto:davem@davemloft.net]
>Sent: Friday, March 11, 2016 2:47 AM
>To: Rajesh Borundia <rajesh.borundia@qlogic.com>
>Cc: netdev <netdev@vger.kernel.org>; Dept-GE Linux NIC Dev <Dept-
>GELinuxNICDev@qlogic.com>
>Subject: Re: [PATCH net v2 0/2] qlcnic fixes
>
>From: Rajesh Borundia <rajesh.borundia@qlogic.com>
>Date: Tue, 8 Mar 2016 02:39:56 -0500
>
>> This series adds following fixes.
>>
>> o While processing mailbox if driver gets a spurious mailbox
>> interrupt it leads into premature completion of a next
>> mailbox request. Added a guard against this by checking current
>> state of mailbox and ignored spurious interrupt.
>> Added a stats counter to record this condition.
>>
>> v2:
>>
>> o Added patch that removes usage of atomic_t as we are not implemeting
>> atomicity by using atomic_t value.
>>
>> Please apply these fixes to net.
>
>As explained in other list postings, 'net' is basically closed for this release cycle,
>so I applied this series to 'net-next'.
>
Thanks.
>Let me know if you'd like me to therefore queue these changes up for -stable.
>
Please queue the changes for stable.
>Thanks.
^ permalink raw reply
* [PATCH] kcm: fix variable type
From: Andrzej Hajda @ 2016-03-11 6:51 UTC (permalink / raw)
To: Tom Herbert
Cc: Andrzej Hajda, Bartlomiej Zolnierkiewicz, Marek Szyprowski,
David S. Miller, netdev, linux-kernel
Function skb_splice_bits can return negative values, its result should
be assigned to signed variable to allow correct error checking.
The problem has been detected using patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
net/kcm/kcmsock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index 40662d73..0b68ba7 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -1483,7 +1483,7 @@ static ssize_t kcm_splice_read(struct socket *sock, loff_t *ppos,
long timeo;
struct kcm_rx_msg *rxm;
int err = 0;
- size_t copied;
+ ssize_t copied;
struct sk_buff *skb;
/* Only support splice for SOCKSEQPACKET */
--
1.9.1
^ permalink raw reply related
* [PATCH net v2] r8169:Remove unnecessary phy reset for pcie nic when setting link spped.
From: Chunhao Lin @ 2016-03-11 6:21 UTC (permalink / raw)
To: netdev; +Cc: nic_swsd, linux-kernel, Chunhao Lin
For pcie nic, after setting link speed and there is no link driver does not need
to do phy reset until link up.
For some pcie nics, to do this will also reset phy speed down counter and prevent
phy from auto speed down.
This patch fix the issue reported in following link.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1547151
Signed-off-by: Chunhao Lin <hau@realtek.com>
---
drivers/net/ethernet/realtek/r8169.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index dd2cf37..94f08f1 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -1999,7 +1999,8 @@ static int rtl8169_set_speed(struct net_device *dev,
goto out;
if (netif_running(dev) && (autoneg == AUTONEG_ENABLE) &&
- (advertising & ADVERTISED_1000baseT_Full)) {
+ (advertising & ADVERTISED_1000baseT_Full) &&
+ !pci_is_pcie(tp->pci_dev)) {
mod_timer(&tp->timer, jiffies + RTL8169_PHY_TIMEOUT);
}
out:
--
1.9.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox