[PATCH net-next v2] net/mlx5e: add conntrack offload rules only in ct or ct_nat flow table

2020-05-29 Thread wenxu
From: wenxu In the ct offload all the conntrack entry offload rules will be add to both ct ft and ct_nat ft twice. It is not make sense. The driver can distinguish NAT from non-NAT conntrack through the FLOW_ACTION_MANGLE action. Signed-off-by: wenxu --- drivers/net/ethernet/mellanox/mlx5/core

Re: [PATCH] net/sched: act_ct: add nat mangle action only for NAT-conntrack

2020-05-29 Thread wenxu
在 2020/5/30 8:04, wenxu 写道: > 在 2020/5/30 1:56, Marcelo Ricardo Leitner 写道: >> On Fri, May 29, 2020 at 12:07:45PM +0800, we...@ucloud.cn wrote: >>> From: wenxu >>> >>> Currently add nat mangle action with comparing invert and ori tuple. >>> It is better to check IPS_NAT_MASK flags first to avoid

[PATCH v2] net/sched: act_ct: add nat mangle action only for NAT-conntrack

2020-05-29 Thread wenxu
From: wenxu Currently add nat mangle action with comparing invert and ori tuple. It is better to check IPS_NAT_MASK flags first to avoid non necessary memcmp for non-NAT conntrack. Signed-off-by: wenxu --- net/sched/act_ct.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/sched/act_

[PATCH net-next] mlx5: Restore err assignment in mlx5_mdev_init

