* [PATCH net-next 11/12] net: hns3: add handshake with VF for PF reset
From: Huazhong Tan @ 2019-08-09 2:31 UTC (permalink / raw)
To: davem
Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
Huazhong Tan
In-Reply-To: <1565317878-31806-1-git-send-email-tanhuazhong@huawei.com>
Before PF asserting function reset, it should make sure
that all its VFs have been ready, otherwise, it will cause
some hardware errors.
So this patch adds function hclge_func_reset_sync_vf() to
synchronize VF before asserting PF function reset. For new
firmware which supports command HCLGE_OPC_QUERY_VF_RST_RDY,
we will try to query VFs' ready status within 30 seconds.
And keep the old implementation for compatible with firmware
which does not support this command.
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>
---
.../net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 7 +++
.../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 56 ++++++++++++++++++----
2 files changed, 55 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
index dade20a..29979be 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
@@ -87,6 +87,7 @@ enum hclge_opcode_type {
HCLGE_OPC_QUERY_VF_RSRC = 0x0024,
HCLGE_OPC_GET_CFG_PARAM = 0x0025,
HCLGE_OPC_PF_RST_DONE = 0x0026,
+ HCLGE_OPC_QUERY_VF_RST_RDY = 0x0027,
HCLGE_OPC_STATS_64_BIT = 0x0030,
HCLGE_OPC_STATS_32_BIT = 0x0031,
@@ -588,6 +589,12 @@ struct hclge_config_mac_mode_cmd {
u8 rsv[20];
};
+struct hclge_pf_rst_sync_cmd {
+#define HCLGE_PF_RST_ALL_VF_RDY_B 0
+ u8 all_vf_ready;
+ u8 rsv[23];
+};
+
#define HCLGE_CFG_SPEED_S 0
#define HCLGE_CFG_SPEED_M GENMASK(5, 0)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 1315275..d207dac 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -35,6 +35,9 @@
#define BUF_RESERVE_PERCENT 90
#define HCLGE_RESET_MAX_FAIL_CNT 5
+#define HCLGE_RESET_SYNC_TIME 100
+#define HCLGE_PF_RESET_SYNC_TIME 20
+#define HCLGE_PF_RESET_SYNC_CNT 1500
/* Get DFX BD number offset */
#define HCLGE_DFX_BIOS_BD_OFFSET 1
@@ -3184,6 +3187,39 @@ static int hclge_set_all_vf_rst(struct hclge_dev *hdev, bool reset)
return 0;
}
+int hclge_func_reset_sync_vf(struct hclge_dev *hdev)
+{
+ struct hclge_pf_rst_sync_cmd *req;
+ struct hclge_desc desc;
+ int cnt = 0;
+ int ret;
+
+ req = (struct hclge_pf_rst_sync_cmd *)desc.data;
+ hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_QUERY_VF_RST_RDY, true);
+
+ do {
+ ret = hclge_cmd_send(&hdev->hw, &desc, 1);
+ /* for compatible with old firmware, wait
+ * 100 ms for VF to stop IO
+ */
+ if (ret == -EOPNOTSUPP) {
+ msleep(HCLGE_RESET_SYNC_TIME);
+ return 0;
+ } else if (ret) {
+ dev_err(&hdev->pdev->dev, "sync with VF fail %d!\n",
+ ret);
+ return ret;
+ } else if (req->all_vf_ready) {
+ return 0;
+ }
+ msleep(HCLGE_PF_RESET_SYNC_TIME);
+ hclge_cmd_reuse_desc(&desc, true);
+ } while (cnt++ < HCLGE_PF_RESET_SYNC_CNT);
+
+ dev_err(&hdev->pdev->dev, "sync with VF timeout!\n");
+ return -ETIME;
+}
+
int hclge_func_reset_cmd(struct hclge_dev *hdev, int func_id)
{
struct hclge_desc desc;
@@ -3350,17 +3386,18 @@ static void hclge_reset_handshake(struct hclge_dev *hdev, bool enable)
static int hclge_reset_prepare_wait(struct hclge_dev *hdev)
{
-#define HCLGE_RESET_SYNC_TIME 100
-
u32 reg_val;
int ret = 0;
switch (hdev->reset_type) {
case HNAE3_FUNC_RESET:
- /* There is no mechanism for PF to know if VF has stopped IO
- * for now, just wait 100 ms for VF to stop IO
+ /* to confirm whether all running VF is ready
+ * before request PF reset
*/
- msleep(HCLGE_RESET_SYNC_TIME);
+ ret = hclge_func_reset_sync_vf(hdev);
+ if (ret)
+ return ret;
+
ret = hclge_func_reset_cmd(hdev, 0);
if (ret) {
dev_err(&hdev->pdev->dev,
@@ -3377,10 +3414,13 @@ static int hclge_reset_prepare_wait(struct hclge_dev *hdev)
hdev->rst_stats.pf_rst_cnt++;
break;
case HNAE3_FLR_RESET:
- /* There is no mechanism for PF to know if VF has stopped IO
- * for now, just wait 100 ms for VF to stop IO
+ /* to confirm whether all running VF is ready
+ * before request PF reset
*/
- msleep(HCLGE_RESET_SYNC_TIME);
+ ret = hclge_func_reset_sync_vf(hdev);
+ if (ret)
+ return ret;
+
set_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state);
set_bit(HNAE3_FLR_DOWN, &hdev->flr_state);
hdev->rst_stats.flr_rst_cnt++;
--
2.7.4
^ permalink raw reply related
* [PATCH net-next 09/12] net: hns3: add function display NCL_CONFIG info
From: Huazhong Tan @ 2019-08-09 2:31 UTC (permalink / raw)
To: davem
Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
Yufeng Mo, Huazhong Tan
In-Reply-To: <1565317878-31806-1-git-send-email-tanhuazhong@huawei.com>
From: Yufeng Mo <moyufeng@huawei.com>
This adds a new function hclge_ncl_config_data_print()
to print the data of NCL_CONFIG, to make the code more
readable. Also, using macro replaces some magic number.
Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Reviewed-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
.../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 52 +++++++++++++---------
1 file changed, 30 insertions(+), 22 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
index 933dec5..f0295d1 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
@@ -995,6 +995,33 @@ void hclge_dbg_get_m7_stats_info(struct hclge_dev *hdev)
kfree(desc_src);
}
+#define HCLGE_CMD_NCL_CONFIG_BD_NUM 5
+
+static void hclge_ncl_config_data_print(struct hclge_dev *hdev,
+ struct hclge_desc *desc, int *offset,
+ int *length)
+{
+#define HCLGE_CMD_DATA_NUM 6
+
+ int i;
+ int j;
+
+ for (i = 0; i < HCLGE_CMD_NCL_CONFIG_BD_NUM; i++) {
+ for (j = 0; j < HCLGE_CMD_DATA_NUM; j++) {
+ if (i == 0 && j == 0)
+ continue;
+
+ dev_info(&hdev->pdev->dev, "0x%04x | 0x%08x\n",
+ *offset,
+ le32_to_cpu(desc[i].data[j]));
+ *offset += sizeof(u32);
+ *length -= sizeof(u32);
+ if (*length <= 0)
+ return;
+ }
+ }
+}
+
/* hclge_dbg_dump_ncl_config: print specified range of NCL_CONFIG file
* @hdev: pointer to struct hclge_dev
* @cmd_buf: string that contains offset and length
@@ -1004,17 +1031,13 @@ static void hclge_dbg_dump_ncl_config(struct hclge_dev *hdev,
{
#define HCLGE_MAX_NCL_CONFIG_OFFSET 4096
#define HCLGE_MAX_NCL_CONFIG_LENGTH (20 + 24 * 4)
-#define HCLGE_CMD_DATA_NUM 6
- struct hclge_desc desc[5];
- u32 byte_offset;
- int bd_num = 5;
+ struct hclge_desc desc[HCLGE_CMD_NCL_CONFIG_BD_NUM];
+ int bd_num = HCLGE_CMD_NCL_CONFIG_BD_NUM;
int offset;
int length;
int data0;
int ret;
- int i;
- int j;
ret = sscanf(cmd_buf, "%x %x", &offset, &length);
if (ret != 2 || offset >= HCLGE_MAX_NCL_CONFIG_OFFSET ||
@@ -1040,22 +1063,7 @@ static void hclge_dbg_dump_ncl_config(struct hclge_dev *hdev,
if (ret)
return;
- byte_offset = offset;
- for (i = 0; i < bd_num; i++) {
- for (j = 0; j < HCLGE_CMD_DATA_NUM; j++) {
- if (i == 0 && j == 0)
- continue;
-
- dev_info(&hdev->pdev->dev, "0x%04x | 0x%08x\n",
- byte_offset,
- le32_to_cpu(desc[i].data[j]));
- byte_offset += sizeof(u32);
- length -= sizeof(u32);
- if (length <= 0)
- return;
- }
- }
- offset += HCLGE_MAX_NCL_CONFIG_LENGTH;
+ hclge_ncl_config_data_print(hdev, desc, &offset, &length);
}
}
--
2.7.4
^ permalink raw reply related
* [PATCH net-next 02/12] net: hns3: fix interrupt clearing error for VF
From: Huazhong Tan @ 2019-08-09 2:31 UTC (permalink / raw)
To: davem
Cc: netdev, linux-kernel, salil.mehta, yisen.zhuang, linuxarm,
Huazhong Tan
In-Reply-To: <1565317878-31806-1-git-send-email-tanhuazhong@huawei.com>
Currently, VF driver has two kinds of interrupts, reset & CMDQ RX.
For revision 0x21, according to the UM, each interrupt should be
cleared by write 0 to the corresponding bit, but the implementation
writes 0 to the whole register in fact, it will clear other
interrupt at the same time, then the VF will loss the interrupt.
But for revision 0x20, this interrupt clear register is a read &
write register, for compatible, we just keep the old implementation
for 0x20.
This patch fixes it, also, adds a new register for reading the interrupt
status according to hardware user manual.
Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support")
Fixes: b90fcc5bd904 ("net: hns3: add reset handling for VF when doing Core/Global/IMP reset")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>
---
.../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 28 +++++++++++++++-------
.../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 2 ++
2 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index ce82b2b..d8b8281 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -1889,21 +1889,20 @@ static void hclgevf_clear_event_cause(struct hclgevf_dev *hdev, u32 regclr)
static enum hclgevf_evt_cause hclgevf_check_evt_cause(struct hclgevf_dev *hdev,
u32 *clearval)
{
- u32 val, cmdq_src_reg, rst_ing_reg;
+ u32 val, cmdq_stat_reg, rst_ing_reg;
/* fetch the events from their corresponding regs */
- cmdq_src_reg = hclgevf_read_dev(&hdev->hw,
- HCLGEVF_VECTOR0_CMDQ_SRC_REG);
+ cmdq_stat_reg = hclgevf_read_dev(&hdev->hw,
+ HCLGEVF_VECTOR0_CMDQ_STAT_REG);
- if (BIT(HCLGEVF_VECTOR0_RST_INT_B) & cmdq_src_reg) {
+ if (BIT(HCLGEVF_VECTOR0_RST_INT_B) & cmdq_stat_reg) {
rst_ing_reg = hclgevf_read_dev(&hdev->hw, HCLGEVF_RST_ING);
dev_info(&hdev->pdev->dev,
"receive reset interrupt 0x%x!\n", rst_ing_reg);
set_bit(HNAE3_VF_RESET, &hdev->reset_pending);
set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state);
set_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state);
- cmdq_src_reg &= ~BIT(HCLGEVF_VECTOR0_RST_INT_B);
- *clearval = cmdq_src_reg;
+ *clearval = ~(1U << HCLGEVF_VECTOR0_RST_INT_B);
hdev->rst_stats.vf_rst_cnt++;
/* set up VF hardware reset status, its PF will clear
* this status when PF has initialized done.
@@ -1915,9 +1914,20 @@ static enum hclgevf_evt_cause hclgevf_check_evt_cause(struct hclgevf_dev *hdev,
}
/* check for vector0 mailbox(=CMDQ RX) event source */
- if (BIT(HCLGEVF_VECTOR0_RX_CMDQ_INT_B) & cmdq_src_reg) {
- cmdq_src_reg &= ~BIT(HCLGEVF_VECTOR0_RX_CMDQ_INT_B);
- *clearval = cmdq_src_reg;
+ if (BIT(HCLGEVF_VECTOR0_RX_CMDQ_INT_B) & cmdq_stat_reg) {
+ /* for revision 0x21, clearing interrupt is writing bit 0
+ * to the clear register, writing bit 1 means to keep the
+ * old value.
+ * for revision 0x20, the clear register is a read & write
+ * register, so we should just write 0 to the bit we are
+ * handling, and keep other bits as cmdq_stat_reg.
+ */
+ if (hdev->pdev->revision >= 0x21)
+ *clearval = ~(1U << HCLGEVF_VECTOR0_RX_CMDQ_INT_B);
+ else
+ *clearval = cmdq_stat_reg &
+ ~BIT(HCLGEVF_VECTOR0_RX_CMDQ_INT_B);
+
return HCLGEVF_VECTOR0_EVENT_MBX;
}
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
index f0736b0..4ccf107 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h
@@ -87,6 +87,8 @@
/* Vector0 interrupt CMDQ event source register(RW) */
#define HCLGEVF_VECTOR0_CMDQ_SRC_REG 0x27100
+/* Vector0 interrupt CMDQ event status register(RO) */
+#define HCLGEVF_VECTOR0_CMDQ_STAT_REG 0x27104
/* CMDQ register bits for RX event(=MBX event) */
#define HCLGEVF_VECTOR0_RX_CMDQ_INT_B 1
/* RST register bits for RESET event */
--
2.7.4
^ permalink raw reply related
* RE: [PATCH net-next 5/5] r8152: change rx_frag_head_sz and rx_max_agg_num dynamically
From: Hayes Wang @ 2019-08-09 3:38 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Maciej Fijalkowski, netdev@vger.kernel.org, nic_swsd,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
In-Reply-To: <20190808114325.5c346d3a@cakuba.netronome.com>
Jakub Kicinski [jakub.kicinski@netronome.com]
[..]> The kernel could support it. And I has finished it.
> > However, when I want to test it by ethtool, I couldn't find suitable command.
> > I couldn't find relative feature in the source code of ethtool, either.
> It's possible it's not implemented in the user space tool 🤔
>
> Looks like it got posted here:
>
> https://www.spinics.net/lists/netdev/msg299877.html
>
> But perhaps never finished?
May I implement both sysfs and set_tunalbe for copybreak first
before the user space tool is ready? Otherwise, the user couldn't
change the copybreak now.
Best Regards,
Hayes
^ permalink raw reply
* Re: [patch net-next rfc 3/7] net: rtnetlink: add commands to add and delete alternative ifnames
From: Roopa Prabhu @ 2019-08-09 4:11 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, David Miller, Jakub Kicinski, Stephen Hemminger,
David Ahern, dcbw, Michal Kubecek, Andrew Lunn, parav,
Saeed Mahameed, mlxsw
In-Reply-To: <20190719110029.29466-4-jiri@resnulli.us>
On Fri, Jul 19, 2019 at 4:00 AM Jiri Pirko <jiri@resnulli.us> wrote:
>
> From: Jiri Pirko <jiri@mellanox.com>
>
> Add two commands to add and delete alternative ifnames for net device.
> Each net device can have multiple alternative names.
>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> ---
> include/linux/netdevice.h | 4 ++
> include/uapi/linux/if.h | 1 +
> include/uapi/linux/if_link.h | 1 +
> include/uapi/linux/rtnetlink.h | 7 +++
> net/core/dev.c | 58 ++++++++++++++++++-
> net/core/rtnetlink.c | 102 +++++++++++++++++++++++++++++++++
> security/selinux/nlmsgtab.c | 4 +-
> 7 files changed, 175 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 74f99f127b0e..6922fdb483ca 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -920,10 +920,14 @@ struct tlsdev_ops;
>
> struct netdev_name_node {
> struct hlist_node hlist;
> + struct list_head list;
> struct net_device *dev;
> char *name;
> };
>
> +int netdev_name_node_alt_create(struct net_device *dev, char *name);
> +int netdev_name_node_alt_destroy(struct net_device *dev, char *name);
> +
> /*
> * This structure defines the management hooks for network devices.
> * The following hooks can be defined; unless noted otherwise, they are
> diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h
> index 7fea0fd7d6f5..4bf33344aab1 100644
> --- a/include/uapi/linux/if.h
> +++ b/include/uapi/linux/if.h
> @@ -33,6 +33,7 @@
> #define IFNAMSIZ 16
> #endif /* __UAPI_DEF_IF_IFNAMSIZ */
> #define IFALIASZ 256
> +#define ALTIFNAMSIZ 128
> #include <linux/hdlc/ioctl.h>
>
> /* For glibc compatibility. An empty enum does not compile. */
> diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
> index 4a8c02cafa9a..92268946e04a 100644
> --- a/include/uapi/linux/if_link.h
> +++ b/include/uapi/linux/if_link.h
> @@ -167,6 +167,7 @@ enum {
> IFLA_NEW_IFINDEX,
> IFLA_MIN_MTU,
> IFLA_MAX_MTU,
> + IFLA_ALT_IFNAME_MOD, /* Alternative ifname to add/delete */
> __IFLA_MAX
> };
>
> diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
> index ce2a623abb75..b36cfd83eb76 100644
> --- a/include/uapi/linux/rtnetlink.h
> +++ b/include/uapi/linux/rtnetlink.h
> @@ -164,6 +164,13 @@ enum {
> RTM_GETNEXTHOP,
> #define RTM_GETNEXTHOP RTM_GETNEXTHOP
>
> + RTM_NEWALTIFNAME = 108,
> +#define RTM_NEWALTIFNAME RTM_NEWALTIFNAME
> + RTM_DELALTIFNAME,
> +#define RTM_DELALTIFNAME RTM_DELALTIFNAME
> + RTM_GETALTIFNAME,
> +#define RTM_GETALTIFNAME RTM_GETALTIFNAME
> +
I might have missed the prior discussion, why do we need new commands
?. can't this simply be part of RTM_*LINK and we use RTM_SETLINK to
set alternate names ?
> __RTM_MAX,
> #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
> };
> diff --git a/net/core/dev.c b/net/core/dev.c
> index ad0d42fbdeee..2a3be2b279d3 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -244,7 +244,13 @@ static struct netdev_name_node *netdev_name_node_alloc(struct net_device *dev,
> static struct netdev_name_node *
> netdev_name_node_head_alloc(struct net_device *dev)
> {
> - return netdev_name_node_alloc(dev, dev->name);
> + struct netdev_name_node *name_node;
> +
> + name_node = netdev_name_node_alloc(dev, dev->name);
> + if (!name_node)
> + return NULL;
> + INIT_LIST_HEAD(&name_node->list);
> + return name_node;
> }
>
> static void netdev_name_node_free(struct netdev_name_node *name_node)
> @@ -288,6 +294,55 @@ static struct netdev_name_node *netdev_name_node_lookup_rcu(struct net *net,
> return NULL;
> }
>
> +int netdev_name_node_alt_create(struct net_device *dev, char *name)
> +{
> + struct netdev_name_node *name_node;
> + struct net *net = dev_net(dev);
> +
> + name_node = netdev_name_node_lookup(net, name);
> + if (name_node)
> + return -EEXIST;
> + name_node = netdev_name_node_alloc(dev, name);
> + if (!name_node)
> + return -ENOMEM;
> + netdev_name_node_add(net, name_node);
> + /* The node that holds dev->name acts as a head of per-device list. */
> + list_add_tail(&name_node->list, &dev->name_node->list);
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(netdev_name_node_alt_create);
> +
> +static void __netdev_name_node_alt_destroy(struct netdev_name_node *name_node)
> +{
> + list_del(&name_node->list);
> + netdev_name_node_del(name_node);
> + kfree(name_node->name);
> + netdev_name_node_free(name_node);
> +}
> +
> +int netdev_name_node_alt_destroy(struct net_device *dev, char *name)
> +{
> + struct netdev_name_node *name_node;
> + struct net *net = dev_net(dev);
> +
> + name_node = netdev_name_node_lookup(net, name);
> + if (!name_node)
> + return -ENOENT;
> + __netdev_name_node_alt_destroy(name_node);
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(netdev_name_node_alt_destroy);
> +
> +static void netdev_name_node_alt_flush(struct net_device *dev)
> +{
> + struct netdev_name_node *name_node, *tmp;
> +
> + list_for_each_entry_safe(name_node, tmp, &dev->name_node->list, list)
> + __netdev_name_node_alt_destroy(name_node);
> +}
> +
> /* Device list insertion */
> static void list_netdevice(struct net_device *dev)
> {
> @@ -8258,6 +8313,7 @@ static void rollback_registered_many(struct list_head *head)
> dev_uc_flush(dev);
> dev_mc_flush(dev);
>
> + netdev_name_node_alt_flush(dev);
> netdev_name_node_free(dev->name_node);
>
> if (dev->netdev_ops->ndo_uninit)
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 1ee6460f8275..7a2010b16e10 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -1750,6 +1750,8 @@ static const struct nla_policy ifla_policy[IFLA_MAX+1] = {
> [IFLA_CARRIER_DOWN_COUNT] = { .type = NLA_U32 },
> [IFLA_MIN_MTU] = { .type = NLA_U32 },
> [IFLA_MAX_MTU] = { .type = NLA_U32 },
> + [IFLA_ALT_IFNAME_MOD] = { .type = NLA_STRING,
> + .len = ALTIFNAMSIZ - 1 },
> };
>
> static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = {
> @@ -3373,6 +3375,103 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr *nlh,
> return err;
> }
>
> +static int rtnl_newaltifname(struct sk_buff *skb, struct nlmsghdr *nlh,
> + struct netlink_ext_ack *extack)
> +{
> + struct net *net = sock_net(skb->sk);
> + struct nlattr *tb[IFLA_MAX + 1];
> + struct net_device *dev;
> + struct ifinfomsg *ifm;
> + char *new_alt_ifname;
> + int err;
> +
> + err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, extack);
> + if (err)
> + return err;
> +
> + err = rtnl_ensure_unique_netns(tb, extack, true);
> + if (err)
> + return err;
> +
> + ifm = nlmsg_data(nlh);
> + if (ifm->ifi_index > 0) {
> + dev = __dev_get_by_index(net, ifm->ifi_index);
> + } else if (tb[IFLA_IFNAME]) {
> + char ifname[IFNAMSIZ];
> +
> + nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ);
> + dev = __dev_get_by_name(net, ifname);
> + } else {
> + return -EINVAL;
> + }
> +
> + if (!dev)
> + return -ENODEV;
> +
> + if (!tb[IFLA_ALT_IFNAME_MOD])
> + return -EINVAL;
> +
> + new_alt_ifname = nla_strdup(tb[IFLA_ALT_IFNAME_MOD], GFP_KERNEL);
> + if (!new_alt_ifname)
> + return -ENOMEM;
> +
> + err = netdev_name_node_alt_create(dev, new_alt_ifname);
> + if (err)
> + goto out_free_new_alt_ifname;
> +
> + return 0;
> +
> +out_free_new_alt_ifname:
> + kfree(new_alt_ifname);
> + return err;
> +}
> +
> +static int rtnl_delaltifname(struct sk_buff *skb, struct nlmsghdr *nlh,
> + struct netlink_ext_ack *extack)
> +{
> + struct net *net = sock_net(skb->sk);
> + struct nlattr *tb[IFLA_MAX + 1];
> + struct net_device *dev;
> + struct ifinfomsg *ifm;
> + char *del_alt_ifname;
> + int err;
> +
> + err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy, extack);
> + if (err)
> + return err;
> +
> + err = rtnl_ensure_unique_netns(tb, extack, true);
> + if (err)
> + return err;
> +
> + ifm = nlmsg_data(nlh);
> + if (ifm->ifi_index > 0) {
> + dev = __dev_get_by_index(net, ifm->ifi_index);
> + } else if (tb[IFLA_IFNAME]) {
> + char ifname[IFNAMSIZ];
> +
> + nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ);
> + dev = __dev_get_by_name(net, ifname);
> + } else {
> + return -EINVAL;
> + }
> +
> + if (!dev)
> + return -ENODEV;
> +
> + if (!tb[IFLA_ALT_IFNAME_MOD])
> + return -EINVAL;
> +
> + del_alt_ifname = nla_strdup(tb[IFLA_ALT_IFNAME_MOD], GFP_KERNEL);
> + if (!del_alt_ifname)
> + return -ENOMEM;
> +
> + err = netdev_name_node_alt_destroy(dev, del_alt_ifname);
> + kfree(del_alt_ifname);
> +
> + return err;
> +}
> +
> static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh)
> {
> struct net *net = sock_net(skb->sk);
> @@ -5331,6 +5430,9 @@ void __init rtnetlink_init(void)
> rtnl_register(PF_UNSPEC, RTM_GETROUTE, NULL, rtnl_dump_all, 0);
> rtnl_register(PF_UNSPEC, RTM_GETNETCONF, NULL, rtnl_dump_all, 0);
>
> + rtnl_register(PF_UNSPEC, RTM_NEWALTIFNAME, rtnl_newaltifname, NULL, 0);
> + rtnl_register(PF_UNSPEC, RTM_DELALTIFNAME, rtnl_delaltifname, NULL, 0);
> +
> rtnl_register(PF_BRIDGE, RTM_NEWNEIGH, rtnl_fdb_add, NULL, 0);
> rtnl_register(PF_BRIDGE, RTM_DELNEIGH, rtnl_fdb_del, NULL, 0);
> rtnl_register(PF_BRIDGE, RTM_GETNEIGH, rtnl_fdb_get, rtnl_fdb_dump, 0);
> diff --git a/security/selinux/nlmsgtab.c b/security/selinux/nlmsgtab.c
> index 58345ba0528e..a712b54c666c 100644
> --- a/security/selinux/nlmsgtab.c
> +++ b/security/selinux/nlmsgtab.c
> @@ -83,6 +83,8 @@ static const struct nlmsg_perm nlmsg_route_perms[] =
> { RTM_NEWNEXTHOP, NETLINK_ROUTE_SOCKET__NLMSG_WRITE },
> { RTM_DELNEXTHOP, NETLINK_ROUTE_SOCKET__NLMSG_WRITE },
> { RTM_GETNEXTHOP, NETLINK_ROUTE_SOCKET__NLMSG_READ },
> + { RTM_NEWALTIFNAME, NETLINK_ROUTE_SOCKET__NLMSG_WRITE },
> + { RTM_DELALTIFNAME, NETLINK_ROUTE_SOCKET__NLMSG_WRITE },
> };
>
> static const struct nlmsg_perm nlmsg_tcpdiag_perms[] =
> @@ -166,7 +168,7 @@ int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm)
> * structures at the top of this file with the new mappings
> * before updating the BUILD_BUG_ON() macro!
> */
> - BUILD_BUG_ON(RTM_MAX != (RTM_NEWNEXTHOP + 3));
> + BUILD_BUG_ON(RTM_MAX != (RTM_NEWALTIFNAME + 3));
> err = nlmsg_perm(nlmsg_type, perm, nlmsg_route_perms,
> sizeof(nlmsg_route_perms));
> break;
> --
> 2.21.0
>
^ permalink raw reply
* Re: [PATCH net-next 5/5] r8152: change rx_frag_head_sz and rx_max_agg_num dynamically
From: David Miller @ 2019-08-09 4:51 UTC (permalink / raw)
To: hayeswang
Cc: jakub.kicinski, maciejromanfijalkowski, netdev, nic_swsd,
linux-kernel, linux-usb
In-Reply-To: <0835B3720019904CB8F7AA43166CEEB2F18D0FFE@RTITMBSVM03.realtek.com.tw>
From: Hayes Wang <hayeswang@realtek.com>
Date: Fri, 9 Aug 2019 03:38:53 +0000
> Jakub Kicinski [jakub.kicinski@netronome.com]
> [..]> The kernel could support it. And I has finished it.
>> > However, when I want to test it by ethtool, I couldn't find suitable command.
>> > I couldn't find relative feature in the source code of ethtool, either.
>
>> It's possible it's not implemented in the user space tool 🤔
>>
>> Looks like it got posted here:
>>
>> https://www.spinics.net/lists/netdev/msg299877.html
>>
>> But perhaps never finished?
>
> May I implement both sysfs and set_tunalbe for copybreak first
> before the user space tool is ready? Otherwise, the user couldn't
> change the copybreak now.
No, fix the tool please.
^ permalink raw reply
* Re: [PATCH net] net: phy: rtl8211f: do a double read to get real time link status
From: Yonglong Liu @ 2019-08-09 4:57 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: davem, netdev, linux-kernel, linuxarm, salil.mehta, yisen.zhuang,
shiju.jose
In-Reply-To: <20190808203415.GO27917@lunn.ch>
On 2019/8/9 4:34, Andrew Lunn wrote:
> On Thu, Aug 08, 2019 at 10:01:39PM +0200, Heiner Kallweit wrote:
>> On 08.08.2019 21:40, Andrew Lunn wrote:
>>>> @@ -568,6 +568,11 @@ int phy_start_aneg(struct phy_device *phydev)
>>>> if (err < 0)
>>>> goto out_unlock;
>>>>
>>>> + /* The PHY may not yet have cleared aneg-completed and link-up bit
>>>> + * w/o this delay when the following read is done.
>>>> + */
>>>> + usleep_range(1000, 2000);
>>>> +
>>>
>>> Hi Heiner
>>>
>>> Does 802.3 C22 say anything about this?
>>>
>> C22 says:
>> "The Auto-Negotiation process shall be restarted by setting bit 0.9 to a logic one. This bit is self-
>> clearing, and a PHY shall return a value of one in bit 0.9 until the Auto-Negotiation process has been
>> initiated."
>>
>> Maybe we should read bit 0.9 in genphy_update_link() after having read BMSR and report
>> aneg-complete and link-up as false (no matter of their current value) if 0.9 is set.
>
> Yes. That sounds sensible.
>
> Andrew
>
> .
>
Hi Heiner:
I have test more than 50 times, it works. Previously less
than 20 times must be recurrence. so I think this patch solved the
problem.
And I checked about 40 times of the time gap between read
and autoneg started, all of them is more than 2ms, as below:
kworker/u257:1-670 [015] .... 27.182632: mdio_access: mii-0000:bd:00.3 write phy:0x07 reg:0x00 val:0x1240
kworker/u257:1-670 [015] .... 27.184670: mdio_access: mii-0000:bd:00.3 read phy:0x07 reg:0x01 val:0x7989
^ permalink raw reply
* Re: [PATCH net-next v5 2/3] net: phy: add support for clause 37 auto-negotiation
From: Vladimir Oltean @ 2019-08-09 4:58 UTC (permalink / raw)
To: Tao Ren
Cc: Andrew Lunn, Florian Fainelli, Heiner Kallweit, David S . Miller,
Arun Parameswaran, Justin Chen, netdev, lkml, openbmc
In-Reply-To: <20190808234816.4189789-1-taoren@fb.com>
On Fri, 9 Aug 2019 at 02:48, Tao Ren <taoren@fb.com> wrote:
>
> From: Heiner Kallweit <hkallweit1@gmail.com>
>
> This patch adds support for clause 37 1000Base-X auto-negotiation.
> It's compile-tested only as I don't have fiber equipment.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
This needs your signed-off-by as well.
> drivers/net/phy/phy_device.c | 139 +++++++++++++++++++++++++++++++++++
> include/linux/phy.h | 5 ++
> 2 files changed, 144 insertions(+)
>
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 252a712d1b2b..7c5315302937 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -1617,6 +1617,40 @@ static int genphy_config_advert(struct phy_device *phydev)
> return changed;
> }
>
> +/**
> + * genphy_c37_config_advert - sanitize and advertise auto-negotiation parameters
> + * @phydev: target phy_device struct
> + *
> + * Description: Writes MII_ADVERTISE with the appropriate values,
> + * after sanitizing the values to make sure we only advertise
> + * what is supported. Returns < 0 on error, 0 if the PHY's advertisement
> + * hasn't changed, and > 0 if it has changed. This function is intended
> + * for Clause 37 1000Base-X mode.
> + */
> +static int genphy_c37_config_advert(struct phy_device *phydev)
> +{
> + u16 adv = 0;
> +
> + /* Only allow advertising what this PHY supports */
> + linkmode_and(phydev->advertising, phydev->advertising,
> + phydev->supported);
> +
> + if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
> + phydev->advertising))
> + adv |= ADVERTISE_1000XFULL;
> + if (linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
> + phydev->advertising))
> + adv |= ADVERTISE_1000XPAUSE;
> + if (linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
> + phydev->advertising))
> + adv |= ADVERTISE_1000XPSE_ASYM;
> +
> + return phy_modify_changed(phydev, MII_ADVERTISE,
> + ADVERTISE_1000XFULL | ADVERTISE_1000XPAUSE |
> + ADVERTISE_1000XHALF | ADVERTISE_1000XPSE_ASYM,
> + adv);
> +}
> +
> /**
> * genphy_config_eee_advert - disable unwanted eee mode advertisement
> * @phydev: target phy_device struct
> @@ -1726,6 +1760,54 @@ int genphy_config_aneg(struct phy_device *phydev)
> }
> EXPORT_SYMBOL(genphy_config_aneg);
>
> +/**
> + * genphy_c37_config_aneg - restart auto-negotiation or write BMCR
> + * @phydev: target phy_device struct
> + *
> + * Description: If auto-negotiation is enabled, we configure the
> + * advertising, and then restart auto-negotiation. If it is not
> + * enabled, then we write the BMCR. This function is intended
> + * for use with Clause 37 1000Base-X mode.
> + */
> +int genphy_c37_config_aneg(struct phy_device *phydev)
> +{
> + int err, changed;
> +
> + if (AUTONEG_ENABLE != phydev->autoneg)
> + return genphy_setup_forced(phydev);
> +
> + err = phy_modify(phydev, MII_BMCR, BMCR_SPEED1000 | BMCR_SPEED100,
> + BMCR_SPEED1000);
> + if (err)
> + return err;
> +
> + changed = genphy_c37_config_advert(phydev);
> + if (changed < 0) /* error */
> + return changed;
> +
> + if (!changed) {
> + /* Advertisement hasn't changed, but maybe aneg was never on to
> + * begin with? Or maybe phy was isolated?
> + */
> + int ctl = phy_read(phydev, MII_BMCR);
> +
> + if (ctl < 0)
> + return ctl;
> +
> + if (!(ctl & BMCR_ANENABLE) || (ctl & BMCR_ISOLATE))
> + changed = 1; /* do restart aneg */
> + }
> +
> + /* Only restart aneg if we are advertising something different
> + * than we were before.
> + */
> + if (changed > 0)
> + return genphy_restart_aneg(phydev);
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(genphy_c37_config_aneg);
> +
> /**
> * genphy_aneg_done - return auto-negotiation status
> * @phydev: target phy_device struct
> @@ -1864,6 +1946,63 @@ int genphy_read_status(struct phy_device *phydev)
> }
> EXPORT_SYMBOL(genphy_read_status);
>
> +/**
> + * genphy_c37_read_status - check the link status and update current link state
> + * @phydev: target phy_device struct
> + *
> + * Description: Check the link, then figure out the current state
> + * by comparing what we advertise with what the link partner
> + * advertises. This function is for Clause 37 1000Base-X mode.
> + */
> +int genphy_c37_read_status(struct phy_device *phydev)
> +{
> + int lpa, err, old_link = phydev->link;
> +
> + /* Update the link, but return if there was an error */
> + err = genphy_update_link(phydev);
> + if (err)
> + return err;
> +
> + /* why bother the PHY if nothing can have changed */
> + if (phydev->autoneg == AUTONEG_ENABLE && old_link && phydev->link)
> + return 0;
> +
> + phydev->duplex = DUPLEX_UNKNOWN;
> + phydev->pause = 0;
> + phydev->asym_pause = 0;
> +
> + if (phydev->autoneg == AUTONEG_ENABLE && phydev->autoneg_complete) {
> + lpa = phy_read(phydev, MII_LPA);
> + if (lpa < 0)
> + return lpa;
> +
> + linkmode_mod_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
> + phydev->lp_advertising, lpa & LPA_LPACK);
> + linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
> + phydev->lp_advertising, lpa & LPA_1000XFULL);
> + linkmode_mod_bit(ETHTOOL_LINK_MODE_Pause_BIT,
> + phydev->lp_advertising, lpa & LPA_1000XPAUSE);
> + linkmode_mod_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
> + phydev->lp_advertising,
> + lpa & LPA_1000XPAUSE_ASYM);
> +
> + phy_resolve_aneg_linkmode(phydev);
> + } else if (phydev->autoneg == AUTONEG_DISABLE) {
> + int bmcr = phy_read(phydev, MII_BMCR);
> +
> + if (bmcr < 0)
> + return bmcr;
> +
> + if (bmcr & BMCR_FULLDPLX)
> + phydev->duplex = DUPLEX_FULL;
> + else
> + phydev->duplex = DUPLEX_HALF;
> + }
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(genphy_c37_read_status);
> +
> /**
> * genphy_soft_reset - software reset the PHY via BMCR_RESET bit
> * @phydev: target phy_device struct
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index 462b90b73f93..81a2921512ee 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -1077,6 +1077,11 @@ int genphy_suspend(struct phy_device *phydev);
> int genphy_resume(struct phy_device *phydev);
> int genphy_loopback(struct phy_device *phydev, bool enable);
> int genphy_soft_reset(struct phy_device *phydev);
> +
> +/* Clause 37 */
> +int genphy_c37_config_aneg(struct phy_device *phydev);
> +int genphy_c37_read_status(struct phy_device *phydev);
> +
> static inline int genphy_no_soft_reset(struct phy_device *phydev)
> {
> return 0;
> --
> 2.17.1
>
^ permalink raw reply
* Re: [PATCH v2] net: sched: sch_taprio: fix memleak in error path for sched list parse
From: David Miller @ 2019-08-09 5:01 UTC (permalink / raw)
To: ivan.khoronzhuk
Cc: vinicius.gomes, jhs, xiyou.wangcong, jiri, netdev, linux-kernel
In-Reply-To: <20190806224540.24912-1-ivan.khoronzhuk@linaro.org>
From: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Date: Wed, 7 Aug 2019 01:45:40 +0300
> In error case, all entries should be freed from the sched list
> before deleting it. For simplicity use rcu way.
>
> Fixes: 5a781ccbd19e46 ("tc: Add support for configuring the taprio scheduler")
> Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Applied and queued up for -stable, thank you.
^ permalink raw reply
* Re: [PATCH v2] bonding: Add vlan tx offload to hw_enc_features
From: David Miller @ 2019-08-09 5:02 UTC (permalink / raw)
To: yuehaibing
Cc: j.vosburgh, vfalico, andy, jiri, jay.vosburgh, linux-kernel,
netdev
In-Reply-To: <20190807021959.58572-1-yuehaibing@huawei.com>
From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 7 Aug 2019 10:19:59 +0800
> As commit 30d8177e8ac7 ("bonding: Always enable vlan tx offload")
> said, we should always enable bonding's vlan tx offload, pass the
> vlan packets to the slave devices with vlan tci, let them to handle
> vlan implementation.
>
> Now if encapsulation protocols like VXLAN is used, skb->encapsulation
> may be set, then the packet is passed to vlan device which based on
> bonding device. However in netif_skb_features(), the check of
> hw_enc_features:
>
> if (skb->encapsulation)
> features &= dev->hw_enc_features;
>
> clears NETIF_F_HW_VLAN_CTAG_TX/NETIF_F_HW_VLAN_STAG_TX. This results
> in same issue in commit 30d8177e8ac7 like this:
>
> vlan_dev_hard_start_xmit
> -->dev_queue_xmit
> -->validate_xmit_skb
> -->netif_skb_features //NETIF_F_HW_VLAN_CTAG_TX is cleared
> -->validate_xmit_vlan
> -->__vlan_hwaccel_push_inside //skb->tci is cleared
> ...
> --> bond_start_xmit
> --> bond_xmit_hash //BOND_XMIT_POLICY_ENCAP34
> --> __skb_flow_dissect // nhoff point to IP header
> --> case htons(ETH_P_8021Q)
> // skb_vlan_tag_present is false, so
> vlan = __skb_header_pointer(skb, nhoff, sizeof(_vlan),
> //vlan point to ip header wrongly
>
> Fixes: b2a103e6d0af ("bonding: convert to ndo_fix_features")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Applied and queued up for -stable.
^ permalink raw reply
* Re: [PATCH net-next v5 2/3] net: phy: add support for clause 37 auto-negotiation
From: Tao Ren @ 2019-08-09 5:06 UTC (permalink / raw)
To: Vladimir Oltean
Cc: Andrew Lunn, Florian Fainelli, Heiner Kallweit, David S . Miller,
Arun Parameswaran, Justin Chen, netdev, lkml,
openbmc@lists.ozlabs.org
In-Reply-To: <CA+h21hpcmpXZZrN6NYwAMhqrOKK2oGq27iiRiDBFT-zAvvZfWA@mail.gmail.com>
On 8/8/19 9:58 PM, Vladimir Oltean wrote:
> On Fri, 9 Aug 2019 at 02:48, Tao Ren <taoren@fb.com> wrote:
>>
>> From: Heiner Kallweit <hkallweit1@gmail.com>
>>
>> This patch adds support for clause 37 1000Base-X auto-negotiation.
>> It's compile-tested only as I don't have fiber equipment.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>
> This needs your signed-off-by as well.
I see. I didn't understand signed-off-by correctly and removed myself from the list explicitly. Adding it back now..
Thanks,
Tao
^ permalink raw reply
* Re: [net-next v3] tipc: add loopback device tracking
From: David Miller @ 2019-08-09 5:11 UTC (permalink / raw)
To: john.rutherford; +Cc: netdev, tipc-discussion
In-Reply-To: <20190807025229.1599-1-john.rutherford@dektech.com.au>
From: john.rutherford@dektech.com.au
Date: Wed, 7 Aug 2019 12:52:29 +1000
> From: John Rutherford <john.rutherford@dektech.com.au>
>
> Since node internal messages are passed directly to the socket, it is not
> possible to observe those messages via tcpdump or wireshark.
>
> We now remedy this by making it possible to clone such messages and send
> the clones to the loopback interface. The clones are dropped at reception
> and have no functional role except making the traffic visible.
>
> The feature is enabled if network taps are active for the loopback device.
> pcap filtering restrictions require the messages to be presented to the
> receiving side of the loopback device.
>
> v3 - Function dev_nit_active used to check for network taps.
> - Procedure netif_rx_ni used to send cloned messages to loopback device.
>
> Signed-off-by: John Rutherford <john.rutherford@dektech.com.au>
> Acked-by: Jon Maloy <jon.maloy@ericsson.com>
> Acked-by: Ying Xue <ying.xue@windriver.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH V4 0/9] Fixes for metadata accelreation
From: David Miller @ 2019-08-09 5:15 UTC (permalink / raw)
To: jasowang; +Cc: mst, kvm, virtualization, netdev, linux-kernel, linux-mm, jgg
In-Reply-To: <20190807070617.23716-1-jasowang@redhat.com>
From: Jason Wang <jasowang@redhat.com>
Date: Wed, 7 Aug 2019 03:06:08 -0400
> This series try to fix several issues introduced by meta data
> accelreation series. Please review.
...
My impression is that patch #7 will be changed to use spinlocks so there
will be a v5.
^ permalink raw reply
* Re: [PATCH] net: tundra: tsi108: use spin_lock_irqsave instead of spin_lock_irq in IRQ context
From: David Miller @ 2019-08-09 5:17 UTC (permalink / raw)
To: huangfq.daxian; +Cc: netdev, linux-kernel
In-Reply-To: <20190807074300.23135-1-huangfq.daxian@gmail.com>
From: Fuqian Huang <huangfq.daxian@gmail.com>
Date: Wed, 7 Aug 2019 15:43:00 +0800
> @@ -372,8 +372,9 @@ static void tsi108_stat_carry(struct net_device *dev)
> {
> struct tsi108_prv_data *data = netdev_priv(dev);
> u32 carry1, carry2;
> + unsigned long flags;
Please preserve reverse christmas tree ordering of local variables.
Thank you.
^ permalink raw reply
* linux-next: manual merge of the usb tree with the net-next tree
From: Stephen Rothwell @ 2019-08-09 5:19 UTC (permalink / raw)
To: Greg KH, David Miller, Networking
Cc: Linux Next Mailing List, Linux Kernel Mailing List,
Benjamin Poirier
[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]
Hi all,
Today's linux-next merge of the usb tree got conflicts in:
drivers/staging/Kconfig
drivers/staging/Makefile
between commit:
955315b0dc8c ("qlge: Move drivers/net/ethernet/qlogic/qlge/ to drivers/staging/qlge/")
from the net-next tree and commit:
71ed79b0e4be ("USB: Move wusbcore and UWB to staging as it is obsolete")
from the usb tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc drivers/staging/Kconfig
index 0b8a614be11e,cf419d9c942d..000000000000
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@@ -120,6 -120,7 +120,9 @@@ source "drivers/staging/kpc2000/Kconfig
source "drivers/staging/isdn/Kconfig"
+source "drivers/staging/qlge/Kconfig"
+
+ source "drivers/staging/wusbcore/Kconfig"
+ source "drivers/staging/uwb/Kconfig"
+
endif # STAGING
diff --cc drivers/staging/Makefile
index 741152511a10,38179bc842a8..000000000000
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@@ -50,4 -50,5 +50,6 @@@ obj-$(CONFIG_EROFS_FS) += erofs
obj-$(CONFIG_FIELDBUS_DEV) += fieldbus/
obj-$(CONFIG_KPC2000) += kpc2000/
obj-$(CONFIG_ISDN_CAPI) += isdn/
+obj-$(CONFIG_QLGE) += qlge/
+ obj-$(CONFIG_UWB) += uwb/
+ obj-$(CONFIG_USB_WUSB) += wusbcore/
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH net-next v3 00/10] net: stmmac: Improvements for -next
From: David Miller @ 2019-08-09 5:20 UTC (permalink / raw)
To: Jose.Abreu
Cc: netdev, Joao.Pinto, peppe.cavallaro, alexandre.torgue,
mcoquelin.stm32, linux-stm32, linux-arm-kernel, linux-kernel
In-Reply-To: <cover.1565164729.git.joabreu@synopsys.com>
From: Jose Abreu <Jose.Abreu@synopsys.com>
Date: Wed, 7 Aug 2019 10:03:08 +0200
> [ This is just a rebase of v2 into latest -next in order to avoid a merge
> conflict ]
>
> Couple of improvements for -next tree. More info in commit logs.
Series applied, thank you.
^ permalink raw reply
* Re: [PATCH net-next] mlxsw: spectrum: Extend to support Spectrum-3 ASIC
From: David Miller @ 2019-08-09 5:27 UTC (permalink / raw)
To: idosch; +Cc: netdev, jiri, petrm, mlxsw, idosch
In-Reply-To: <20190807104231.16085-1-idosch@idosch.org>
From: Ido Schimmel <idosch@idosch.org>
Date: Wed, 7 Aug 2019 13:42:31 +0300
> From: Jiri Pirko <jiri@mellanox.com>
>
> Extend existing driver for Spectrum and Spectrum-2 ASICs
> to support Spectrum-3 ASIC as well.
>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> Reviewed-by: Petr Machata <petrm@mellanox.com>
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] net: dsa: sja1105: remove set but not used variables 'tx_vid' and 'rx_vid'
From: David Miller @ 2019-08-09 5:29 UTC (permalink / raw)
To: yuehaibing
Cc: olteanv, andrew, vivien.didelot, f.fainelli, linux-kernel, netdev
In-Reply-To: <20190807130856.60792-1-yuehaibing@huawei.com>
From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 7 Aug 2019 21:08:56 +0800
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/net/dsa/sja1105/sja1105_main.c: In function sja1105_fdb_dump:
> drivers/net/dsa/sja1105/sja1105_main.c:1226:14: warning:
> variable tx_vid set but not used [-Wunused-but-set-variable]
> drivers/net/dsa/sja1105/sja1105_main.c:1226:6: warning:
> variable rx_vid set but not used [-Wunused-but-set-variable]
>
> They are not used since commit 6d7c7d948a2e ("net: dsa:
> sja1105: Fix broken learning with vlan_filtering disabled")
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Applied to 'net'.
^ permalink raw reply
* Re: [PATCH net-next] net/ncsi: allow to customize BMC MAC Address offset
From: Tao Ren @ 2019-08-09 5:29 UTC (permalink / raw)
To: Andrew Lunn
Cc: Jakub Kicinski, netdev@vger.kernel.org, openbmc@lists.ozlabs.org,
linux-kernel@vger.kernel.org, Samuel Mendoza-Jonas,
David S . Miller, William Kennington
In-Reply-To: <20190808230312.GS27917@lunn.ch>
On 8/8/19 4:03 PM, Andrew Lunn wrote:
>> After giving it more thought, I'm thinking about adding ncsi dt node
>> with following structure (mac/ncsi similar to mac/mdio/phy):
>>
>> &mac0 {
>> /* MAC properties... */
>>
>> use-ncsi;
>
> This property seems to be specific to Faraday FTGMAC100. Are you going
> to make it more generic?
I'm also using ftgmac100 on my platform, and I don't have plan to change this property.
>> ncsi {
>> /* ncsi level properties if any */
>>
>> package@0 {
>
> You should get Rob Herring involved. This is not really describing
> hardware, so it might get rejected by the device tree maintainer.
Got it. Thank you for the sharing, and let me think it over :-)
>> 1) mac driver doesn't need to parse "mac-offset" stuff: these
>> ncsi-network-controller specific settings should be parsed in ncsi
>> stack.
>
>> 2) get_bmc_mac_address command is a channel specific command, and
>> technically people can configure different offset/formula for
>> different channels.
>
> Does that mean the NCSA code puts the interface into promiscuous mode?
> Or at least adds these unicast MAC addresses to the MAC receive
> filter? Humm, ftgmac100 only seems to support multicast address
> filtering, not unicast filters, so it must be using promisc mode, if
> you expect to receive frames using this MAC address.
Uhh, I actually didn't think too much about this: basically it's how to configure frame filtering when there are multiple packages/channels active: single BMC MAC or multiple BMC MAC is also allowed?
I don't have the answer yet, but will talk to NCSI expert and figure it out.
Thanks,
Tao
^ permalink raw reply
* Re: [PATCH net-next] fq_codel: remove set but not used variables 'prev_ecn_mark' and 'prev_drop_count'
From: David Miller @ 2019-08-09 5:31 UTC (permalink / raw)
To: yuehaibing; +Cc: jhs, xiyou.wangcong, jiri, dave.taht, linux-kernel, netdev
In-Reply-To: <20190807131055.66668-1-yuehaibing@huawei.com>
From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 7 Aug 2019 21:10:55 +0800
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> net/sched/sch_fq_codel.c: In function fq_codel_dequeue:
> net/sched/sch_fq_codel.c:288:23: warning: variable prev_ecn_mark set but not used [-Wunused-but-set-variable]
> net/sched/sch_fq_codel.c:288:6: warning: variable prev_drop_count set but not used [-Wunused-but-set-variable]
>
> They are not used since commit 77ddaff218fc ("fq_codel: Kill
> useless per-flow dropped statistic")
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Do you even compile test this stuff?
CC [M] net/sched/sch_fq_codel.o
net/sched/sch_fq_codel.c: In function ‘fq_codel_dequeue’:
net/sched/sch_fq_codel.c:309:42: error: ‘prev_drop_count’ undeclared (first use in this function); did you mean ‘page_ref_count’?
flow->dropped += q->cstats.drop_count - prev_drop_count;
^~~~~~~~~~~~~~~
page_ref_count
net/sched/sch_fq_codel.c:309:42: note: each undeclared identifier is reported only once for each function it appears in
net/sched/sch_fq_codel.c:310:40: error: ‘prev_ecn_mark’ undeclared (first use in this function); did you mean ‘pmd_pfn_mask’?
flow->dropped += q->cstats.ecn_mark - prev_ecn_mark;
^~~~~~~~~~~~~
pmd_pfn_mask
make[1]: *** [scripts/Makefile.build:274: net/sched/sch_fq_codel.o] Error 1
make: *** [Makefile:1769: net/sched/sch_fq_codel.o] Error 2
^ permalink raw reply
* Re: [PATCH net-next] fq_codel: remove set but not used variables 'prev_ecn_mark' and 'prev_drop_count'
From: David Miller @ 2019-08-09 5:32 UTC (permalink / raw)
To: yuehaibing; +Cc: jhs, xiyou.wangcong, jiri, dave.taht, linux-kernel, netdev
In-Reply-To: <20190808.223136.1507513183278607177.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Thu, 08 Aug 2019 22:31:36 -0700 (PDT)
> From: YueHaibing <yuehaibing@huawei.com>
> Date: Wed, 7 Aug 2019 21:10:55 +0800
>
>> Fixes gcc '-Wunused-but-set-variable' warning:
>>
>> net/sched/sch_fq_codel.c: In function fq_codel_dequeue:
>> net/sched/sch_fq_codel.c:288:23: warning: variable prev_ecn_mark set but not used [-Wunused-but-set-variable]
>> net/sched/sch_fq_codel.c:288:6: warning: variable prev_drop_count set but not used [-Wunused-but-set-variable]
>>
>> They are not used since commit 77ddaff218fc ("fq_codel: Kill
>> useless per-flow dropped statistic")
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>
> Do you even compile test this stuff?
>
> CC [M] net/sched/sch_fq_codel.o
> net/sched/sch_fq_codel.c: In function ‘fq_codel_dequeue’:
> net/sched/sch_fq_codel.c:309:42: error: ‘prev_drop_count’ undeclared (first use in this function); did you mean ‘page_ref_count’?
Never mind, this is my fault.
I was build testing the patch on the wrong tree, I'm very sorry.
^ permalink raw reply
* Re: [PATCH net-next] r8169: allocate rx buffers using alloc_pages_node
From: David Miller @ 2019-08-09 5:35 UTC (permalink / raw)
To: hkallweit1; +Cc: nic_swsd, netdev
In-Reply-To: <7d79d794-b41c-101f-0720-59eea88bf9ab@gmail.com>
From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Wed, 7 Aug 2019 21:38:22 +0200
> We allocate 16kb per rx buffer, so we can avoid some overhead by using
> alloc_pages_node directly instead of bothering kmalloc_node. Due to
> this change buffers are page-aligned now, therefore the alignment check
> can be removed.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH V4 0/9] Fixes for metadata accelreation
From: Jason Wang @ 2019-08-09 5:35 UTC (permalink / raw)
To: David Miller
Cc: mst, kvm, virtualization, netdev, linux-kernel, linux-mm, jgg
In-Reply-To: <20190808.221543.450194346419371363.davem@davemloft.net>
On 2019/8/9 下午1:15, David Miller wrote:
> From: Jason Wang <jasowang@redhat.com>
> Date: Wed, 7 Aug 2019 03:06:08 -0400
>
>> This series try to fix several issues introduced by meta data
>> accelreation series. Please review.
> ...
>
> My impression is that patch #7 will be changed to use spinlocks so there
> will be a v5.
>
Yes. V5 is on the way.
Thanks
^ permalink raw reply
* [PATCH v2] net: tundra: tsi108: use spin_lock_irqsave instead of spin_lock_irq in IRQ context
From: Fuqian Huang @ 2019-08-09 5:35 UTC (permalink / raw)
Cc: David S . Miller, netdev, linux-kernel, Fuqian Huang
As spin_unlock_irq will enable interrupts.
Function tsi108_stat_carry is called from interrupt handler tsi108_irq.
Interrupts are enabled in interrupt handler.
Use spin_lock_irqsave/spin_unlock_irqrestore instead of spin_(un)lock_irq
in IRQ context to avoid this.
Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
---
Changes in v2:
- Preserve reverse christmas tree ordering of local variables.
drivers/net/ethernet/tundra/tsi108_eth.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/tundra/tsi108_eth.c b/drivers/net/ethernet/tundra/tsi108_eth.c
index 78a7de3fb622..c62f474b6d08 100644
--- a/drivers/net/ethernet/tundra/tsi108_eth.c
+++ b/drivers/net/ethernet/tundra/tsi108_eth.c
@@ -371,9 +371,10 @@ tsi108_stat_carry_one(int carry, int carry_bit, int carry_shift,
static void tsi108_stat_carry(struct net_device *dev)
{
struct tsi108_prv_data *data = netdev_priv(dev);
+ unsigned long flags;
u32 carry1, carry2;
- spin_lock_irq(&data->misclock);
+ spin_lock_irqsave(&data->misclock, flags);
carry1 = TSI_READ(TSI108_STAT_CARRY1);
carry2 = TSI_READ(TSI108_STAT_CARRY2);
@@ -441,7 +442,7 @@ static void tsi108_stat_carry(struct net_device *dev)
TSI108_STAT_TXPAUSEDROP_CARRY,
&data->tx_pause_drop);
- spin_unlock_irq(&data->misclock);
+ spin_unlock_irqrestore(&data->misclock, flags);
}
/* Read a stat counter atomically with respect to carries.
--
2.11.0
^ permalink raw reply related
* Re: [PATCH net 0/2] Fix batched event generation for skbedit action
From: David Miller @ 2019-08-09 5:37 UTC (permalink / raw)
To: mrv; +Cc: netdev, kernel, jhs, xiyou.wangcong, jiri
In-Reply-To: <1565207849-11442-1-git-send-email-mrv@mojatatu.com>
From: Roman Mashak <mrv@mojatatu.com>
Date: Wed, 7 Aug 2019 15:57:27 -0400
> When adding or deleting a batch of entries, the kernel sends up to
> TCA_ACT_MAX_PRIO (defined to 32 in kernel) entries in an event to user
> space. However it does not consider that the action sizes may vary and
> require different skb sizes.
>
> For example, consider the following script adding 32 entries with all
> supported skbedit parameters and cookie (in order to maximize netlink
> messages size):
...
> patch 1 adds callback in tc_action_ops of skbedit action, which calculates
> the action size, and passes size to tcf_add_notify()/tcf_del_notify().
>
> patch 2 updates the TDC test suite with relevant skbedit test cases.
Series applied and queued up for -stable, thanks.
^ permalink raw reply
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