* Re: [PATCH iproute2 net-next] bridge: add option extern_learn to set NTF_EXT_LEARNED on fdb entries
From: Roopa Prabhu @ 2018-03-19 18:05 UTC (permalink / raw)
To: David Ahern; +Cc: Stephen Hemminger, netdev, Nikolay Aleksandrov
In-Reply-To: <4da9d3be-b5b0-aa91-bed0-ecb99f271a63@gmail.com>
On Mon, Mar 19, 2018 at 10:56 AM, David Ahern <dsahern@gmail.com> wrote:
> On 3/19/18 11:54 AM, Stephen Hemminger wrote:
>> On Mon, 19 Mar 2018 10:20:10 -0700
>> Roopa Prabhu <roopa@cumulusnetworks.com> wrote:
>>
>>> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>>>
>>> NTF_EXT_LEARNED can be set by a user on bridge fdb entry.
>>> Provide a bridge command option to allow a user to set
>>> NTF_EXT_LEARNED on a bridge fdb entry.
>>>
>>> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
>>> ---
>>> bridge/fdb.c | 4 +++-
>>> man/man8/bridge.8 | 8 +++++++-
>>> 2 files changed, 10 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/bridge/fdb.c b/bridge/fdb.c
>>> index 205b4fa..4dbc894 100644
>>> --- a/bridge/fdb.c
>>> +++ b/bridge/fdb.c
>>> @@ -36,7 +36,7 @@ static void usage(void)
>>> {
>>> fprintf(stderr,
>>> "Usage: bridge fdb { add | append | del | replace } ADDR dev DEV\n"
>>> - " [ self ] [ master ] [ use ] [ router ]\n"
>>> + " [ self ] [ master ] [ use ] [ router ] [ extern_learn ]\n"
>>> " [ local | static | dynamic ] [ dst IPADDR ] [ vlan VID ]\n"
>>> " [ port PORT] [ vni VNI ] [ via DEV ]\n"
>>> " bridge fdb [ show [ br BRDEV ] [ brport DEV ] [ vlan VID ] [ state STATE ] ]\n");
>>> @@ -412,6 +412,8 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
>>> vid = atoi(*argv);
>>> } else if (matches(*argv, "use") == 0) {
>>> req.ndm.ndm_flags |= NTF_USE;
>>> + } else if (matches(*argv, "extern_learn") == 0) {
>>> + req.ndm.ndm_flags |= NTF_EXT_LEARNED;
>>> } else {
>>> if (strcmp(*argv, "to") == 0)
>>> NEXT_ARG();
>>> diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
>>> index 05512b0..e7f7148 100644
>>> --- a/man/man8/bridge.8
>>> +++ b/man/man8/bridge.8
>>> @@ -61,7 +61,7 @@ bridge \- show / manipulate bridge addresses and devices
>>> .B dev
>>> .IR DEV " { "
>>> .BR local " | " static " | " dynamic " } [ "
>>> -.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ "
>>> +.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ " extern_learn " ] [ "
>>> .B dst
>>> .IR IPADDR " ] [ "
>>> .B vni
>>> @@ -414,6 +414,12 @@ route shortcircuit enabled.
>>> indicate to the kernel that the fdb entry is in use.
>>> .sp
>>>
>>> +.B extern_learn
>>> +- this entry was learned externally. This option can be used to
>>> +indicate to the kernel that an entry was hardware or user-space
>>> +controller learnt dynamic entry. Kernel will not age such an entry.
>>> +.sp
>>> +
>>> .in -8
>>> The next command line parameters apply only
>>> when the specified device
>>
>>
>> What about displaying the flag as well?
>>
>
> Also, I believe other commands have converged on 'external' for the keyword.
There is already code to display it and it displays it as
'extern_learn' (hence the choice of extern_learn)
static void fdb_print_flags(FILE *fp, unsigned int flags)
{
....
if (flags & NTF_EXT_LEARNED)
print_string(PRINT_ANY, NULL, "%s ", "extern_learn");
....
}
^ permalink raw reply
* [PATCH 4.4 063/134] MIPS: BPF: Fix multiple problems in JIT skb access helpers.
From: Greg Kroah-Hartman @ 2018-03-19 18:05 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, David Daney, James Hogan,
Alexei Starovoitov, Steven J. Hill, linux-mips, netdev,
Ralf Baechle, Sasha Levin
In-Reply-To: <20180319171849.024066323@linuxfoundation.org>
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Daney <david.daney@cavium.com>
[ Upstream commit a81507c79f4ae9a0f9fb1054b59b62a090620dd9 ]
o Socket data is unsigned, so use unsigned accessors instructions.
o Fix path result pointer generation arithmetic.
o Fix half-word byte swapping code for unsigned semantics.
Signed-off-by: David Daney <david.daney@cavium.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Steven J. Hill <steven.hill@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/15747/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/mips/net/bpf_jit_asm.S | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
--- a/arch/mips/net/bpf_jit_asm.S
+++ b/arch/mips/net/bpf_jit_asm.S
@@ -90,18 +90,14 @@ FEXPORT(sk_load_half_positive)
is_offset_in_header(2, half)
/* Offset within header boundaries */
PTR_ADDU t1, $r_skb_data, offset
- .set reorder
- lh $r_A, 0(t1)
- .set noreorder
+ lhu $r_A, 0(t1)
#ifdef CONFIG_CPU_LITTLE_ENDIAN
# if defined(__mips_isa_rev) && (__mips_isa_rev >= 2)
- wsbh t0, $r_A
- seh $r_A, t0
+ wsbh $r_A, $r_A
# else
- sll t0, $r_A, 24
- andi t1, $r_A, 0xff00
- sra t0, t0, 16
- srl t1, t1, 8
+ sll t0, $r_A, 8
+ srl t1, $r_A, 8
+ andi t0, t0, 0xff00
or $r_A, t0, t1
# endif
#endif
@@ -115,7 +111,7 @@ FEXPORT(sk_load_byte_positive)
is_offset_in_header(1, byte)
/* Offset within header boundaries */
PTR_ADDU t1, $r_skb_data, offset
- lb $r_A, 0(t1)
+ lbu $r_A, 0(t1)
jr $r_ra
move $r_ret, zero
END(sk_load_byte)
@@ -139,6 +135,11 @@ FEXPORT(sk_load_byte_positive)
* (void *to) is returned in r_s0
*
*/
+#ifdef CONFIG_CPU_LITTLE_ENDIAN
+#define DS_OFFSET(SIZE) (4 * SZREG)
+#else
+#define DS_OFFSET(SIZE) ((4 * SZREG) + (4 - SIZE))
+#endif
#define bpf_slow_path_common(SIZE) \
/* Quick check. Are we within reasonable boundaries? */ \
LONG_ADDIU $r_s1, $r_skb_len, -SIZE; \
@@ -150,7 +151,7 @@ FEXPORT(sk_load_byte_positive)
PTR_LA t0, skb_copy_bits; \
PTR_S $r_ra, (5 * SZREG)($r_sp); \
/* Assign low slot to a2 */ \
- move a2, $r_sp; \
+ PTR_ADDIU a2, $r_sp, DS_OFFSET(SIZE); \
jalr t0; \
/* Reset our destination slot (DS but it's ok) */ \
INT_S zero, (4 * SZREG)($r_sp); \
^ permalink raw reply
* [PATCH 4.4 062/134] MIPS: BPF: Quit clobbering callee saved registers in JIT code.
From: Greg Kroah-Hartman @ 2018-03-19 18:05 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, stable, David Daney, James Hogan,
Alexei Starovoitov, Steven J. Hill, linux-mips, netdev,
Ralf Baechle, Sasha Levin
In-Reply-To: <20180319171849.024066323@linuxfoundation.org>
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Daney <david.daney@cavium.com>
[ Upstream commit 1ef0910cfd681f0bd0b81f8809935b2006e9cfb9 ]
If bpf_needs_clear_a() returns true, only actually clear it if it is
ever used. If it is not used, we don't save and restore it, so the
clearing has the nasty side effect of clobbering caller state.
Also, don't emit stack pointer adjustment instructions if the
adjustment amount is zero.
Signed-off-by: David Daney <david.daney@cavium.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Steven J. Hill <steven.hill@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/15745/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/mips/net/bpf_jit.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
--- a/arch/mips/net/bpf_jit.c
+++ b/arch/mips/net/bpf_jit.c
@@ -527,7 +527,8 @@ static void save_bpf_jit_regs(struct jit
u32 sflags, tmp_flags;
/* Adjust the stack pointer */
- emit_stack_offset(-align_sp(offset), ctx);
+ if (offset)
+ emit_stack_offset(-align_sp(offset), ctx);
tmp_flags = sflags = ctx->flags >> SEEN_SREG_SFT;
/* sflags is essentially a bitmap */
@@ -579,7 +580,8 @@ static void restore_bpf_jit_regs(struct
emit_load_stack_reg(r_ra, r_sp, real_off, ctx);
/* Restore the sp and discard the scrach memory */
- emit_stack_offset(align_sp(offset), ctx);
+ if (offset)
+ emit_stack_offset(align_sp(offset), ctx);
}
static unsigned int get_stack_depth(struct jit_ctx *ctx)
@@ -626,8 +628,14 @@ static void build_prologue(struct jit_ct
if (ctx->flags & SEEN_X)
emit_jit_reg_move(r_X, r_zero, ctx);
- /* Do not leak kernel data to userspace */
- if (bpf_needs_clear_a(&ctx->skf->insns[0]))
+ /*
+ * Do not leak kernel data to userspace, we only need to clear
+ * r_A if it is ever used. In fact if it is never used, we
+ * will not save/restore it, so clearing it in this case would
+ * corrupt the state of the caller.
+ */
+ if (bpf_needs_clear_a(&ctx->skf->insns[0]) &&
+ (ctx->flags & SEEN_A))
emit_jit_reg_move(r_A, r_zero, ctx);
}
^ permalink raw reply
* Re: [PATCH net-next 3/4] net: dsa: Plug in PHYLINK support
From: Florian Fainelli @ 2018-03-19 17:59 UTC (permalink / raw)
To: Andrew Lunn
Cc: netdev, privat, vivien.didelot, davem, rmk+kernel, sean.wang,
Woojung.Huh, john, cphealy
In-Reply-To: <20180318191923.GN1188@lunn.ch>
Hi Andrew,
On 03/18/2018 12:19 PM, Andrew Lunn wrote:
>> +static int dsa_slave_nway_reset(struct net_device *dev)
>> +{
>> + struct dsa_port *dp = dsa_slave_to_port(dev);
>> +
>> + return phylink_ethtool_nway_reset(dp->pl);
>> +}
>
> Hi Florian
>
> I've seen in one of Russells trees a patch to put a phylink into
> net_device. That would make a generic slave_nway_reset() possible, and
> a few others as well. Maybe it makes sense to pull in that patch?
To make this generic, we would have to have net_device carry a reference
to a phylink instance, which I would rather not do. Were you possibly
referring to this patch set:
http://git.armlinux.org.uk/cgit/linux-arm.git/commit/?h=phy&id=4eda3b76573473d811bc80a6f0e5a2e06dd76bf6
in which case I think it was discussed and rejected (that was my
recollection).
--
Florian
^ permalink raw reply
* [net-next 9/9] i40e: Fix the polling mechanism of GLGEN_RSTAT.DEVSTATE
From: Jeff Kirsher @ 2018-03-19 17:56 UTC (permalink / raw)
To: davem
Cc: Paweł Jabłoński, netdev, nhorman, sassmann,
jogreene, Jeff Kirsher
In-Reply-To: <20180319175659.17685-1-jeffrey.t.kirsher@intel.com>
From: Paweł Jabłoński <pawel.jablonski@intel.com>
This fixes the polling mechanism of GLGEN_RSTAT.DEVSTATE in the
PF Reset path when Global Reset is in progress. While the driver
is polling for the end of the PF Reset and the Global Reset is
triggered, abandon the PF Reset path and prepare for the
upcoming Global Reset.
Signed-off-by: Paweł Jabłoński <pawel.jablonski@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_common.c | 35 ++++++++++++++++++++++-----
1 file changed, 29 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index a40b8f37d48f..4fa31d87d9d2 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -1208,6 +1208,29 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
return media;
}
+/**
+ * i40e_poll_globr - Poll for Global Reset completion
+ * @hw: pointer to the hardware structure
+ * @retry_limit: how many times to retry before failure
+ **/
+static i40e_status i40e_poll_globr(struct i40e_hw *hw,
+ u32 retry_limit)
+{
+ u32 cnt, reg = 0;
+
+ for (cnt = 0; cnt < retry_limit; cnt++) {
+ reg = rd32(hw, I40E_GLGEN_RSTAT);
+ if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK))
+ return 0;
+ msleep(100);
+ }
+
+ hw_dbg(hw, "Global reset failed.\n");
+ hw_dbg(hw, "I40E_GLGEN_RSTAT = 0x%x\n", reg);
+
+ return I40E_ERR_RESET_FAILED;
+}
+
#define I40E_PF_RESET_WAIT_COUNT_A0 200
#define I40E_PF_RESET_WAIT_COUNT 200
/**
@@ -1284,14 +1307,14 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw)
if (!(reg & I40E_PFGEN_CTRL_PFSWR_MASK))
break;
reg2 = rd32(hw, I40E_GLGEN_RSTAT);
- if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) {
- hw_dbg(hw, "Core reset upcoming. Skipping PF reset request.\n");
- hw_dbg(hw, "I40E_GLGEN_RSTAT = 0x%x\n", reg2);
- return I40E_ERR_NOT_READY;
- }
+ if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK)
+ break;
usleep_range(1000, 2000);
}
- if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) {
+ if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) {
+ if (i40e_poll_globr(hw, grst_del))
+ return I40E_ERR_RESET_FAILED;
+ } else if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) {
hw_dbg(hw, "PF reset polling failed to complete.\n");
return I40E_ERR_RESET_FAILED;
}
--
2.14.3
^ permalink raw reply related
* [net-next 8/9] i40evf: remove flags that are never used
From: Jeff Kirsher @ 2018-03-19 17:56 UTC (permalink / raw)
To: davem; +Cc: Jacob Keller, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <20180319175659.17685-1-jeffrey.t.kirsher@intel.com>
From: Jacob Keller <jacob.e.keller@intel.com>
These flags were defined, but there is no use within the driver code, so
we don't need to keep them.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40evf/i40evf.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h
index e46555ad7122..279dced87e47 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf.h
+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h
@@ -280,13 +280,10 @@ struct i40evf_adapter {
u32 flags;
#define I40EVF_FLAG_RX_CSUM_ENABLED BIT(0)
-#define I40EVF_FLAG_IMIR_ENABLED BIT(1)
-#define I40EVF_FLAG_MQ_CAPABLE BIT(2)
#define I40EVF_FLAG_PF_COMMS_FAILED BIT(3)
#define I40EVF_FLAG_RESET_PENDING BIT(4)
#define I40EVF_FLAG_RESET_NEEDED BIT(5)
#define I40EVF_FLAG_WB_ON_ITR_CAPABLE BIT(6)
-#define I40EVF_FLAG_OUTER_UDP_CSUM_CAPABLE BIT(7)
#define I40EVF_FLAG_ADDR_SET_BY_PF BIT(8)
#define I40EVF_FLAG_SERVICE_CLIENT_REQUESTED BIT(9)
#define I40EVF_FLAG_CLIENT_NEEDS_OPEN BIT(10)
--
2.14.3
^ permalink raw reply related
* [net-next 7/9] i40e: Prevent setting link speed on I40E_DEV_ID_25G_B
From: Jeff Kirsher @ 2018-03-19 17:56 UTC (permalink / raw)
To: davem; +Cc: Patryk Małek, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
In-Reply-To: <20180319175659.17685-1-jeffrey.t.kirsher@intel.com>
From: Patryk Małek <patryk.malek@intel.com>
Setting link settings on backplane devices shouldn't be allowed.
This patch adds one more device id to the list which we check
that against.
Signed-off-by: Patryk Małek <patryk.malek@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index d3d299ab9de3..0c7e7de595d3 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -860,6 +860,7 @@ static int i40e_set_link_ksettings(struct net_device *netdev,
hw->device_id == I40E_DEV_ID_KX_C ||
hw->device_id == I40E_DEV_ID_20G_KR2 ||
hw->device_id == I40E_DEV_ID_20G_KR2_A ||
+ hw->device_id == I40E_DEV_ID_25G_B ||
hw->device_id == I40E_DEV_ID_KX_X722) {
netdev_info(netdev, "Changing settings is not supported on backplane.\n");
return -EOPNOTSUPP;
--
2.14.3
^ permalink raw reply related
* [net-next 5/9] i40e: add doxygen comment for new mode parameter
From: Jeff Kirsher @ 2018-03-19 17:56 UTC (permalink / raw)
To: davem; +Cc: Jacob Keller, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <20180319175659.17685-1-jeffrey.t.kirsher@intel.com>
From: Jacob Keller <jacob.e.keller@intel.com>
A recent patch updated the signature for i40e_aq_set_switch_config() to
add a new parameter 'mode'. It forgot to document the parameter in the
doxygen function header comment. Add the parameter to the function
description now.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_common.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 242c4c789e8d..df852c23f45c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -2415,6 +2415,7 @@ i40e_status i40e_aq_get_switch_config(struct i40e_hw *hw,
* i40e_aq_set_switch_config
* @hw: pointer to the hardware structure
* @flags: bit flag values to set
+ * @mode: cloud filter mode
* @valid_flags: which bit flags to set
* @mode: cloud filter mode
* @cmd_details: pointer to command details structure or NULL
--
2.14.3
^ permalink raw reply related
* [net-next 6/9] i40e: Fix incorrect return types
From: Jeff Kirsher @ 2018-03-19 17:56 UTC (permalink / raw)
To: davem; +Cc: Doug Dziggel, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <20180319175659.17685-1-jeffrey.t.kirsher@intel.com>
From: Doug Dziggel <douglas.a.dziggel@intel.com>
Fix return types from i40e_status to enum i40e_status_code.
Signed-off-by: Doug Dziggel <douglas.a.dziggel@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_common.c | 4 ++--
drivers/net/ethernet/intel/i40e/i40e_prototype.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index df852c23f45c..a40b8f37d48f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -5553,7 +5553,7 @@ i40e_aq_add_cloud_filters(struct i40e_hw *hw, u16 seid,
* function.
*
**/
-i40e_status
+enum i40e_status_code
i40e_aq_add_cloud_filters_bb(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_cloud_filters_element_bb *filters,
u8 filter_count)
@@ -5647,7 +5647,7 @@ i40e_aq_rem_cloud_filters(struct i40e_hw *hw, u16 seid,
* function.
*
**/
-i40e_status
+enum i40e_status_code
i40e_aq_rem_cloud_filters_bb(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_cloud_filters_element_bb *filters,
u8 filter_count)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index 83798b7841b9..eabb636f6a19 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -287,7 +287,7 @@ i40e_status i40e_aq_query_switch_comp_bw_config(struct i40e_hw *hw,
struct i40e_asq_cmd_details *cmd_details);
i40e_status i40e_aq_resume_port_tx(struct i40e_hw *hw,
struct i40e_asq_cmd_details *cmd_details);
-i40e_status
+enum i40e_status_code
i40e_aq_add_cloud_filters_bb(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_cloud_filters_element_bb *filters,
u8 filter_count);
@@ -299,7 +299,7 @@ enum i40e_status_code
i40e_aq_rem_cloud_filters(struct i40e_hw *hw, u16 vsi,
struct i40e_aqc_cloud_filters_element_data *filters,
u8 filter_count);
-i40e_status
+enum i40e_status_code
i40e_aq_rem_cloud_filters_bb(struct i40e_hw *hw, u16 seid,
struct i40e_aqc_cloud_filters_element_bb *filters,
u8 filter_count);
--
2.14.3
^ permalink raw reply related
* [net-next 3/9] i40e: Prevent setting link speed on KX_X722
From: Jeff Kirsher @ 2018-03-19 17:56 UTC (permalink / raw)
To: davem; +Cc: Patryk Małek, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
In-Reply-To: <20180319175659.17685-1-jeffrey.t.kirsher@intel.com>
From: Patryk Małek <patryk.malek@intel.com>
Setting link settings on backplane devices shouldn't be allowed.
This patch adds one more device id to the list which we check
that against.
Signed-off-by: Patryk Małek <patryk.malek@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 0ce68e8a45cc..d3d299ab9de3 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -859,7 +859,8 @@ static int i40e_set_link_ksettings(struct net_device *netdev,
if (hw->device_id == I40E_DEV_ID_KX_B ||
hw->device_id == I40E_DEV_ID_KX_C ||
hw->device_id == I40E_DEV_ID_20G_KR2 ||
- hw->device_id == I40E_DEV_ID_20G_KR2_A) {
+ hw->device_id == I40E_DEV_ID_20G_KR2_A ||
+ hw->device_id == I40E_DEV_ID_KX_X722) {
netdev_info(netdev, "Changing settings is not supported on backplane.\n");
return -EOPNOTSUPP;
}
--
2.14.3
^ permalink raw reply related
* [net-next 4/9] i40e: Close client on suspend and restore client MSIx on resume
From: Jeff Kirsher @ 2018-03-19 17:56 UTC (permalink / raw)
To: davem; +Cc: Shiraz Saleem, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <20180319175659.17685-1-jeffrey.t.kirsher@intel.com>
From: Shiraz Saleem <shiraz.saleem@intel.com>
During suspend client MSIx vectors are freed while they are still
in use causing a crash on entering S3.
Fix this calling client close before freeing up its MSIx vectors.
Also update the client MSIx vectors on resume before client
open is called.
Fixes commit b980c0634fe5 ("i40e: shutdown all IRQs and disable MSI-X
when suspended")
Reported-by: Stefan Assmann <sassmann@redhat.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e.h | 1 +
drivers/net/ethernet/intel/i40e/i40e_client.c | 16 +++++++++++++---
drivers/net/ethernet/intel/i40e/i40e_main.c | 8 ++++++++
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 36d9401a6258..271ab1a861b7 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -1041,6 +1041,7 @@ void i40e_notify_client_of_l2_param_changes(struct i40e_vsi *vsi);
void i40e_notify_client_of_netdev_close(struct i40e_vsi *vsi, bool reset);
void i40e_notify_client_of_vf_enable(struct i40e_pf *pf, u32 num_vfs);
void i40e_notify_client_of_vf_reset(struct i40e_pf *pf, u32 vf_id);
+void i40e_client_update_msix_info(struct i40e_pf *pf);
int i40e_vf_client_capable(struct i40e_pf *pf, u32 vf_id);
/**
* i40e_irq_dynamic_enable - Enable default interrupt generation settings
diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c
index 0de9610c1d8d..704695a61645 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_client.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c
@@ -287,6 +287,17 @@ int i40e_vf_client_capable(struct i40e_pf *pf, u32 vf_id)
return capable;
}
+void i40e_client_update_msix_info(struct i40e_pf *pf)
+{
+ struct i40e_client_instance *cdev = pf->cinst;
+
+ if (!cdev || !cdev->client)
+ return;
+
+ cdev->lan_info.msix_count = pf->num_iwarp_msix;
+ cdev->lan_info.msix_entries = &pf->msix_entries[pf->iwarp_base_vector];
+}
+
/**
* i40e_client_add_instance - add a client instance struct to the instance list
* @pf: pointer to the board struct
@@ -328,9 +339,6 @@ static void i40e_client_add_instance(struct i40e_pf *pf)
return;
}
- cdev->lan_info.msix_count = pf->num_iwarp_msix;
- cdev->lan_info.msix_entries = &pf->msix_entries[pf->iwarp_base_vector];
-
mac = list_first_entry(&cdev->lan_info.netdev->dev_addrs.list,
struct netdev_hw_addr, list);
if (mac)
@@ -340,6 +348,8 @@ static void i40e_client_add_instance(struct i40e_pf *pf)
cdev->client = registered_client;
pf->cinst = cdev;
+
+ i40e_client_update_msix_info(pf);
}
/**
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index b78c06a1f82c..4a4401c61089 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -10594,6 +10594,9 @@ static int i40e_restore_interrupt_scheme(struct i40e_pf *pf)
if (err)
goto err_unwind;
+ if (pf->flags & I40E_FLAG_IWARP_ENABLED)
+ i40e_client_update_msix_info(pf);
+
return 0;
err_unwind:
@@ -14344,6 +14347,11 @@ static int __maybe_unused i40e_suspend(struct device *dev)
del_timer_sync(&pf->service_timer);
cancel_work_sync(&pf->service_task);
+ /* Client close must be called explicitly here because the timer
+ * has been stopped.
+ */
+ i40e_notify_client_of_netdev_close(pf->vsi[pf->lan_vsi], false);
+
if (pf->wol_en && (pf->hw_features & I40E_HW_WOL_MC_MAGIC_PKT_WAKE))
i40e_enable_mc_magic_wake(pf);
--
2.14.3
^ permalink raw reply related
* [net-next 1/9] i40evf: Reorder configure_clsflower to avoid deadlock on error
From: Jeff Kirsher @ 2018-03-19 17:56 UTC (permalink / raw)
To: davem; +Cc: Alexander Duyck, netdev, nhorman, sassmann, jogreene,
Jeff Kirsher
In-Reply-To: <20180319175659.17685-1-jeffrey.t.kirsher@intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
While doing some code review I noticed that we can get into a state where
we exit with the "IN_CRITICAL_TASK" bit set while notifying the PF of
flower filters. This patch is meant to address that plus tweak the ordering
of the while loop waiting on it slightly so that we don't wait an extra
period after we have failed for the last time.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 486cf491b000..7e7cd80abaf4 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2791,14 +2791,7 @@ static int i40evf_configure_clsflower(struct i40evf_adapter *adapter,
{
int tc = tc_classid_to_hwtc(adapter->netdev, cls_flower->classid);
struct i40evf_cloud_filter *filter = NULL;
- int err = 0, count = 50;
-
- while (test_and_set_bit(__I40EVF_IN_CRITICAL_TASK,
- &adapter->crit_section)) {
- udelay(1);
- if (--count == 0)
- return -EINVAL;
- }
+ int err = -EINVAL, count = 50;
if (tc < 0) {
dev_err(&adapter->pdev->dev, "Invalid traffic class\n");
@@ -2806,10 +2799,16 @@ static int i40evf_configure_clsflower(struct i40evf_adapter *adapter,
}
filter = kzalloc(sizeof(*filter), GFP_KERNEL);
- if (!filter) {
- err = -ENOMEM;
- goto clearout;
+ if (!filter)
+ return -ENOMEM;
+
+ while (test_and_set_bit(__I40EVF_IN_CRITICAL_TASK,
+ &adapter->crit_section)) {
+ if (--count == 0)
+ goto err;
+ udelay(1);
}
+
filter->cookie = cls_flower->cookie;
/* set the mask to all zeroes to begin with */
@@ -2834,7 +2833,7 @@ static int i40evf_configure_clsflower(struct i40evf_adapter *adapter,
err:
if (err)
kfree(filter);
-clearout:
+
clear_bit(__I40EVF_IN_CRITICAL_TASK, &adapter->crit_section);
return err;
}
--
2.14.3
^ permalink raw reply related
* [net-next 2/9] i40e: Properly check allowed advertisement capabilities
From: Jeff Kirsher @ 2018-03-19 17:56 UTC (permalink / raw)
To: davem; +Cc: Jan Sokolowski, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <20180319175659.17685-1-jeffrey.t.kirsher@intel.com>
From: Jan Sokolowski <jan.sokolowski@intel.com>
The i40e_set_link_ksettings and i40e_get_link_ksettings use different
codepaths to check available and supported advertisement modes. This
creates scenarios where it's possible to set a mode that's not allowed,
resulting in a link down.
Fix setting advertisement in i40e_set_link_ksettings by calling
i40e_get_link_ksettings to check what modes are allowed.
Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 89807e32a898..0ce68e8a45cc 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -870,23 +870,21 @@ static int i40e_set_link_ksettings(struct net_device *netdev,
/* save autoneg out of ksettings */
autoneg = copy_ks.base.autoneg;
- memset(&safe_ks, 0, sizeof(safe_ks));
+ /* get our own copy of the bits to check against */
+ memset(&safe_ks, 0, sizeof(struct ethtool_link_ksettings));
+ safe_ks.base.cmd = copy_ks.base.cmd;
+ safe_ks.base.link_mode_masks_nwords =
+ copy_ks.base.link_mode_masks_nwords;
+ i40e_get_link_ksettings(netdev, &safe_ks);
+
/* Get link modes supported by hardware and check against modes
* requested by the user. Return an error if unsupported mode was set.
*/
- i40e_phy_type_to_ethtool(pf, &safe_ks);
if (!bitmap_subset(copy_ks.link_modes.advertising,
safe_ks.link_modes.supported,
__ETHTOOL_LINK_MODE_MASK_NBITS))
return -EINVAL;
- /* get our own copy of the bits to check against */
- memset(&safe_ks, 0, sizeof(struct ethtool_link_ksettings));
- safe_ks.base.cmd = copy_ks.base.cmd;
- safe_ks.base.link_mode_masks_nwords =
- copy_ks.base.link_mode_masks_nwords;
- i40e_get_link_ksettings(netdev, &safe_ks);
-
/* set autoneg back to what it currently is */
copy_ks.base.autoneg = safe_ks.base.autoneg;
--
2.14.3
^ permalink raw reply related
* [net-next 0/9][pull request] 40GbE Intel Wired LAN Driver Updates 2018-03-19
From: Jeff Kirsher @ 2018-03-19 17:56 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene
This series contains updates to i40e and i40evf only.
Alex fixes a potential deadlock in the configure_clsflower function in
i40evf, where we exit with the "IN_CRITICAL_TASK" bit set while
notifying the PF of flower filters.
Jan fixed an issue where it was possible to set a mode that is not
allowed which resulted in link being down, so fixed the parity between
i40e_set_link_ksettings() and i40e_get_link_ksettings().
Patryk fixes a bug where a backplane device was allowing the setting of
link settings, which is not allowed.
Shiraz fixes a crash when entering S3 because the client interface was
freeing the MSIx vectors while they are still in use.
Jake fixes up a function header comment to document a newly added
parameter. Also cleaned up flags that were never used.
Doug fixes the incorrect return type for i40e_aq_add_cloud_filters().
The following are changes since commit e3c72f3d37e4745dc3a6ae69f5fc2bd4c31ca4eb:
selftests: pmtu: Drop prints to kernel log from pmtu_vti6_link_change_mtu
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue 40GbE
Alexander Duyck (1):
i40evf: Reorder configure_clsflower to avoid deadlock on error
Doug Dziggel (1):
i40e: Fix incorrect return types
Jacob Keller (2):
i40e: add doxygen comment for new mode parameter
i40evf: remove flags that are never used
Jan Sokolowski (1):
i40e: Properly check allowed advertisement capabilities
Patryk Małek (2):
i40e: Prevent setting link speed on KX_X722
i40e: Prevent setting link speed on I40E_DEV_ID_25G_B
Paweł Jabłoński (1):
i40e: Fix the polling mechanism of GLGEN_RSTAT.DEVSTATE
Shiraz Saleem (1):
i40e: Close client on suspend and restore client MSIx on resume
drivers/net/ethernet/intel/i40e/i40e.h | 1 +
drivers/net/ethernet/intel/i40e/i40e_client.c | 16 ++++++++--
drivers/net/ethernet/intel/i40e/i40e_common.c | 40 +++++++++++++++++++-----
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 20 ++++++------
drivers/net/ethernet/intel/i40e/i40e_main.c | 8 +++++
drivers/net/ethernet/intel/i40e/i40e_prototype.h | 4 +--
drivers/net/ethernet/intel/i40evf/i40evf.h | 3 --
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 23 +++++++-------
8 files changed, 77 insertions(+), 38 deletions(-)
--
2.14.3
^ permalink raw reply
* Re: [PATCH iproute2 net-next] bridge: add option extern_learn to set NTF_EXT_LEARNED on fdb entries
From: David Ahern @ 2018-03-19 17:56 UTC (permalink / raw)
To: Stephen Hemminger, Roopa Prabhu; +Cc: netdev, nikolay
In-Reply-To: <20180319105403.293d93ed@xeon-e3>
On 3/19/18 11:54 AM, Stephen Hemminger wrote:
> On Mon, 19 Mar 2018 10:20:10 -0700
> Roopa Prabhu <roopa@cumulusnetworks.com> wrote:
>
>> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>>
>> NTF_EXT_LEARNED can be set by a user on bridge fdb entry.
>> Provide a bridge command option to allow a user to set
>> NTF_EXT_LEARNED on a bridge fdb entry.
>>
>> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
>> ---
>> bridge/fdb.c | 4 +++-
>> man/man8/bridge.8 | 8 +++++++-
>> 2 files changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/bridge/fdb.c b/bridge/fdb.c
>> index 205b4fa..4dbc894 100644
>> --- a/bridge/fdb.c
>> +++ b/bridge/fdb.c
>> @@ -36,7 +36,7 @@ static void usage(void)
>> {
>> fprintf(stderr,
>> "Usage: bridge fdb { add | append | del | replace } ADDR dev DEV\n"
>> - " [ self ] [ master ] [ use ] [ router ]\n"
>> + " [ self ] [ master ] [ use ] [ router ] [ extern_learn ]\n"
>> " [ local | static | dynamic ] [ dst IPADDR ] [ vlan VID ]\n"
>> " [ port PORT] [ vni VNI ] [ via DEV ]\n"
>> " bridge fdb [ show [ br BRDEV ] [ brport DEV ] [ vlan VID ] [ state STATE ] ]\n");
>> @@ -412,6 +412,8 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
>> vid = atoi(*argv);
>> } else if (matches(*argv, "use") == 0) {
>> req.ndm.ndm_flags |= NTF_USE;
>> + } else if (matches(*argv, "extern_learn") == 0) {
>> + req.ndm.ndm_flags |= NTF_EXT_LEARNED;
>> } else {
>> if (strcmp(*argv, "to") == 0)
>> NEXT_ARG();
>> diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
>> index 05512b0..e7f7148 100644
>> --- a/man/man8/bridge.8
>> +++ b/man/man8/bridge.8
>> @@ -61,7 +61,7 @@ bridge \- show / manipulate bridge addresses and devices
>> .B dev
>> .IR DEV " { "
>> .BR local " | " static " | " dynamic " } [ "
>> -.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ "
>> +.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ " extern_learn " ] [ "
>> .B dst
>> .IR IPADDR " ] [ "
>> .B vni
>> @@ -414,6 +414,12 @@ route shortcircuit enabled.
>> indicate to the kernel that the fdb entry is in use.
>> .sp
>>
>> +.B extern_learn
>> +- this entry was learned externally. This option can be used to
>> +indicate to the kernel that an entry was hardware or user-space
>> +controller learnt dynamic entry. Kernel will not age such an entry.
>> +.sp
>> +
>> .in -8
>> The next command line parameters apply only
>> when the specified device
>
>
> What about displaying the flag as well?
>
Also, I believe other commands have converged on 'external' for the keyword.
^ permalink raw reply
* Re: [PATCH iproute2 1/1] tc: fix conversion types when printing actions unsigned values
From: Stephen Hemminger @ 2018-03-19 17:55 UTC (permalink / raw)
To: Roman Mashak; +Cc: netdev, jhs, xiyou.wangcong, jiri
In-Reply-To: <1521481807-20401-1-git-send-email-mrv@mojatatu.com>
On Mon, 19 Mar 2018 13:50:07 -0400
Roman Mashak <mrv@mojatatu.com> wrote:
> Signed-off-by: Roman Mashak <mrv@mojatatu.com>
> ---
> tc/m_action.c | 2 +-
> tc/m_gact.c | 2 +-
> tc/m_ife.c | 2 +-
> tc/m_pedit.c | 2 +-
> tc/m_sample.c | 6 +++---
> tc/m_tunnel_key.c | 2 +-
> 6 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/tc/m_action.c b/tc/m_action.c
> index 148f1372d414..85c9d44c7e50 100644
> --- a/tc/m_action.c
> +++ b/tc/m_action.c
> @@ -408,7 +408,7 @@ int print_action(const struct sockaddr_nl *who,
> if (tb[TCA_ROOT_COUNT])
> tot_acts = RTA_DATA(tb[TCA_ROOT_COUNT]);
>
> - fprintf(fp, "total acts %d\n", tot_acts ? *tot_acts:0);
> + fprintf(fp, "total acts %u\n", tot_acts ? *tot_acts:0);
Please add spaces around : in trigraph.
When fixing code, it has to pass style checkers.
^ permalink raw reply
* Re: [PATCH net-next v2 2/2] dt: bindings: add new dt entries for brcmfmac
From: Florian Fainelli @ 2018-03-19 17:55 UTC (permalink / raw)
To: Alexey Roslyakov, Arend van Spriel
Cc: Andrew Lunn, kvalo, robh+dt, mark.rutland, franky.lin,
hante.meuleman, chi-hsien.lin, wright.feng, netdev,
linux-wireless, devicetree, linux-kernel, brcm80211-dev-list.pdl,
brcm80211-dev-list
In-Reply-To: <CALFoz4YMKJr40fefczrbjXBROtZxnGikv0Jze-BnefofCB3dyg@mail.gmail.com>
On 03/19/2018 07:10 AM, Alexey Roslyakov wrote:
> Hi Arend,
> I appreciate your response. In my opinion, it has nothing to do with
> SDIO host, because it defines "quirks" in the driver itself.
It is not clear to me from your patch series whether the problem is that:
- the SDIO device has a specific alignment requirements, which would be
either a SDIO device driver limitation/issue or maybe the underlying
hardware device/firmware requiring that
- the SDIO host controller used is not capable of coping nicely with
these said limitations
It seems to me like what you are doing here is a) applicable to possibly
more SDIO devices and host combinations, and b) should likely be done at
the layer between the host and device, such that it is available to more
combinations.
> If I get it right, you mean something like this:
>
> mmc3: mmc@1c12000 {
> ...
> broken-sg-support;
> sd-head-align = 4;
> sd-sgentry-align = 512;
>
> brcmf: wifi@1 {
> ...
> };
> };
>
> Where dt: bindings documentation for these entries should reside?
> In generic MMC bindings? Well, this is the very special case and
> mmc-linux maintainer will unlikely to accept these changes.
> Also, extra kernel code modification might be required. It could make
> quite trivial change much more complex.
If the MMC maintainers are not copied on this patch series, it will
likely be hard for them to identify this patch series and chime in...
>
>> Also I am not sure if the broken-sg-support is still needed. We added that for omap_hsmmc, but that has since changed to scatter-gather emulation so it might not be needed anymore.
>
> I've experienced the problem with rk3288 (dw-mmc host) and sdio
> settings like above solved it.
> Frankly, I haven't investigated any deeper which one of the settings
> helped in my case yet...
> I will try to get rid of broken-sg-support first and let you know if
> it does make any difference.
>
> All the best,
> Alex.
>
> On 19 March 2018 at 16:31, Arend van Spriel
> <arend.vanspriel@broadcom.com> wrote:
>> On 3/19/2018 2:40 AM, Alexey Roslyakov wrote:
>>>
>>> In case if the host has higher align requirements for SG items, allow
>>> setting device-specific aligns for scatterlist items.
>>>
>>> Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com>
>>> ---
>>> Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt | 5
>>> +++++
>>> 1 file changed, 5 insertions(+)
>>>
>>> diff --git
>>> a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>> b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>> index 86602f264dce..187b8c1b52a7 100644
>>> --- a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>> +++ b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt
>>> @@ -17,6 +17,11 @@ Optional properties:
>>> When not specified the device will use in-band SDIO interrupts.
>>> - interrupt-names : name of the out-of-band interrupt, which must be
>>> set
>>> to "host-wake".
>>> + - brcm,broken-sg-support : boolean flag to indicate that the SDIO host
>>> + controller has higher align requirement than 32 bytes for each
>>> + scatterlist item.
>>> + - brcm,sd-head-align : alignment requirement for start of data buffer.
>>> + - brcm,sd-sgentry-align : length alignment requirement for each sg
>>> entry.
>>
>>
>> Hi Alexey,
>>
>> Thanks for the patch. However, the problem with these is that they are
>> characterizing the host controller and not the wireless device. So from
>> device tree perspective , which is to describe the hardware, these
>> properties should be SDIO host controller properties. Also I am not sure if
>> the broken-sg-support is still needed. We added that for omap_hsmmc, but
>> that has since changed to scatter-gather emulation so it might not be needed
>> anymore.
>>
>> Regards,
>> Arend
>
>
>
--
Florian
^ permalink raw reply
* Re: [PATCH iproute2 net-next] bridge: add option extern_learn to set NTF_EXT_LEARNED on fdb entries
From: Stephen Hemminger @ 2018-03-19 17:54 UTC (permalink / raw)
To: Roopa Prabhu; +Cc: dsahern, netdev, nikolay
In-Reply-To: <1521480010-47042-1-git-send-email-roopa@cumulusnetworks.com>
On Mon, 19 Mar 2018 10:20:10 -0700
Roopa Prabhu <roopa@cumulusnetworks.com> wrote:
> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>
> NTF_EXT_LEARNED can be set by a user on bridge fdb entry.
> Provide a bridge command option to allow a user to set
> NTF_EXT_LEARNED on a bridge fdb entry.
>
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
> ---
> bridge/fdb.c | 4 +++-
> man/man8/bridge.8 | 8 +++++++-
> 2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/bridge/fdb.c b/bridge/fdb.c
> index 205b4fa..4dbc894 100644
> --- a/bridge/fdb.c
> +++ b/bridge/fdb.c
> @@ -36,7 +36,7 @@ static void usage(void)
> {
> fprintf(stderr,
> "Usage: bridge fdb { add | append | del | replace } ADDR dev DEV\n"
> - " [ self ] [ master ] [ use ] [ router ]\n"
> + " [ self ] [ master ] [ use ] [ router ] [ extern_learn ]\n"
> " [ local | static | dynamic ] [ dst IPADDR ] [ vlan VID ]\n"
> " [ port PORT] [ vni VNI ] [ via DEV ]\n"
> " bridge fdb [ show [ br BRDEV ] [ brport DEV ] [ vlan VID ] [ state STATE ] ]\n");
> @@ -412,6 +412,8 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
> vid = atoi(*argv);
> } else if (matches(*argv, "use") == 0) {
> req.ndm.ndm_flags |= NTF_USE;
> + } else if (matches(*argv, "extern_learn") == 0) {
> + req.ndm.ndm_flags |= NTF_EXT_LEARNED;
> } else {
> if (strcmp(*argv, "to") == 0)
> NEXT_ARG();
> diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
> index 05512b0..e7f7148 100644
> --- a/man/man8/bridge.8
> +++ b/man/man8/bridge.8
> @@ -61,7 +61,7 @@ bridge \- show / manipulate bridge addresses and devices
> .B dev
> .IR DEV " { "
> .BR local " | " static " | " dynamic " } [ "
> -.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ "
> +.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ " extern_learn " ] [ "
> .B dst
> .IR IPADDR " ] [ "
> .B vni
> @@ -414,6 +414,12 @@ route shortcircuit enabled.
> indicate to the kernel that the fdb entry is in use.
> .sp
>
> +.B extern_learn
> +- this entry was learned externally. This option can be used to
> +indicate to the kernel that an entry was hardware or user-space
> +controller learnt dynamic entry. Kernel will not age such an entry.
> +.sp
> +
> .in -8
> The next command line parameters apply only
> when the specified device
What about displaying the flag as well?
^ permalink raw reply
* [PATCH iproute2 1/1] tc: fix conversion types when printing actions unsigned values
From: Roman Mashak @ 2018-03-19 17:50 UTC (permalink / raw)
To: stephen; +Cc: netdev, jhs, xiyou.wangcong, jiri, Roman Mashak
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
---
tc/m_action.c | 2 +-
tc/m_gact.c | 2 +-
tc/m_ife.c | 2 +-
tc/m_pedit.c | 2 +-
tc/m_sample.c | 6 +++---
tc/m_tunnel_key.c | 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/tc/m_action.c b/tc/m_action.c
index 148f1372d414..85c9d44c7e50 100644
--- a/tc/m_action.c
+++ b/tc/m_action.c
@@ -408,7 +408,7 @@ int print_action(const struct sockaddr_nl *who,
if (tb[TCA_ROOT_COUNT])
tot_acts = RTA_DATA(tb[TCA_ROOT_COUNT]);
- fprintf(fp, "total acts %d\n", tot_acts ? *tot_acts:0);
+ fprintf(fp, "total acts %u\n", tot_acts ? *tot_acts:0);
if (tb[TCA_ACT_TAB] == NULL) {
if (n->nlmsg_type != RTM_GETACTION)
fprintf(stderr, "print_action: NULL kind\n");
diff --git a/tc/m_gact.c b/tc/m_gact.c
index 16c4413f4217..52022415db48 100644
--- a/tc/m_gact.c
+++ b/tc/m_gact.c
@@ -194,7 +194,7 @@ print_gact(struct action_util *au, FILE *f, struct rtattr *arg)
print_string(PRINT_ANY, "random_type", "\n\t random type %s",
prob_n2a(pp->ptype));
print_action_control(f, " ", pp->paction, " ");
- print_int(PRINT_ANY, "val", "val %d", pp->pval);
+ print_int(PRINT_ANY, "val", "val %u", pp->pval);
close_json_object();
#endif
print_uint(PRINT_ANY, "index", "\n\t index %u", p->index);
diff --git a/tc/m_ife.c b/tc/m_ife.c
index 205efc9f1d9a..e1dbd3a79649 100644
--- a/tc/m_ife.c
+++ b/tc/m_ife.c
@@ -280,7 +280,7 @@ static int print_ife(struct action_util *au, FILE *f, struct rtattr *arg)
if (len) {
mtcindex =
rta_getattr_u16(metalist[IFE_META_TCINDEX]);
- fprintf(f, "use tcindex %d ", mtcindex);
+ fprintf(f, "use tcindex %u ", mtcindex);
} else
fprintf(f, "allow tcindex ");
}
diff --git a/tc/m_pedit.c b/tc/m_pedit.c
index 26549eeea899..151dfe1a230a 100644
--- a/tc/m_pedit.c
+++ b/tc/m_pedit.c
@@ -817,7 +817,7 @@ int print_pedit(struct action_util *au, FILE *f, struct rtattr *arg)
(unsigned int)ntohl(key->mask));
}
} else {
- fprintf(f, "\npedit %x keys %d is not LEGIT", sel->index,
+ fprintf(f, "\npedit %x keys %u is not LEGIT", sel->index,
sel->nkeys);
}
diff --git a/tc/m_sample.c b/tc/m_sample.c
index 01763cb4c356..d42a6a327965 100644
--- a/tc/m_sample.c
+++ b/tc/m_sample.c
@@ -155,17 +155,17 @@ static int print_sample(struct action_util *au, FILE *f, struct rtattr *arg)
}
p = RTA_DATA(tb[TCA_SAMPLE_PARMS]);
- fprintf(f, "sample rate 1/%d group %d",
+ fprintf(f, "sample rate 1/%u group %u",
rta_getattr_u32(tb[TCA_SAMPLE_RATE]),
rta_getattr_u32(tb[TCA_SAMPLE_PSAMPLE_GROUP]));
if (tb[TCA_SAMPLE_TRUNC_SIZE])
- fprintf(f, " trunc_size %d",
+ fprintf(f, " trunc_size %u",
rta_getattr_u32(tb[TCA_SAMPLE_TRUNC_SIZE]));
print_action_control(f, " ", p->action, "");
- fprintf(f, "\n\tindex %d ref %d bind %d", p->index, p->refcnt,
+ fprintf(f, "\n\tindex %u ref %d bind %d", p->index, p->refcnt,
p->bindcnt);
if (show_stats) {
diff --git a/tc/m_tunnel_key.c b/tc/m_tunnel_key.c
index 1cdd03560c35..dd8f8e8c635b 100644
--- a/tc/m_tunnel_key.c
+++ b/tc/m_tunnel_key.c
@@ -292,7 +292,7 @@ static int print_tunnel_key(struct action_util *au, FILE *f, struct rtattr *arg)
}
print_action_control(f, " ", parm->action, "");
- fprintf(f, "\n\tindex %d ref %d bind %d", parm->index, parm->refcnt,
+ fprintf(f, "\n\tindex %u ref %d bind %d", parm->index, parm->refcnt,
parm->bindcnt);
if (show_stats) {
--
2.7.4
^ permalink raw reply related
* Re: linux-next on x60: network manager often complains "network is disabled" after resume
From: Dan Williams @ 2018-03-19 17:45 UTC (permalink / raw)
To: Pavel Machek
Cc: Woody Suwalski, Rafael J. Wysocki, kernel list,
Linux-pm mailing list, Netdev list
In-Reply-To: <20180319173356.GA28462@amd>
On Mon, 2018-03-19 at 18:33 +0100, Pavel Machek wrote:
> On Mon 2018-03-19 10:40:08, Dan Williams wrote:
> > On Mon, 2018-03-19 at 10:21 +0100, Pavel Machek wrote:
> > > On Mon 2018-03-19 05:17:45, Woody Suwalski wrote:
> > > > Pavel Machek wrote:
> > > > > Hi!
> > > > >
> > > > > With recent linux-next, after resume networkmanager often
> > > > > claims
> > > > > that
> > > > > "network is disabled". Sometimes suspend/resume clears that.
> > > > >
> > > > > Any ideas? Does it work for you?
> > > > >
> > > > >
> > > > > Pavel
> > > >
> > > > Tried the 4.16-rc6 with nm 1.4.4 - I do not see the issue.
> > >
> > > Thanks for testing... but yes, 4.16 should be ok. If not fixed,
> > > problem will appear in 4.17-rc1.
> >
> > Where does the complaint occur? In the GUI, or with nmcli, or
> > somewhere else? Also, what's the output of "nmcli dev" after
> > resume?
>
> In the GUI. I click in place where I'd select access point, and menu
> does not show up, telling me that "network is disabled".
Ok, what does 'nmcli dev' and 'nmcli radio' show?
Dan
^ permalink raw reply
* Re: [PATCH net-next 0/4] net: dsa: Plug in PHYLINK support
From: Florian Fainelli @ 2018-03-19 17:45 UTC (permalink / raw)
To: Andrew Lunn
Cc: netdev, privat, vivien.didelot, davem, rmk+kernel, sean.wang,
Woojung.Huh, john, cphealy
In-Reply-To: <20180319134438.GE26039@lunn.ch>
On 03/19/2018 06:44 AM, Andrew Lunn wrote:
>> I think I will proceed differently for v2:
>>
>> - introduce DSA phylink_mac_ops in dsa_switch_ops, such that drivers can
>> define those as preliminary commits, those won't be used by
>> net/dsa/slave.c just yet though
>>
>> - have all relevant drivers implement phylink_mac_ops such that the
>> pluming is there and functional
>>
>> - switch net/dsa/slave.c to using PHYLINK
>>
>> That way, we should avoid any breakage in between and have an "atomic"
>> switch between PHYLIB and PHYLINK.
>
> Hi Florian
>
> That sounds good. Maybe we can also convert ZII devel B to using SFP
> at the same time?
That should be done, yes.
>
> I can take a look at implementing the Marvell phylink_mac_ops.
If you could do that, I would be grateful, without the datasheet things
will take time to be reverse engineered for me. AFAIR, Russell had sent
us patches separately that he used.
The way the patch series is structured right now, only the user-facing
ports will need to have phylink_mac_ops, which should help reduce the
amount of testing.
Thanks!
--
Florian
^ permalink raw reply
* Re: linux-next on x60: network manager often complains "network is disabled" after resume
From: Pavel Machek @ 2018-03-19 17:33 UTC (permalink / raw)
To: Dan Williams
Cc: Woody Suwalski, Rafael J. Wysocki, kernel list,
Linux-pm mailing list, Netdev list
In-Reply-To: <1521474008.20208.2.camel@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1071 bytes --]
On Mon 2018-03-19 10:40:08, Dan Williams wrote:
> On Mon, 2018-03-19 at 10:21 +0100, Pavel Machek wrote:
> > On Mon 2018-03-19 05:17:45, Woody Suwalski wrote:
> > > Pavel Machek wrote:
> > > > Hi!
> > > >
> > > > With recent linux-next, after resume networkmanager often claims
> > > > that
> > > > "network is disabled". Sometimes suspend/resume clears that.
> > > >
> > > > Any ideas? Does it work for you?
> > > >
> > > > Pavel
> > >
> > > Tried the 4.16-rc6 with nm 1.4.4 - I do not see the issue.
> >
> > Thanks for testing... but yes, 4.16 should be ok. If not fixed,
> > problem will appear in 4.17-rc1.
>
> Where does the complaint occur? In the GUI, or with nmcli, or
> somewhere else? Also, what's the output of "nmcli dev" after resume?
In the GUI. I click in place where I'd select access point, and menu
does not show up, telling me that "network is disabled".
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply
* [PATCH iproute2 net-next] bridge: add option extern_learn to set NTF_EXT_LEARNED on fdb entries
From: Roopa Prabhu @ 2018-03-19 17:20 UTC (permalink / raw)
To: dsahern; +Cc: netdev, nikolay
From: Roopa Prabhu <roopa@cumulusnetworks.com>
NTF_EXT_LEARNED can be set by a user on bridge fdb entry.
Provide a bridge command option to allow a user to set
NTF_EXT_LEARNED on a bridge fdb entry.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
bridge/fdb.c | 4 +++-
man/man8/bridge.8 | 8 +++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/bridge/fdb.c b/bridge/fdb.c
index 205b4fa..4dbc894 100644
--- a/bridge/fdb.c
+++ b/bridge/fdb.c
@@ -36,7 +36,7 @@ static void usage(void)
{
fprintf(stderr,
"Usage: bridge fdb { add | append | del | replace } ADDR dev DEV\n"
- " [ self ] [ master ] [ use ] [ router ]\n"
+ " [ self ] [ master ] [ use ] [ router ] [ extern_learn ]\n"
" [ local | static | dynamic ] [ dst IPADDR ] [ vlan VID ]\n"
" [ port PORT] [ vni VNI ] [ via DEV ]\n"
" bridge fdb [ show [ br BRDEV ] [ brport DEV ] [ vlan VID ] [ state STATE ] ]\n");
@@ -412,6 +412,8 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv)
vid = atoi(*argv);
} else if (matches(*argv, "use") == 0) {
req.ndm.ndm_flags |= NTF_USE;
+ } else if (matches(*argv, "extern_learn") == 0) {
+ req.ndm.ndm_flags |= NTF_EXT_LEARNED;
} else {
if (strcmp(*argv, "to") == 0)
NEXT_ARG();
diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
index 05512b0..e7f7148 100644
--- a/man/man8/bridge.8
+++ b/man/man8/bridge.8
@@ -61,7 +61,7 @@ bridge \- show / manipulate bridge addresses and devices
.B dev
.IR DEV " { "
.BR local " | " static " | " dynamic " } [ "
-.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ "
+.BR self " ] [ " master " ] [ " router " ] [ " use " ] [ " extern_learn " ] [ "
.B dst
.IR IPADDR " ] [ "
.B vni
@@ -414,6 +414,12 @@ route shortcircuit enabled.
indicate to the kernel that the fdb entry is in use.
.sp
+.B extern_learn
+- this entry was learned externally. This option can be used to
+indicate to the kernel that an entry was hardware or user-space
+controller learnt dynamic entry. Kernel will not age such an entry.
+.sp
+
.in -8
The next command line parameters apply only
when the specified device
--
2.1.4
^ permalink raw reply related
* Re: [PATCH RFC iproute2] libnetlink: allow reading more than one message from extack
From: Marcelo Ricardo Leitner @ 2018-03-19 17:14 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, Alexander Aring, Jiri Pirko, Jakub Kicinski
In-Reply-To: <20180319090950.3241e397@xeon-e3>
On Mon, Mar 19, 2018 at 09:09:50AM -0700, Stephen Hemminger wrote:
> On Fri, 16 Mar 2018 16:23:09 -0300
> Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> wrote:
>
> > This patch introduces support for reading more than one message from
> > extack's and to adjust their level (warning/error) accordingly.
> >
> > Yes, there is a FIXME tag in the callback call for now.
> >
> > Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
>
> Make sense, can hold off until kernel supports warnings.
Okay.
>
> > ---
> > lib/libnetlink.c | 55 ++++++++++++++++++++++++++++++++++++++++---------------
> > 1 file changed, 40 insertions(+), 15 deletions(-)
> >
> > diff --git a/lib/libnetlink.c b/lib/libnetlink.c
> > index 928de1dd16d84b7802c06d0a659f5d73e1bbcb4b..7c4c81e11e02ea857888190eb5e7a9e99d159bb3 100644
> > --- a/lib/libnetlink.c
> > +++ b/lib/libnetlink.c
> > @@ -43,9 +43,16 @@ static const enum mnl_attr_data_type extack_policy[NLMSGERR_ATTR_MAX + 1] = {
> > [NLMSGERR_ATTR_OFFS] = MNL_TYPE_U32,
> > };
> >
> > +#define NETLINK_MAX_EXTACK_MSGS 8
>
> Would rather not have fixed maximums
Makes sense. Then it is more forward-compatible in case we increase
that on kernel side later.
>
> > +struct extack_args {
> > + const struct nlattr *msg[NETLINK_MAX_EXTACK_MSGS];
> > + const struct nlattr *offs;
> > + int msg_count;
> > +};
>
> If you put msg[] last in structure, it could be variable length.
It will also require a two-times parsing then because we don't have an
attribute with the number of messages in there and we have to allocate
it with a certain length.
>
> > static int err_attr_cb(const struct nlattr *attr, void *data)
> > {
> > - const struct nlattr **tb = data;
> > + struct extack_args *tb = data;
> > uint16_t type;
> >
> > if (mnl_attr_type_valid(attr, NLMSGERR_ATTR_MAX) < 0) {
> > @@ -60,19 +67,23 @@ static int err_attr_cb(const struct nlattr *attr, void *data)
> > return MNL_CB_ERROR;
> > }
> >
> > - tb[type] = attr;
> > + if (type == NLMSGERR_ATTR_OFFS)
> > + tb->offs = attr;
> > + else if (tb->msg_count < NETLINK_MAX_EXTACK_MSGS)
> > + tb->msg[tb->msg_count++] = attr;
> > return MNL_CB_OK;
> > }
> >
> > /* dump netlink extended ack error message */
> > int nl_dump_ext_ack(const struct nlmsghdr *nlh, nl_ext_ack_fn_t errfn)
> > {
> > - struct nlattr *tb[NLMSGERR_ATTR_MAX + 1] = {};
> > + struct extack_args tb = {};
> > const struct nlmsgerr *err = mnl_nlmsg_get_payload(nlh);
> > const struct nlmsghdr *err_nlh = NULL;
> > unsigned int hlen = sizeof(*err);
> > - const char *msg = NULL;
> > + const char *msg[NETLINK_MAX_EXTACK_MSGS] = {};
> > uint32_t off = 0;
> > + int ret, i;
> >
> > /* no TLVs, nothing to do here */
> > if (!(nlh->nlmsg_flags & NLM_F_ACK_TLVS))
> > @@ -82,14 +93,14 @@ int nl_dump_ext_ack(const struct nlmsghdr *nlh, nl_ext_ack_fn_t errfn)
> > if (!(nlh->nlmsg_flags & NLM_F_CAPPED))
> > hlen += mnl_nlmsg_get_payload_len(&err->msg);
> >
> > - if (mnl_attr_parse(nlh, hlen, err_attr_cb, tb) != MNL_CB_OK)
> > + if (mnl_attr_parse(nlh, hlen, err_attr_cb, &tb) != MNL_CB_OK)
> > return 0;
> >
> > - if (tb[NLMSGERR_ATTR_MSG])
> > - msg = mnl_attr_get_str(tb[NLMSGERR_ATTR_MSG]);
> > + for (i = 0; i < NETLINK_MAX_EXTACK_MSGS && tb.msg[i]; i++)
> > + msg[i] = mnl_attr_get_str(tb.msg[i]);
> >
> > - if (tb[NLMSGERR_ATTR_OFFS]) {
> > - off = mnl_attr_get_u32(tb[NLMSGERR_ATTR_OFFS]);
> > + if (tb.offs) {
> > + off = mnl_attr_get_u32(tb.offs);
> >
> > if (off > nlh->nlmsg_len) {
> > fprintf(stderr,
> > @@ -100,21 +111,35 @@ int nl_dump_ext_ack(const struct nlmsghdr *nlh, nl_ext_ack_fn_t errfn)
> > }
> >
> > if (errfn)
> > - return errfn(msg, off, err_nlh);
> > + return errfn(*msg, off, err_nlh); /* FIXME */
> >
> > - if (msg && *msg != '\0') {
> > + ret = 0;
> > + for (i = 0; i < NETLINK_MAX_EXTACK_MSGS && msg[i]; i++) {
> > bool is_err = !!err->error;
> > + const char *_msg = msg[i];
> > +
> > + /* Message tagging has precedence.
> > + * KERN_WARNING = ASCII Start Of Header ('\001') + '4'
> > + */
> > + if (!strncmp(_msg, "\0014", 2)) {
> > + is_err = false;
> > + _msg += 2;
> > + }
>
> If you are going to have an API that has levels, it must be the same
> as existing syslog kernel log format and maybe even get some code reuse.
It is the same representation already. The magic "\0014" in there is
the same as KERN_WARNING. I'll check how other userspace applications
are dealing with this, as I don't see KERN_WARNING being exported to
userspace.
Thanks,
Marcelo
>
> > + /* But we can't have Error if it didn't fail. */
> > + if (is_err && !err->error)
> > + is_err = 0;
> >
> > fprintf(stderr, "%s: %s",
> > - is_err ? "Error" : "Warning", msg);
> > - if (msg[strlen(msg) - 1] != '.')
> > + is_err ? "Error" : "Warning", _msg);
> > + if (_msg[strlen(_msg) - 1] != '.')
> > fprintf(stderr, ".");
> > fprintf(stderr, "\n");
> >
> > - return is_err ? 1 : 0;
> > + if (is_err)
> > + ret = 1;
> > }
> >
> > - return 0;
> > + return ret;
> > }
> > #else
> > #warning "libmnl required for error support"
>
^ permalink raw reply
* Re: [PATCH v12 net-next 06/12] crypto: chtls - structure and macro for Inline TLS
From: Stefano Brivio @ 2018-03-19 17:02 UTC (permalink / raw)
To: Atul Gupta
Cc: davem, herbert, davejwatson, sd, linux-crypto, netdev, ganeshgr
In-Reply-To: <1521467745-23201-7-git-send-email-atul.gupta@chelsio.com>
On Mon, 19 Mar 2018 19:25:39 +0530
Atul Gupta <atul.gupta@chelsio.com> wrote:
> +#define SOCK_INLINE (31)
>
> [...]
>
> +static inline int csk_flag(const struct sock *sk, enum csk_flags flag)
> +{
> + struct chtls_sock *csk = rcu_dereference_sk_user_data(sk);
> +
> + if (!sock_flag(sk, SOCK_INLINE))
> + return 0;
Please take care of the comments.
I understand this series is big and you might be tempted to minimize
your effort in the hope that reviewers will fail to check that you
addressed their concerns.
You are also succeeding in making it hard by re-posting so quickly,
addressing a few "easy" comments at a time, without taking care of the
change log.
But still I believe your hopes are not so reasonably founded.
--
Stefano
^ 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