* [net-next 3/6] igc: Update the MAC reset flow
From: Jeff Kirsher @ 2019-07-23 17:36 UTC (permalink / raw)
To: davem; +Cc: Sasha Neftin, netdev, nhorman, sassmann, Aaron Brown,
Jeff Kirsher
In-Reply-To: <20190723173650.23276-1-jeffrey.t.kirsher@intel.com>
From: Sasha Neftin <sasha.neftin@intel.com>
Use Device Reset flow instead of Port Reset flow.
This flow performs a reset of the entire controller device,
resulting in a state nearly approximating the state
following a power-up reset or internal PCIe reset,
except for system PCI configuration.
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igc/igc_base.c | 2 +-
drivers/net/ethernet/intel/igc/igc_defines.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_base.c b/drivers/net/ethernet/intel/igc/igc_base.c
index 59258d791106..46206b3dabfb 100644
--- a/drivers/net/ethernet/intel/igc/igc_base.c
+++ b/drivers/net/ethernet/intel/igc/igc_base.c
@@ -40,7 +40,7 @@ static s32 igc_reset_hw_base(struct igc_hw *hw)
ctrl = rd32(IGC_CTRL);
hw_dbg("Issuing a global reset to MAC\n");
- wr32(IGC_CTRL, ctrl | IGC_CTRL_RST);
+ wr32(IGC_CTRL, ctrl | IGC_CTRL_DEV_RST);
ret_val = igc_get_auto_rd_done(hw);
if (ret_val) {
diff --git a/drivers/net/ethernet/intel/igc/igc_defines.h b/drivers/net/ethernet/intel/igc/igc_defines.h
index fc0ccfe38a20..11b99acf4abe 100644
--- a/drivers/net/ethernet/intel/igc/igc_defines.h
+++ b/drivers/net/ethernet/intel/igc/igc_defines.h
@@ -54,7 +54,7 @@
#define IGC_ERR_SWFW_SYNC 13
/* Device Control */
-#define IGC_CTRL_RST 0x04000000 /* Global reset */
+#define IGC_CTRL_DEV_RST 0x20000000 /* Device reset */
#define IGC_CTRL_PHY_RST 0x80000000 /* PHY Reset */
#define IGC_CTRL_SLU 0x00000040 /* Set link up (Force Link) */
--
2.21.0
^ permalink raw reply related
* [net-next 4/6] igc: Add more SKUs for i225 device
From: Jeff Kirsher @ 2019-07-23 17:36 UTC (permalink / raw)
To: davem; +Cc: Sasha Neftin, netdev, nhorman, sassmann, Aaron Brown,
Jeff Kirsher
In-Reply-To: <20190723173650.23276-1-jeffrey.t.kirsher@intel.com>
From: Sasha Neftin <sasha.neftin@intel.com>
Add support for more SKUs.
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igc/igc_base.c | 3 +++
drivers/net/ethernet/intel/igc/igc_hw.h | 3 +++
drivers/net/ethernet/intel/igc/igc_main.c | 3 +++
3 files changed, 9 insertions(+)
diff --git a/drivers/net/ethernet/intel/igc/igc_base.c b/drivers/net/ethernet/intel/igc/igc_base.c
index 46206b3dabfb..db289bcce21d 100644
--- a/drivers/net/ethernet/intel/igc/igc_base.c
+++ b/drivers/net/ethernet/intel/igc/igc_base.c
@@ -209,6 +209,9 @@ static s32 igc_get_invariants_base(struct igc_hw *hw)
switch (hw->device_id) {
case IGC_DEV_ID_I225_LM:
case IGC_DEV_ID_I225_V:
+ case IGC_DEV_ID_I225_I:
+ case IGC_DEV_ID_I220_V:
+ case IGC_DEV_ID_I225_K:
mac->type = igc_i225;
break;
default:
diff --git a/drivers/net/ethernet/intel/igc/igc_hw.h b/drivers/net/ethernet/intel/igc/igc_hw.h
index 9a338fbf671c..abb2d72911ff 100644
--- a/drivers/net/ethernet/intel/igc/igc_hw.h
+++ b/drivers/net/ethernet/intel/igc/igc_hw.h
@@ -18,6 +18,9 @@
#define IGC_DEV_ID_I225_LM 0x15F2
#define IGC_DEV_ID_I225_V 0x15F3
+#define IGC_DEV_ID_I225_I 0x15F8
+#define IGC_DEV_ID_I220_V 0x15F7
+#define IGC_DEV_ID_I225_K 0x3100
#define IGC_FUNC_0 0
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 9ffe71424ece..e5114bebd30b 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -36,6 +36,9 @@ static const struct igc_info *igc_info_tbl[] = {
static const struct pci_device_id igc_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_LM), board_base },
{ PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_V), board_base },
+ { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_I), board_base },
+ { PCI_VDEVICE(INTEL, IGC_DEV_ID_I220_V), board_base },
+ { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_K), board_base },
/* required last entry */
{0, }
};
--
2.21.0
^ permalink raw reply related
* [net-next 6/6] e1000e: disable force K1-off feature
From: Jeff Kirsher @ 2019-07-23 17:36 UTC (permalink / raw)
To: davem; +Cc: Kai-Heng Feng, netdev, nhorman, sassmann, Aaron Brown,
Jeff Kirsher
In-Reply-To: <20190723173650.23276-1-jeffrey.t.kirsher@intel.com>
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
MAC-PHY desync may occur causing miss detection of link up event.
Disabling K1-off feature can work around the problem.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204057
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/e1000e/hw.h | 1 +
drivers/net/ethernet/intel/e1000e/ich8lan.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h
index eff75bd8a8f0..e3c71fd093ee 100644
--- a/drivers/net/ethernet/intel/e1000e/hw.h
+++ b/drivers/net/ethernet/intel/e1000e/hw.h
@@ -662,6 +662,7 @@ struct e1000_dev_spec_ich8lan {
bool kmrn_lock_loss_workaround_enabled;
struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS];
bool nvm_k1_enabled;
+ bool disable_k1_off;
bool eee_disable;
u16 eee_lp_ability;
enum e1000_ulp_state ulp_state;
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index a1fab77b2096..6a9a4014f4b7 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -1538,6 +1538,9 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
fextnvm6 &= ~E1000_FEXTNVM6_K1_OFF_ENABLE;
}
+ if (hw->dev_spec.ich8lan.disable_k1_off == true)
+ fextnvm6 &= ~E1000_FEXTNVM6_K1_OFF_ENABLE;
+
ew32(FEXTNVM6, fextnvm6);
}
--
2.21.0
^ permalink raw reply related
* [net-next 5/6] e1000e: add workaround for possible stalled packet
From: Jeff Kirsher @ 2019-07-23 17:36 UTC (permalink / raw)
To: davem; +Cc: Kai-Heng Feng, netdev, nhorman, sassmann, Aaron Brown,
Jeff Kirsher
In-Reply-To: <20190723173650.23276-1-jeffrey.t.kirsher@intel.com>
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
This works around a possible stalled packet issue, which may occur due to
clock recovery from the PCH being too slow, when the LAN is transitioning
from K1 at 1G link speed.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204057
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/e1000e/ich8lan.c | 10 ++++++++++
drivers/net/ethernet/intel/e1000e/ich8lan.h | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index 395b05701480..a1fab77b2096 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -1429,6 +1429,16 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
else
phy_reg |= 0xFA;
e1e_wphy_locked(hw, I217_PLL_CLOCK_GATE_REG, phy_reg);
+
+ if (speed == SPEED_1000) {
+ hw->phy.ops.read_reg_locked(hw, HV_PM_CTRL,
+ &phy_reg);
+
+ phy_reg |= HV_PM_CTRL_K1_CLK_REQ;
+
+ hw->phy.ops.write_reg_locked(hw, HV_PM_CTRL,
+ phy_reg);
+ }
}
hw->phy.ops.release(hw);
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.h b/drivers/net/ethernet/intel/e1000e/ich8lan.h
index eb09c755fa17..1502895eb45d 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.h
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.h
@@ -210,7 +210,7 @@
/* PHY Power Management Control */
#define HV_PM_CTRL PHY_REG(770, 17)
-#define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA 0x100
+#define HV_PM_CTRL_K1_CLK_REQ 0x200
#define HV_PM_CTRL_K1_ENABLE 0x4000
#define I217_PLL_CLOCK_GATE_REG PHY_REG(772, 28)
--
2.21.0
^ permalink raw reply related
* [net-next 1/6] igc: Remove the polarity field from a PHY information structure
From: Jeff Kirsher @ 2019-07-23 17:36 UTC (permalink / raw)
To: davem; +Cc: Sasha Neftin, netdev, nhorman, sassmann, Aaron Brown,
Jeff Kirsher
In-Reply-To: <20190723173650.23276-1-jeffrey.t.kirsher@intel.com>
From: Sasha Neftin <sasha.neftin@intel.com>
Polarity and cable length fields is not applicable for the i225 device.
This patch comes to clean up PHY information structure.
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igc/igc_hw.h | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_hw.h b/drivers/net/ethernet/intel/igc/igc_hw.h
index 1039a224ac80..f689f0a02b5d 100644
--- a/drivers/net/ethernet/intel/igc/igc_hw.h
+++ b/drivers/net/ethernet/intel/igc/igc_hw.h
@@ -151,16 +151,10 @@ struct igc_phy_info {
u16 autoneg_advertised;
u16 autoneg_mask;
- u16 cable_length;
- u16 max_cable_length;
- u16 min_cable_length;
- u16 pair_length[4];
u8 mdix;
- bool disable_polarity_correction;
bool is_mdix;
- bool polarity_correction;
bool reset_disable;
bool speed_downgraded;
bool autoneg_wait_to_complete;
--
2.21.0
^ permalink raw reply related
* Re: [PATCH bpf-next 1/5] selftests/bpf: convert test_get_stack_raw_tp to perf_buffer API
From: Andrii Nakryiko @ 2019-07-23 17:38 UTC (permalink / raw)
To: Song Liu
Cc: Andrii Nakryiko, bpf, netdev@vger.kernel.org, Alexei Starovoitov,
daniel@iogearbox.net, Kernel Team
In-Reply-To: <EBDB05E7-C10F-479F-B2A7-62D59EE4887E@fb.com>
On Tue, Jul 23, 2019 at 2:25 AM Song Liu <songliubraving@fb.com> wrote:
>
>
>
> > On Jul 22, 2019, at 9:31 PM, Andrii Nakryiko <andriin@fb.com> wrote:
> >
> > Convert test_get_stack_raw_tp test to new perf_buffer API.
> >
> > Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> > ---
> > .../bpf/prog_tests/get_stack_raw_tp.c | 78 ++++++++++---------
> > .../bpf/progs/test_get_stack_rawtp.c | 2 +-
> > 2 files changed, 44 insertions(+), 36 deletions(-)
> >
> > diff --git a/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c b/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c
> > index c2a0a9d5591b..473889e1b219 100644
> > --- a/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c
> > @@ -1,8 +1,15 @@
> > // SPDX-License-Identifier: GPL-2.0
> > +#define _GNU_SOURCE
> > +#include <pthread.h>
> > +#include <sched.h>
> > +#include <sys/socket.h>
> > #include <test_progs.h>
> >
> > #define MAX_CNT_RAWTP 10ull
> > #define MAX_STACK_RAWTP 100
> > +
> > +static int duration = 0;
> > +
>
> Are we using "duration" at all?
Yes, unfortunately in test_progs CHECK macro expects "duration"
variable to be defined. It's very annoying and I'm going to work on
cleaning up and streamlining how we do selftests in bpf, so hopefully
we'll get rid of some of those "artifacts". But for now, yeah,
duration has to be defined somewhere.
>
> > struct get_stack_trace_t {
> > int pid;
> > int kern_stack_size;
> > @@ -13,7 +20,7 @@ struct get_stack_trace_t {
> > struct bpf_stack_build_id user_stack_buildid[MAX_STACK_RAWTP];
> > };
> >
> > -static int get_stack_print_output(void *data, int size)
> > +static void get_stack_print_output(void *ctx, int cpu, void *data, __u32 size)
> > {
> > bool good_kern_stack = false, good_user_stack = false;
> > const char *nonjit_func = "___bpf_prog_run";
> > @@ -65,75 +72,76 @@ static int get_stack_print_output(void *data, int size)
> > if (e->user_stack_size > 0 && e->user_stack_buildid_size > 0)
> > good_user_stack = true;
> > }
> > - if (!good_kern_stack || !good_user_stack)
> > - return LIBBPF_PERF_EVENT_ERROR;
> >
> > - if (cnt == MAX_CNT_RAWTP)
> > - return LIBBPF_PERF_EVENT_DONE;
> > -
> > - return LIBBPF_PERF_EVENT_CONT;
> > + if (!good_kern_stack)
> > + CHECK(!good_kern_stack, "bad_kern_stack", "bad\n");
>
> Two "bad" is a little weird. How about "kern stack", "bad"?
Heh :) I'll add something more human-readable, like "failed to get
kernel stack".
>
> > + if (!good_user_stack)
> > + CHECK(!good_user_stack, "bad_user_stack", "bad\n");
> > }
> >
> > void test_get_stack_raw_tp(void)
> > {
[...]
^ permalink raw reply
* Re: [patch iproute2 1/2] tc: action: fix crash caused by incorrect *argv check
From: Stephen Hemminger @ 2019-07-23 17:47 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, sthemmin, dsahern, alexanderk, mlxsw
In-Reply-To: <20190723112538.10977-1-jiri@resnulli.us>
On Tue, 23 Jul 2019 13:25:37 +0200
Jiri Pirko <jiri@resnulli.us> wrote:
> From: Jiri Pirko <jiri@mellanox.com>
>
> One cannot depend on *argv being null in case of no arg is left on the
> command line. For example in batch mode, this is not always true. Check
> argc instead to prevent crash.
>
> Reported-by: Alex Kushnarov <alexanderk@mellanox.com>
> Fixes: fd8b3d2c1b9b ("actions: Add support for user cookies")
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> ---
> tc/m_action.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tc/m_action.c b/tc/m_action.c
> index ab6bc0ad28ff..0f9c3a27795d 100644
> --- a/tc/m_action.c
> +++ b/tc/m_action.c
> @@ -222,7 +222,7 @@ done0:
> goto bad_val;
> }
>
> - if (*argv && strcmp(*argv, "cookie") == 0) {
> + if (argc && strcmp(*argv, "cookie") == 0) {
> size_t slen;
>
> NEXT_ARG();
Ok, but we should also fix batch mode to null last argv
^ permalink raw reply
* Re: [patch iproute2 1/2] tc: action: fix crash caused by incorrect *argv check
From: Stephen Hemminger @ 2019-07-23 17:54 UTC (permalink / raw)
To: Jiri Pirko; +Cc: netdev, sthemmin, dsahern, alexanderk, mlxsw
In-Reply-To: <20190723112538.10977-1-jiri@resnulli.us>
On Tue, 23 Jul 2019 13:25:37 +0200
Jiri Pirko <jiri@resnulli.us> wrote:
> From: Jiri Pirko <jiri@mellanox.com>
>
> One cannot depend on *argv being null in case of no arg is left on the
> command line. For example in batch mode, this is not always true. Check
> argc instead to prevent crash.
>
> Reported-by: Alex Kushnarov <alexanderk@mellanox.com>
> Fixes: fd8b3d2c1b9b ("actions: Add support for user cookies")
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Actually makeargs does NULL terminate the last arg so what input
to batchmode is breaking this?
^ permalink raw reply
* Re: [PATCH net-next] dpaa2-eth: Don't use netif_receive_skb_list for TCP frames
From: Saeed Mahameed @ 2019-07-23 17:54 UTC (permalink / raw)
To: ruxandra.radulescu@nxp.com, netdev@vger.kernel.org,
davem@davemloft.net
Cc: ioana.ciornei@nxp.com, vladimir.oltean@nxp.com
In-Reply-To: <1563902923-26178-1-git-send-email-ruxandra.radulescu@nxp.com>
On Tue, 2019-07-23 at 20:28 +0300, Ioana Radulescu wrote:
> Using Rx skb bulking for all frames may negatively impact the
> performance in some TCP termination scenarios, as it effectively
> bypasses GRO.
>
> Look at the hardware parse results of each ingress frame to see
> if a TCP header is present or not; for TCP frames fall back to
> the old implementation.
>
> Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
> drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 15 ++++++-
> drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h | 51
> ++++++++++++++++++++++++
> 2 files changed, 65 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> index 0acb115..412f87f 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> @@ -348,6 +348,16 @@ static u32 run_xdp(struct dpaa2_eth_priv *priv,
> return xdp_act;
> }
>
> +static bool frame_is_tcp(const struct dpaa2_fd *fd, struct dpaa2_fas
> *fas)
> +{
> + struct dpaa2_fapr *fapr = dpaa2_get_fapr(fas, false);
> +
> + if (!(dpaa2_fd_get_frc(fd) & DPAA2_FD_FRC_FAPRV))
> + return false;
> +
> + return !!(fapr->faf_hi & DPAA2_FAF_HI_TCP_PRESENT);
> +}
> +
> /* Main Rx frame processing routine */
> static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
> struct dpaa2_eth_channel *ch,
> @@ -435,7 +445,10 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv
> *priv,
> percpu_stats->rx_packets++;
> percpu_stats->rx_bytes += dpaa2_fd_get_len(fd);
>
> - list_add_tail(&skb->list, ch->rx_list);
> + if (frame_is_tcp(fd, fas))
> + napi_gro_receive(&ch->napi, skb);
> + else
> + list_add_tail(&skb->list, ch->rx_list);
>
Maybe it is better if we introduce napi_gro_receive_list()
and let napi decide when to do napi_gro_receive or list_add_tail, gro
stack already knows how to make the decision, (no need to have a
specialized hw parser for TCP frames) so all drivers will benefit from
this and we will not repeat the same thing you did here in all
drivers.
also in such case napi/napi_gro will maintain the temporary rx skb
list, which seems more natural than implementing it per driver.
On napi_gro_receive_list:
1) Try gro
2) if the result is GRO_NORMAL, then add the skb to list
3) on napi_complete or when list budget is consumed flush skb list by
calling netif_receive_skb_list.
> return;
>
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
> b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
> index 9af18c2..d723ae7 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
> @@ -155,6 +155,49 @@ struct dpaa2_fas {
> */
> #define DPAA2_TS_OFFSET 0x8
>
> +/* Frame annotation parse results */
> +struct dpaa2_fapr {
> + /* 64-bit word 1 */
> + __le32 faf_lo;
> + __le16 faf_ext;
> + __le16 nxt_hdr;
> + /* 64-bit word 2 */
> + __le64 faf_hi;
> + /* 64-bit word 3 */
> + u8 last_ethertype_offset;
> + u8 vlan_tci_offset_n;
> + u8 vlan_tci_offset_1;
> + u8 llc_snap_offset;
> + u8 eth_offset;
> + u8 ip1_pid_offset;
> + u8 shim_offset_2;
> + u8 shim_offset_1;
> + /* 64-bit word 4 */
> + u8 l5_offset;
> + u8 l4_offset;
> + u8 gre_offset;
> + u8 l3_offset_n;
> + u8 l3_offset_1;
> + u8 mpls_offset_n;
> + u8 mpls_offset_1;
> + u8 pppoe_offset;
> + /* 64-bit word 5 */
> + __le16 running_sum;
> + __le16 gross_running_sum;
> + u8 ipv6_frag_offset;
> + u8 nxt_hdr_offset;
> + u8 routing_hdr_offset_2;
> + u8 routing_hdr_offset_1;
> + /* 64-bit word 6 */
> + u8 reserved[5]; /* Soft-parsing context */
> + u8 ip_proto_offset_n;
> + u8 nxt_hdr_frag_offset;
> + u8 parse_error_code;
> +};
> +
> +#define DPAA2_FAPR_OFFSET 0x10
> +#define DPAA2_FAPR_SIZE sizeof((struct
> dpaa2_fapr))
> +
> /* Frame annotation egress action descriptor */
> #define DPAA2_FAEAD_OFFSET 0x58
>
> @@ -185,6 +228,11 @@ static inline __le64 *dpaa2_get_ts(void
> *buf_addr, bool swa)
> return dpaa2_get_hwa(buf_addr, swa) + DPAA2_TS_OFFSET;
> }
>
> +static inline struct dpaa2_fapr *dpaa2_get_fapr(void *buf_addr, bool
> swa)
> +{
> + return dpaa2_get_hwa(buf_addr, swa) + DPAA2_FAPR_OFFSET;
> +}
> +
> static inline struct dpaa2_faead *dpaa2_get_faead(void *buf_addr,
> bool swa)
> {
> return dpaa2_get_hwa(buf_addr, swa) + DPAA2_FAEAD_OFFSET;
> @@ -236,6 +284,9 @@ static inline struct dpaa2_faead
> *dpaa2_get_faead(void *buf_addr, bool swa)
> DPAA2_FAS_L3CE | \
> DPAA2_FAS_L4CE)
>
> +/* TCP indication in Frame Annotation Parse Results */
> +#define DPAA2_FAF_HI_TCP_PRESENT BIT(23)
> +
> /* Time in milliseconds between link state updates */
> #define DPAA2_ETH_LINK_STATE_REFRESH 1000
>
^ permalink raw reply
* Re: [PATCH net 2/2] lib/dim: Fix -Wunused-const-variable warnings
From: Leon Romanovsky @ 2019-07-23 18:01 UTC (permalink / raw)
To: Saeed Mahameed
Cc: cai@lca.pw, davem@davemloft.net, Jason Gunthorpe, Yamin Friedman,
linux-rdma@vger.kernel.org, Tal Gilboa, dledford@redhat.com,
netdev@vger.kernel.org
In-Reply-To: <63328bfc11778eb851773872aa30d15796a428d9.camel@mellanox.com>
On Tue, Jul 23, 2019 at 05:05:19PM +0000, Saeed Mahameed wrote:
> On Tue, 2019-07-23 at 10:22 +0300, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@mellanox.com>
> >
> > DIM causes to the following warnings during kernel compilation
> > which indicates that tx_profile and rx_profile are supposed to
> > be declared in *.c and not in *.h files.
> >
> > In file included from ./include/rdma/ib_verbs.h:64,
> > from ./include/linux/mlx5/device.h:37,
> > from ./include/linux/mlx5/driver.h:51,
> > from ./include/linux/mlx5/vport.h:36,
> > from drivers/infiniband/hw/mlx5/ib_virt.c:34:
> > ./include/linux/dim.h:326:1: warning: _tx_profile_ defined but not
> > used [-Wunused-const-variable=]
> > 326 |
> > tx_profile[DIM_CQ_PERIOD_NUM_MODES][NET_DIM_PARAMS_NUM_PROFILES] = {
> > | ^~~~~~~~~~
> > ./include/linux/dim.h:320:1: warning: _rx_profile_ defined but not
> > used [-Wunused-const-variable=]
> > 320 |
> > rx_profile[DIM_CQ_PERIOD_NUM_MODES][NET_DIM_PARAMS_NUM_PROFILES] = {
> > | ^~~~~~~~~~
> >
> > Fixes: 4f75da3666c0 ("linux/dim: Move implementation to .c files")
> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
>
> A similar patch was already submitted to linux-kernel ML,
> "[PATCH] linux/dim: fix -Wunused-const-variable warnings"
Are you talking about this merged patch? If yes, it was incomplete.
ommit bedc0fd0f9b517698193d644f914b33951856fd2
Author: Qian Cai <cai@lca.pw>
Date: Thu Jul 11 09:55:56 2019 -0400
RDMA/core: Fix -Wunused-const-variable warnings
>
> I basically asked Qian to do the same as you did in this patch.
> Anyway i guess it is ok to drop that patch and keep this one.
>
> Acked-by: Saeed Mahameed <saeedm@mellanox.com>
>
> > ---
> > include/linux/dim.h | 56 -----------------------------------------
> > ----
> > lib/dim/net_dim.c | 56
> > +++++++++++++++++++++++++++++++++++++++++++++
> > 2 files changed, 56 insertions(+), 56 deletions(-)
> >
> > diff --git a/include/linux/dim.h b/include/linux/dim.h
> > index d3a0fbfff2bb..9fa4b3f88c39 100644
> > --- a/include/linux/dim.h
> > +++ b/include/linux/dim.h
> > @@ -272,62 +272,6 @@ dim_update_sample_with_comps(u16 event_ctr, u64
> > packets, u64 bytes, u64 comps,
> >
> > /* Net DIM */
> >
> > -/*
> > - * Net DIM profiles:
> > - * There are different set of profiles for each CQ period
> > mode.
> > - * There are different set of profiles for RX/TX CQs.
> > - * Each profile size must be of NET_DIM_PARAMS_NUM_PROFILES
> > - */
> > -#define NET_DIM_PARAMS_NUM_PROFILES 5
> > -#define NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE 256
> > -#define NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE 128
> > -#define NET_DIM_DEF_PROFILE_CQE 1
> > -#define NET_DIM_DEF_PROFILE_EQE 1
> > -
> > -#define NET_DIM_RX_EQE_PROFILES { \
> > - {1, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > - {8, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > - {64, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > - {128, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > - {256, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > -}
> > -
> > -#define NET_DIM_RX_CQE_PROFILES { \
> > - {2, 256}, \
> > - {8, 128}, \
> > - {16, 64}, \
> > - {32, 64}, \
> > - {64, 64} \
> > -}
> > -
> > -#define NET_DIM_TX_EQE_PROFILES { \
> > - {1, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > - {8, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > - {32, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > - {64, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > - {128, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE} \
> > -}
> > -
> > -#define NET_DIM_TX_CQE_PROFILES { \
> > - {5, 128}, \
> > - {8, 64}, \
> > - {16, 32}, \
> > - {32, 32}, \
> > - {64, 32} \
> > -}
> > -
> > -static const struct dim_cq_moder
> > -rx_profile[DIM_CQ_PERIOD_NUM_MODES][NET_DIM_PARAMS_NUM_PROFILES] = {
> > - NET_DIM_RX_EQE_PROFILES,
> > - NET_DIM_RX_CQE_PROFILES,
> > -};
> > -
> > -static const struct dim_cq_moder
> > -tx_profile[DIM_CQ_PERIOD_NUM_MODES][NET_DIM_PARAMS_NUM_PROFILES] = {
> > - NET_DIM_TX_EQE_PROFILES,
> > - NET_DIM_TX_CQE_PROFILES,
> > -};
> > -
> > /**
> > * net_dim_get_rx_moderation - provide a CQ moderation object for
> > the given RX profile
> > * @cq_period_mode: CQ period mode
> > diff --git a/lib/dim/net_dim.c b/lib/dim/net_dim.c
> > index 5bcc902c5388..a4db51c21266 100644
> > --- a/lib/dim/net_dim.c
> > +++ b/lib/dim/net_dim.c
> > @@ -5,6 +5,62 @@
> >
> > #include <linux/dim.h>
> >
> > +/*
> > + * Net DIM profiles:
> > + * There are different set of profiles for each CQ period
> > mode.
> > + * There are different set of profiles for RX/TX CQs.
> > + * Each profile size must be of NET_DIM_PARAMS_NUM_PROFILES
> > + */
> > +#define NET_DIM_PARAMS_NUM_PROFILES 5
> > +#define NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE 256
> > +#define NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE 128
> > +#define NET_DIM_DEF_PROFILE_CQE 1
> > +#define NET_DIM_DEF_PROFILE_EQE 1
> > +
> > +#define NET_DIM_RX_EQE_PROFILES { \
> > + {1, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > + {8, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > + {64, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > + {128, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > + {256, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > +}
> > +
> > +#define NET_DIM_RX_CQE_PROFILES { \
> > + {2, 256}, \
> > + {8, 128}, \
> > + {16, 64}, \
> > + {32, 64}, \
> > + {64, 64} \
> > +}
> > +
> > +#define NET_DIM_TX_EQE_PROFILES { \
> > + {1, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > + {8, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > + {32, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > + {64, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \
> > + {128, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE} \
> > +}
> > +
> > +#define NET_DIM_TX_CQE_PROFILES { \
> > + {5, 128}, \
> > + {8, 64}, \
> > + {16, 32}, \
> > + {32, 32}, \
> > + {64, 32} \
> > +}
> > +
> > +static const struct dim_cq_moder
> > +rx_profile[DIM_CQ_PERIOD_NUM_MODES][NET_DIM_PARAMS_NUM_PROFILES] = {
> > + NET_DIM_RX_EQE_PROFILES,
> > + NET_DIM_RX_CQE_PROFILES,
> > +};
> > +
> > +static const struct dim_cq_moder
> > +tx_profile[DIM_CQ_PERIOD_NUM_MODES][NET_DIM_PARAMS_NUM_PROFILES] = {
> > + NET_DIM_TX_EQE_PROFILES,
> > + NET_DIM_TX_CQE_PROFILES,
> > +};
> > +
> > struct dim_cq_moder
> > net_dim_get_rx_moderation(u8 cq_period_mode, int ix)
> > {
> > --
> > 2.20.1
> >
^ permalink raw reply
* Re: [PATCH net-next v2 3/3] netlink: add validation of NLA_F_NESTED flag
From: Stephen Hemminger @ 2019-07-23 18:02 UTC (permalink / raw)
To: Michal Kubecek
Cc: David S. Miller, netdev, Johannes Berg, David Ahern, linux-kernel
In-Reply-To: <6b6ead21c5d8436470b82ab40355f6bd7dbbf14b.1556806084.git.mkubecek@suse.cz>
On Thu, 2 May 2019 16:15:10 +0200 (CEST)
Michal Kubecek <mkubecek@suse.cz> wrote:
> Add new validation flag NL_VALIDATE_NESTED which adds three consistency
> checks of NLA_F_NESTED_FLAG:
>
> - the flag is set on attributes with NLA_NESTED{,_ARRAY} policy
> - the flag is not set on attributes with other policies except NLA_UNSPEC
> - the flag is set on attribute passed to nla_parse_nested()
>
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
>
> v2: change error messages to mention NLA_F_NESTED explicitly
There are some cases where netlink related to IPv4 does not send nested
flag. You risk breaking older iproute2 and other tools being used on newer
kernel. I.e this patch may break binary compatibility. Have you tried running
with this on a very old distro (like Redhat Linux 9)?
^ permalink raw reply
* Re: [PATCH net 1/2] linux/dim: Fix overflow in dim calculation
From: Leon Romanovsky @ 2019-07-23 18:04 UTC (permalink / raw)
To: Saeed Mahameed
Cc: davem@davemloft.net, Jason Gunthorpe, Yamin Friedman,
linux-rdma@vger.kernel.org, Tal Gilboa, dledford@redhat.com,
netdev@vger.kernel.org
In-Reply-To: <4f4bc2958dc1512087f19db64e8e43f1247cf2dd.camel@mellanox.com>
On Tue, Jul 23, 2019 at 05:22:43PM +0000, Saeed Mahameed wrote:
> On Tue, 2019-07-23 at 10:22 +0300, Leon Romanovsky wrote:
> > From: Yamin Friedman <yaminf@mellanox.com>
> >
> > While using net_dim, a dim_sample was used without ever initializing
> > the
> > comps value. Added use of DIV_ROUND_DOWN_ULL() to prevent potential
> > overflow, it should not be a problem to save the final result in an
> > int
> > because after the division by epms the value should not be larger
> > than a
> > few thousand.
> >
> > [ 1040.127124] UBSAN: Undefined behaviour in lib/dim/dim.c:78:23
> > [ 1040.130118] signed integer overflow:
> > [ 1040.131643] 134718714 * 100 cannot be represented in type 'int'
> >
> > Fixes: 398c2b05bbee ("linux/dim: Add completions count to
> > dim_sample")
> > Signed-off-by: Yamin Friedman <yaminf@mellanox.com>
> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> > ---
> > drivers/net/ethernet/broadcom/bcmsysport.c | 2 +-
> > drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +-
> > drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +-
> > drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c | 4 ++--
> > lib/dim/dim.c | 4 ++--
> > 5 files changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c
> > b/drivers/net/ethernet/broadcom/bcmsysport.c
> > index b9c5cea8db16..9483553ce444 100644
> > --- a/drivers/net/ethernet/broadcom/bcmsysport.c
> > +++ b/drivers/net/ethernet/broadcom/bcmsysport.c
> > @@ -992,7 +992,7 @@ static int bcm_sysport_poll(struct napi_struct
> > *napi, int budget)
> > {
> > struct bcm_sysport_priv *priv =
> > container_of(napi, struct bcm_sysport_priv, napi);
> > - struct dim_sample dim_sample;
> > + struct dim_sample dim_sample = {};
>
> net_dim implementation doesn't care about sample->comp_ctr, so this is
> unnecessary for the sake of fixing the rdma overflow issue, but it
> doens't hurt anyone to have this change in this patch.
Yes, this is why we decided to change all drivers and not mlx5 only.
Thanks
^ permalink raw reply
* Re: [PATCH 3/3] net/xdp: convert put_page() to put_user_page*()
From: Ira Weiny @ 2019-07-23 18:06 UTC (permalink / raw)
To: John Hubbard
Cc: john.hubbard, Andrew Morton, Alexander Viro,
Björn Töpel, Boaz Harrosh, Christoph Hellwig,
Daniel Vetter, Dan Williams, Dave Chinner, David Airlie,
David S . Miller, Ilya Dryomov, Jan Kara, Jason Gunthorpe,
Jens Axboe, Jérôme Glisse, Johannes Thumshirn,
Magnus Karlsson, Matthew Wilcox, Miklos Szeredi, Ming Lei,
Sage Weil, Santosh Shilimkar, Yan Zheng, netdev, dri-devel,
linux-mm, linux-rdma, bpf, LKML
In-Reply-To: <a4e9b293-11f8-6b3c-cf4d-308e3b32df34@nvidia.com>
On Mon, Jul 22, 2019 at 09:41:34PM -0700, John Hubbard wrote:
> On 7/22/19 5:25 PM, Ira Weiny wrote:
> > On Mon, Jul 22, 2019 at 03:34:15PM -0700, john.hubbard@gmail.com wrote:
> > > From: John Hubbard <jhubbard@nvidia.com>
> > >
> > > For pages that were retained via get_user_pages*(), release those pages
> > > via the new put_user_page*() routines, instead of via put_page() or
> > > release_pages().
> > >
> > > This is part a tree-wide conversion, as described in commit fc1d8e7cca2d
> > > ("mm: introduce put_user_page*(), placeholder versions").
> > >
> > > Cc: Björn Töpel <bjorn.topel@intel.com>
> > > Cc: Magnus Karlsson <magnus.karlsson@intel.com>
> > > Cc: David S. Miller <davem@davemloft.net>
> > > Cc: netdev@vger.kernel.org
> > > Signed-off-by: John Hubbard <jhubbard@nvidia.com>
> > > ---
> > > net/xdp/xdp_umem.c | 9 +--------
> > > 1 file changed, 1 insertion(+), 8 deletions(-)
> > >
> > > diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c
> > > index 83de74ca729a..0325a17915de 100644
> > > --- a/net/xdp/xdp_umem.c
> > > +++ b/net/xdp/xdp_umem.c
> > > @@ -166,14 +166,7 @@ void xdp_umem_clear_dev(struct xdp_umem *umem)
> > > static void xdp_umem_unpin_pages(struct xdp_umem *umem)
> > > {
> > > - unsigned int i;
> > > -
> > > - for (i = 0; i < umem->npgs; i++) {
> > > - struct page *page = umem->pgs[i];
> > > -
> > > - set_page_dirty_lock(page);
> > > - put_page(page);
> > > - }
> > > + put_user_pages_dirty_lock(umem->pgs, umem->npgs);
> >
> > What is the difference between this and
> >
> > __put_user_pages(umem->pgs, umem->npgs, PUP_FLAGS_DIRTY_LOCK);
> >
> > ?
>
> No difference.
>
> >
> > I'm a bit concerned with adding another form of the same interface. We should
> > either have 1 call with flags (enum in this case) or multiple calls. Given the
> > previous discussion lets move in the direction of having the enum but don't
> > introduce another caller of the "old" interface.
>
> I disagree that this is a "problem". There is no maintenance pitfall here; there
> are merely two ways to call the put_user_page*() API. Both are correct, and
> neither one will get you into trouble.
>
> Not only that, but there is ample precedent for this approach in other
> kernel APIs.
>
> >
> > So I think on this patch NAK from me.
> >
> > I also don't like having a __* call in the exported interface but there is a
> > __get_user_pages_fast() call so I guess there is precedent. :-/
> >
>
> I thought about this carefully, and looked at other APIs. And I noticed that
> things like __get_user_pages*() are how it's often done:
>
> * The leading underscores are often used for the more elaborate form of the
> call (as oppposed to decorating the core function name with "_flags", for
> example).
>
> * There are often calls in which you can either call the simpler form, or the
> form with flags and additional options, and yes, you'll get the same result.
>
> Obviously, this stuff is all subject to a certain amount of opinion, but I
> think I'm on really solid ground as far as precedent goes. So I'm pushing
> back on the NAK... :)
Fair enough... However, we have discussed in the past how GUP can be a
confusing interface to use.
So I'd like to see it be more directed. Only using the __put_user_pages()
version allows us to ID callers easier through a grep of PUP_FLAGS_DIRTY_LOCK
in addition to directing users to use that interface rather than having to read
the GUP code to figure out that the 2 calls above are equal. It is not a huge
deal but...
Ira
>
> thanks,
> --
> John Hubbard
> NVIDIA
>
^ permalink raw reply
* Re: [PATCH] net: broadcom: Use dev_get_drvdata
From: Saeed Mahameed @ 2019-07-23 18:09 UTC (permalink / raw)
To: hslester96@gmail.com
Cc: davem@davemloft.net, siva.kallam@broadcom.com,
prashant@broadcom.com, michael.chan@broadcom.com,
linux-kernel@vger.kernel.org, GR-Linux-NIC-Dev@marvell.com,
netdev@vger.kernel.org, rmody@marvell.com
In-Reply-To: <20190723131929.31987-1-hslester96@gmail.com>
On Tue, 2019-07-23 at 21:19 +0800, Chuhong Yuan wrote:
> Instead of using to_pci_dev + pci_get_drvdata,
> use dev_get_drvdata to make code simpler.
>
Hi Chuhong, i see that you have generated many stand alone patches that
belong to the same series/patchset.
A better way to do this is to generate one patchset that includes all
the patches and attach a cover letter for it:
$ git format-patch -s --cover-letter --subject-prefix="PATCH net-next"
-o ./patchset/ ${BASE_COMMIT}..${HEAD_COMMIT}
and resubmit with the edited cover-letter.
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
> drivers/net/ethernet/broadcom/bnx2.c | 6 ++----
> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 ++----
> drivers/net/ethernet/broadcom/tg3.c | 6 ++----
> 3 files changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnx2.c
> b/drivers/net/ethernet/broadcom/bnx2.c
> index dfdd14eadd57..fbc196b480b6 100644
> --- a/drivers/net/ethernet/broadcom/bnx2.c
> +++ b/drivers/net/ethernet/broadcom/bnx2.c
> @@ -8673,8 +8673,7 @@ bnx2_remove_one(struct pci_dev *pdev)
> static int
> bnx2_suspend(struct device *device)
> {
> - struct pci_dev *pdev = to_pci_dev(device);
> - struct net_device *dev = pci_get_drvdata(pdev);
> + struct net_device *dev = dev_get_drvdata(device);
> struct bnx2 *bp = netdev_priv(dev);
>
> if (netif_running(dev)) {
> @@ -8693,8 +8692,7 @@ bnx2_suspend(struct device *device)
> static int
> bnx2_resume(struct device *device)
> {
> - struct pci_dev *pdev = to_pci_dev(device);
> - struct net_device *dev = pci_get_drvdata(pdev);
> + struct net_device *dev = dev_get_drvdata(device);
> struct bnx2 *bp = netdev_priv(dev);
>
> if (!netif_running(dev))
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 7134d2c3eb1c..1aad59b8a413 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -10920,8 +10920,7 @@ static void bnxt_shutdown(struct pci_dev
> *pdev)
> #ifdef CONFIG_PM_SLEEP
> static int bnxt_suspend(struct device *device)
> {
> - struct pci_dev *pdev = to_pci_dev(device);
> - struct net_device *dev = pci_get_drvdata(pdev);
> + struct net_device *dev = dev_get_drvdata(device);
> struct bnxt *bp = netdev_priv(dev);
> int rc = 0;
>
> @@ -10937,8 +10936,7 @@ static int bnxt_suspend(struct device
> *device)
>
> static int bnxt_resume(struct device *device)
> {
> - struct pci_dev *pdev = to_pci_dev(device);
> - struct net_device *dev = pci_get_drvdata(pdev);
> + struct net_device *dev = dev_get_drvdata(device);
> struct bnxt *bp = netdev_priv(dev);
> int rc = 0;
>
> diff --git a/drivers/net/ethernet/broadcom/tg3.c
> b/drivers/net/ethernet/broadcom/tg3.c
> index 4c404d2213f9..77f3511b97de 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -18041,8 +18041,7 @@ static void tg3_remove_one(struct pci_dev
> *pdev)
> #ifdef CONFIG_PM_SLEEP
> static int tg3_suspend(struct device *device)
> {
> - struct pci_dev *pdev = to_pci_dev(device);
> - struct net_device *dev = pci_get_drvdata(pdev);
> + struct net_device *dev = dev_get_drvdata(device);
> struct tg3 *tp = netdev_priv(dev);
> int err = 0;
>
> @@ -18098,8 +18097,7 @@ static int tg3_suspend(struct device *device)
>
> static int tg3_resume(struct device *device)
> {
> - struct pci_dev *pdev = to_pci_dev(device);
> - struct net_device *dev = pci_get_drvdata(pdev);
> + struct net_device *dev = dev_get_drvdata(device);
> struct tg3 *tp = netdev_priv(dev);
> int err = 0;
>
^ permalink raw reply
* Re: [PATCH net-next v2 3/3] netlink: add validation of NLA_F_NESTED flag
From: Johannes Berg @ 2019-07-23 18:17 UTC (permalink / raw)
To: Stephen Hemminger, Michal Kubecek
Cc: David S. Miller, netdev, David Ahern, linux-kernel
In-Reply-To: <20190723110206.4cb1f6b1@hermes.lan>
On Tue, 2019-07-23 at 11:02 -0700, Stephen Hemminger wrote:
>
> There are some cases where netlink related to IPv4 does not send nested
> flag. You risk breaking older iproute2 and other tools being used on newer
> kernel. I.e this patch may break binary compatibility. Have you tried running
> with this on a very old distro (like Redhat Linux 9)?
There are *tons* of places where this (and other things) wasn't done
right, but the validation is only added for
* all attributes on _new operations_ (that old userspace couldn't have
been using since they're introduced after this patch)
* _new attributes_ (dito, if the policy 'strict start' is filled)
johannes
^ permalink raw reply
* Re: [PATCH mlx5-next] net/mlx5: Fix modify_cq_in alignment
From: David Miller @ 2019-07-23 18:28 UTC (permalink / raw)
To: leon; +Cc: dledford, jgg, edwards, linux-rdma, yishaih, saeedm, netdev,
leonro
In-Reply-To: <20190723071255.6588-1-leon@kernel.org>
From: Leon Romanovsky <leon@kernel.org>
Date: Tue, 23 Jul 2019 10:12:55 +0300
> From: Edward Srouji <edwards@mellanox.com>
>
> Fix modify_cq_in alignment to match the device specification.
> After this fix the 'cq_umem_valid' field will be in the right offset.
>
> Cc: <stable@vger.kernel.org> # 4.19
> Fixes: bd37197554eb ("net/mlx5: Update mlx5_ifc with DEVX UID bits")
> Signed-off-by: Edward Srouji <edwards@mellanox.com>
> Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Very confusing submission on many levels.
Coming from a Mellanox developer using a kernel.org email address.
Targetting the mlx5-next tree, yet CC:'ing stable.
A networking change, for which stable submissions are handled by me by
hand and not via CC:'ing stable.
^ permalink raw reply
* Re: [PATCH net-next] qlge: Move drivers/net/ethernet/qlogic/qlge/ to drivers/staging/qlge/
From: David Miller @ 2019-07-23 18:29 UTC (permalink / raw)
To: bpoirier; +Cc: gregkh, manishc, GR-Linux-NIC-Dev, netdev
In-Reply-To: <20190723061413.10342-1-bpoirier@suse.com>
From: Benjamin Poirier <bpoirier@suse.com>
Date: Tue, 23 Jul 2019 15:14:13 +0900
> The hardware has been declared EOL by the vendor more than 5 years ago.
> What's more relevant to the Linux kernel is that the quality of this driver
> is not on par with many other mainline drivers.
>
> Cc: Manish Chopra <manishc@marvell.com>
> Message-id: <20190617074858.32467-1-bpoirier@suse.com>
> Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Applied, thank you.
^ permalink raw reply
* Re: [net-next:master 13/14] drivers/net/ethernet/faraday/ftgmac100.c:777:13: error: 'skb_frag_t {aka struct bio_vec}' has no member named 'size'
From: David Miller @ 2019-07-23 18:46 UTC (permalink / raw)
To: opensource; +Cc: willy, kbuild-all, netdev
In-Reply-To: <20190723085844.Horde.ehPsGFdWI2BCQdl_UyzJxlS@www.vdorst.com>
Fixes as follows:
====================
From 084323f62b0b976c9fd931d86c5d2553af5eb9f7 Mon Sep 17 00:00:00 2001
From: "David S. Miller" <davem@davemloft.net>
Date: Tue, 23 Jul 2019 11:45:44 -0700
Subject: [PATCH] ftgmac100: Fix build.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
drivers/net/ethernet/faraday/ftgmac100.c:777:13: error: 'skb_frag_t {aka struct bio_vec}' has no member named 'size'
Fallout from the skb_frag_t conversion to bio_vec, simply
use skb_frag_size().
Fixes: b8b576a16f79 ("net: Rename skb_frag_t size to bv_len")
Reported-by: René van Dorst <opensource@vdorst.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/ethernet/faraday/ftgmac100.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 030fed65393e..dc8d3e726e75 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -774,7 +774,7 @@ static netdev_tx_t ftgmac100_hard_start_xmit(struct sk_buff *skb,
for (i = 0; i < nfrags; i++) {
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
- len = frag->size;
+ len = skb_frag_size(frag);
/* Map it */
map = skb_frag_dma_map(priv->dev, frag, 0, len,
--
2.20.1
^ permalink raw reply related
* Re: [PATCH] net-ipv6-ndisc: add support for RFC7710 RA Captive Portal Identifier
From: David Miller @ 2019-07-23 18:46 UTC (permalink / raw)
To: zenczykowski; +Cc: netdev, lorenzo, reminv, raorn
In-Reply-To: <CANP3RGfG0gcA1a8n550+X1+43=6tpzdv4YG+FX6GQanfWKG7QQ@mail.gmail.com>
From: Maciej Żenczykowski <zenczykowski@gmail.com>
Date: Tue, 23 Jul 2019 17:52:17 +0800
>> Applied to net-next
>
> Any chance we could get this into LTS releases?
It's a new feature, not a bug fix. So no.
^ permalink raw reply
* Re: [net-next:master 13/14] drivers/net/ethernet/faraday/ftgmac100.c:777:13: error: 'skb_frag_t {aka struct bio_vec}' has no member named 'size'
From: David Miller @ 2019-07-23 18:50 UTC (permalink / raw)
To: willy; +Cc: opensource, kbuild-all, netdev
In-Reply-To: <20190723115238.GJ363@bombadil.infradead.org>
From: Matthew Wilcox <willy@infradead.org>
Date: Tue, 23 Jul 2019 04:52:38 -0700
> On Tue, Jul 23, 2019 at 08:58:44AM +0000, René van Dorst wrote:
>> Hi Matthew,
>>
>> I see the same issue for the mediatek/mtk_eth_soc driver.
>
> Thanks, Rene. The root problem for both of these drivers is that neither
> are built on x86 with CONFIG_COMPILE_TEST. Is it possible to fix this?
>
> An untested patch to fix both of these problems (and two more that I
> spotted):
I took care of the ftgmac100 case in the net-next tree, sorry I didn't see
this first...
^ permalink raw reply
* Re: [PATCH net-next 3/3] net: stmmac: Introducing support for Page Pool
From: David Miller @ 2019-07-23 18:51 UTC (permalink / raw)
To: jonathanh
Cc: robin.murphy, Jose.Abreu, lists, ilias.apalodimas, Joao.Pinto,
alexandre.torgue, maxime.ripard, netdev, linux-kernel,
linux-stm32, wens, mcoquelin.stm32, linux-tegra, peppe.cavallaro,
linux-arm-kernel
In-Reply-To: <8756d681-e167-fe4a-c6f0-47ae2dcbb100@nvidia.com>
From: Jon Hunter <jonathanh@nvidia.com>
Date: Tue, 23 Jul 2019 13:09:00 +0100
> Setting "iommu.passthrough=1" works for me. However, I am not sure where
> to go from here, so any ideas you have would be great.
Then definitely we are accessing outside of a valid IOMMU mapping due
to the page pool support changes.
Such a problem should be spotted with swiommu enabled with debugging.
^ permalink raw reply
* [PATCH v2] drivers: net: xgene: Remove acpi_has_method() calls
From: Kelsey Skunberg @ 2019-07-23 18:58 UTC (permalink / raw)
To: iyappan, keyur, quan, davem, netdev, linux-kernel, bjorn
Cc: skhan, linux-kernel-mentees, skunberg.kelsey
In-Reply-To: <20190722030401.69563-1-skunberg.kelsey@gmail.com>
acpi_evaluate_object will already return an error if the needed method
does not exist. Remove unnecessary acpi_has_method() calls and check the
returned acpi_status for failure instead.
Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>
---
Changes in v2:
- Fixed white space warnings and errors
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | 9 ++++-----
drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c | 10 +++++-----
drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c | 9 ++++-----
3 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
index 61a465097cb8..79924efd4ab7 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
@@ -694,6 +694,7 @@ bool xgene_ring_mgr_init(struct xgene_enet_pdata *p)
static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
{
struct device *dev = &pdata->pdev->dev;
+ acpi_status status;
if (!xgene_ring_mgr_init(pdata))
return -ENODEV;
@@ -712,11 +713,9 @@ static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
udelay(5);
} else {
#ifdef CONFIG_ACPI
- if (acpi_has_method(ACPI_HANDLE(&pdata->pdev->dev), "_RST")) {
- acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
- "_RST", NULL, NULL);
- } else if (acpi_has_method(ACPI_HANDLE(&pdata->pdev->dev),
- "_INI")) {
+ status = acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
+ "_RST", NULL, NULL);
+ if (ACPI_FAILURE(status)) {
acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
"_INI", NULL, NULL);
}
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c b/drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c
index 6453fc2ebb1f..5d637b46b2bf 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c
@@ -437,6 +437,7 @@ static void xgene_sgmac_tx_disable(struct xgene_enet_pdata *p)
static int xgene_enet_reset(struct xgene_enet_pdata *p)
{
struct device *dev = &p->pdev->dev;
+ acpi_status status;
if (!xgene_ring_mgr_init(p))
return -ENODEV;
@@ -460,14 +461,13 @@ static int xgene_enet_reset(struct xgene_enet_pdata *p)
}
} else {
#ifdef CONFIG_ACPI
- if (acpi_has_method(ACPI_HANDLE(&p->pdev->dev), "_RST"))
- acpi_evaluate_object(ACPI_HANDLE(&p->pdev->dev),
- "_RST", NULL, NULL);
- else if (acpi_has_method(ACPI_HANDLE(&p->pdev->dev), "_INI"))
+ status = acpi_evaluate_object(ACPI_HANDLE(&p->pdev->dev),
+ "_RST", NULL, NULL);
+ if (ACPI_FAILURE(status)) {
acpi_evaluate_object(ACPI_HANDLE(&p->pdev->dev),
"_INI", NULL, NULL);
+ }
#endif
- }
if (!p->port_id) {
xgene_enet_ecc_init(p);
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c b/drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c
index 133eb91c542e..78584089d76d 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c
@@ -380,6 +380,7 @@ static void xgene_xgmac_tx_disable(struct xgene_enet_pdata *pdata)
static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
{
struct device *dev = &pdata->pdev->dev;
+ acpi_status status;
if (!xgene_ring_mgr_init(pdata))
return -ENODEV;
@@ -393,11 +394,9 @@ static int xgene_enet_reset(struct xgene_enet_pdata *pdata)
udelay(5);
} else {
#ifdef CONFIG_ACPI
- if (acpi_has_method(ACPI_HANDLE(&pdata->pdev->dev), "_RST")) {
- acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
- "_RST", NULL, NULL);
- } else if (acpi_has_method(ACPI_HANDLE(&pdata->pdev->dev),
- "_INI")) {
+ status = acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
+ "_RST", NULL, NULL);
+ if (ACPI_FAILURE(status)) {
acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
"_INI", NULL, NULL);
}
--
2.20.1
^ permalink raw reply related
* [PATCH net-next 1/1] tc-testing: added tdc tests for [b|p]fifo qdisc
From: Roman Mashak @ 2019-07-23 19:01 UTC (permalink / raw)
To: davem; +Cc: netdev, kernel, jhs, xiyou.wangcong, jiri, Roman Mashak
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
---
.../selftests/tc-testing/tc-tests/qdiscs/fifo.json | 304 +++++++++++++++++++++
1 file changed, 304 insertions(+)
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/fifo.json
diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/fifo.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/fifo.json
new file mode 100644
index 000000000000..9de61fa10878
--- /dev/null
+++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/fifo.json
@@ -0,0 +1,304 @@
+[
+ {
+ "id": "a519",
+ "name": "Add bfifo qdisc with system default parameters on egress",
+ "__comment": "When omitted, queue size in bfifo is calculated as: txqueuelen * (MTU + LinkLayerHdrSize), where LinkLayerHdrSize=14 for Ethernet",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link add dev $DEV1 type dummy || /bin/true"
+ ],
+ "cmdUnderTest": "$TC qdisc add dev $DEV1 handle 1: root bfifo",
+ "expExitCode": "0",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc bfifo 1: root.*limit [0-9]+b",
+ "matchCount": "1",
+ "teardown": [
+ "$TC qdisc del dev $DEV1 handle 1: root bfifo",
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ },
+ {
+ "id": "585c",
+ "name": "Add pfifo qdisc with system default parameters on egress",
+ "__comment": "When omitted, queue size in pfifo is defaulted to the interface's txqueuelen value.",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link add dev $DEV1 type dummy || /bin/true"
+ ],
+ "cmdUnderTest": "$TC qdisc add dev $DEV1 handle 1: root pfifo",
+ "expExitCode": "0",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc pfifo 1: root.*limit [0-9]+p",
+ "matchCount": "1",
+ "teardown": [
+ "$TC qdisc del dev $DEV1 handle 1: root pfifo",
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ },
+ {
+ "id": "a86e",
+ "name": "Add bfifo qdisc with system default parameters on egress with handle of maximum value",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link add dev $DEV1 type dummy || /bin/true"
+ ],
+ "cmdUnderTest": "$TC qdisc add dev $DEV1 root handle ffff: bfifo",
+ "expExitCode": "0",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc bfifo ffff: root.*limit [0-9]+b",
+ "matchCount": "1",
+ "teardown": [
+ "$TC qdisc del dev $DEV1 handle ffff: root bfifo",
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ },
+ {
+ "id": "9ac8",
+ "name": "Add bfifo qdisc on egress with queue size of 3000 bytes",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link add dev $DEV1 type dummy || /bin/true"
+ ],
+ "cmdUnderTest": "$TC qdisc add dev $DEV1 handle 1: root bfifo limit 3000b",
+ "expExitCode": "0",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc bfifo 1: root.*limit 3000b",
+ "matchCount": "1",
+ "teardown": [
+ "$TC qdisc del dev $DEV1 handle 1: root bfifo",
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ },
+ {
+ "id": "f4e6",
+ "name": "Add pfifo qdisc on egress with queue size of 3000 packets",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link add dev $DEV1 txqueuelen 3000 type dummy || /bin/true"
+ ],
+ "cmdUnderTest": "$TC qdisc add dev $DEV1 handle 1: root pfifo limit 3000",
+ "expExitCode": "0",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc pfifo 1: root.*limit 3000p",
+ "matchCount": "1",
+ "teardown": [
+ "$TC qdisc del dev $DEV1 handle 1: root pfifo",
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ },
+ {
+ "id": "b1b1",
+ "name": "Add bfifo qdisc with system default parameters on egress with invalid handle exceeding maximum value",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link add dev $DEV1 type dummy || /bin/true"
+ ],
+ "cmdUnderTest": "$TC qdisc add dev $DEV1 root handle 10000: bfifo",
+ "expExitCode": "255",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc bfifo 10000: root.*limit [0-9]+b",
+ "matchCount": "0",
+ "teardown": [
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ },
+ {
+ "id": "8d5e",
+ "name": "Add bfifo qdisc on egress with unsupported argument",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link add dev $DEV1 type dummy || /bin/true"
+ ],
+ "cmdUnderTest": "$TC qdisc add dev $DEV1 handle 1: root bfifo foorbar",
+ "expExitCode": "1",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc bfifo 1: root",
+ "matchCount": "0",
+ "teardown": [
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ },
+ {
+ "id": "7787",
+ "name": "Add pfifo qdisc on egress with unsupported argument",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link add dev $DEV1 type dummy || /bin/true"
+ ],
+ "cmdUnderTest": "$TC qdisc add dev $DEV1 handle 1: root pfifo foorbar",
+ "expExitCode": "1",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc pfifo 1: root",
+ "matchCount": "0",
+ "teardown": [
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ },
+ {
+ "id": "c4b6",
+ "name": "Replace bfifo qdisc on egress with new queue size",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link del dev $DEV1 type dummy || /bin/true",
+ "$IP link add dev $DEV1 txqueuelen 1000 type dummy",
+ "$TC qdisc add dev $DEV1 handle 1: root bfifo"
+ ],
+ "cmdUnderTest": "$TC qdisc replace dev $DEV1 handle 1: root bfifo limit 3000b",
+ "expExitCode": "0",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc bfifo 1: root.*limit 3000b",
+ "matchCount": "1",
+ "teardown": [
+ "$TC qdisc del dev $DEV1 handle 1: root bfifo",
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ },
+ {
+ "id": "3df6",
+ "name": "Replace pfifo qdisc on egress with new queue size",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link del dev $DEV1 type dummy || /bin/true",
+ "$IP link add dev $DEV1 txqueuelen 1000 type dummy",
+ "$TC qdisc add dev $DEV1 handle 1: root pfifo"
+ ],
+ "cmdUnderTest": "$TC qdisc replace dev $DEV1 handle 1: root pfifo limit 30",
+ "expExitCode": "0",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc pfifo 1: root.*limit 30p",
+ "matchCount": "1",
+ "teardown": [
+ "$TC qdisc del dev $DEV1 handle 1: root pfifo",
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ },
+ {
+ "id": "7a67",
+ "name": "Add bfifo qdisc on egress with queue size in invalid format",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link add dev $DEV1 type dummy || /bin/true"
+ ],
+ "cmdUnderTest": "$TC qdisc add dev $DEV1 handle 1: root bfifo limit foo-bar",
+ "expExitCode": "1",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc bfifo 1: root.*limit foo-bar",
+ "matchCount": "0",
+ "teardown": [
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ },
+ {
+ "id": "1298",
+ "name": "Add duplicate bfifo qdisc on egress",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link add dev $DEV1 type dummy || /bin/true",
+ "$TC qdisc add dev $DEV1 handle 1: root bfifo"
+ ],
+ "cmdUnderTest": "$TC qdisc add dev $DEV1 handle 1: root bfifo",
+ "expExitCode": "2",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc bfifo 1: root",
+ "matchCount": "1",
+ "teardown": [
+ "$TC qdisc del dev $DEV1 handle 1: root bfifo",
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ },
+ {
+ "id": "45a0",
+ "name": "Delete nonexistent bfifo qdisc",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link add dev $DEV1 type dummy || /bin/true"
+ ],
+ "cmdUnderTest": "$TC qdisc del dev $DEV1 root handle 1: bfifo",
+ "expExitCode": "2",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc bfifo 1: root",
+ "matchCount": "0",
+ "teardown": [
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ },
+ {
+ "id": "972b",
+ "name": "Add prio qdisc on egress with invalid format for handles",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link add dev $DEV1 type dummy || /bin/true"
+ ],
+ "cmdUnderTest": "$TC qdisc add dev $DEV1 root handle 123^ bfifo limit 100b",
+ "expExitCode": "255",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc bfifo 123 root",
+ "matchCount": "0",
+ "teardown": [
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ },
+ {
+ "id": "4d39",
+ "name": "Delete bfifo qdisc twice",
+ "category": [
+ "qdisc",
+ "fifo"
+ ],
+ "setup": [
+ "$IP link add dev $DEV1 type dummy || /bin/true",
+ "$TC qdisc add dev $DEV1 root handle 1: bfifo",
+ "$TC qdisc del dev $DEV1 root handle 1: bfifo"
+ ],
+ "cmdUnderTest": "$TC qdisc del dev $DEV1 handle 1: root bfifo",
+ "expExitCode": "2",
+ "verifyCmd": "$TC qdisc show dev $DEV1",
+ "matchPattern": "qdisc bfifo 1: root",
+ "matchCount": "0",
+ "teardown": [
+ "$IP link del dev $DEV1 type dummy"
+ ]
+ }
+]
--
2.7.4
^ permalink raw reply related
* [PATCH net-next] Name NICs based on vmbus offer and enable async probe by default
From: Haiyang Zhang @ 2019-07-23 19:02 UTC (permalink / raw)
To: sashal@kernel.org, linux-hyperv@vger.kernel.org,
netdev@vger.kernel.org
Cc: Haiyang Zhang, KY Srinivasan, Stephen Hemminger, olaf@aepfle.de,
vkuznets, davem@davemloft.net, linux-kernel@vger.kernel.org
Previously the async probing caused NIC naming in random order.
The patch adds a dev_num field in vmbus channel structure. It’s assigned
to the first available number when the channel is offered. So netvsc can
use it for NIC naming based on channel offer sequence. Now we re-enable
the async probing mode by default for faster probing.
Also added a modules parameter, probe_type, to set sync probing mode if
a user wants to.
Fixes: af0a5646cb8d ("use the new async probing feature for the hyperv drivers")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/hv/channel_mgmt.c | 46 +++++++++++++++++++++++++++++++++++++++--
drivers/net/hyperv/netvsc_drv.c | 33 ++++++++++++++++++++++++++---
include/linux/hyperv.h | 4 ++++
3 files changed, 78 insertions(+), 5 deletions(-)
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index addcef5..ab7c05b 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -304,6 +304,8 @@ bool vmbus_prep_negotiate_resp(struct icmsg_hdr *icmsghdrp,
EXPORT_SYMBOL_GPL(vmbus_prep_negotiate_resp);
+#define HV_DEV_NUM_INVALID (-1)
+
/*
* alloc_channel - Allocate and initialize a vmbus channel object
*/
@@ -315,6 +317,8 @@ static struct vmbus_channel *alloc_channel(void)
if (!channel)
return NULL;
+ channel->dev_num = HV_DEV_NUM_INVALID;
+
spin_lock_init(&channel->lock);
init_completion(&channel->rescind_event);
@@ -533,6 +537,42 @@ static void vmbus_add_channel_work(struct work_struct *work)
}
/*
+ * Get the first available device number of its type, then
+ * record it in the channel structure.
+ */
+static void hv_set_devnum(struct vmbus_channel *newchannel)
+{
+ struct vmbus_channel *channel;
+ unsigned int i = 0;
+ bool found;
+
+ BUG_ON(!mutex_is_locked(&vmbus_connection.channel_mutex));
+
+ /* Only HV_NIC uses this number for now */
+ if (hv_get_dev_type(newchannel) != HV_NIC)
+ return;
+
+next:
+ found = false;
+
+ list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
+ if (i == channel->dev_num &&
+ guid_equal(&channel->offermsg.offer.if_type,
+ &newchannel->offermsg.offer.if_type)) {
+ found = true;
+ break;
+ }
+ }
+
+ if (found) {
+ i++;
+ goto next;
+ }
+
+ newchannel->dev_num = i;
+}
+
+/*
* vmbus_process_offer - Process the offer by creating a channel/device
* associated with this offer
*/
@@ -561,10 +601,12 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
}
}
- if (fnew)
+ if (fnew) {
+ hv_set_devnum(newchannel);
+
list_add_tail(&newchannel->listentry,
&vmbus_connection.chn_list);
- else {
+ } else {
/*
* Check to see if this is a valid sub-channel.
*/
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index afdcc56..af53690 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -57,6 +57,10 @@
module_param(debug, int, 0444);
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
+static unsigned int probe_type __ro_after_init = PROBE_PREFER_ASYNCHRONOUS;
+module_param(probe_type, uint, 0444);
+MODULE_PARM_DESC(probe_type, "Probe type: 1=async(default), 2=sync");
+
static LIST_HEAD(netvsc_dev_list);
static void netvsc_change_rx_flags(struct net_device *net, int change)
@@ -2233,10 +2237,19 @@ static int netvsc_probe(struct hv_device *dev,
struct net_device_context *net_device_ctx;
struct netvsc_device_info *device_info = NULL;
struct netvsc_device *nvdev;
+ char name[IFNAMSIZ];
int ret = -ENOMEM;
- net = alloc_etherdev_mq(sizeof(struct net_device_context),
- VRSS_CHANNEL_MAX);
+ if (probe_type == PROBE_PREFER_ASYNCHRONOUS) {
+ snprintf(name, IFNAMSIZ, "eth%d", dev->channel->dev_num);
+ net = alloc_netdev_mqs(sizeof(struct net_device_context), name,
+ NET_NAME_ENUM, ether_setup,
+ VRSS_CHANNEL_MAX, VRSS_CHANNEL_MAX);
+ } else {
+ net = alloc_etherdev_mq(sizeof(struct net_device_context),
+ VRSS_CHANNEL_MAX);
+ }
+
if (!net)
goto no_net;
@@ -2323,6 +2336,14 @@ static int netvsc_probe(struct hv_device *dev,
net->max_mtu = ETH_DATA_LEN;
ret = register_netdevice(net);
+
+ if (ret == -EEXIST) {
+ pr_info("NIC name %s exists, request another name.\n",
+ net->name);
+ strlcpy(net->name, "eth%d", IFNAMSIZ);
+ ret = register_netdevice(net);
+ }
+
if (ret != 0) {
pr_err("Unable to register netdev.\n");
goto register_failed;
@@ -2407,7 +2428,7 @@ static int netvsc_remove(struct hv_device *dev)
.probe = netvsc_probe,
.remove = netvsc_remove,
.driver = {
- .probe_type = PROBE_FORCE_SYNCHRONOUS,
+ .probe_type = PROBE_PREFER_ASYNCHRONOUS,
},
};
@@ -2473,6 +2494,12 @@ static int __init netvsc_drv_init(void)
}
netvsc_ring_bytes = ring_size * PAGE_SIZE;
+ if (probe_type != PROBE_PREFER_ASYNCHRONOUS)
+ probe_type = PROBE_FORCE_SYNCHRONOUS;
+
+ netvsc_drv.driver.probe_type = probe_type;
+ pr_info("probe_type: %u\n", probe_type);
+
ret = vmbus_driver_register(&netvsc_drv);
if (ret)
return ret;
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 6256cc3..12fc5ea 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -841,6 +841,10 @@ struct vmbus_channel {
*/
struct vmbus_channel *primary_channel;
/*
+ * Used for device naming based on channel offer sequence.
+ */
+ int dev_num;
+ /*
* Support per-channel state for use by vmbus drivers.
*/
void *per_channel_state;
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH mlx5-next] net/mlx5: Fix modify_cq_in alignment
From: Leon Romanovsky @ 2019-07-23 19:04 UTC (permalink / raw)
To: David Miller; +Cc: dledford, jgg, edwards, linux-rdma, yishaih, saeedm, netdev
In-Reply-To: <20190723.112850.610952032088764951.davem@davemloft.net>
On Tue, Jul 23, 2019 at 11:28:50AM -0700, David Miller wrote:
> From: Leon Romanovsky <leon@kernel.org>
> Date: Tue, 23 Jul 2019 10:12:55 +0300
>
> > From: Edward Srouji <edwards@mellanox.com>
> >
> > Fix modify_cq_in alignment to match the device specification.
> > After this fix the 'cq_umem_valid' field will be in the right offset.
> >
> > Cc: <stable@vger.kernel.org> # 4.19
> > Fixes: bd37197554eb ("net/mlx5: Update mlx5_ifc with DEVX UID bits")
> > Signed-off-by: Edward Srouji <edwards@mellanox.com>
> > Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
>
> Very confusing submission on many levels.
>
> Coming from a Mellanox developer using a kernel.org email address.
It works for us and was proven internally as the best way to have
setup which always works.
>
> Targetting the mlx5-next tree, yet CC:'ing stable.
This patch was found by RDMA team, needed by RDMA but changes are located
in code accessible by mlx5_core part. This is why mlx5-next.
>
> A networking change, for which stable submissions are handled by me by
> hand and not via CC:'ing stable.
The intention was to have this patch in shared mlx5 branch, which is
picked by RDMA too. This "Cc: stable@..." together with merge through
RDMA will ensure that such patch will be part of stable automatically.
I can remove "Cc: ..." line if you think that it is inappropriate to
have such line in patch in mlx5-next.
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