* [PATCH mlx5-next 2/8] net/mlx5: Expose MPEGC (Management PCIe General Configuration) structures
From: Saeed Mahameed @ 2018-07-17 1:35 UTC (permalink / raw)
To: netdev, linux-rdma
Cc: David S. Miller, Doug Ledford, Jason Gunthorpe, Leon Romanovsky,
Eran Ben Elisha, Saeed Mahameed
In-Reply-To: <20180717013537.26411-1-saeedm@mellanox.com>
From: Eran Ben Elisha <eranbe@mellanox.com>
This patch exposes PRM layout for handling MPEGC (Management PCIe
General Configuration).
This will be used in the downstream patch for configuring MPEGC via the
driver.
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
include/linux/mlx5/driver.h | 1 +
include/linux/mlx5/mlx5_ifc.h | 23 +++++++++++++++++++++--
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 4a4125b4279d..957199c20a0f 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -145,6 +145,7 @@ enum {
MLX5_REG_MPCNT = 0x9051,
MLX5_REG_MTPPS = 0x9053,
MLX5_REG_MTPPSE = 0x9054,
+ MLX5_REG_MPEGC = 0x9056,
MLX5_REG_MCQI = 0x9061,
MLX5_REG_MCC = 0x9062,
MLX5_REG_MCDA = 0x9063,
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index bd7b71f54d59..2de5feaeb74a 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -8049,6 +8049,19 @@ struct mlx5_ifc_peir_reg_bits {
u8 error_type[0x8];
};
+struct mlx5_ifc_mpegc_reg_bits {
+ u8 reserved_at_0[0x30];
+ u8 field_select[0x10];
+
+ u8 tx_overflow_sense[0x1];
+ u8 mark_cqe[0x1];
+ u8 mark_cnp[0x1];
+ u8 reserved_at_43[0x1b];
+ u8 tx_lossy_overflow_oper[0x2];
+
+ u8 reserved_at_60[0x100];
+};
+
struct mlx5_ifc_pcam_enhanced_features_bits {
u8 reserved_at_0[0x6d];
u8 rx_icrc_encapsulated_counter[0x1];
@@ -8097,7 +8110,11 @@ struct mlx5_ifc_pcam_reg_bits {
};
struct mlx5_ifc_mcam_enhanced_features_bits {
- u8 reserved_at_0[0x7b];
+ u8 reserved_at_0[0x74];
+ u8 mark_tx_action_cnp[0x1];
+ u8 mark_tx_action_cqe[0x1];
+ u8 dynamic_tx_overflow[0x1];
+ u8 reserved_at_77[0x4];
u8 pcie_outbound_stalled[0x1];
u8 tx_overflow_buffer_pkt[0x1];
u8 mtpps_enh_out_per_adj[0x1];
@@ -8112,7 +8129,9 @@ struct mlx5_ifc_mcam_access_reg_bits {
u8 mcqi[0x1];
u8 reserved_at_1f[0x1];
- u8 regs_95_to_68[0x1c];
+ u8 regs_95_to_87[0x9];
+ u8 mpegc[0x1];
+ u8 regs_85_to_68[0x12];
u8 tracer_registers[0x4];
u8 regs_63_to_32[0x20];
--
2.17.0
^ permalink raw reply related
* [PATCH mlx5-next 3/8] net/mlx5: Add core support for double vlan push/pop steering action
From: Saeed Mahameed @ 2018-07-17 1:35 UTC (permalink / raw)
To: netdev, linux-rdma
Cc: David S. Miller, Doug Ledford, Jason Gunthorpe, Leon Romanovsky,
Jianbo Liu, Saeed Mahameed
In-Reply-To: <20180717013537.26411-1-saeedm@mellanox.com>
From: Jianbo Liu <jianbol@mellanox.com>
As newer firmware supports double push/pop in a single FTE, we add
core bits and extend vlan action logic for it.
Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
.../ethernet/mellanox/mlx5/core/diag/fs_tracepoint.h | 2 ++
.../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 6 +++---
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c | 12 +++++++++---
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 4 +++-
include/linux/mlx5/fs.h | 4 +++-
include/linux/mlx5/mlx5_ifc.h | 11 +++++++++--
6 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.h b/drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.h
index 09f178a3fcab..0240aee9189e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.h
@@ -138,6 +138,8 @@ TRACE_EVENT(mlx5_fs_del_fg,
{MLX5_FLOW_CONTEXT_ACTION_MOD_HDR, "MOD_HDR"},\
{MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH, "VLAN_PUSH"},\
{MLX5_FLOW_CONTEXT_ACTION_VLAN_POP, "VLAN_POP"},\
+ {MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2, "VLAN_PUSH_2"},\
+ {MLX5_FLOW_CONTEXT_ACTION_VLAN_POP_2, "VLAN_POP_2"},\
{MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_PRIO, "NEXT_PRIO"}
TRACE_EVENT(mlx5_fs_set_fte,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index cecd201f0b73..8f50ce80ff66 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -70,9 +70,9 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
flow_act.action &= ~(MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH |
MLX5_FLOW_CONTEXT_ACTION_VLAN_POP);
else if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH) {
- flow_act.vlan.ethtype = ntohs(attr->vlan_proto);
- flow_act.vlan.vid = attr->vlan_vid;
- flow_act.vlan.prio = attr->vlan_prio;
+ flow_act.vlan[0].ethtype = ntohs(attr->vlan_proto);
+ flow_act.vlan[0].vid = attr->vlan_vid;
+ flow_act.vlan[0].prio = attr->vlan_prio;
}
if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c
index 5a00deff5457..6a62b84e57f4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c
@@ -349,9 +349,15 @@ static int mlx5_cmd_set_fte(struct mlx5_core_dev *dev,
vlan = MLX5_ADDR_OF(flow_context, in_flow_context, push_vlan);
- MLX5_SET(vlan, vlan, ethtype, fte->action.vlan.ethtype);
- MLX5_SET(vlan, vlan, vid, fte->action.vlan.vid);
- MLX5_SET(vlan, vlan, prio, fte->action.vlan.prio);
+ MLX5_SET(vlan, vlan, ethtype, fte->action.vlan[0].ethtype);
+ MLX5_SET(vlan, vlan, vid, fte->action.vlan[0].vid);
+ MLX5_SET(vlan, vlan, prio, fte->action.vlan[0].prio);
+
+ vlan = MLX5_ADDR_OF(flow_context, in_flow_context, push_vlan_2);
+
+ MLX5_SET(vlan, vlan, ethtype, fte->action.vlan[1].ethtype);
+ MLX5_SET(vlan, vlan, vid, fte->action.vlan[1].vid);
+ MLX5_SET(vlan, vlan, prio, fte->action.vlan[1].prio);
in_match_value = MLX5_ADDR_OF(flow_context, in_flow_context,
match_value);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index 49a75d31185e..05e7a5112b74 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -1464,7 +1464,9 @@ static bool check_conflicting_actions(u32 action1, u32 action2)
MLX5_FLOW_CONTEXT_ACTION_DECAP |
MLX5_FLOW_CONTEXT_ACTION_MOD_HDR |
MLX5_FLOW_CONTEXT_ACTION_VLAN_POP |
- MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH))
+ MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH |
+ MLX5_FLOW_CONTEXT_ACTION_VLAN_POP_2 |
+ MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2))
return true;
return false;
diff --git a/include/linux/mlx5/fs.h b/include/linux/mlx5/fs.h
index 757b4a30281e..c40f2fc68655 100644
--- a/include/linux/mlx5/fs.h
+++ b/include/linux/mlx5/fs.h
@@ -152,6 +152,8 @@ struct mlx5_fs_vlan {
u8 prio;
};
+#define MLX5_FS_VLAN_DEPTH 2
+
struct mlx5_flow_act {
u32 action;
bool has_flow_tag;
@@ -159,7 +161,7 @@ struct mlx5_flow_act {
u32 encap_id;
u32 modify_id;
uintptr_t esp_id;
- struct mlx5_fs_vlan vlan;
+ struct mlx5_fs_vlan vlan[MLX5_FS_VLAN_DEPTH];
struct ib_counters *counters;
};
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 2de5feaeb74a..ae12120ef021 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -337,7 +337,10 @@ struct mlx5_ifc_flow_table_prop_layout_bits {
u8 reserved_at_9[0x1];
u8 pop_vlan[0x1];
u8 push_vlan[0x1];
- u8 reserved_at_c[0x14];
+ u8 reserved_at_c[0x1];
+ u8 pop_vlan_2[0x1];
+ u8 push_vlan_2[0x1];
+ u8 reserved_at_f[0x11];
u8 reserved_at_20[0x2];
u8 log_max_ft_size[0x6];
@@ -2386,6 +2389,8 @@ enum {
MLX5_FLOW_CONTEXT_ACTION_MOD_HDR = 0x40,
MLX5_FLOW_CONTEXT_ACTION_VLAN_POP = 0x80,
MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH = 0x100,
+ MLX5_FLOW_CONTEXT_ACTION_VLAN_POP_2 = 0x400,
+ MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2 = 0x800,
};
struct mlx5_ifc_vlan_bits {
@@ -2416,7 +2421,9 @@ struct mlx5_ifc_flow_context_bits {
u8 modify_header_id[0x20];
- u8 reserved_at_100[0x100];
+ struct mlx5_ifc_vlan_bits push_vlan_2;
+
+ u8 reserved_at_120[0xe0];
struct mlx5_ifc_fte_match_param_bits match_value;
--
2.17.0
^ permalink raw reply related
* [PATCH mlx5-next 1/8] net/mlx5: FW tracer, add hardware structures
From: Saeed Mahameed @ 2018-07-17 1:35 UTC (permalink / raw)
To: netdev, linux-rdma
Cc: David S. Miller, Doug Ledford, Jason Gunthorpe, Leon Romanovsky,
Feras Daoud, Saeed Mahameed
In-Reply-To: <20180717013537.26411-1-saeedm@mellanox.com>
From: Feras Daoud <ferasda@mellanox.com>
This change adds the infrastructure to mlx5 core fw tracer.
It introduces the following 4 new registers:
MLX5_REG_MTRC_CAP - Used to read tracer capabilities
MLX5_REG_MTRC_CONF - Used to set tracer configurations
MLX5_REG_MTRC_STDB - Used to query tracer strings database
MLX5_REG_MTRC_CTRL - Used to control the tracer
The capability of the tracing can be checked using mcam access
register, therefore, the mcam access register interface will expose
the tracer register.
Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
include/linux/mlx5/driver.h | 4 +++
include/linux/mlx5/mlx5_ifc.h | 61 ++++++++++++++++++++++++++++++++++-
2 files changed, 64 insertions(+), 1 deletion(-)
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 1cb1c0317b77..4a4125b4279d 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -138,6 +138,10 @@ enum {
MLX5_REG_HOST_ENDIANNESS = 0x7004,
MLX5_REG_MCIA = 0x9014,
MLX5_REG_MLCR = 0x902b,
+ MLX5_REG_MTRC_CAP = 0x9040,
+ MLX5_REG_MTRC_CONF = 0x9041,
+ MLX5_REG_MTRC_STDB = 0x9042,
+ MLX5_REG_MTRC_CTRL = 0x9043,
MLX5_REG_MPCNT = 0x9051,
MLX5_REG_MTPPS = 0x9053,
MLX5_REG_MTPPSE = 0x9054,
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 1853e7fd6924..bd7b71f54d59 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -8112,7 +8112,9 @@ struct mlx5_ifc_mcam_access_reg_bits {
u8 mcqi[0x1];
u8 reserved_at_1f[0x1];
- u8 regs_95_to_64[0x20];
+ u8 regs_95_to_68[0x1c];
+ u8 tracer_registers[0x4];
+
u8 regs_63_to_32[0x20];
u8 regs_31_to_0[0x20];
};
@@ -9187,4 +9189,61 @@ struct mlx5_ifc_create_uctx_in_bits {
struct mlx5_ifc_uctx_bits uctx;
};
+struct mlx5_ifc_mtrc_string_db_param_bits {
+ u8 string_db_base_address[0x20];
+
+ u8 reserved_at_20[0x8];
+ u8 string_db_size[0x18];
+};
+
+struct mlx5_ifc_mtrc_cap_bits {
+ u8 trace_owner[0x1];
+ u8 trace_to_memory[0x1];
+ u8 reserved_at_2[0x4];
+ u8 trc_ver[0x2];
+ u8 reserved_at_8[0x14];
+ u8 num_string_db[0x4];
+
+ u8 first_string_trace[0x8];
+ u8 num_string_trace[0x8];
+ u8 reserved_at_30[0x28];
+
+ u8 log_max_trace_buffer_size[0x8];
+
+ u8 reserved_at_60[0x20];
+
+ struct mlx5_ifc_mtrc_string_db_param_bits string_db_param[8];
+
+ u8 reserved_at_280[0x180];
+};
+
+struct mlx5_ifc_mtrc_conf_bits {
+ u8 reserved_at_0[0x1c];
+ u8 trace_mode[0x4];
+ u8 reserved_at_20[0x18];
+ u8 log_trace_buffer_size[0x8];
+ u8 trace_mkey[0x20];
+ u8 reserved_at_60[0x3a0];
+};
+
+struct mlx5_ifc_mtrc_stdb_bits {
+ u8 string_db_index[0x4];
+ u8 reserved_at_4[0x4];
+ u8 read_size[0x18];
+ u8 start_offset[0x20];
+ u8 string_db_data[0];
+};
+
+struct mlx5_ifc_mtrc_ctrl_bits {
+ u8 trace_status[0x2];
+ u8 reserved_at_2[0x2];
+ u8 arm_event[0x1];
+ u8 reserved_at_5[0xb];
+ u8 modify_field_select[0x10];
+ u8 reserved_at_20[0x2b];
+ u8 current_timestamp52_32[0x15];
+ u8 current_timestamp31_0[0x20];
+ u8 reserved_at_80[0x180];
+};
+
#endif /* MLX5_IFC_H */
--
2.17.0
^ permalink raw reply related
* [PATCH mlx5-next 0/8] Mellanox, mlx5 updates 2018-07-16
From: Saeed Mahameed @ 2018-07-17 1:35 UTC (permalink / raw)
To: netdev, linux-rdma
Cc: David S. Miller, Doug Ledford, Jason Gunthorpe, Leon Romanovsky,
Saeed Mahameed
Hi,
This series includes mlx5 core infrastructure updates and fixes
aimed for mlx5-next branch.
In case of no objections, below patches will be applied to mlx5-next branch
and next mlx5 net-next pull request will start with a merge commit
pointing to the last patch in this series.
>From Eran:
- Add MPEGC (Management PCIe General Configuration) registers and btis
- Fix tristate and description for MLX5 module
>From Feras:
- Add hardware structures for the firmware tracer
>From Jainbo:
- Core support for double vlan push/pop steering action
>From Max:
- Add XRQ commands definitions
>From Noa:
- Add missing SET_DRIVER_VERSION command translation
>From Roi:
- Use ERR_CAST() instead of coding it
>From Tariq:
- Better return types for CQE API
Thanks,
Saeed
---
Eran Ben Elisha (2):
net/mlx5: Expose MPEGC (Management PCIe General Configuration)
structures
net/mlx5: Fix tristate and description for MLX5 module
Feras Daoud (1):
net/mlx5: FW tracer, add hardware structures
Jianbo Liu (1):
net/mlx5: Add core support for double vlan push/pop steering action
Max Gurtovoy (1):
net/mlx5: Add XRQ commands definitions
Noa Osherovich (1):
net/mlx5: Add missing SET_DRIVER_VERSION command translation
Roi Dayan (1):
net/mlx5: Use ERR_CAST() instead of coding it
Tariq Toukan (1):
net/mlx5: Better return types for CQE API
drivers/infiniband/hw/mlx5/Kconfig | 2 +-
.../net/ethernet/mellanox/mlx5/core/Kconfig | 6 +-
drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 9 ++
.../mellanox/mlx5/core/diag/fs_tracepoint.h | 2 +
.../mellanox/mlx5/core/eswitch_offloads.c | 6 +-
.../net/ethernet/mellanox/mlx5/core/fs_cmd.c | 12 ++-
.../net/ethernet/mellanox/mlx5/core/fs_core.c | 6 +-
.../net/ethernet/mellanox/mlx5/core/main.c | 2 +-
include/linux/mlx5/device.h | 8 +-
include/linux/mlx5/driver.h | 5 +
include/linux/mlx5/fs.h | 4 +-
include/linux/mlx5/mlx5_ifc.h | 93 ++++++++++++++++++-
12 files changed, 133 insertions(+), 22 deletions(-)
--
2.17.0
^ permalink raw reply
* [PATCH] net: cxgb3_main: fix potential Spectre v1
From: Gustavo A. R. Silva @ 2018-07-17 1:59 UTC (permalink / raw)
To: Santosh Raspatur, David S. Miller
Cc: netdev, linux-kernel, Gustavo A. R. Silva
t.qset_idx can be indirectly controlled by user-space, hence leading to
a potential exploitation of the Spectre variant 1 vulnerability.
This issue was detected with the help of Smatch:
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c:2286 cxgb_extension_ioctl()
warn: potential spectre issue 'adapter->msix_info'
Fix this by sanitizing t.qset_idx before using it to index
adapter->msix_info
Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].
[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
index 7b795ed..a19172d 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
@@ -51,6 +51,7 @@
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
+#include <linux/nospec.h>
#include "common.h"
#include "cxgb3_ioctl.h"
@@ -2268,6 +2269,7 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
if (t.qset_idx >= nqsets)
return -EINVAL;
+ t.qset_idx = array_index_nospec(t.qset_idx, nqsets);
q = &adapter->params.sge.qset[q1 + t.qset_idx];
t.rspq_size = q->rspq_size;
--
2.7.4
^ permalink raw reply related
* [PATCH net-next] liquidio: correct error msg text when removing VLAN ID
From: Felix Manlunas @ 2018-07-17 1:06 UTC (permalink / raw)
To: davem
Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
felix.manlunas, ricardo.farrington
From: Rick Farrington <ricardo.farrington@cavium.com>
Signed-off-by: Rick Farrington <ricardo.farrington@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
---
drivers/net/ethernet/cavium/liquidio/lio_main.c | 2 +-
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
index a60d5af..4edb158 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
@@ -2628,7 +2628,7 @@ static int liquidio_vlan_rx_kill_vid(struct net_device *netdev,
ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl);
if (ret < 0) {
- dev_err(&oct->pci_dev->dev, "Add VLAN filter failed in core (ret: 0x%x)\n",
+ dev_err(&oct->pci_dev->dev, "Del VLAN filter failed in core (ret: 0x%x)\n",
ret);
}
return ret;
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
index 7fa0212..b778357 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
@@ -1693,7 +1693,7 @@ liquidio_vlan_rx_kill_vid(struct net_device *netdev,
ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl);
if (ret < 0) {
- dev_err(&oct->pci_dev->dev, "Add VLAN filter failed in core (ret: 0x%x)\n",
+ dev_err(&oct->pci_dev->dev, "Del VLAN filter failed in core (ret: 0x%x)\n",
ret);
}
return ret;
^ permalink raw reply related
* Re: [PATCH v2 iproute2-next 06/31] tc/util: add print helpers for JSON
From: David Ahern @ 2018-07-17 1:05 UTC (permalink / raw)
To: Stephen Hemminger, netdev; +Cc: Stephen Hemminger
In-Reply-To: <20180710210558.20278-7-stephen@networkplumber.org>
On 7/10/18 3:05 PM, Stephen Hemminger wrote:
> From: Stephen Hemminger <sthemmin@microsoft.com>
>
> Add a helper to print rate, time and size in numeric or pretty format
> based on JSON flag.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> tc/tc_util.c | 83 +++++++++++++++++++++++++++++++++-------------------
> tc/tc_util.h | 6 ++++
> 2 files changed, 59 insertions(+), 30 deletions(-)
This one fails to compile on Stretch:
tc
CC tc_util.o
tc_util.c:388:6: error: conflicting types for ‘print_time’
void print_time(const char *key, const char *fmt, __u32 tm)
^~~~~~~~~~
In file included from tc_util.c:27:0:
tc_util.h:92:6: note: previous declaration of ‘print_time’ was here
void print_time(const char *key, const char *fmt, __s32 tm);
^~~~~~~~~~
../config.mk:43: recipe for target 'tc_util.o' failed
^ permalink raw reply
* Re: [PATCH] net: cavium: Drop dependency of NET_VENDOR_CAVIUM on PCI
From: kbuild test robot @ 2018-07-17 1:01 UTC (permalink / raw)
To: Alexander Sverdlin
Cc: kbuild-all, netdev, Alexander Sverdlin, David S. Miller,
Aleksey Makarov, Sunil Goutham, Raghu Vatsavayi,
Vijaya Mohan Guvva
In-Reply-To: <20180713150428.1638-1-alexander.sverdlin@nokia.com>
[-- Attachment #1: Type: text/plain, Size: 11377 bytes --]
Hi Alexander,
I love your patch! Yet something to improve:
[auto build test ERROR on net-next/master]
[also build test ERROR on v4.18-rc5 next-20180713]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Alexander-Sverdlin/net-cavium-Drop-dependency-of-NET_VENDOR_CAVIUM-on-PCI/20180716-002448
config: s390-defconfig (attached as .config)
compiler: s390x-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=s390
:::::: branch date: 15 hours ago
:::::: commit date: 15 hours ago
All error/warnings (new ones prefixed by >>):
drivers/net/ethernet/cavium/common/cavium_ptp.c: In function 'cavium_ptp_probe':
>> drivers/net/ethernet/cavium/common/cavium_ptp.c:235:8: error: implicit declaration of function 'pcim_enable_device'; did you mean 'pci_enable_device'? [-Werror=implicit-function-declaration]
err = pcim_enable_device(pdev);
^~~~~~~~~~~~~~~~~~
pci_enable_device
drivers/net/ethernet/cavium/common/cavium_ptp.c: At top level:
>> drivers/net/ethernet/cavium/common/cavium_ptp.c:339:1: warning: data definition has no type or storage class
module_pci_driver(cavium_ptp_driver);
^~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/cavium/common/cavium_ptp.c:339:1: error: type defaults to 'int' in declaration of 'module_pci_driver' [-Werror=implicit-int]
>> drivers/net/ethernet/cavium/common/cavium_ptp.c:339:1: warning: parameter names (without types) in function declaration
drivers/net/ethernet/cavium/common/cavium_ptp.c:332:26: warning: 'cavium_ptp_driver' defined but not used [-Wunused-variable]
static struct pci_driver cavium_ptp_driver = {
^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
# https://github.com/0day-ci/linux/commit/c862aa8f427828f2c08fdc96494152690a2ec5d0
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout c862aa8f427828f2c08fdc96494152690a2ec5d0
vim +235 drivers/net/ethernet/cavium/common/cavium_ptp.c
8c56df37 Radoslaw Biernacki 2018-01-15 216
8c56df37 Radoslaw Biernacki 2018-01-15 217 static int cavium_ptp_probe(struct pci_dev *pdev,
8c56df37 Radoslaw Biernacki 2018-01-15 218 const struct pci_device_id *ent)
8c56df37 Radoslaw Biernacki 2018-01-15 219 {
8c56df37 Radoslaw Biernacki 2018-01-15 220 struct device *dev = &pdev->dev;
8c56df37 Radoslaw Biernacki 2018-01-15 221 struct cavium_ptp *clock;
8c56df37 Radoslaw Biernacki 2018-01-15 222 struct cyclecounter *cc;
8c56df37 Radoslaw Biernacki 2018-01-15 223 u64 clock_cfg;
8c56df37 Radoslaw Biernacki 2018-01-15 224 u64 clock_comp;
8c56df37 Radoslaw Biernacki 2018-01-15 225 int err;
8c56df37 Radoslaw Biernacki 2018-01-15 226
8c56df37 Radoslaw Biernacki 2018-01-15 227 clock = devm_kzalloc(dev, sizeof(*clock), GFP_KERNEL);
8c56df37 Radoslaw Biernacki 2018-01-15 228 if (!clock) {
8c56df37 Radoslaw Biernacki 2018-01-15 229 err = -ENOMEM;
8c56df37 Radoslaw Biernacki 2018-01-15 230 goto error;
8c56df37 Radoslaw Biernacki 2018-01-15 231 }
8c56df37 Radoslaw Biernacki 2018-01-15 232
8c56df37 Radoslaw Biernacki 2018-01-15 233 clock->pdev = pdev;
8c56df37 Radoslaw Biernacki 2018-01-15 234
8c56df37 Radoslaw Biernacki 2018-01-15 @235 err = pcim_enable_device(pdev);
8c56df37 Radoslaw Biernacki 2018-01-15 236 if (err)
8c56df37 Radoslaw Biernacki 2018-01-15 237 goto error_free;
8c56df37 Radoslaw Biernacki 2018-01-15 238
8c56df37 Radoslaw Biernacki 2018-01-15 239 err = pcim_iomap_regions(pdev, 1 << PCI_PTP_BAR_NO, pci_name(pdev));
8c56df37 Radoslaw Biernacki 2018-01-15 240 if (err)
8c56df37 Radoslaw Biernacki 2018-01-15 241 goto error_free;
8c56df37 Radoslaw Biernacki 2018-01-15 242
8c56df37 Radoslaw Biernacki 2018-01-15 243 clock->reg_base = pcim_iomap_table(pdev)[PCI_PTP_BAR_NO];
8c56df37 Radoslaw Biernacki 2018-01-15 244
8c56df37 Radoslaw Biernacki 2018-01-15 245 spin_lock_init(&clock->spin_lock);
8c56df37 Radoslaw Biernacki 2018-01-15 246
8c56df37 Radoslaw Biernacki 2018-01-15 247 cc = &clock->cycle_counter;
8c56df37 Radoslaw Biernacki 2018-01-15 248 cc->read = cavium_ptp_cc_read;
8c56df37 Radoslaw Biernacki 2018-01-15 249 cc->mask = CYCLECOUNTER_MASK(64);
8c56df37 Radoslaw Biernacki 2018-01-15 250 cc->mult = 1;
8c56df37 Radoslaw Biernacki 2018-01-15 251 cc->shift = 0;
8c56df37 Radoslaw Biernacki 2018-01-15 252
8c56df37 Radoslaw Biernacki 2018-01-15 253 timecounter_init(&clock->time_counter, &clock->cycle_counter,
8c56df37 Radoslaw Biernacki 2018-01-15 254 ktime_to_ns(ktime_get_real()));
8c56df37 Radoslaw Biernacki 2018-01-15 255
8c56df37 Radoslaw Biernacki 2018-01-15 256 clock->clock_rate = ptp_cavium_clock_get();
8c56df37 Radoslaw Biernacki 2018-01-15 257
8c56df37 Radoslaw Biernacki 2018-01-15 258 clock->ptp_info = (struct ptp_clock_info) {
8c56df37 Radoslaw Biernacki 2018-01-15 259 .owner = THIS_MODULE,
8c56df37 Radoslaw Biernacki 2018-01-15 260 .name = "ThunderX PTP",
8c56df37 Radoslaw Biernacki 2018-01-15 261 .max_adj = 1000000000ull,
8c56df37 Radoslaw Biernacki 2018-01-15 262 .n_ext_ts = 0,
8c56df37 Radoslaw Biernacki 2018-01-15 263 .n_pins = 0,
8c56df37 Radoslaw Biernacki 2018-01-15 264 .pps = 0,
8c56df37 Radoslaw Biernacki 2018-01-15 265 .adjfine = cavium_ptp_adjfine,
8c56df37 Radoslaw Biernacki 2018-01-15 266 .adjtime = cavium_ptp_adjtime,
8c56df37 Radoslaw Biernacki 2018-01-15 267 .gettime64 = cavium_ptp_gettime,
8c56df37 Radoslaw Biernacki 2018-01-15 268 .settime64 = cavium_ptp_settime,
8c56df37 Radoslaw Biernacki 2018-01-15 269 .enable = cavium_ptp_enable,
8c56df37 Radoslaw Biernacki 2018-01-15 270 };
8c56df37 Radoslaw Biernacki 2018-01-15 271
8c56df37 Radoslaw Biernacki 2018-01-15 272 clock_cfg = readq(clock->reg_base + PTP_CLOCK_CFG);
8c56df37 Radoslaw Biernacki 2018-01-15 273 clock_cfg |= PTP_CLOCK_CFG_PTP_EN;
8c56df37 Radoslaw Biernacki 2018-01-15 274 writeq(clock_cfg, clock->reg_base + PTP_CLOCK_CFG);
8c56df37 Radoslaw Biernacki 2018-01-15 275
8c56df37 Radoslaw Biernacki 2018-01-15 276 clock_comp = ((u64)1000000000ull << 32) / clock->clock_rate;
8c56df37 Radoslaw Biernacki 2018-01-15 277 writeq(clock_comp, clock->reg_base + PTP_CLOCK_COMP);
8c56df37 Radoslaw Biernacki 2018-01-15 278
8c56df37 Radoslaw Biernacki 2018-01-15 279 clock->ptp_clock = ptp_clock_register(&clock->ptp_info, dev);
8c56df37 Radoslaw Biernacki 2018-01-15 280 if (!clock->ptp_clock) {
8c56df37 Radoslaw Biernacki 2018-01-15 281 err = -ENODEV;
8c56df37 Radoslaw Biernacki 2018-01-15 282 goto error_stop;
8c56df37 Radoslaw Biernacki 2018-01-15 283 }
8c56df37 Radoslaw Biernacki 2018-01-15 284 if (IS_ERR(clock->ptp_clock)) {
8c56df37 Radoslaw Biernacki 2018-01-15 285 err = PTR_ERR(clock->ptp_clock);
8c56df37 Radoslaw Biernacki 2018-01-15 286 goto error_stop;
8c56df37 Radoslaw Biernacki 2018-01-15 287 }
8c56df37 Radoslaw Biernacki 2018-01-15 288
8c56df37 Radoslaw Biernacki 2018-01-15 289 pci_set_drvdata(pdev, clock);
8c56df37 Radoslaw Biernacki 2018-01-15 290 return 0;
8c56df37 Radoslaw Biernacki 2018-01-15 291
8c56df37 Radoslaw Biernacki 2018-01-15 292 error_stop:
8c56df37 Radoslaw Biernacki 2018-01-15 293 clock_cfg = readq(clock->reg_base + PTP_CLOCK_CFG);
8c56df37 Radoslaw Biernacki 2018-01-15 294 clock_cfg &= ~PTP_CLOCK_CFG_PTP_EN;
8c56df37 Radoslaw Biernacki 2018-01-15 295 writeq(clock_cfg, clock->reg_base + PTP_CLOCK_CFG);
8c56df37 Radoslaw Biernacki 2018-01-15 296 pcim_iounmap_regions(pdev, 1 << PCI_PTP_BAR_NO);
8c56df37 Radoslaw Biernacki 2018-01-15 297
8c56df37 Radoslaw Biernacki 2018-01-15 298 error_free:
8c56df37 Radoslaw Biernacki 2018-01-15 299 devm_kfree(dev, clock);
8c56df37 Radoslaw Biernacki 2018-01-15 300
8c56df37 Radoslaw Biernacki 2018-01-15 301 error:
8c56df37 Radoslaw Biernacki 2018-01-15 302 /* For `cavium_ptp_get()` we need to differentiate between the case
8c56df37 Radoslaw Biernacki 2018-01-15 303 * when the core has not tried to probe this device and the case when
8c56df37 Radoslaw Biernacki 2018-01-15 304 * the probe failed. In the later case we pretend that the
8c56df37 Radoslaw Biernacki 2018-01-15 305 * initialization was successful and keep the error in
8c56df37 Radoslaw Biernacki 2018-01-15 306 * `dev->driver_data`.
8c56df37 Radoslaw Biernacki 2018-01-15 307 */
8c56df37 Radoslaw Biernacki 2018-01-15 308 pci_set_drvdata(pdev, ERR_PTR(err));
8c56df37 Radoslaw Biernacki 2018-01-15 309 return 0;
8c56df37 Radoslaw Biernacki 2018-01-15 310 }
8c56df37 Radoslaw Biernacki 2018-01-15 311
8c56df37 Radoslaw Biernacki 2018-01-15 312 static void cavium_ptp_remove(struct pci_dev *pdev)
8c56df37 Radoslaw Biernacki 2018-01-15 313 {
8c56df37 Radoslaw Biernacki 2018-01-15 314 struct cavium_ptp *clock = pci_get_drvdata(pdev);
8c56df37 Radoslaw Biernacki 2018-01-15 315 u64 clock_cfg;
8c56df37 Radoslaw Biernacki 2018-01-15 316
8c56df37 Radoslaw Biernacki 2018-01-15 317 if (IS_ERR_OR_NULL(clock))
8c56df37 Radoslaw Biernacki 2018-01-15 318 return;
8c56df37 Radoslaw Biernacki 2018-01-15 319
8c56df37 Radoslaw Biernacki 2018-01-15 320 ptp_clock_unregister(clock->ptp_clock);
8c56df37 Radoslaw Biernacki 2018-01-15 321
8c56df37 Radoslaw Biernacki 2018-01-15 322 clock_cfg = readq(clock->reg_base + PTP_CLOCK_CFG);
8c56df37 Radoslaw Biernacki 2018-01-15 323 clock_cfg &= ~PTP_CLOCK_CFG_PTP_EN;
8c56df37 Radoslaw Biernacki 2018-01-15 324 writeq(clock_cfg, clock->reg_base + PTP_CLOCK_CFG);
8c56df37 Radoslaw Biernacki 2018-01-15 325 }
8c56df37 Radoslaw Biernacki 2018-01-15 326
8c56df37 Radoslaw Biernacki 2018-01-15 327 static const struct pci_device_id cavium_ptp_id_table[] = {
8c56df37 Radoslaw Biernacki 2018-01-15 328 { PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVICE_ID_CAVIUM_PTP) },
8c56df37 Radoslaw Biernacki 2018-01-15 329 { 0, }
8c56df37 Radoslaw Biernacki 2018-01-15 330 };
8c56df37 Radoslaw Biernacki 2018-01-15 331
8c56df37 Radoslaw Biernacki 2018-01-15 332 static struct pci_driver cavium_ptp_driver = {
8c56df37 Radoslaw Biernacki 2018-01-15 333 .name = DRV_NAME,
8c56df37 Radoslaw Biernacki 2018-01-15 334 .id_table = cavium_ptp_id_table,
8c56df37 Radoslaw Biernacki 2018-01-15 335 .probe = cavium_ptp_probe,
8c56df37 Radoslaw Biernacki 2018-01-15 336 .remove = cavium_ptp_remove,
8c56df37 Radoslaw Biernacki 2018-01-15 337 };
8c56df37 Radoslaw Biernacki 2018-01-15 338
75498aa1 Wei Yongjun 2018-03-28 @339 module_pci_driver(cavium_ptp_driver);
8c56df37 Radoslaw Biernacki 2018-01-15 340
:::::: The code at line 235 was first introduced by commit
:::::: 8c56df372bc1371504bf3cc29fbb3c09967cafff net: add support for Cavium PTP coprocessor
:::::: TO: Radoslaw Biernacki <rad@semihalf.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 10962 bytes --]
^ permalink raw reply
* Re: [PATCH][net-next][v2] net: convert gro_count to bitmask
From: kbuild test robot @ 2018-07-17 1:04 UTC (permalink / raw)
To: Li RongQing; +Cc: kbuild-all, netdev, edumazet, sbrivio
In-Reply-To: <1531464096-11319-1-git-send-email-lirongqing@baidu.com>
[-- Attachment #1: Type: text/plain, Size: 5476 bytes --]
Hi Li,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
[also build test ERROR on next-20180713]
[cannot apply to v4.18-rc5]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Li-RongQing/net-convert-gro_count-to-bitmask/20180715-233722
config: i386-randconfig-s1-201828 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
:::::: branch date: 15 hours ago
:::::: commit date: 15 hours ago
All errors (new ones prefixed by >>):
In file included from arch/x86/include/asm/current.h:5:0,
from include/linux/sched.h:12,
from include/linux/uaccess.h:5,
from net/core/dev.c:75:
net/core/dev.c: In function 'netdev_init':
>> include/linux/compiler.h:339:38: error: call to '__compiletime_assert_9285' declared with attribute error: BUILD_BUG_ON failed: GRO_HASH_BUCKETS > FIELD_SIZEOF(struct napi_struct, gro_bitmask)
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^
include/linux/compiler.h:319:4: note: in definition of macro '__compiletime_assert'
prefix ## suffix(); \
^~~~~~
include/linux/compiler.h:339:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:45:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:69:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
^~~~~~~~~~~~~~~~
net/core/dev.c:9284:2: note: in expansion of macro 'BUILD_BUG_ON'
BUILD_BUG_ON(GRO_HASH_BUCKETS >
^~~~~~~~~~~~
--
In file included from arch/x86/include/asm/current.h:5:0,
from include/linux/sched.h:12,
from include/linux/uaccess.h:5,
from net//core/dev.c:75:
net//core/dev.c: In function 'netdev_init':
>> include/linux/compiler.h:339:38: error: call to '__compiletime_assert_9285' declared with attribute error: BUILD_BUG_ON failed: GRO_HASH_BUCKETS > FIELD_SIZEOF(struct napi_struct, gro_bitmask)
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^
include/linux/compiler.h:319:4: note: in definition of macro '__compiletime_assert'
prefix ## suffix(); \
^~~~~~
include/linux/compiler.h:339:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:45:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:69:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
^~~~~~~~~~~~~~~~
net//core/dev.c:9284:2: note: in expansion of macro 'BUILD_BUG_ON'
BUILD_BUG_ON(GRO_HASH_BUCKETS >
^~~~~~~~~~~~
# https://github.com/0day-ci/linux/commit/b4ba3db381100e1869270a58dd2d9950ef0923de
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout b4ba3db381100e1869270a58dd2d9950ef0923de
vim +/__compiletime_assert_9285 +339 include/linux/compiler.h
9a8ab1c3 Daniel Santos 2013-02-21 325
9a8ab1c3 Daniel Santos 2013-02-21 326 #define _compiletime_assert(condition, msg, prefix, suffix) \
9a8ab1c3 Daniel Santos 2013-02-21 327 __compiletime_assert(condition, msg, prefix, suffix)
9a8ab1c3 Daniel Santos 2013-02-21 328
9a8ab1c3 Daniel Santos 2013-02-21 329 /**
9a8ab1c3 Daniel Santos 2013-02-21 330 * compiletime_assert - break build and emit msg if condition is false
9a8ab1c3 Daniel Santos 2013-02-21 331 * @condition: a compile-time constant condition to check
9a8ab1c3 Daniel Santos 2013-02-21 332 * @msg: a message to emit if condition is false
9a8ab1c3 Daniel Santos 2013-02-21 333 *
9a8ab1c3 Daniel Santos 2013-02-21 334 * In tradition of POSIX assert, this macro will break the build if the
9a8ab1c3 Daniel Santos 2013-02-21 335 * supplied condition is *false*, emitting the supplied error message if the
9a8ab1c3 Daniel Santos 2013-02-21 336 * compiler has support to do so.
9a8ab1c3 Daniel Santos 2013-02-21 337 */
9a8ab1c3 Daniel Santos 2013-02-21 338 #define compiletime_assert(condition, msg) \
9a8ab1c3 Daniel Santos 2013-02-21 @339 _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
9a8ab1c3 Daniel Santos 2013-02-21 340
:::::: The code at line 339 was first introduced by commit
:::::: 9a8ab1c39970a4938a72d94e6fd13be88a797590 bug.h, compiler.h: introduce compiletime_assert & BUILD_BUG_ON_MSG
:::::: TO: Daniel Santos <daniel.santos@pobox.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29806 bytes --]
^ permalink raw reply
* [RFC 0/2] compat: in_compat_syscall() differs on x86
From: Dmitry Safonov @ 2018-07-17 0:50 UTC (permalink / raw)
To: linux-kernel
Cc: Dmitry Safonov, Ard Biesheuvel, David S. Miller, Herbert Xu,
H. Peter Anvin, Ingo Molnar, John Stultz, Kirill A. Shutemov,
Oleg Nesterov, Steffen Klassert, Stephen Boyd, Steven Rostedt,
Thomas Gleixner, x86, linux-efi, netdev, Dmitry Safonov
Reading xfrm (ipsec) code I've found such code:
: #ifdef CONFIG_COMPAT
: if (in_compat_syscall())
: return -EOPNOTSUPP;
: #endif
While I can read that it's false on native i386, it's a bit misleading
and in result it's better to introduce a helper for that.
Grepping other code, I've found that there are already such helpers.
And the uniq behavior of in_compat_syscall() on x86 is disturbing.
Adjusting it to generic with the following..
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86@kernel.org
Cc: linux-efi@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: Dmitry Safonov <0x7f454c46@gmail.com>
Dmitry Safonov (2):
x86/compat: Adjust in_compat_syscall() to generic code under !COMPAT
compat: Cleanup in_compat_syscall() callers
arch/x86/include/asm/compat.h | 9 ++++++++-
arch/x86/include/asm/ftrace.h | 4 +---
arch/x86/kernel/process_64.c | 4 ++--
arch/x86/kernel/sys_x86_64.c | 11 ++++++-----
arch/x86/mm/hugetlbpage.c | 4 ++--
arch/x86/mm/mmap.c | 2 +-
drivers/firmware/efi/efivars.c | 16 ++++------------
include/linux/compat.h | 4 ++--
kernel/time/time.c | 2 +-
net/xfrm/xfrm_state.c | 2 --
net/xfrm/xfrm_user.c | 2 --
11 files changed, 27 insertions(+), 33 deletions(-)
--
2.13.6
^ permalink raw reply
* [RFC PATCH net-next] net: mvpp2: mvpp2_flow_get_hek_fields() can be static
From: kbuild test robot @ 2018-07-17 1:18 UTC (permalink / raw)
To: Maxime Chevallier
Cc: kbuild-all, netdev, Antoine Tenart, kbuild test robot,
linux-kernel
In-Reply-To: <201807141506.hlrwYth1%fengguang.wu@intel.com>
Fixes: d33ec4525007 ("net: mvpp2: add an RSS classification step for each flow")
Signed-off-by: kbuild test robot <fengguang.wu@intel.com>
---
mvpp2_cls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
index 723d0ba..fc9ec51 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
@@ -618,7 +618,7 @@ static int mvpp2_port_rss_hash_opts_set(struct mvpp2_port *port, int flow_type,
return 0;
}
-u16 mvpp2_flow_get_hek_fields(struct mvpp2_cls_flow_entry *fe)
+static u16 mvpp2_flow_get_hek_fields(struct mvpp2_cls_flow_entry *fe)
{
u16 hash_opts = 0;
int n_fields, i, field;
^ permalink raw reply related
* [net-next:master 598/621] drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c:621:5: sparse: symbol 'mvpp2_flow_get_hek_fields' was not declared. Should it be static?
From: kbuild test robot @ 2018-07-17 1:17 UTC (permalink / raw)
To: Maxime Chevallier; +Cc: kbuild-all, netdev, Antoine Tenart, linux-kernel
tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head: 9cee8c4375431d5087466eacf6f8f436210e56ea
commit: d33ec452500798868c430c5e2e4b5e8399ae70e3 [598/621] net: mvpp2: add an RSS classification step for each flow
reproduce:
# apt-get install sparse
git checkout d33ec452500798868c430c5e2e4b5e8399ae70e3
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__
:::::: branch date: 4 hours ago
:::::: commit date: 31 hours ago
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c:560:23: sparse: symbol 'mvpp2_cls_flow_get' was not declared. Should it be static?
>> drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c:621:5: sparse: symbol 'mvpp2_flow_get_hek_fields' was not declared. Should it be static?
Please review and possibly fold the followup patch.
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply
* Re: [PATCH next] bonding: pass link-local packets to bonding master also.
From: Stephen Hemminger @ 2018-07-17 0:43 UTC (permalink / raw)
To: Mahesh Bandewar (महेश बंडेवार)
Cc: Mahesh Bandewar, Jay Vosburgh, Andy Gospodarek, Veaceslav Falico,
David Miller, Netdev, Michal Soltys
In-Reply-To: <CAF2d9jjTh2ksyfe_n8yzvBB6ux8CPXWbr+m7XzKYR3iwkOcE8Q@mail.gmail.com>
On Mon, 16 Jul 2018 16:57:22 -0700
Mahesh Bandewar (महेश बंडेवार) <maheshb@google.com> wrote:
> On Mon, Jul 16, 2018 at 4:33 PM, Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> > On Sun, 15 Jul 2018 18:12:46 -0700
> > Mahesh Bandewar <mahesh@bandewar.net> wrote:
> >
> >> From: Mahesh Bandewar <maheshb@google.com>
> >>
> >> Commit b89f04c61efe ("bonding: deliver link-local packets with
> >> skb->dev set to link that packets arrived on") changed the behavior
> >> of how link-local-multicast packets are processed. The change in
> >> the behavior broke some legacy use cases where these packets are
> >> expected to arrive on bonding master device also.
> >>
> >> This patch passes the packet to the stack with the link it arrived
> >> on as well as passes to the bonding-master device to preserve the
> >> legacy use case.
> >>
> >> Reported-by: Michal Soltys <soltys@ziu.info>
> >> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> >
> > Thanks for fixing this.
> >
> > Why not add a Fixes: tag instead of just talking about the commit?
> > That helps the stable maintainers know which versions of the kernel
> > need the patch.
> Well, I thought about it. It's definitely 'related' but not sure it
> 'fixes' in true sense. It definitely fixes the broken legacy case
> though. Is that sufficient to add 'fixes' tag?
The previous commit caused a regression. your change fixes the regression
^ permalink raw reply
* Re: [PATCH net-next v2 1/7] kernfs: allow creating kernfs objects with arbitrary uid/gid
From: kbuild test robot @ 2018-07-17 1:04 UTC (permalink / raw)
To: Tyler Hicks
Cc: kbuild-all, Greg Kroah-Hartman, Tejun Heo, David S. Miller,
Stephen Hemminger, Dmitry Torokhov, Eric W. Biederman,
linux-kernel, netdev, bridge, Linux Containers
In-Reply-To: <1531497949-1766-2-git-send-email-tyhicks@canonical.com>
[-- Attachment #1: Type: text/plain, Size: 16546 bytes --]
Hi Dmitry,
I love your patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Tyler-Hicks/Make-sys-class-net-per-net-namespace-objects-belong-to-container/20180716-020459
config: x86_64-randconfig-u0-07161309 (attached as .config)
compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
:::::: branch date: 13 hours ago
:::::: commit date: 13 hours ago
All errors (new ones prefixed by >>):
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c: In function 'rdtgroup_add_file':
>> arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:149:7: error: incompatible type for argument 4 of '__kernfs_create_file'
0, rft->kf_ops, rft, NULL, NULL);
^
In file included from include/linux/sysfs.h:16:0,
from include/linux/kobject.h:20,
from include/linux/device.h:16,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:23:
include/linux/kernfs.h:333:21: note: expected 'kuid_t {aka struct <anonymous>}' but argument is of type 'int'
struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
^
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:149:10: error: incompatible type for argument 5 of '__kernfs_create_file'
0, rft->kf_ops, rft, NULL, NULL);
^
In file included from include/linux/sysfs.h:16:0,
from include/linux/kobject.h:20,
from include/linux/device.h:16,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:23:
include/linux/kernfs.h:333:21: note: expected 'kgid_t {aka struct <anonymous>}' but argument is of type 'struct kernfs_ops *'
struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
^
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:149:23: warning: passing argument 6 of '__kernfs_create_file' makes integer from pointer without a cast [-Wint-conversion]
0, rft->kf_ops, rft, NULL, NULL);
^
In file included from include/linux/sysfs.h:16:0,
from include/linux/kobject.h:20,
from include/linux/device.h:16,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:23:
include/linux/kernfs.h:333:21: note: expected 'loff_t {aka long long int}' but argument is of type 'struct rftype *'
struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
^
>> arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:148:7: error: too few arguments to function '__kernfs_create_file'
kn = __kernfs_create_file(parent_kn, rft->name, rft->mode,
^
In file included from include/linux/sysfs.h:16:0,
from include/linux/kobject.h:20,
from include/linux/device.h:16,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:23:
include/linux/kernfs.h:333:21: note: declared here
struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
^
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c: In function 'mon_addfile':
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:1506:51: error: incompatible type for argument 4 of '__kernfs_create_file'
kn = __kernfs_create_file(parent_kn, name, 0444, 0,
^
In file included from include/linux/sysfs.h:16:0,
from include/linux/kobject.h:20,
from include/linux/device.h:16,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:23:
include/linux/kernfs.h:333:21: note: expected 'kuid_t {aka struct <anonymous>}' but argument is of type 'int'
struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
^
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:1507:7: error: incompatible type for argument 5 of '__kernfs_create_file'
&kf_mondata_ops, priv, NULL, NULL);
^
In file included from include/linux/sysfs.h:16:0,
from include/linux/kobject.h:20,
from include/linux/device.h:16,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:23:
include/linux/kernfs.h:333:21: note: expected 'kgid_t {aka struct <anonymous>}' but argument is of type 'struct kernfs_ops *'
struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
^
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:1507:24: warning: passing argument 6 of '__kernfs_create_file' makes integer from pointer without a cast [-Wint-conversion]
&kf_mondata_ops, priv, NULL, NULL);
^
In file included from include/linux/sysfs.h:16:0,
from include/linux/kobject.h:20,
from include/linux/device.h:16,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:23:
include/linux/kernfs.h:333:21: note: expected 'loff_t {aka long long int}' but argument is of type 'void *'
struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
^
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:1506:7: error: too few arguments to function '__kernfs_create_file'
kn = __kernfs_create_file(parent_kn, name, 0444, 0,
^
In file included from include/linux/sysfs.h:16:0,
from include/linux/kobject.h:20,
from include/linux/device.h:16,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from arch/x86/kernel/cpu/intel_rdt_rdtgroup.c:23:
include/linux/kernfs.h:333:21: note: declared here
struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
^
# https://github.com/0day-ci/linux/commit/d5f7e84e70937f0546d774162a3f9425caec5687
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout d5f7e84e70937f0546d774162a3f9425caec5687
vim +/__kernfs_create_file +149 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
5ff193fb Fenghua Yu 2016-10-28 22
12e0110c Tony Luck 2016-10-28 @23 #include <linux/cpu.h>
5ff193fb Fenghua Yu 2016-10-28 24 #include <linux/fs.h>
5ff193fb Fenghua Yu 2016-10-28 25 #include <linux/sysfs.h>
5ff193fb Fenghua Yu 2016-10-28 26 #include <linux/kernfs.h>
9b3a7fd0 Tony Luck 2017-09-25 27 #include <linux/seq_buf.h>
4e978d06 Fenghua Yu 2016-10-28 28 #include <linux/seq_file.h>
3f07c014 Ingo Molnar 2017-02-08 29 #include <linux/sched/signal.h>
29930025 Ingo Molnar 2017-02-08 30 #include <linux/sched/task.h>
5ff193fb Fenghua Yu 2016-10-28 31 #include <linux/slab.h>
e02737d5 Fenghua Yu 2016-10-28 32 #include <linux/task_work.h>
5ff193fb Fenghua Yu 2016-10-28 33
5ff193fb Fenghua Yu 2016-10-28 34 #include <uapi/linux/magic.h>
5ff193fb Fenghua Yu 2016-10-28 35
05830204 Vikas Shivappa 2017-07-25 36 #include <asm/intel_rdt_sched.h>
05830204 Vikas Shivappa 2017-07-25 37 #include "intel_rdt.h"
5ff193fb Fenghua Yu 2016-10-28 38
4af4a88e Vikas Shivappa 2017-07-25 39 DEFINE_STATIC_KEY_FALSE(rdt_enable_key);
4af4a88e Vikas Shivappa 2017-07-25 40 DEFINE_STATIC_KEY_FALSE(rdt_mon_enable_key);
1b5c0b75 Vikas Shivappa 2017-07-25 41 DEFINE_STATIC_KEY_FALSE(rdt_alloc_enable_key);
cb2200e9 Reinette Chatre 2017-07-25 42 static struct kernfs_root *rdt_root;
5ff193fb Fenghua Yu 2016-10-28 43 struct rdtgroup rdtgroup_default;
5ff193fb Fenghua Yu 2016-10-28 44 LIST_HEAD(rdt_all_groups);
5ff193fb Fenghua Yu 2016-10-28 45
4e978d06 Fenghua Yu 2016-10-28 46 /* Kernel fs node for "info" directory under root */
4e978d06 Fenghua Yu 2016-10-28 47 static struct kernfs_node *kn_info;
4e978d06 Fenghua Yu 2016-10-28 48
4af4a88e Vikas Shivappa 2017-07-25 49 /* Kernel fs node for "mon_groups" directory under root */
4af4a88e Vikas Shivappa 2017-07-25 50 static struct kernfs_node *kn_mongrp;
4af4a88e Vikas Shivappa 2017-07-25 51
4af4a88e Vikas Shivappa 2017-07-25 52 /* Kernel fs node for "mon_data" directory under root */
4af4a88e Vikas Shivappa 2017-07-25 53 static struct kernfs_node *kn_mondata;
4af4a88e Vikas Shivappa 2017-07-25 54
9b3a7fd0 Tony Luck 2017-09-25 55 static struct seq_buf last_cmd_status;
9b3a7fd0 Tony Luck 2017-09-25 56 static char last_cmd_status_buf[512];
9b3a7fd0 Tony Luck 2017-09-25 57
9b3a7fd0 Tony Luck 2017-09-25 58 void rdt_last_cmd_clear(void)
9b3a7fd0 Tony Luck 2017-09-25 59 {
9b3a7fd0 Tony Luck 2017-09-25 60 lockdep_assert_held(&rdtgroup_mutex);
9b3a7fd0 Tony Luck 2017-09-25 61 seq_buf_clear(&last_cmd_status);
9b3a7fd0 Tony Luck 2017-09-25 62 }
9b3a7fd0 Tony Luck 2017-09-25 63
9b3a7fd0 Tony Luck 2017-09-25 64 void rdt_last_cmd_puts(const char *s)
9b3a7fd0 Tony Luck 2017-09-25 65 {
9b3a7fd0 Tony Luck 2017-09-25 66 lockdep_assert_held(&rdtgroup_mutex);
9b3a7fd0 Tony Luck 2017-09-25 67 seq_buf_puts(&last_cmd_status, s);
9b3a7fd0 Tony Luck 2017-09-25 68 }
9b3a7fd0 Tony Luck 2017-09-25 69
9b3a7fd0 Tony Luck 2017-09-25 70 void rdt_last_cmd_printf(const char *fmt, ...)
9b3a7fd0 Tony Luck 2017-09-25 71 {
9b3a7fd0 Tony Luck 2017-09-25 72 va_list ap;
9b3a7fd0 Tony Luck 2017-09-25 73
9b3a7fd0 Tony Luck 2017-09-25 74 va_start(ap, fmt);
9b3a7fd0 Tony Luck 2017-09-25 75 lockdep_assert_held(&rdtgroup_mutex);
9b3a7fd0 Tony Luck 2017-09-25 76 seq_buf_vprintf(&last_cmd_status, fmt, ap);
9b3a7fd0 Tony Luck 2017-09-25 77 va_end(ap);
9b3a7fd0 Tony Luck 2017-09-25 78 }
9b3a7fd0 Tony Luck 2017-09-25 79
60cf5e10 Fenghua Yu 2016-10-28 80 /*
60cf5e10 Fenghua Yu 2016-10-28 81 * Trivial allocator for CLOSIDs. Since h/w only supports a small number,
60cf5e10 Fenghua Yu 2016-10-28 82 * we can keep a bitmap of free CLOSIDs in a single integer.
60cf5e10 Fenghua Yu 2016-10-28 83 *
60cf5e10 Fenghua Yu 2016-10-28 84 * Using a global CLOSID across all resources has some advantages and
60cf5e10 Fenghua Yu 2016-10-28 85 * some drawbacks:
60cf5e10 Fenghua Yu 2016-10-28 86 * + We can simply set "current->closid" to assign a task to a resource
60cf5e10 Fenghua Yu 2016-10-28 87 * group.
60cf5e10 Fenghua Yu 2016-10-28 88 * + Context switch code can avoid extra memory references deciding which
60cf5e10 Fenghua Yu 2016-10-28 89 * CLOSID to load into the PQR_ASSOC MSR
60cf5e10 Fenghua Yu 2016-10-28 90 * - We give up some options in configuring resource groups across multi-socket
60cf5e10 Fenghua Yu 2016-10-28 91 * systems.
60cf5e10 Fenghua Yu 2016-10-28 92 * - Our choices on how to configure each resource become progressively more
60cf5e10 Fenghua Yu 2016-10-28 93 * limited as the number of resources grows.
60cf5e10 Fenghua Yu 2016-10-28 94 */
60cf5e10 Fenghua Yu 2016-10-28 95 static int closid_free_map;
60cf5e10 Fenghua Yu 2016-10-28 96
60cf5e10 Fenghua Yu 2016-10-28 97 static void closid_init(void)
60cf5e10 Fenghua Yu 2016-10-28 98 {
60cf5e10 Fenghua Yu 2016-10-28 99 struct rdt_resource *r;
60cf5e10 Fenghua Yu 2016-10-28 100 int rdt_min_closid = 32;
60cf5e10 Fenghua Yu 2016-10-28 101
60cf5e10 Fenghua Yu 2016-10-28 102 /* Compute rdt_min_closid across all resources */
1b5c0b75 Vikas Shivappa 2017-07-25 103 for_each_alloc_enabled_rdt_resource(r)
60cf5e10 Fenghua Yu 2016-10-28 104 rdt_min_closid = min(rdt_min_closid, r->num_closid);
60cf5e10 Fenghua Yu 2016-10-28 105
60cf5e10 Fenghua Yu 2016-10-28 106 closid_free_map = BIT_MASK(rdt_min_closid) - 1;
60cf5e10 Fenghua Yu 2016-10-28 107
60cf5e10 Fenghua Yu 2016-10-28 108 /* CLOSID 0 is always reserved for the default group */
60cf5e10 Fenghua Yu 2016-10-28 109 closid_free_map &= ~1;
60cf5e10 Fenghua Yu 2016-10-28 110 }
60cf5e10 Fenghua Yu 2016-10-28 111
cb2200e9 Reinette Chatre 2017-07-25 112 static int closid_alloc(void)
60cf5e10 Fenghua Yu 2016-10-28 113 {
0734ded1 Vikas Shivappa 2017-07-25 114 u32 closid = ffs(closid_free_map);
60cf5e10 Fenghua Yu 2016-10-28 115
60cf5e10 Fenghua Yu 2016-10-28 116 if (closid == 0)
60cf5e10 Fenghua Yu 2016-10-28 117 return -ENOSPC;
60cf5e10 Fenghua Yu 2016-10-28 118 closid--;
60cf5e10 Fenghua Yu 2016-10-28 119 closid_free_map &= ~(1 << closid);
60cf5e10 Fenghua Yu 2016-10-28 120
60cf5e10 Fenghua Yu 2016-10-28 121 return closid;
60cf5e10 Fenghua Yu 2016-10-28 122 }
60cf5e10 Fenghua Yu 2016-10-28 123
60cf5e10 Fenghua Yu 2016-10-28 124 static void closid_free(int closid)
60cf5e10 Fenghua Yu 2016-10-28 125 {
60cf5e10 Fenghua Yu 2016-10-28 126 closid_free_map |= 1 << closid;
60cf5e10 Fenghua Yu 2016-10-28 127 }
60cf5e10 Fenghua Yu 2016-10-28 128
4e978d06 Fenghua Yu 2016-10-28 129 /* set uid and gid of rdtgroup dirs and files to that of the creator */
4e978d06 Fenghua Yu 2016-10-28 130 static int rdtgroup_kn_set_ugid(struct kernfs_node *kn)
4e978d06 Fenghua Yu 2016-10-28 131 {
4e978d06 Fenghua Yu 2016-10-28 132 struct iattr iattr = { .ia_valid = ATTR_UID | ATTR_GID,
4e978d06 Fenghua Yu 2016-10-28 133 .ia_uid = current_fsuid(),
4e978d06 Fenghua Yu 2016-10-28 134 .ia_gid = current_fsgid(), };
4e978d06 Fenghua Yu 2016-10-28 135
4e978d06 Fenghua Yu 2016-10-28 136 if (uid_eq(iattr.ia_uid, GLOBAL_ROOT_UID) &&
4e978d06 Fenghua Yu 2016-10-28 137 gid_eq(iattr.ia_gid, GLOBAL_ROOT_GID))
4e978d06 Fenghua Yu 2016-10-28 138 return 0;
4e978d06 Fenghua Yu 2016-10-28 139
4e978d06 Fenghua Yu 2016-10-28 140 return kernfs_setattr(kn, &iattr);
4e978d06 Fenghua Yu 2016-10-28 141 }
4e978d06 Fenghua Yu 2016-10-28 142
4e978d06 Fenghua Yu 2016-10-28 143 static int rdtgroup_add_file(struct kernfs_node *parent_kn, struct rftype *rft)
4e978d06 Fenghua Yu 2016-10-28 144 {
4e978d06 Fenghua Yu 2016-10-28 145 struct kernfs_node *kn;
4e978d06 Fenghua Yu 2016-10-28 146 int ret;
4e978d06 Fenghua Yu 2016-10-28 147
4e978d06 Fenghua Yu 2016-10-28 @148 kn = __kernfs_create_file(parent_kn, rft->name, rft->mode,
4e978d06 Fenghua Yu 2016-10-28 @149 0, rft->kf_ops, rft, NULL, NULL);
4e978d06 Fenghua Yu 2016-10-28 150 if (IS_ERR(kn))
4e978d06 Fenghua Yu 2016-10-28 151 return PTR_ERR(kn);
4e978d06 Fenghua Yu 2016-10-28 152
4e978d06 Fenghua Yu 2016-10-28 153 ret = rdtgroup_kn_set_ugid(kn);
4e978d06 Fenghua Yu 2016-10-28 154 if (ret) {
4e978d06 Fenghua Yu 2016-10-28 155 kernfs_remove(kn);
4e978d06 Fenghua Yu 2016-10-28 156 return ret;
4e978d06 Fenghua Yu 2016-10-28 157 }
4e978d06 Fenghua Yu 2016-10-28 158
4e978d06 Fenghua Yu 2016-10-28 159 return 0;
4e978d06 Fenghua Yu 2016-10-28 160 }
4e978d06 Fenghua Yu 2016-10-28 161
:::::: The code at line 149 was first introduced by commit
:::::: 4e978d06dedb8207b298a5a8a49fce4b2ab80d12 x86/intel_rdt: Add "info" files to resctrl file system
:::::: TO: Fenghua Yu <fenghua.yu@intel.com>
:::::: CC: Thomas Gleixner <tglx@linutronix.de>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31237 bytes --]
^ permalink raw reply
* Re: [PATCH net-next 4/5] net: mvpp2: debugfs: add entries for classifier flows
From: kbuild test robot @ 2018-07-17 1:01 UTC (permalink / raw)
To: Maxime Chevallier
Cc: kbuild-all, davem, Maxime Chevallier, netdev, linux-kernel,
Antoine Tenart, thomas.petazzoni, gregory.clement, miquel.raynal,
nadavh, stefanc, ymarkman, mw
In-Reply-To: <20180713161344.19872-5-maxime.chevallier@bootlin.com>
[-- Attachment #1: Type: text/plain, Size: 2513 bytes --]
Hi Maxime,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Maxime-Chevallier/net-mvpp2-add-debugfs-interface/20180716-014927
config: powerpc-allmodconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=powerpc
:::::: branch date: 14 hours ago
:::::: commit date: 14 hours ago
All errors (new ones prefixed by >>):
>> drivers/net//ethernet/marvell/mvpp2/mvpp2_cls.c:575:31: error: static declaration of 'mvpp2_cls_flow_get' follows non-static declaration
static struct mvpp2_cls_flow *mvpp2_cls_flow_get(int flow)
^~~~~~~~~~~~~~~~~~
In file included from drivers/net//ethernet/marvell/mvpp2/mvpp2_cls.c:11:0:
drivers/net//ethernet/marvell/mvpp2/mvpp2_cls.h:216:24: note: previous declaration of 'mvpp2_cls_flow_get' was here
struct mvpp2_cls_flow *mvpp2_cls_flow_get(int flow);
^~~~~~~~~~~~~~~~~~
# https://github.com/0day-ci/linux/commit/0a0aa09b1f053ab79e9e87ca21ce51f14764ce70
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 0a0aa09b1f053ab79e9e87ca21ce51f14764ce70
vim +/mvpp2_cls_flow_get +575 drivers/net//ethernet/marvell/mvpp2/mvpp2_cls.c
b1a962c6 Maxime Chevallier 2018-07-12 574
9cee8c43 kbuild test robot 2018-07-14 @575 static struct mvpp2_cls_flow *mvpp2_cls_flow_get(int flow)
f9358e12 Maxime Chevallier 2018-07-12 576 {
f9358e12 Maxime Chevallier 2018-07-12 577 if (flow >= MVPP2_N_FLOWS)
f9358e12 Maxime Chevallier 2018-07-12 578 return NULL;
f9358e12 Maxime Chevallier 2018-07-12 579
f9358e12 Maxime Chevallier 2018-07-12 580 return &cls_flows[flow];
f9358e12 Maxime Chevallier 2018-07-12 581 }
f9358e12 Maxime Chevallier 2018-07-12 582
:::::: The code at line 575 was first introduced by commit
:::::: 9cee8c4375431d5087466eacf6f8f436210e56ea net: mvpp2: mvpp2_cls_flow_get() can be static
:::::: TO: kbuild test robot <fengguang.wu@intel.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 57634 bytes --]
^ permalink raw reply
* [RFC 2/2] compat: Cleanup in_compat_syscall() callers
From: Dmitry Safonov @ 2018-07-17 0:50 UTC (permalink / raw)
To: linux-kernel
Cc: Dmitry Safonov, Ard Biesheuvel, David S. Miller, Herbert Xu,
H. Peter Anvin, Ingo Molnar, John Stultz, Kirill A. Shutemov,
Oleg Nesterov, Steffen Klassert, Stephen Boyd, Steven Rostedt,
Thomas Gleixner, x86, linux-efi, netdev, Dmitry Safonov
In-Reply-To: <20180717005004.25984-1-dima@arista.com>
Now that in_compat_syscall() == false on native i686, it's possible to
remove some ifdeffery and no more needed helpers.
Signed-off-by: Dmitry Safonov <dima@arista.com>
---
drivers/firmware/efi/efivars.c | 16 ++++------------
kernel/time/time.c | 2 +-
net/xfrm/xfrm_state.c | 2 --
net/xfrm/xfrm_user.c | 2 --
4 files changed, 5 insertions(+), 17 deletions(-)
diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c
index 3e626fd9bd4e..8061667a6765 100644
--- a/drivers/firmware/efi/efivars.c
+++ b/drivers/firmware/efi/efivars.c
@@ -229,14 +229,6 @@ sanity_check(struct efi_variable *var, efi_char16_t *name, efi_guid_t vendor,
return 0;
}
-static inline bool is_compat(void)
-{
- if (IS_ENABLED(CONFIG_COMPAT) && in_compat_syscall())
- return true;
-
- return false;
-}
-
static void
copy_out_compat(struct efi_variable *dst, struct compat_efi_variable *src)
{
@@ -263,7 +255,7 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count)
u8 *data;
int err;
- if (is_compat()) {
+ if (in_compat_syscall()) {
struct compat_efi_variable *compat;
if (count != sizeof(*compat))
@@ -324,7 +316,7 @@ efivar_show_raw(struct efivar_entry *entry, char *buf)
&entry->var.DataSize, entry->var.Data))
return -EIO;
- if (is_compat()) {
+ if (in_compat_syscall()) {
compat = (struct compat_efi_variable *)buf;
size = sizeof(*compat);
@@ -418,7 +410,7 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj,
struct compat_efi_variable *compat = (struct compat_efi_variable *)buf;
struct efi_variable *new_var = (struct efi_variable *)buf;
struct efivar_entry *new_entry;
- bool need_compat = is_compat();
+ bool need_compat = in_compat_syscall();
efi_char16_t *name;
unsigned long size;
u32 attributes;
@@ -495,7 +487,7 @@ static ssize_t efivar_delete(struct file *filp, struct kobject *kobj,
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
- if (is_compat()) {
+ if (in_compat_syscall()) {
if (count != sizeof(*compat))
return -EINVAL;
diff --git a/kernel/time/time.c b/kernel/time/time.c
index 2b41e8e2d31d..d59caa6d03e6 100644
--- a/kernel/time/time.c
+++ b/kernel/time/time.c
@@ -865,7 +865,7 @@ int get_timespec64(struct timespec64 *ts,
ts->tv_sec = kts.tv_sec;
/* Zero out the padding for 32 bit systems or in compat mode */
- if (IS_ENABLED(CONFIG_64BIT_TIME) && (!IS_ENABLED(CONFIG_64BIT) || in_compat_syscall()))
+ if (IS_ENABLED(CONFIG_64BIT_TIME) && in_compat_syscall())
kts.tv_nsec &= 0xFFFFFFFFUL;
ts->tv_nsec = kts.tv_nsec;
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 8308281f3253..3f48a6925606 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -2057,10 +2057,8 @@ int xfrm_user_policy(struct sock *sk, int optname, u8 __user *optval, int optlen
struct xfrm_mgr *km;
struct xfrm_policy *pol = NULL;
-#ifdef CONFIG_COMPAT
if (in_compat_syscall())
return -EOPNOTSUPP;
-#endif
if (!optval && !optlen) {
xfrm_sk_policy_insert(sk, XFRM_POLICY_IN, NULL);
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 080035f056d9..2677cb55b7a8 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2546,10 +2546,8 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
const struct xfrm_link *link;
int type, err;
-#ifdef CONFIG_COMPAT
if (in_compat_syscall())
return -EOPNOTSUPP;
-#endif
type = nlh->nlmsg_type;
if (type > XFRM_MSG_MAX)
--
2.13.6
^ permalink raw reply related
* [RFC 1/2] x86/compat: Adjust in_compat_syscall() to generic code under !COMPAT
From: Dmitry Safonov @ 2018-07-17 0:50 UTC (permalink / raw)
To: linux-kernel
Cc: Dmitry Safonov, Ard Biesheuvel, David S. Miller, Herbert Xu,
H. Peter Anvin, Ingo Molnar, John Stultz, Kirill A. Shutemov,
Oleg Nesterov, Steffen Klassert, Stephen Boyd, Steven Rostedt,
Thomas Gleixner, x86, linux-efi, netdev, Dmitry Safonov
In-Reply-To: <20180717005004.25984-1-dima@arista.com>
The result of in_compat_syscall() can be pictured as:
x86 platform:
---------------------------------------------------
| Arch\syscall | 64-bit | ia32 | x32 |
|-------------------------------------------------|
| x86_64 | false | true | true |
|-------------------------------------------------|
| i686 | false | <true> | false |
---------------------------------------------------
Other platforms:
------------------------------------------------
| Arch\syscall | 64-bit | compat (32?) |
|----------------------------------------------|
| 64-bit | false | true |
|----------------------------------------------|
| 32-bit(?) | false | <false> |
------------------------------------------------
As it seen, the result of in_compat_syscall() on generic 32-bit platform
differs from i686.
There is no reason for in_compat_syscall() == true on native i686.
It also easy to misread code if the result on native 32-bit platform
differs between arches.
Because of that non arch-specific code has many places with:
if (IS_ENABLED(CONFIG_COMPAT) && in_compat_syscall())
in different variations.
It looks-like the only non-x86 code which uses in_compat_syscall() not
under CONFIG_COMPAT guard is in amd/amdkfd. But according to
the commit a18069c132cb ("amdkfd: Disable support for 32-bit user
processes"), it actually should be disabled on native i686.
Rename in_compat_syscall() to in_32bit_syscall() for x86-specific code
and make in_compat_syscall() false under !CONFIG_COMPAT.
With a following patch I'll clean generic users which were forced
to check IS_ENABLED(CONFIG_COMPAT) with in_compat_syscall().
Signed-off-by: Dmitry Safonov <dima@arista.com>
---
arch/x86/include/asm/compat.h | 9 ++++++++-
arch/x86/include/asm/ftrace.h | 4 +---
arch/x86/kernel/process_64.c | 4 ++--
arch/x86/kernel/sys_x86_64.c | 11 ++++++-----
arch/x86/mm/hugetlbpage.c | 4 ++--
arch/x86/mm/mmap.c | 2 +-
include/linux/compat.h | 4 ++--
7 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h
index fb97cf7c4137..626bcf1d037d 100644
--- a/arch/x86/include/asm/compat.h
+++ b/arch/x86/include/asm/compat.h
@@ -232,11 +232,18 @@ static inline bool in_x32_syscall(void)
return false;
}
-static inline bool in_compat_syscall(void)
+static inline bool in_32bit_syscall(void)
{
return in_ia32_syscall() || in_x32_syscall();
}
+
+#ifdef CONFIG_COMPAT
+static inline bool in_compat_syscall(void)
+{
+ return in_32bit_syscall();
+}
#define in_compat_syscall in_compat_syscall /* override the generic impl */
+#endif
struct compat_siginfo;
int __copy_siginfo_to_user32(struct compat_siginfo __user *to,
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index c18ed65287d5..cf350639e76d 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -76,9 +76,7 @@ static inline bool arch_syscall_match_sym_name(const char *sym, const char *name
#define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS 1
static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs)
{
- if (in_compat_syscall())
- return true;
- return false;
+ return in_32bit_syscall();
}
#endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_IA32_EMULATION */
#endif /* !COMPILE_OFFSETS */
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 12bb445fb98d..3a6f3cf27808 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -564,10 +564,10 @@ static void __set_personality_x32(void)
current->mm->context.ia32_compat = TIF_X32;
current->personality &= ~READ_IMPLIES_EXEC;
/*
- * in_compat_syscall() uses the presence of the x32 syscall bit
+ * in_32bit_syscall() uses the presence of the x32 syscall bit
* flag to determine compat status. The x86 mmap() code relies on
* the syscall bitness so set x32 syscall bit right here to make
- * in_compat_syscall() work during exec().
+ * in_32bit_syscall() work during exec().
*
* Pretend to come from a x32 execve.
*/
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
index 6a78d4b36a79..f7476ce23b6e 100644
--- a/arch/x86/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
@@ -105,7 +105,7 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
static void find_start_end(unsigned long addr, unsigned long flags,
unsigned long *begin, unsigned long *end)
{
- if (!in_compat_syscall() && (flags & MAP_32BIT)) {
+ if (!in_32bit_syscall() && (flags & MAP_32BIT)) {
/* This is usually used needed to map code in small
model, so it needs to be in the first 31bit. Limit
it to that. This means we need to move the
@@ -122,7 +122,7 @@ static void find_start_end(unsigned long addr, unsigned long flags,
}
*begin = get_mmap_base(1);
- if (in_compat_syscall())
+ if (in_32bit_syscall())
*end = task_size_32bit();
else
*end = task_size_64bit(addr > DEFAULT_MAP_WINDOW);
@@ -193,7 +193,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
return addr;
/* for MAP_32BIT mappings we force the legacy mmap base */
- if (!in_compat_syscall() && (flags & MAP_32BIT))
+ if (!in_32bit_syscall() && (flags & MAP_32BIT))
goto bottomup;
/* requesting a specific address */
@@ -217,9 +217,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
* If hint address is above DEFAULT_MAP_WINDOW, look for unmapped area
* in the full address space.
*
- * !in_compat_syscall() check to avoid high addresses for x32.
+ * !in_32bit_syscall() check to avoid high addresses for x32
+ * (and make it no op on native i386).
*/
- if (addr > DEFAULT_MAP_WINDOW && !in_compat_syscall())
+ if (addr > DEFAULT_MAP_WINDOW && !in_32bit_syscall())
info.high_limit += TASK_SIZE_MAX - DEFAULT_MAP_WINDOW;
info.align_mask = 0;
diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
index 00b296617ca4..92e4c4b85bba 100644
--- a/arch/x86/mm/hugetlbpage.c
+++ b/arch/x86/mm/hugetlbpage.c
@@ -92,7 +92,7 @@ static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *file,
* If hint address is above DEFAULT_MAP_WINDOW, look for unmapped area
* in the full address space.
*/
- info.high_limit = in_compat_syscall() ?
+ info.high_limit = in_32bit_syscall() ?
task_size_32bit() : task_size_64bit(addr > DEFAULT_MAP_WINDOW);
info.align_mask = PAGE_MASK & ~huge_page_mask(h);
@@ -116,7 +116,7 @@ static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file,
* If hint address is above DEFAULT_MAP_WINDOW, look for unmapped area
* in the full address space.
*/
- if (addr > DEFAULT_MAP_WINDOW && !in_compat_syscall())
+ if (addr > DEFAULT_MAP_WINDOW && !in_32bit_syscall())
info.high_limit += TASK_SIZE_MAX - DEFAULT_MAP_WINDOW;
info.align_mask = PAGE_MASK & ~huge_page_mask(h);
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
index 48c591251600..36334ce78be8 100644
--- a/arch/x86/mm/mmap.c
+++ b/arch/x86/mm/mmap.c
@@ -166,7 +166,7 @@ unsigned long get_mmap_base(int is_legacy)
struct mm_struct *mm = current->mm;
#ifdef CONFIG_HAVE_ARCH_COMPAT_MMAP_BASES
- if (in_compat_syscall()) {
+ if (in_32bit_syscall()) {
return is_legacy ? mm->mmap_compat_legacy_base
: mm->mmap_compat_base;
}
diff --git a/include/linux/compat.h b/include/linux/compat.h
index c68acc47da57..4dd4b00407ab 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -1031,9 +1031,9 @@ static inline struct compat_timeval ns_to_compat_timeval(s64 nsec)
#else /* !CONFIG_COMPAT */
#define is_compat_task() (0)
-#ifndef in_compat_syscall
+/* Ensure no one redefines in_compat_syscall() under !CONFIG_COMPAT */
+#define in_compat_syscall in_compat_syscall
static inline bool in_compat_syscall(void) { return false; }
-#endif
#endif /* CONFIG_COMPAT */
--
2.13.6
^ permalink raw reply related
* Re: [PATCH net-next V2 0/8] Packed virtqueue support for vhost
From: Jason Wang @ 2018-07-17 0:45 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: kvm, netdev, linux-kernel, virtualization, maxime.coquelin, wexu
In-Reply-To: <20180716154102-mutt-send-email-mst@kernel.org>
On 2018年07月16日 20:49, Michael S. Tsirkin wrote:
> On Mon, Jul 16, 2018 at 05:46:33PM +0800, Jason Wang wrote:
>>
>> On 2018年07月16日 16:39, Michael S. Tsirkin wrote:
>>> On Mon, Jul 16, 2018 at 11:28:03AM +0800, Jason Wang wrote:
>>>> Hi all:
>>>>
>>>> This series implements packed virtqueues. The code were tested with
>>>> Tiwei's guest driver series at https://patchwork.ozlabs.org/cover/942297/
>>>>
>>>>
>>>> Pktgen test for both RX and TX does not show obvious difference with
>>>> split virtqueues. The main bottleneck is the guest Linux driver, since
>>>> it can not stress vhost for a 100% CPU utilization. A full TCP
>>>> benchmark is ongoing. Will test virtio-net pmd as well when it was
>>>> ready.
>>> Well the question then is why we should bother merging this
>>> if this doesn't give a performance gain.
>> We meet bottlenecks at other places. I can only test Linux driver which has
>> lots of overheads e.g interrupts. And perf show only a small fraction of
>> time were spent on e.g virtqueue manipulation. I hope virtio-net pmd can
>> give us different result but we don't have one ready for testing now. (Jen's
>> V4 have bugs thus can not work with this series).
> Can't linux busy poll?
For vhost busy polling, there's no difference since guest can not give
vhost enough stress. For guest busy polling, it does not work for the
packets generated by pktgen.
> And how about testing loopback with XDP?
No difference, I even shortcut both the tun_get_user() on host and
netif_receive_skb() in guest.
>>> Do you see
>>> a gain in CPU utilization maybe?
>> Unfortunately not.
>>
>>> If not - let's wait for that TCP benchmark result?
>> We can, but you know TCP_STREAM result is sometime misleading.
>>
>> A brunch of other patches of mine were rebased on this and then blocked on
>> this series. Consider we don't meet regression, maybe we can merge this
>> first and try optimizations or fixups on top?
>>
>> Thanks
> I'm not sure I understand this approach. Packed ring is just an optimization.
> What value is there in merging it if it does not help speed?
If you want to support migration from dpdk or vDPA backend. And we still
have the chance to see the performance with virito-net pmd in the
future. If this does not make sense for you, I will leave this series
until we can get results from virtio-net pmd (or find a way that packed
virtqueue outperform). And I will start to post other optimizations on
vhost.
Thanks
>
>>>> Notes:
>>>> - This version depends on Tiwei's series at https://patchwork.ozlabs.org/cover/942297/
>>>>
>>>> This version were tested with:
>>>>
>>>> - Zerocopy (Out of Order) support
>>>> - vIOMMU support
>>>> - mergeable buffer on/off
>>>> - busy polling on/off
>>>> - vsock (nc-vsock)
>>>>
>>>> Changes from V1:
>>>> - drop uapi patch and use Tiwei's
>>>> - split the enablement of packed virtqueue into a separate patch
>>>>
>>>> Changes from RFC V5:
>>>>
>>>> - save unnecessary barriers during vhost_add_used_packed_n()
>>>> - more compact math for event idx
>>>> - fix failure of SET_VRING_BASE when avail_wrap_counter is true
>>>> - fix not copy avail_wrap_counter during GET_VRING_BASE
>>>> - introduce SET_VRING_USED_BASE/GET_VRING_USED_BASE for syncing last_used_idx
>>>> - rename used_wrap_counter to last_used_wrap_counter
>>>> - rebase to net-next
>>>>
>>>> Changes from RFC V4:
>>>>
>>>> - fix signalled_used index recording
>>>> - track avail index correctly
>>>> - various minor fixes
>>>>
>>>> Changes from RFC V3:
>>>>
>>>> - Fix math on event idx checking
>>>> - Sync last avail wrap counter through GET/SET_VRING_BASE
>>>> - remove desc_event prefix in the driver/device structure
>>>>
>>>> Changes from RFC V2:
>>>>
>>>> - do not use & in checking desc_event_flags
>>>> - off should be most significant bit
>>>> - remove the workaround of mergeable buffer for dpdk prototype
>>>> - id should be in the last descriptor in the chain
>>>> - keep _F_WRITE for write descriptor when adding used
>>>> - device flags updating should use ADDR_USED type
>>>> - return error on unexpected unavail descriptor in a chain
>>>> - return false in vhost_ve_avail_empty is descriptor is available
>>>> - track last seen avail_wrap_counter
>>>> - correctly examine available descriptor in get_indirect_packed()
>>>> - vhost_idx_diff should return u16 instead of bool
>>>>
>>>> Changes from RFC V1:
>>>>
>>>> - Refactor vhost used elem code to avoid open coding on used elem
>>>> - Event suppression support (compile test only).
>>>> - Indirect descriptor support (compile test only).
>>>> - Zerocopy support.
>>>> - vIOMMU support.
>>>> - SCSI/VSOCK support (compile test only).
>>>> - Fix several bugs
>>>>
>>>> Jason Wang (8):
>>>> vhost: move get_rx_bufs to vhost.c
>>>> vhost: hide used ring layout from device
>>>> vhost: do not use vring_used_elem
>>>> vhost_net: do not explicitly manipulate vhost_used_elem
>>>> vhost: vhost_put_user() can accept metadata type
>>>> vhost: packed ring support
>>>> vhost: event suppression for packed ring
>>>> vhost: enable packed virtqueues
>>>>
>>>> drivers/vhost/net.c | 143 ++-----
>>>> drivers/vhost/scsi.c | 62 +--
>>>> drivers/vhost/vhost.c | 994 ++++++++++++++++++++++++++++++++++++++++-----
>>>> drivers/vhost/vhost.h | 55 ++-
>>>> drivers/vhost/vsock.c | 42 +-
>>>> include/uapi/linux/vhost.h | 7 +
>>>> 6 files changed, 1035 insertions(+), 268 deletions(-)
>>>>
>>>> --
>>>> 2.7.4
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply
* Re: [PATCH][net-next][v2] net: convert gro_count to bitmask
From: David Miller @ 2018-07-17 0:02 UTC (permalink / raw)
To: eric.dumazet; +Cc: lirongqing, netdev, edumazet, sbrivio
In-Reply-To: <80f69d24-bf80-c8ac-7d16-a8d6b91e2448@gmail.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 16 Jul 2018 16:40:52 -0700
> I guess we could either use BITS_PER_LONG or :
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index c883b17ee0fe2c8a7ca2f2867560ba74004790a7..4f8b92d81d107fc9acd2499297435cbd9e9b5c67 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -9282,7 +9282,7 @@ static struct hlist_head * __net_init netdev_create_hash(void)
Commited thusly:
====================
[PATCH] net: Fix GRO_HASH_BUCKETS assertion.
FIELD_SIZEOF() is in bytes, but we want bits.
Fixes: d9f37d01e294 ("net: convert gro_count to bitmask")
Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/core/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index c883b17ee0fe..4f8b92d81d10 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -9282,7 +9282,7 @@ static struct hlist_head * __net_init netdev_create_hash(void)
static int __net_init netdev_init(struct net *net)
{
BUILD_BUG_ON(GRO_HASH_BUCKETS >
- FIELD_SIZEOF(struct napi_struct, gro_bitmask));
+ 8 * FIELD_SIZEOF(struct napi_struct, gro_bitmask));
if (net != &init_net)
INIT_LIST_HEAD(&net->dev_base_head);
--
2.13.6
^ permalink raw reply related
* Re: [PATCH next] bonding: pass link-local packets to bonding master also.
From: Mahesh Bandewar (महेश बंडेवार) @ 2018-07-16 23:57 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Mahesh Bandewar, Jay Vosburgh, Andy Gospodarek, Veaceslav Falico,
David Miller, Netdev, Michal Soltys
In-Reply-To: <20180716163353.2fe5659c@xeon-e3>
On Mon, Jul 16, 2018 at 4:33 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> On Sun, 15 Jul 2018 18:12:46 -0700
> Mahesh Bandewar <mahesh@bandewar.net> wrote:
>
>> From: Mahesh Bandewar <maheshb@google.com>
>>
>> Commit b89f04c61efe ("bonding: deliver link-local packets with
>> skb->dev set to link that packets arrived on") changed the behavior
>> of how link-local-multicast packets are processed. The change in
>> the behavior broke some legacy use cases where these packets are
>> expected to arrive on bonding master device also.
>>
>> This patch passes the packet to the stack with the link it arrived
>> on as well as passes to the bonding-master device to preserve the
>> legacy use case.
>>
>> Reported-by: Michal Soltys <soltys@ziu.info>
>> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>
> Thanks for fixing this.
>
> Why not add a Fixes: tag instead of just talking about the commit?
> That helps the stable maintainers know which versions of the kernel
> need the patch.
Well, I thought about it. It's definitely 'related' but not sure it
'fixes' in true sense. It definitely fixes the broken legacy case
though. Is that sufficient to add 'fixes' tag?
^ permalink raw reply
* Re: [PATCH next] bonding: pass link-local packets to bonding master also.
From: Mahesh Bandewar (महेश बंडेवार) @ 2018-07-16 23:53 UTC (permalink / raw)
To: Jay Vosburgh
Cc: Mahesh Bandewar, Andy Gospodarek, Veaceslav Falico, David Miller,
Netdev, Michal Soltys
In-Reply-To: <12404.1531776273@nyx>
On Mon, Jul 16, 2018 at 2:24 PM, Jay Vosburgh
<jay.vosburgh@canonical.com> wrote:
> Mahesh Bandewar <mahesh@bandewar.net> wrote:
>
>>From: Mahesh Bandewar <maheshb@google.com>
>>
>>Commit b89f04c61efe ("bonding: deliver link-local packets with
>>skb->dev set to link that packets arrived on") changed the behavior
>>of how link-local-multicast packets are processed. The change in
>>the behavior broke some legacy use cases where these packets are
>>expected to arrive on bonding master device also.
>>
>>This patch passes the packet to the stack with the link it arrived
>>on as well as passes to the bonding-master device to preserve the
>>legacy use case.
>
> Michal, can you test this? I'm travelling this week and won't
> be able to run the patch.
>
> Mahesh, will this confuse LLDP, et al, daemons that, e.g., bind
> to every possible interface and now see the same LLDP PDU (identical
> Chassis ID, Port ID, et al, TLVs) on multiple interfaces?
>
Well it's hard to say. In the previous world when these packets used
to appear only on bonding-master, that service had to go extra-lengths
to figure it out which link it actually came on in. With the earlier
change (SHA1: b89f04c61efe) it didn't have to but with this patch, the
best thing that they could do is just ignore those packets coming from
(any) virtual devices. The only reason why I'm OK with this change is
because L2 of a physical link is shared with a virtual link (bonding
master) and hence both links receiving the same link-local-multicast
seems acceptable. Making them appear only on bonding-master is just
wrong while correcting that behavior breaks the legacy use case and
here we are.
BTW when links are aggregated and using LACP, these packets don't
arrive the system-mac but the real mac of the sender with a dest
multicast-mac.
--mahesh..
> Thanks,
>
> -J
>
>>Reported-by: Michal Soltys <soltys@ziu.info>
>>Signed-off-by: Mahesh Bandewar <maheshb@google.com>
>>---
>> drivers/net/bonding/bond_main.c | 17 +++++++++++++++--
>> 1 file changed, 15 insertions(+), 2 deletions(-)
>>
>>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>>index 9a2ea3c1f949..1d3b7d8448f2 100644
>>--- a/drivers/net/bonding/bond_main.c
>>+++ b/drivers/net/bonding/bond_main.c
>>@@ -1177,9 +1177,22 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
>> }
>> }
>>
>>- /* don't change skb->dev for link-local packets */
>>- if (is_link_local_ether_addr(eth_hdr(skb)->h_dest))
>>+ /* Link-local multicast packets should be passed to the
>>+ * stack on the link they arrive as well as pass them to the
>>+ * bond-master device. These packets are mostly usable when
>>+ * stack receives it with the link on which they arrive
>>+ * (e.g. LLDP) but there may be some legacy behavior that
>>+ * expects these packets to appear on bonding master too.
>>+ */
>>+ if (is_link_local_ether_addr(eth_hdr(skb)->h_dest)) {
>>+ struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
>>+
>>+ if (nskb) {
>>+ nskb->dev = bond->dev;
>>+ netif_rx(nskb);
>>+ }
>> return RX_HANDLER_PASS;
>>+ }
>> if (bond_should_deliver_exact_match(skb, slave, bond))
>> return RX_HANDLER_EXACT;
>>
>>--
>>2.18.0.203.gfac676dfb9-goog
>
> ---
> -Jay Vosburgh, jay.vosburgh@canonical.com
^ permalink raw reply
* [net:master 66/72] drivers/net/hyperv/rndis_filter.c:1341:16: sparse: Using plain integer as NULL pointer
From: kbuild test robot @ 2018-07-16 23:43 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: kbuild-all, netdev
tree: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master
head: 3578a7ecb69920efc3885dbd610e98c00dbdf5db
commit: 916c5e1413be058d1c1f6e502db350df890730ce [66/72] hv/netvsc: fix handling of fallback to single queue mode
reproduce:
# apt-get install sparse
git checkout 916c5e1413be058d1c1f6e502db350df890730ce
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__
sparse warnings: (new ones prefixed by >>)
drivers/net/hyperv/rndis_filter.c:1307:31: sparse: expression using sizeof(void)
drivers/net/hyperv/rndis_filter.c:1307:31: sparse: expression using sizeof(void)
drivers/net/hyperv/rndis_filter.c:1310:31: sparse: expression using sizeof(void)
drivers/net/hyperv/rndis_filter.c:1313:31: sparse: expression using sizeof(void)
drivers/net/hyperv/rndis_filter.c:1313:31: sparse: expression using sizeof(void)
>> drivers/net/hyperv/rndis_filter.c:1341:16: sparse: Using plain integer as NULL pointer
vim +1341 drivers/net/hyperv/rndis_filter.c
1224
1225 struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
1226 struct netvsc_device_info *device_info)
1227 {
1228 struct net_device *net = hv_get_drvdata(dev);
1229 struct netvsc_device *net_device;
1230 struct rndis_device *rndis_device;
1231 struct ndis_recv_scale_cap rsscap;
1232 u32 rsscap_size = sizeof(struct ndis_recv_scale_cap);
1233 u32 mtu, size;
1234 u32 num_possible_rss_qs;
1235 int i, ret;
1236
1237 rndis_device = get_rndis_device();
1238 if (!rndis_device)
1239 return ERR_PTR(-ENODEV);
1240
1241 /* Let the inner driver handle this first to create the netvsc channel
1242 * NOTE! Once the channel is created, we may get a receive callback
1243 * (RndisFilterOnReceive()) before this call is completed
1244 */
1245 net_device = netvsc_device_add(dev, device_info);
1246 if (IS_ERR(net_device)) {
1247 kfree(rndis_device);
1248 return net_device;
1249 }
1250
1251 /* Initialize the rndis device */
1252 net_device->max_chn = 1;
1253 net_device->num_chn = 1;
1254
1255 net_device->extension = rndis_device;
1256 rndis_device->ndev = net;
1257
1258 /* Send the rndis initialization message */
1259 ret = rndis_filter_init_device(rndis_device, net_device);
1260 if (ret != 0)
1261 goto err_dev_remv;
1262
1263 /* Get the MTU from the host */
1264 size = sizeof(u32);
1265 ret = rndis_filter_query_device(rndis_device, net_device,
1266 RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE,
1267 &mtu, &size);
1268 if (ret == 0 && size == sizeof(u32) && mtu < net->mtu)
1269 net->mtu = mtu;
1270
1271 /* Get the mac address */
1272 ret = rndis_filter_query_device_mac(rndis_device, net_device);
1273 if (ret != 0)
1274 goto err_dev_remv;
1275
1276 memcpy(device_info->mac_adr, rndis_device->hw_mac_adr, ETH_ALEN);
1277
1278 /* Get friendly name as ifalias*/
1279 if (!net->ifalias)
1280 rndis_get_friendly_name(net, rndis_device, net_device);
1281
1282 /* Query and set hardware capabilities */
1283 ret = rndis_netdev_set_hwcaps(rndis_device, net_device);
1284 if (ret != 0)
1285 goto err_dev_remv;
1286
1287 rndis_filter_query_device_link_status(rndis_device, net_device);
1288
1289 netdev_dbg(net, "Device MAC %pM link state %s\n",
1290 rndis_device->hw_mac_adr,
1291 rndis_device->link_state ? "down" : "up");
1292
1293 if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_5)
1294 goto out;
1295
1296 rndis_filter_query_link_speed(rndis_device, net_device);
1297
1298 /* vRSS setup */
1299 memset(&rsscap, 0, rsscap_size);
1300 ret = rndis_filter_query_device(rndis_device, net_device,
1301 OID_GEN_RECEIVE_SCALE_CAPABILITIES,
1302 &rsscap, &rsscap_size);
1303 if (ret || rsscap.num_recv_que < 2)
1304 goto out;
1305
1306 /* This guarantees that num_possible_rss_qs <= num_online_cpus */
> 1307 num_possible_rss_qs = min_t(u32, num_online_cpus(),
1308 rsscap.num_recv_que);
1309
1310 net_device->max_chn = min_t(u32, VRSS_CHANNEL_MAX, num_possible_rss_qs);
1311
1312 /* We will use the given number of channels if available. */
1313 net_device->num_chn = min(net_device->max_chn, device_info->num_chn);
1314
1315 for (i = 0; i < ITAB_NUM; i++)
1316 rndis_device->rx_table[i] = ethtool_rxfh_indir_default(
1317 i, net_device->num_chn);
1318
1319 atomic_set(&net_device->open_chn, 1);
1320 vmbus_set_sc_create_callback(dev->channel, netvsc_sc_open);
1321
1322 for (i = 1; i < net_device->num_chn; i++) {
1323 ret = netvsc_alloc_recv_comp_ring(net_device, i);
1324 if (ret) {
1325 while (--i != 0)
1326 vfree(net_device->chan_table[i].mrc.slots);
1327 goto out;
1328 }
1329 }
1330
1331 for (i = 1; i < net_device->num_chn; i++)
1332 netif_napi_add(net, &net_device->chan_table[i].napi,
1333 netvsc_poll, NAPI_POLL_WEIGHT);
1334
1335 return net_device;
1336
1337 out:
1338 /* setting up multiple channels failed */
1339 net_device->max_chn = 1;
1340 net_device->num_chn = 1;
> 1341 return 0;
1342
1343 err_dev_remv:
1344 rndis_filter_device_remove(dev, net_device);
1345 return ERR_PTR(ret);
1346 }
1347
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply
* Re: [PATCH][net-next][v2] net: convert gro_count to bitmask
From: Eric Dumazet @ 2018-07-16 23:40 UTC (permalink / raw)
To: Li RongQing, netdev; +Cc: edumazet, sbrivio
In-Reply-To: <1531464096-11319-1-git-send-email-lirongqing@baidu.com>
On 07/12/2018 11:41 PM, Li RongQing wrote:
> gro_hash size is 192 bytes, and uses 3 cache lines, if there is few
*/
> @@ -9264,6 +9273,9 @@ static struct hlist_head * __net_init netdev_create_hash(void)
> /* Initialize per network namespace state */
> static int __net_init netdev_init(struct net *net)
> {
> + BUILD_BUG_ON(GRO_HASH_BUCKETS >
> + FIELD_SIZEOF(struct napi_struct, gro_bitmask));
> +
Sorry for the delay (patch is already merged)
This looks wrong to me.
FIELD_SIZEOF() is in bytes not bits.
I guess we could either use BITS_PER_LONG or :
diff --git a/net/core/dev.c b/net/core/dev.c
index c883b17ee0fe2c8a7ca2f2867560ba74004790a7..4f8b92d81d107fc9acd2499297435cbd9e9b5c67 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -9282,7 +9282,7 @@ static struct hlist_head * __net_init netdev_create_hash(void)
static int __net_init netdev_init(struct net *net)
{
BUILD_BUG_ON(GRO_HASH_BUCKETS >
- FIELD_SIZEOF(struct napi_struct, gro_bitmask));
+ 8 * FIELD_SIZEOF(struct napi_struct, gro_bitmask));
if (net != &init_net)
INIT_LIST_HEAD(&net->dev_base_head);
^ permalink raw reply related
* Re: [PATCH net-next 4/4] act_mirred: use ACT_REDIRECT when possible
From: Cong Wang @ 2018-07-16 23:39 UTC (permalink / raw)
To: Paolo Abeni
Cc: Linux Kernel Network Developers, Jamal Hadi Salim, Jiri Pirko,
Alexei Starovoitov, Daniel Borkmann, Marcelo Ricardo Leitner
In-Reply-To: <95034fe41fa132b2216686eeb41deaefd997e85b.1531473946.git.pabeni@redhat.com>
On Fri, Jul 13, 2018 at 2:55 AM Paolo Abeni <pabeni@redhat.com> wrote:
>
> When mirred is invoked from the ingress path, and it wants to redirect
> the processed packet, it can now use the ACT_REDIRECT action,
> filling the tcf_result accordingly.
>
> This avoids a skb_clone() in the TC S/W data path giving a ~10%
> improvement in forwarding performances. Overall TC S/W performances
> are now comparable to the kernel openswitch datapath.
Avoiding skb_clone() for redirection is cool, but why need to use
skb_do_redirect() here?
There is a subtle difference here:
skb_do_redirect() calls __bpf_rx_skb() which calls
dev_forward_skb().
while the current mirred action doesn't scrub packets when
redirecting to ingress (from egress). Although I forget if it is
intentionally.
Also, skb->skb_iif is unset in skb_do_redirect() when
redirecting to ingress, I recall we have to set it correctly
for input routing. Probably yet another reason why we
can't scrub it, unless my memory goes wrong. :)
Thanks!
^ permalink raw reply
* Re: [PATCH bpf-next 0/2] tools: bpf: build cleanups
From: Alexei Starovoitov @ 2018-07-16 23:39 UTC (permalink / raw)
To: Daniel Borkmann; +Cc: Jakub Kicinski, oss-drivers, netdev
In-Reply-To: <323b0000-56eb-617b-4755-d1d8a8e84116@iogearbox.net>
On Tue, Jul 17, 2018 at 12:34:03AM +0200, Daniel Borkmann wrote:
> On 07/16/2018 07:57 PM, Jakub Kicinski wrote:
> > Hi!
> >
> > While tracking down the perf vs libbpf vs reallocarray build issue
> > I noticed libbpf is checking for a feature it never uses and that
> > bpftool's makefile attempt to reuse feature dump doesn't really
> > make sense.
> >
> > Jakub Kicinski (2):
> > tools: libbpf: remove libelf-getphdrnum feature detection
> > tools: bpftool: don't pass FEATURES_DUMP to libbpf
> >
> > tools/bpf/bpftool/Makefile | 2 +-
> > tools/lib/bpf/Makefile | 6 +-----
> > 2 files changed, 2 insertions(+), 6 deletions(-)
> >
>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
somehow cover letter didn't make it into patchworks,
so I applied both patches manually to bpf-next and propagated Daniel's Ack.
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