2020-05-29 Thread Nathan Chancellor
Clang warns: drivers/net/ethernet/mellanox/mlx5/core/main.c:1278:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (!priv->dbg_root) { ^~~ drivers/net/ethernet/mellanox/mlx5/core/main.c:1303:9: note: unin

Re: [PATCH net-next v2] net/sched: fix a couple of splats in the error path of tcf_gate_init()

2020-05-29 Thread Cong Wang
On Fri, May 29, 2020 at 11:10 AM Davide Caratti wrote: > > this is caused by hrtimer_cancel(), running before hrtimer_init(). Fix it > ensuring to call hrtimer_cancel() only if clockid is valid, and the timer > has been initialized. After fixing this splat, the same error path causes > another pro

Re: [PATCH] flow_dissector: work around stack frame size warning

2020-05-29 Thread Cong Wang
On Fri, May 29, 2020 at 1:14 PM Arnd Bergmann wrote: > > The fl_flow_key structure is around 500 bytes, so having two of them > on the stack in one function now exceeds the warning limit after an > otherwise correct change: > > net/sched/cls_flower.c:298:12: error: stack frame size of 1056 bytes i

Re: [RFC PATCH net-next 0/3] TC: Introduce qevents

2020-05-29 Thread Cong Wang
On Thu, May 28, 2020 at 2:48 AM Petr Machata wrote: > So you propose to have further division within the block? To have sort > of namespaces within blocks or chains, where depending on the context, > only filters in the corresponding namespace are executed? What I suggest is to let filters (or ch

Re: [PATCH net] devinet: fix memleak in inetdev_init()

2020-05-29 Thread Cong Wang
On Fri, May 29, 2020 at 8:11 PM Yang Yingliang wrote: > > When devinet_sysctl_register() failed, the memory allocated > in neigh_parms_alloc() should be freed. > > Fixes: 20e61da7ffcf ("ipv4: fail early when creating netdev named all or > default") > Signed-off-by: Yang Yingliang Acked-by: Cong

[net-next 13/15] net/mlx5e: en_tc: Fix incorrect type in initializer warnings

2020-05-29 Thread Saeed Mahameed
Fix some trivial warnings of the type: warning: incorrect type in initializer (different base types) Signed-off-by: Saeed Mahameed Reviewed-by: Mark Bloch --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet

[net-next 14/15] net/mlx5e: en_tc: Fix cast to restricted __be32 warning

2020-05-29 Thread Saeed Mahameed
Fixes sparse warnings: warning: cast to restricted __be32 warning: restricted __be32 degrades to integer Signed-off-by: Saeed Mahameed Reviewed-by: Mark Bloch --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/

[net-next 12/15] net/mlx5: IPSec: Fix incorrect type for spi

2020-05-29 Thread Saeed Mahameed
spi is __be32, fix that. Fixes sparse warning: drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec.c:74:64 warning: incorrect type Signed-off-by: Saeed Mahameed --- include/linux/mlx5/accel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mlx5/accel.h b/includ

[net-next 10/15] net/mlx5: cmd: Fix memset with byte count warning

2020-05-29 Thread Saeed Mahameed
Fix sparse warning: drivers/net/ethernet/mellanox/mlx5/core/cmd.c:1949:15: warning: memset with byte count of 271720 mlx5_cmd_stats array is too big to be held inline in mlx5_cmd. Allocate it separately. Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 20 ++

[net-next 15/15] net/mlx5e: Make mlx5e_dcbnl_ops static

2020-05-29 Thread Saeed Mahameed
Fix sparse warning: drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c:988:29: error: symbol 'mlx5e_dcbnl_ops' was not declared. Should it be static? Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -

[net-next 11/15] net/mlx5: Accel: fpga tls fix cast to __be64 and incorrect argument types

2020-05-29 Thread Saeed Mahameed
tls handle and rcd_sn are actually big endian and not in host format. Fix that. Fix the following sparse warnings: drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls.c:177:21: warning: cast to restricted __be64 drivers/net/ethernet/mellanox/mlx5/core/en_accel/tls.c:178:52: warning: incorrect ty

[net-next 08/15] net/mlx5: DR: Fix cast to restricted __be32

2020-05-29 Thread Saeed Mahameed
raw_ip actual type is __be32 and not u32. Fix that and get rid of the warning. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c:906:31: warning: cast to restricted __be32 Signed-off-by: Saeed Mahameed Reviewed-by: Mark Bloch --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.

[net-next 06/15] net/mlx5e: Use generic API to build MPLS label

2020-05-29 Thread Saeed Mahameed
From: Eli Cohen Make use of generic API mpls_entry_encode() to build mpls label and get rid of local function. Signed-off-by: Eli Cohen Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/en/tc_tun_mplsoudp.c | 20 +++ 1 file changed, 3 insertions(+), 17 deletions(-) d

[net-next 03/15] net/mlx5e: Don't use err uninitialized in mlx5e_attach_decap

2020-05-29 Thread Saeed Mahameed
From: Nathan Chancellor Clang warns: drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:3712:6: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (IS_ERR(d->pkt_reformat)) { ^~~ drivers/net/ethernet/

[net-next 07/15] net/mlx5: DR: Fix incorrect type in argument

2020-05-29 Thread Saeed Mahameed
HW spec objects should receive a void ptr to work on, the MLX5_SET/GET macro will know how to handle it. No need to provide explicit or wrong pointer type in this case. warning: incorrect type in argument 1 (different base types) expected unsigned long long const [usertype] *sw_action got

[net-next 09/15] net/mlx5: DR: Fix incorrect type in return expression

2020-05-29 Thread Saeed Mahameed
dr_ste_crc32_calc() calculates crc32 and should return it in HW format. It is being used to calculate a u32 index, hence we force the return value of u32 to avoid the sparse warning: drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c:115:16: warning: incorrect type in return expression (dif

[net-next 01/15] mlx5: fix xdp data_meta setup in mlx5e_fill_xdp_buff

2020-05-29 Thread Saeed Mahameed
From: Jesper Dangaard Brouer The helper function xdp_set_data_meta_invalid() must be called after setting xdp->data as it depends on it. The bug was introduced in the cited patch below, and cause the kernel to crash when using BPF helper bpf_xdp_adjust_head() on mlx5 driver. Fixes: 39d6443c8daf

[pull request][net-next 00/15] mlx5 cleanup 2020-05-29

2020-05-29 Thread Saeed Mahameed
Hi Dave/Jakub, While the TLS RX series is being discussed, If it is ok with you, i would like to get this cleanup series merged into net-next. This series provides some trivial fixes, cleanup and follow-up on previous net-next submissions. Highlights: 1) XDP data meta setup fix By Jesper. 2) In

[net-next 05/15] net: Make mpls_entry_encode() available for generic users

2020-05-29 Thread Saeed Mahameed
From: Eli Cohen Move mpls_entry_encode() from net/mpls/internal.h to include/net/mpls.h and make it available for other users. Specifically, hardware driver that offload MPLS can benefit from that. Suggested-by: Jakub Kicinski Suggested-by: David Ahern Signed-off-by: Eli Cohen Signed-off-by:

[net-next 04/15] net/mlx5: reduce stack usage in qp_read_field

2020-05-29 Thread Saeed Mahameed
From: Arnd Bergmann Moving the mlx5_ifc_query_qp_out_bits structure on the stack was a bit excessive and now causes the compiler to complain on 32-bit architectures: drivers/net/ethernet/mellanox/mlx5/core/debugfs.c: In function 'qp_read_field': drivers/net/ethernet/mellanox/mlx5/core/debugfs.c:

[net-next 02/15] net/mlx5: Kconfig: Fix spelling typo

2020-05-29 Thread Saeed Mahameed
"mdoe"->"mode" Fixes: d956873f908c ("net/mlx5e: Introduce kconfig var for TC support") Signed-off-by: Saeed Mahameed Reported-by: Marcelo Ricardo Leitner --- drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/

Re: [net-next 10/11] net/mlx5e: kTLS, Add kTLS RX resync support

2020-05-29 Thread Saeed Mahameed
On Fri, 2020-05-29 at 22:47 +, Saeed Mahameed wrote: > On Fri, 2020-05-29 at 14:50 -0700, Jakub Kicinski wrote: > > On Fri, 29 May 2020 20:44:29 + Saeed Mahameed wrote: > > > > I thought you said that resync requests are guaranteed to never > > > > fail? > > > > > > I didn't say that :),

Re: [PATCH net] tun: correct header offsets in napi frags mode

2020-05-29 Thread Willem de Bruijn
On Fri, May 29, 2020 at 8:27 PM David Miller wrote: > > From: Willem de Bruijn > Date: Thu, 28 May 2020 13:05:32 -0400 > > > Temporarily pull ETH_HLEN to make control flow the same for frags and > > not frags. Then push the header just before calling napi_gro_frags. > ... > > case IFF_TAP:

[PATCH net] devinet: fix memleak in inetdev_init()

2020-05-29 Thread Yang Yingliang
When devinet_sysctl_register() failed, the memory allocated in neigh_parms_alloc() should be freed. Fixes: 20e61da7ffcf ("ipv4: fail early when creating netdev named all or default") Signed-off-by: Yang Yingliang --- net/ipv4/devinet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv

[PATCH] net: vmxnet3: fix possible buffer overflow caused by bad DMA value in vmxnet3_get_rss()

2020-05-29 Thread Jia-Ju Bai
The value adapter->rss_conf is stored in DMA memory, and it is assigned to rssConf, so rssConf->indTableSize can be modified at anytime by malicious hardware. Because rssConf->indTableSize is assigned to n, buffer overflow may occur when the code "rssConf->indTable[n]" is executed. To fix this pos

Re: [net-next 1/6] net: marvell: prestera: Add driver for Prestera family ASIC devices

2020-05-29 Thread Andrew Lunn
On Sat, May 30, 2020 at 03:46:22AM +0300, Vadym Kochan wrote: > Hi David, > > On Fri, May 29, 2020 at 05:18:39PM -0700, David Miller wrote: > > > > Please remove all of the __packed attributes. > > > > I looked at your data structures and all of them use fixed sized types > > and are multiples o

[PATCH net-next v3] hinic: add set_channels ethtool_ops support

2020-05-29 Thread Luo bin
add support to change TX/RX queue number with ethtool -L ethx combined Signed-off-by: Luo bin --- .../net/ethernet/huawei/hinic/hinic_ethtool.c | 40 +++ .../net/ethernet/huawei/hinic/hinic_main.c| 2 +- drivers/net/ethernet/huawei/hinic/hinic_tx.c | 5 +++ 3 files changed

[PATCH v3] virtio_vsock: Fix race condition in virtio_transport_recv_pkt

2020-05-29 Thread Jia He
When client on the host tries to connect(SOCK_STREAM, O_NONBLOCK) to the server on the guest, there will be a panic on a ThunderX2 (armv8a server): [ 463.718844] Unable to handle kernel NULL pointer dereference at virtual address [ 463.718848] Mem abort info: [ 463.718849] E

Re: [PATCH net-next v2] hinic: add set_channels ethtool_ops support

2020-05-29 Thread luobin (L)
On 2020/5/30 1:44, Jakub Kicinski wrote: On Thu, 28 May 2020 18:36:33 + Luo bin wrote: add support to change TX/RX queue number with ethtool -L Signed-off-by: Luo bin Luo bin, your patches continue to come with Date: header being in the past. Also suspiciously no time zone offset. Can yo

RE: [PATCH v2] virtio_vsock: Fix race condition in virtio_transport_recv_pkt

2020-05-29 Thread Justin He
Hi Stefano > -Original Message- > From: Stefano Garzarella > Sent: Saturday, May 30, 2020 12:34 AM > To: Justin He > Cc: Stefan Hajnoczi ; David S. Miller > ; Jakub Kicinski ; > k...@vger.kernel.org; virtualizat...@lists.linux-foundation.org; > netdev@vger.kernel.org; linux-ker...@vger.k

[PATCH net-next 5/6] net: hns3: fix two coding style issues in hclgevf_main.c

2020-05-29 Thread Huazhong Tan
Remove a redundant blank line in hclgevf_cmd_set_promisc_mode(), and fix a reverse xmas tree coding style issue in hclgevf_set_rss_tc_mode(). Reported-by: Jian Shen Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 3 +-- 1 file changed, 1 insertion(+),

[PATCH net-next 3/6] net: hns3: remove two unused macros in hclgevf_cmd.c

2020-05-29 Thread Huazhong Tan
Macro hclgevf_ring_to_dma_dir and hclgevf_is_csq defined in hclgevf_cmd.c, but not used, so remove them. Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclge

[PATCH net-next 6/6] net: hns3: remove some unused codes in hns3_nic_set_features()

2020-05-29 Thread Huazhong Tan
NETIF_F_HW_VLAN_CTAG_FILTER is not set in netdev->hw_feature for the HNS3 driver, so the handler of NETIF_F_HW_VLAN_CTAG_FILTER in hns3_nic_set_features() won't be called, remove it. Reported-by: Jian Shen Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 6 -

[PATCH net-next 2/6] net: hns3: remove an unused macro hclge_is_csq

2020-05-29 Thread Huazhong Tan
Macro hclge_is_csq defined in hcgle_cmd.c has not been used, so remove it. Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c b/drivers/net/ethernet/hi

[PATCH net-next 4/6] net: hns3: fix an incorrect comment for num_tqps in struct hclgevf_dev

2020-05-29 Thread Huazhong Tan
struct hclgevf_dev stands for VF device, its field num_tqps indicates the number of VF's task queue pairs, so the comment is incorrect, replace 'PF' with 'VF'. Reported-by: Jian Shen Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 2 +- 1 file changed

[PATCH net-next 1/6] net: hns3: fix a print format issue in hclge_mac_mdio_config()

2020-05-29 Thread Huazhong Tan
Use %d to print int variable 'ret' in hclge_mac_mdio_config(). Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethern

[PATCH net-next 0/6] net: hns3: adds some cleanups for -next

2020-05-29 Thread Huazhong Tan
There are some cleanups for the HNS3 ethernet driver, fix an incorrect print format, an incorrect comment and some coding style issues, also remove some unused codes and macros. Huazhong Tan (6): net: hns3: fix a print format issue in hclge_mac_mdio_config() net: hns3: remove an unused macro h

Re: [net-next 1/6] net: marvell: prestera: Add driver for Prestera family ASIC devices

2020-05-29 Thread Vadym Kochan
Hi David, On Fri, May 29, 2020 at 05:18:39PM -0700, David Miller wrote: > > Please remove all of the __packed attributes. > > I looked at your data structures and all of them use fixed sized types > and are multiples of 4 so the __packed attribute is completely > unnecessary. > > The alignment

Re: [PATCH net-next] tcp: tcp_init_buffer_space can be static

2020-05-29 Thread David Miller
From: Florian Westphal Date: Fri, 29 May 2020 00:01:52 +0200 > As of commit 98fa6271cfcb > ("tcp: refactor setting the initial congestion window") this is called > only from tcp_input.c, so it can be static. > > Signed-off-by: Florian Westphal Applied, thanks Florian.

Re: [PATCH] net: ethtool: cabletest: Make ethnl_act_cable_test_tdr_cfg static

2020-05-29 Thread David Miller
From: Andrew Lunn Date: Thu, 28 May 2020 23:43:24 +0200 > kbuild test robot is reporting: > net/ethtool/cabletest.c:230:5: warning: no previous prototype for > > Mark the function as static. > > Reported-by: kbuild test robot > Signed-off-by: Andrew Lunn Applied, thanks Andrew. Please put "

Re: [PATCH net] tun: correct header offsets in napi frags mode

2020-05-29 Thread David Miller
From: Willem de Bruijn Date: Thu, 28 May 2020 13:05:32 -0400 > Temporarily pull ETH_HLEN to make control flow the same for frags and > not frags. Then push the header just before calling napi_gro_frags. ... > case IFF_TAP: > - if (!frags) > - skb->protocol =

Re: [PATCH net] drivers/net/ibmvnic: Update VNIC protocol version reporting

2020-05-29 Thread David Miller
From: Thomas Falcon Date: Thu, 28 May 2020 11:19:17 -0500 > VNIC protocol version is reported in big-endian format, but it > is not byteswapped before logging. Fix that, and remove version > comparison as only one protocol version exists at this time. > > Signed-off-by: Thomas Falcon Applied,

Re: [net-next 1/6] net: marvell: prestera: Add driver for Prestera family ASIC devices

2020-05-29 Thread David Miller
Please remove all of the __packed attributes. I looked at your data structures and all of them use fixed sized types and are multiples of 4 so the __packed attribute is completely unnecessary. The alignment attribute is also unnecessary so please remove that too.

Re: [PATCH][net-next] nexthop: fix incorrect allocation failure on nhg->spare

2020-05-29 Thread David Miller
From: Colin King Date: Thu, 28 May 2020 15:51:14 +0100 > @@ -1185,7 +1185,7 @@ static struct nexthop *nexthop_create_group(struct net > *net, > > /* spare group used for removals */ > nhg->spare = nexthop_grp_alloc(num_nh); I don't even see this line in the current net-next tree n

Re: [PATCH net-next] nfp: flower: fix incorrect flag assignment

2020-05-29 Thread David Miller
From: Simon Horman Date: Thu, 28 May 2020 16:18:46 +0200 > From: Louis Peens > > A previous refactoring missed some locations the flags were renamed > but not moved from the previous flower_ext_feats to the new flower_en_feats > variable. This lead to the FLOW_MERGE and LAG features not being e

Re: [PATCH net-next v2] dt-bindings: net: rename the bindings document for MediaTek STAR EMAC

2020-05-29 Thread David Miller
From: Bartosz Golaszewski Date: Thu, 28 May 2020 15:59:02 +0200 > From: Bartosz Golaszewski > > The driver itself was renamed before getting merged into mainline, but > the binding document kept the old name. This makes both names consistent. > > Signed-off-by: Bartosz Golaszewski > --- > v1

Re: [PATCH] NFC: st21nfca: add missed kfree_skb() in an error path

2020-05-29 Thread David Miller
From: Chuhong Yuan Date: Thu, 28 May 2020 18:20:37 +0800 > st21nfca_tm_send_atr_res() misses to call kfree_skb() in an error path. > Add the missed function call to fix it. > > Fixes: 1892bf844ea0 ("NFC: st21nfca: Adding P2P support to st21nfca in > Initiator & Target mode") > Signed-off-by: Ch

Re: [PATCH] net/sched: act_ct: add nat mangle action only for NAT-conntrack

2020-05-29 Thread wenxu
在 2020/5/30 1:56, Marcelo Ricardo Leitner 写道: > On Fri, May 29, 2020 at 12:07:45PM +0800, we...@ucloud.cn wrote: >> From: wenxu >> >> Currently add nat mangle action with comparing invert and ori tuple. >> It is better to check IPS_NAT_MASK flags first to avoid non necessary >> memcmp for non-NA

Re: [PATCH v2 net 0/3] net: ethernet: dwmac: add ethernet glue logic for NXP imx8 chip

2020-05-29 Thread David Miller
From: fugang.d...@nxp.com Date: Thu, 28 May 2020 16:26:22 +0800 > From: Fugang Duan > > NXP imx8 family like imx8mp/imx8dxl chips support Synopsys > MAC 5.10a IP, the patch set is to add ethernet DWMAC glue > layer including clocks, dwmac address width, phy interface > mode selection and rgmii t

Re: [PATCH net-next] tipc: remove set but not used variable 'prev'

2020-05-29 Thread David Miller
From: YueHaibing Date: Thu, 28 May 2020 07:43:59 + > Fixes gcc '-Wunused-but-set-variable' warning: > > net/tipc/msg.c: In function 'tipc_msg_append': > net/tipc/msg.c:215:24: warning: > variable 'prev' set but not used [-Wunused-but-set-variable] > > commit 0a3e060f340d ("tipc: add test f

Re: [PATCH net] neigh: fix ARP retransmit timer guard

2020-05-29 Thread David Miller
From: Hangbin Liu Date: Thu, 28 May 2020 15:15:13 +0800 > In commit 19e16d220f0a ("neigh: support smaller retrans_time settting") > we add more accurate control for ARP and NS. But for ARP I forgot to > update the latest guard in neigh_timer_handler(), then the next > retransmit would be reset to

Re: [net-next 0/2] net: sched: cls-flower: add support for port-based fragment filtering

2020-05-29 Thread David Miller
From: Jason Baron Date: Wed, 27 May 2020 16:25:28 -0400 > Port based allow rules must currently allow all fragments since the > port number is not included in the 1rst fragment. We want to restrict > allowing all fragments by inclucding the port number in the 1rst > fragments. > > For example, w

Re: [PATCH net-next] net: dsa: sja1105: avoid invalid state in sja1105_vlan_filtering

2020-05-29 Thread David Miller
From: Vladimir Oltean Date: Wed, 27 May 2020 20:20:38 +0300 > From: Vladimir Oltean > > Be there 2 switches spi/spi2.0 and spi/spi2.1 in a cross-chip setup, > both under the same VLAN-filtering bridge, both in the > SJA1105_VLAN_BEST_EFFORT state. > > If we try to change the VLAN state of one

Re: [PATCH net-next] net: dsa: tag_8021q: stop restoring VLANs from bridge

2020-05-29 Thread David Miller
From: Vladimir Oltean Date: Wed, 27 May 2020 19:41:34 +0300 > From: Vladimir Oltean > > Right now, our only tag_8021q user, sja1105, has the ability to restore > bridge VLANs on its own, so this logic is unnecessary. > > Signed-off-by: Vladimir Oltean The tagging code had no business doing t

Re: [PATCH net] net: dsa: sja1105: fix port mirroring for P/Q/R/S

2020-05-29 Thread David Miller
From: Vladimir Oltean Date: Wed, 27 May 2020 19:40:06 +0300 > From: Vladimir Oltean > > The dynamic configuration interface for the General Params and the L2 > Lookup Params tables was copy-pasted between E/T devices and P/Q/R/S > devices. Nonetheless, these interfaces are bitwise different (an

[PATCH 1/2] docs: mm/gup: pin_user_pages.rst: add a "case 5"

2020-05-29 Thread John Hubbard
There are four cases listed in pin_user_pages.rst. These are intended to help developers figure out whether to use get_user_pages*(), or pin_user_pages*(). However, the four cases do not cover all the situations. For example, drivers/vhost/vhost.c has a "pin, write to page, set page dirty, unpin" c

[PATCH 2/2] vhost: convert get_user_pages() --> pin_user_pages()

2020-05-29 Thread John Hubbard
This code was using get_user_pages*(), in approximately a "Case 5" scenario (accessing the data within a page), using the categorization from [1]. That means that it's time to convert the get_user_pages*() + put_page() calls to pin_user_pages*() + unpin_user_pages() calls. There is some helpful ba

[PATCH 0/2] vhost, docs: convert to pin_user_pages(), new "case 5"

2020-05-29 Thread John Hubbard
Hi, It recently became clear to me that there are some get_user_pages*() callers that don't fit neatly into any of the four cases that are so far listed in pin_user_pages.rst. vhost.c is one of those. Add a Case 5 to the documentation, and refer to that when converting vhost.c. Thanks to Jan Kar

Re: [PATCH net-next] vxlan: remove fdb when out interface is removed

2020-05-29 Thread David Miller
From: Taehee Yoo Date: Wed, 27 May 2020 16:29:50 + > vxlan fdb can have NDA_IFINDEX, which indicates an out interface. > If the interface is removed, that fdb will not work. > So, when interface is removed, vxlan's fdb can be removed. > > Test commands: > ip link add dummy0 type dummy >

Re: [PATCH net-next] rds: transport module should be auto loaded when transport is set

2020-05-29 Thread David Miller
From: rao.sho...@oracle.com Date: Wed, 27 May 2020 01:17:42 -0700 > diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h > index cba368e55863..7273c681e6c1 100644 > --- a/include/uapi/linux/rds.h > +++ b/include/uapi/linux/rds.h > @@ -64,7 +64,7 @@ > > /* supported values for SO_RDS

Re: [PATCH net-next] net: dsa: felix: support half-duplex link modes

2020-05-29 Thread Vladimir Oltean
On Thu, 28 May 2020 at 12:44, Vladimir Oltean wrote: > > From: Vladimir Oltean > > Ping tested: > > [ 11.808455] mscc_felix :00:00.5 swp0: Link is Up - 1Gbps/Full - flow > control rx/tx > [ 11.816497] IPv6: ADDRCONF(NETDEV_CHANGE): swp0: link becomes ready > > [root@LS1028ARDB ~] # ethto

Re: [PATCH net-next,v2] crypto/chtls: IPv6 support for inline TLS

2020-05-29 Thread David Miller
From: Vinay Kumar Yadav Date: Wed, 27 May 2020 11:23:52 +0530 > @@ -2110,6 +2110,7 @@ struct proto tcpv6_prot = { > #endif > .diag_destroy = tcp_abort, > }; > +EXPORT_SYMBOL(tcpv6_prot); If you are going to do something which is so invasive and exposes internals so deeply, you

Re: [pull request][net V2 0/7] mlx5 fixes 2020-05-28

2020-05-29 Thread David Miller
From: Saeed Mahameed Date: Fri, 29 May 2020 13:46:03 -0700 > This series introduces some fixes to mlx5 driver. > > v1->v2: > - Fix bad sha1, Jakub. > - Added one more patch by Pablo. >net/mlx5e: replace EINVAL in mlx5e_flower_parse_meta() > > > Nothing major, the only patch worth mention

[bpf-next PATCH 2/3] bpf: fix running sk_skb program types with ktls

2020-05-29 Thread John Fastabend
KTLS uses a stream parser to collect TLS messages and send them to the upper layer tls receive handler. This ensures the tls receiver has a full TLS header to parse when it is run. However, when a socket has BPF_SK_SKB_STREAM_VERDICT program attached before KTLS is enabled we end up with two stream

[bpf-next PATCH 3/3] bpf, selftests: add test for ktls with skb bpf ingress policy

2020-05-29 Thread John Fastabend
This adds a test for bpf ingress policy. To ensure data writes happen as expected with extra TLS headers we run these tests with data verification enabled by default. This will test receive packets have "PASS" stamped into the front of the payload. Signed-off-by: John Fastabend --- .../selftests

[bpf-next PATCH 1/3] bpf: refactor sockmap redirect code so its easy to reuse

2020-05-29 Thread John Fastabend
We will need this block of code called from tls context shortly lets refactor the redirect logic so its easy to use. This also cleans up the switch stmt so we have fewer fallthrough cases. No logic changes are intended. Fixes: d829e9c4112b5 ("tls: convert to generic sk_msg interface") Signed-off-

[bpf-next PATCH 0/3] fix ktls with sk_skb_verdict programs

2020-05-29 Thread John Fastabend
If a socket is running a BPF_SK_SKB_SREAM_VERDICT program and KTLS is enabled the data stream may be broken if both TLS stream parser and BPF stream parser try to handle data. Fix this here by making KTLS stream parser run first to ensure TLS messages are received correctly and then calling the ver

Re: pull-request: bpf 2020-05-29

2020-05-29 Thread David Miller
From: Alexei Starovoitov Date: Fri, 29 May 2020 13:47:16 -0700 > The following pull-request contains BPF updates for your *net* tree. Pulled, thanks Alexei.

Re: [net-next 10/11] net/mlx5e: kTLS, Add kTLS RX resync support

2020-05-29 Thread Saeed Mahameed
On Fri, 2020-05-29 at 14:50 -0700, Jakub Kicinski wrote: > On Fri, 29 May 2020 20:44:29 + Saeed Mahameed wrote: > > > I thought you said that resync requests are guaranteed to never > > > fail? > > > > I didn't say that :), maybe tariq did say this before my review, > > Boris ;) > > > but b

Re: general protection fault in inet_unhash

2020-05-29 Thread Andrii Nakryiko
On 5/29/20 10:32 AM, Eric Dumazet wrote: On 5/28/20 11:32 PM, Andrii Nakryiko wrote: On 5/28/20 11:23 PM, Dmitry Vyukov wrote: On Thu, May 28, 2020 at 11:01 PM 'Andrii Nakryiko' via syzkaller-bugs wrote: On 5/28/20 9:44 AM, syzbot wrote: Hello, syzbot found the following crash on: HEAD

RE: [PATCH net-next v3 2/7] dpaa2-eth: Distribute ingress frames based on VLAN prio

2020-05-29 Thread Ioana Ciornei
> Subject: Re: [PATCH net-next v3 2/7] dpaa2-eth: Distribute ingress frames > based > on VLAN prio > > On Fri, 29 May 2020 21:41:38 + Ioana Ciornei wrote: > > > Subject: Re: [PATCH net-next v3 2/7] dpaa2-eth: Distribute ingress > > > frames based on VLAN prio > > > > > > On Fri, 29 May 2020 2

[PATCH v4 bpf-next 2/5] bpf: Add support to attach bpf program to a devmap entry

2020-05-29 Thread David Ahern
Add BPF_XDP_DEVMAP attach type for use with programs associated with a DEVMAP entry. Allow DEVMAPs to associate a program with a device entry by adding a bpf_prog.fd to 'struct bpf_devmap_val'. Values read show the program id, so the fd and id are a union. bpf programs can get access to the struct

[PATCH v4 bpf-next 5/5] selftest: Add tests for XDP programs in devmap entries

2020-05-29 Thread David Ahern
Add tests to verify ability to add an XDP program to a entry in a DEVMAP. Add negative tests to show DEVMAP programs can not be attached to devices as a normal XDP program, and accesses to egress_ifindex require BPF_XDP_DEVMAP attach type. Signed-off-by: David Ahern Acked-by: Toke Høiland-Jørgen

[PATCH v4 bpf-next 0/5] bpf: Add support for XDP programs in DEVMAP entries

2020-05-29 Thread David Ahern
Implementation of Daniel's proposal for allowing DEVMAP entries to be a device index, program fd pair. Programs are run after XDP_REDIRECT and have access to both Rx device and Tx device. v4 - moved struct bpf_devmap_val from uapi to devmap.c, named the union and dropped the prefix from the ele

[PATCH v4 bpf-next 1/5] devmap: Formalize map value as a named struct

2020-05-29 Thread David Ahern
Add 'struct bpf_devmap_val' to formalize the expected values that can be passed in for a DEVMAP. Update devmap code to use the struct. Signed-off-by: David Ahern Acked-by: Toke Høiland-Jørgensen --- kernel/bpf/devmap.c | 45 - 1 file changed, 28 inser

[PATCH v4 bpf-next 4/5] libbpf: Add SEC name for xdp programs attached to device map

2020-05-29 Thread David Ahern
Support SEC("xdp_devmap*") as a short cut for loading the program with type BPF_PROG_TYPE_XDP and expected attach type BPF_XDP_DEVMAP. Signed-off-by: David Ahern Acked-by: Toke Høiland-Jørgensen --- tools/lib/bpf/libbpf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/lib/bpf/libbp

[PATCH v4 bpf-next 3/5] xdp: Add xdp_txq_info to xdp_buff

2020-05-29 Thread David Ahern
Add xdp_txq_info as the Tx counterpart to xdp_rxq_info. At the moment only the device is added. Other fields (queue_index) can be added as use cases arise. >From a UAPI perspective, add egress_ifindex to xdp context for bpf programs to see the Tx device. Update the verifier to only allow accesses

Re: [PATCH net-next v3 2/7] dpaa2-eth: Distribute ingress frames based on VLAN prio

2020-05-29 Thread Jakub Kicinski
On Fri, 29 May 2020 21:41:38 + Ioana Ciornei wrote: > > Subject: Re: [PATCH net-next v3 2/7] dpaa2-eth: Distribute ingress frames > > based > > on VLAN prio > > > > On Fri, 29 May 2020 20:43:40 +0300 Ioana Ciornei wrote: > > > From: Ioana Radulescu > > > > > > Configure static ingress clas

Re: [net-next 10/11] net/mlx5e: kTLS, Add kTLS RX resync support

2020-05-29 Thread Jakub Kicinski
On Fri, 29 May 2020 20:44:29 + Saeed Mahameed wrote: > > I thought you said that resync requests are guaranteed to never fail? > > I didn't say that :), maybe tariq did say this before my review, Boris ;) > but basically with the current mlx5 arch, it is impossible to guarantee > this unles

RE: [PATCH net-next v3 2/7] dpaa2-eth: Distribute ingress frames based on VLAN prio

2020-05-29 Thread Ioana Ciornei
> Subject: Re: [PATCH net-next v3 2/7] dpaa2-eth: Distribute ingress frames > based > on VLAN prio > > On Fri, 29 May 2020 20:43:40 +0300 Ioana Ciornei wrote: > > From: Ioana Radulescu > > > > Configure static ingress classification based on VLAN PCP field. > > If the DPNI doesn't have enough

Re: [PATCH] lan743x: Added fixed link and RGMII support

2020-05-29 Thread Andrew Lunn
On Fri, May 29, 2020 at 09:30:02PM +0200, Roelof Berg wrote: > Microchip lan7431 is frequently connected to a phy. However, it > can also be directly connected to a MII remote peer without > any phy in between. For supporting such a phyless hardware setup > in Linux we utilized phylib, which suppor

Re: [PATCH net-next v3 2/7] dpaa2-eth: Distribute ingress frames based on VLAN prio

2020-05-29 Thread Jakub Kicinski
On Fri, 29 May 2020 20:43:40 +0300 Ioana Ciornei wrote: > From: Ioana Radulescu > > Configure static ingress classification based on VLAN PCP field. > If the DPNI doesn't have enough traffic classes to accommodate all > priority levels, the lowest ones end up on TC 0 (default on miss). > > Signe

Re: [PATCH net-next v4 1/4] dt-bindings: net: Add tx and rx internal delays

2020-05-29 Thread Rob Herring
On Fri, May 29, 2020 at 1:24 PM Dan Murphy wrote: > > Rob > > On 5/29/20 1:25 PM, Rob Herring wrote: > > On Wed, May 27, 2020 at 11:49:31AM -0500, Dan Murphy wrote: > >> tx-internal-delays and rx-internal-delays are a common setting for RGMII > >> capable devices. > >> > >> These properties are us

Re: [PATCH v2 bpf-next 2/4] bpf: Introduce sleepable BPF programs

2020-05-29 Thread Alexei Starovoitov
On Fri, May 29, 2020 at 01:38:40PM -0700, Andrii Nakryiko wrote: > > > > if (prog->type == BPF_PROG_TYPE_STRUCT_OPS) > > > > return check_struct_ops_btf_id(env); > > > > > > > > @@ -10762,8 +10801,29 @@ static int check_attach_btf_id(struct > > > > bpf_verifier_env *env) >

Re: [PATCH 7/9] bpf: Compile the BTF id whitelist data in vmlinux

2020-05-29 Thread Andrii Nakryiko
On Thu, May 28, 2020 at 10:24 AM Jiri Olsa wrote: > > On Thu, May 14, 2020 at 03:46:26PM -0700, Andrii Nakryiko wrote: > > SNIP > > > > I was thinking of putting the names in __init section and generate the BTF > > > ids on kernel start, but the build time generation seemed more > > > convenient.

pull-request: bpf 2020-05-29

2020-05-29 Thread Alexei Starovoitov
Hi David, The following pull-request contains BPF updates for your *net* tree. We've added 6 non-merge commits during the last 7 day(s) which contain a total of 4 files changed, 55 insertions(+), 34 deletions(-). The main changes are: 1) minor verifier fix for fmod_ret progs, from Alexei. 2) a

[net V2 7/7] net/mlx5e: replace EINVAL in mlx5e_flower_parse_meta()

2020-05-29 Thread Saeed Mahameed
From: Pablo Neira Ayuso The drivers reports EINVAL to userspace through netlink on invalid meta match. This is confusing since EINVAL is usually reserved for malformed netlink messages. Replace it by more meaningful codes. Fixes: 6d65bc64e232 ("net/mlx5e: Add mlx5e_flower_parse_meta support") Si

[net V2 5/7] net/mlx5e: Properly set default values when disabling adaptive moderation

2020-05-29 Thread Saeed Mahameed
From: Tal Gilboa Add a call to mlx5e_reset_rx/tx_moderation() when enabling/disabling adaptive moderation, in order to select the proper default values. In order to do so, we separate the logic of selecting the moderation values and setting moderion mode (CQE/EQE based). Fixes: 0088cbbc4b66 ("n

[net V2 2/7] net/mlx5e: Fix stats update for matchall classifier

2020-05-29 Thread Saeed Mahameed
From: Roi Dayan It's bytes, packets, lastused. Fixes: fcb64c0f5640 ("net/mlx5: E-Switch, add ingress rate support") Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dr

[net V2 4/7] net/mlx5e: Fix arch depending casting issue in FEC

2020-05-29 Thread Saeed Mahameed
From: Aya Levin Change type of active_fec to u32 to match the type expected by mlx5e_get_fec_mode. Copy active_fec and configured_fec values to unsigned long before preforming bitwise manipulations. Take the same approach when configuring FEC over 50G link modes: copy the policy into an unsigned

[net V2 3/7] net/mlx5e: Remove warning "devices are not on same switch HW"

2020-05-29 Thread Saeed Mahameed
From: Maor Dickman On tunnel decap rule insertion, the indirect mechanism will attempt to offload the rule on all uplink representors which will trigger the "devices are not on same switch HW, can't offload forwarding" message for the uplink which isn't on the same switch HW as the VF representor

[net V2 6/7] net/mlx5e: Fix MLX5_TC_CT dependencies

2020-05-29 Thread Saeed Mahameed
From: Vlad Buslov Change MLX5_TC_CT config dependencies to include MLX5_ESWITCH instead of MLX5_CORE_EN && NET_SWITCHDEV, which are already required by MLX5_ESWITCH. Without this change mlx5 fails to compile if user disables MLX5_ESWITCH without also manually disabling MLX5_TC_CT. Fixes: 4c3844d

[net V2 1/7] net/mlx5: Fix crash upon suspend/resume

2020-05-29 Thread Saeed Mahameed
From: Mark Bloch Currently a Linux system with the mlx5 NIC always crashes upon hibernation - suspend/resume. Add basic callbacks so the NIC could be suspended and resumed. Fixes: 9603b61de1ee ("mlx5: Move pci device handling from mlx5_ib to mlx5_core") Tested-by: Dexuan Cui Signed-off-by: Mar

[pull request][net V2 0/7] mlx5 fixes 2020-05-28

2020-05-29 Thread Saeed Mahameed
Hi Dave/Jakub, This series introduces some fixes to mlx5 driver. v1->v2: - Fix bad sha1, Jakub. - Added one more patch by Pablo. net/mlx5e: replace EINVAL in mlx5e_flower_parse_meta() Nothing major, the only patch worth mentioning is the suspend/resume crash fix by adding the missing pci d

Re: [net-next 10/11] net/mlx5e: kTLS, Add kTLS RX resync support

2020-05-29 Thread Saeed Mahameed
On Fri, 2020-05-29 at 13:16 -0700, Jakub Kicinski wrote: > On Fri, 29 May 2020 12:46:40 -0700 Saeed Mahameed wrote: > > /* Re-sync */ > > +static struct mlx5_wqe_ctrl_seg * > > +resync_post_get_progress_params(struct mlx5e_icosq *sq, > > + struct mlx5e_ktls_offload_contex

Re: [PATCH v2 bpf-next 1/3] bpf: Consolidate inner-map-compatible properties into bpf_types.h

2020-05-29 Thread Andrii Nakryiko
On Thu, May 28, 2020 at 11:31 PM Martin KaFai Lau wrote: > > On Tue, May 26, 2020 at 10:54:26AM -0700, Andrii Nakryiko wrote: > > On Fri, May 22, 2020 at 6:01 PM Martin KaFai Lau wrote: > > > > > > On Sat, May 23, 2020 at 12:22:48AM +0200, Daniel Borkmann wrote: > > > > On 5/22/20 4:23 AM, Martin

Re: [PATCH v2 bpf-next 2/4] bpf: Introduce sleepable BPF programs

2020-05-29 Thread Andrii Nakryiko
On Fri, May 29, 2020 at 1:12 PM Alexei Starovoitov wrote: > > On Fri, May 29, 2020 at 01:25:06AM -0700, Andrii Nakryiko wrote: > > > index 11584618e861..26b18b6a3dbc 100644 > > > --- a/kernel/bpf/arraymap.c > > > +++ b/kernel/bpf/arraymap.c > > > @@ -393,6 +393,11 @@ static void array_map_free(str

  1   2   3   4   >