linux-2.6-microblaze.git
3 years agomptcp: unify ADD_ADDR and ADD_ADDR6 suboptions writing
Geliang Tang [Wed, 9 Dec 2020 23:51:19 +0000 (15:51 -0800)]
mptcp: unify ADD_ADDR and ADD_ADDR6 suboptions writing

The length of ADD_ADDR6 is 12 octets longer than ADD_ADDR. That's the
only difference between them.

This patch dropped the duplicate code between ADD_ADDR and ADD_ADDR6
suboptions writing, and unify them into one.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomptcp: unify ADD_ADDR and echo suboptions writing
Geliang Tang [Wed, 9 Dec 2020 23:51:18 +0000 (15:51 -0800)]
mptcp: unify ADD_ADDR and echo suboptions writing

There are two differences between ADD_ADDR suboption and ADD_ADDR echo
suboption: The length of the former is 8 octets longer than the length
of the latter. The former's echo-flag is 0, and latter's echo-flag is 1.

This patch added two local variables, len and echo, to unify ADD_ADDR
and ADD_ADDR echo suboptions writing.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next...
David S. Miller [Thu, 10 Dec 2020 02:51:59 +0000 (18:51 -0800)]
Merge branch '100GbE' of git://git./linux/kernel/git/tnguy/next-queue

Tony Nguyen says:

====================
100GbE Intel Wired LAN Driver Updates 2020-12-09

This series contains updates to ice driver only.

Bruce changes the allocation of ice_flow_prof_params from stack to heap to
avoid excessive stack usage. Corrects a misleading comment and silences a
sparse warning that is not a problem.

Paul allows for HW initialization to continue if PHY abilities cannot
be obtained.

Jeb removes bypassing FW link override and reading Option ROM and
netlist information for non-E810 devices as this is now available on
other devices.

Nick removes vlan_ena field as this information can be gathered by
checking num_vlan.

Jake combines format strings and debug prints to the same line.

Simon adds a space to fix string concatenation.

v4: Drop ACL patches. Change PHY abilities failure message from debug to
warning.
v3: Fix email address for DaveM and fix character in cover letter
v2: Expand on commit message for patch 3 to show example usage/commands.
    Reduce number of defensive checks being done.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: marvell: octeontx2: simplify the otx2_ptp_adjfine()
Zheng Yongjun [Wed, 9 Dec 2020 09:27:26 +0000 (17:27 +0800)]
net: marvell: octeontx2: simplify the otx2_ptp_adjfine()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: dsa: simplify the return rtl8366_vlan_prepare()
Zheng Yongjun [Wed, 9 Dec 2020 09:26:21 +0000 (17:26 +0800)]
net: dsa: simplify the return rtl8366_vlan_prepare()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: stmmac: simplify the return dwmac5_rxp_disable()
Zheng Yongjun [Wed, 9 Dec 2020 09:23:25 +0000 (17:23 +0800)]
net: stmmac: simplify the return dwmac5_rxp_disable()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: hinic: simplify the return hinic_configure_max_qnum()
Zheng Yongjun [Wed, 9 Dec 2020 09:22:41 +0000 (17:22 +0800)]
net: hinic: simplify the return hinic_configure_max_qnum()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: freescale: dpaa: simplify the return dpaa_eth_refill_bpools()
Zheng Yongjun [Wed, 9 Dec 2020 09:21:07 +0000 (17:21 +0800)]
net: freescale: dpaa: simplify the return dpaa_eth_refill_bpools()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: cisco: enic: simplify the return vnic_cq_alloc()
Zheng Yongjun [Wed, 9 Dec 2020 09:20:31 +0000 (17:20 +0800)]
net: cisco: enic: simplify the return vnic_cq_alloc()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: emulex: benet: simplify the return expression of be_if_create()
Zheng Yongjun [Wed, 9 Dec 2020 09:19:57 +0000 (17:19 +0800)]
net: emulex: benet: simplify the return expression of be_if_create()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: marvell: octeontx2: simplify the return expression of rvu_npa_init()
Zheng Yongjun [Wed, 9 Dec 2020 09:18:44 +0000 (17:18 +0800)]
net: marvell: octeontx2: simplify the return expression of rvu_npa_init()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: marvell: prestera: simplify the return expression of prestera_port_close()
Zheng Yongjun [Wed, 9 Dec 2020 09:17:51 +0000 (17:17 +0800)]
net: marvell: prestera: simplify the return expression of prestera_port_close()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'nfc-s3fwrn5-Change-I2C-interrupt-trigger-to-EDGE_RISING'
David S. Miller [Thu, 10 Dec 2020 00:49:46 +0000 (16:49 -0800)]
Merge branch 'nfc-s3fwrn5-Change-I2C-interrupt-trigger-to-EDGE_RISING'

Bongsu Jeon says:

====================
nfc: s3fwrn5: Change I2C interrupt trigger to EDGE_RISING

For stable Samsung's I2C interrupt handling, I changed the interrupt
trigger from IRQ_TYPE_LEVEL_HIGH to IRQ_TYPE_EDGE_RISING and removed
the hard coded interrupt trigger type in the i2c module for the flexible
control.

1/2 is the changed dt binding for the edge rising trigger.
2/2 is to remove the hard coded interrupt trigger type in the i2c module.

ChangeLog:
 v2:
  2/2
   - remove the hard coded interrupt trigger type.

Bongsu Jeon (2):
  dt-bindings: net: nfc: s3fwrn5: Change I2C interrupt trigger to
    EDGE_RISING
  nfc: s3fwrn5: Remove hard coded interrupt trigger type from the i2c
    module
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonfc: s3fwrn5: Remove hard coded interrupt trigger type from the i2c module
Bongsu Jeon [Tue, 8 Dec 2020 14:10:12 +0000 (23:10 +0900)]
nfc: s3fwrn5: Remove hard coded interrupt trigger type from the i2c module

For the flexible control of interrupt trigger type, remove the hard coded
interrupt trigger type in the i2c module. The trigger type will be loaded
 from a dts.

Signed-off-by: Bongsu Jeon <bongsu.jeon@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodt-bindings: net: nfc: s3fwrn5: Change I2C interrupt trigger type
Bongsu Jeon [Tue, 8 Dec 2020 14:10:11 +0000 (23:10 +0900)]
dt-bindings: net: nfc: s3fwrn5: Change I2C interrupt trigger type

Change interrupt trigger from IRQ_TYPE_LEVEL_HIGH to IRQ_TYPE_EDGE_RISING
 for stable NFC I2C interrupt handling.
Samsung's NFC Firmware sends an i2c frame as below.
1. NFC Firmware sets the GPIO(interrupt pin) high when there is an i2c
 frame to send.
2. If the CPU's I2C master has received the i2c frame, NFC F/W sets the
GPIO low.
NFC driver's i2c interrupt handler would be called in the abnormal case
as the NFC FW task of number 2 is delayed because of other high priority
tasks.
In that case, NFC driver will try to receive the i2c frame but there isn't
 any i2c frame to send in NFC.
It would cause an I2C communication problem. This case would hardly happen.
But, I changed the interrupt as a defense code.
If Driver uses the TRIGGER_RISING instead of the LEVEL trigger,
there would be no problem even if the NFC FW task is delayed.

Signed-off-by: Bongsu Jeon <bongsu.jeon@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: ipa: convert comma to semicolon
Zheng Yongjun [Wed, 9 Dec 2020 13:40:03 +0000 (21:40 +0800)]
net: ipa: convert comma to semicolon

Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: mv88e6xxx: convert comma to semicolon
Zheng Yongjun [Wed, 9 Dec 2020 13:39:38 +0000 (21:39 +0800)]
net: mv88e6xxx: convert comma to semicolon

Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: thunderbolt: convert comma to semicolon
Zheng Yongjun [Wed, 9 Dec 2020 13:38:52 +0000 (21:38 +0800)]
net: thunderbolt: convert comma to semicolon

Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: usb: convert comma to semicolon
Zheng Yongjun [Wed, 9 Dec 2020 13:38:11 +0000 (21:38 +0800)]
net: usb: convert comma to semicolon

Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: freescale: convert comma to semicolon
Zheng Yongjun [Wed, 9 Dec 2020 13:37:39 +0000 (21:37 +0800)]
net: freescale: convert comma to semicolon

Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: ethernet: ti: convert comma to semicolon
Zheng Yongjun [Wed, 9 Dec 2020 13:37:16 +0000 (21:37 +0800)]
net: ethernet: ti: convert comma to semicolon

Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agohisilicon/hns3: convert comma to semicolon
Zheng Yongjun [Wed, 9 Dec 2020 13:36:30 +0000 (21:36 +0800)]
hisilicon/hns3: convert comma to semicolon

Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agohisilicon/hns: convert comma to semicolon
Zheng Yongjun [Wed, 9 Dec 2020 13:35:31 +0000 (21:35 +0800)]
hisilicon/hns: convert comma to semicolon

Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: mlx5: convert comma to semicolon
Zheng Yongjun [Wed, 9 Dec 2020 13:34:41 +0000 (21:34 +0800)]
net: mlx5: convert comma to semicolon

Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: micrel: convert comma to semicolon
Zheng Yongjun [Wed, 9 Dec 2020 13:34:02 +0000 (21:34 +0800)]
net: micrel: convert comma to semicolon

Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: rxrpc: convert comma to semicolon
Zheng Yongjun [Wed, 9 Dec 2020 13:32:28 +0000 (21:32 +0800)]
net: rxrpc: convert comma to semicolon

Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'macb-sama7g5'
David S. Miller [Thu, 10 Dec 2020 00:19:21 +0000 (16:19 -0800)]
Merge branch 'macb-sama7g5'

Claudiu Beznea says:

====================
net: macb: add support for sama7g5

This series adds support for SAMA7G5 Ethernet interfaces: one 10/100Mbps
and one 1Gbps interfaces.

Along with it I also included a fix to disable clocks for SiFive FU540-C000
on failure path of fu540_c000_clk_init().

Thank you,
Claudiu Beznea

Changed in v3:
- use clk_bulk_disable_unprepare in patch 3/8
- corrected clang compilation warning in patch 3/8
- revert changes in macb_clk_init() in patch 3/8

Changes in v2:
- introduced patch "net: macb: add function to disable all macb clocks" and
  update patch "net: macb: unprepare clocks in case of failure" accordingly
- collected tags
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: macb: add support for sama7g5 emac interface
Claudiu Beznea [Wed, 9 Dec 2020 13:03:39 +0000 (15:03 +0200)]
net: macb: add support for sama7g5 emac interface

Add support for SAMA7G5 10/100Mbps interface.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: macb: add support for sama7g5 gem interface
Claudiu Beznea [Wed, 9 Dec 2020 13:03:38 +0000 (15:03 +0200)]
net: macb: add support for sama7g5 gem interface

Add support for SAMA7G5 gigabit ethernet interface.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodt-bindings: add documentation for sama7g5 gigabit ethernet interface
Claudiu Beznea [Wed, 9 Dec 2020 13:03:37 +0000 (15:03 +0200)]
dt-bindings: add documentation for sama7g5 gigabit ethernet interface

Add documentation for SAMA7G5 gigabit ethernet interface.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodt-bindings: add documentation for sama7g5 ethernet interface
Claudiu Beznea [Wed, 9 Dec 2020 13:03:36 +0000 (15:03 +0200)]
dt-bindings: add documentation for sama7g5 ethernet interface

Add documentation for SAMA7G5 ethernet interface.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: macb: unprepare clocks in case of failure
Claudiu Beznea [Wed, 9 Dec 2020 13:03:35 +0000 (15:03 +0200)]
net: macb: unprepare clocks in case of failure

Unprepare clocks in case of any failure in fu540_c000_clk_init().

Fixes: c218ad559020 ("macb: Add support for SiFive FU540-C000")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: macb: add function to disable all macb clocks
Claudiu Beznea [Wed, 9 Dec 2020 13:03:34 +0000 (15:03 +0200)]
net: macb: add function to disable all macb clocks

Add function to disable all macb clocks.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: macb: add capability to not set the clock rate
Claudiu Beznea [Wed, 9 Dec 2020 13:03:33 +0000 (15:03 +0200)]
net: macb: add capability to not set the clock rate

SAMA7G5's ethernet IPs TX clock could be provided by its generic clock or
by the external clock provided by the PHY. The internal IP logic divides
properly this clock depending on the link speed. The patch adds a new
capability so that macb_set_tx_clock() to not be called for IPs having
this capability (the clock rate, in case of generic clock, is set at the
boot time via device tree and the driver only enables it).

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: macb: add userio bits as platform configuration
Claudiu Beznea [Wed, 9 Dec 2020 13:03:32 +0000 (15:03 +0200)]
net: macb: add userio bits as platform configuration

This is necessary for SAMA7G5 as it uses different values for
PHY interface and also introduces hdfctlen bit.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: sched: incorrect Kconfig dependencies on Netfilter modules
Pablo Neira Ayuso [Tue, 8 Dec 2020 20:47:07 +0000 (21:47 +0100)]
net: sched: incorrect Kconfig dependencies on Netfilter modules

- NET_ACT_CONNMARK and NET_ACT_CTINFO only require conntrack support.
- NET_ACT_IPT only requires NETFILTER_XTABLES symbols, not
  IP_NF_IPTABLES. After this patch, NET_ACT_IPT becomes consistent
  with NET_EMATCH_IPT. NET_ACT_IPT dependency on IP_NF_IPTABLES predates
  Linux-2.6.12-rc2 (initial git repository build).

Fixes: 22a5dc0e5e3e ("net: sched: Introduce connmark action")
Fixes: 24ec483cec98 ("net: sched: Introduce act_ctinfo action")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Link: https://lore.kernel.org/r/20201208204707.11268-1-pablo@netfilter.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agoMerge branch 'xdp-redirect-implementation-for-ena-driver'
Jakub Kicinski [Wed, 9 Dec 2020 23:26:42 +0000 (15:26 -0800)]
Merge branch 'xdp-redirect-implementation-for-ena-driver'

Shay Agroskin says:

====================
XDP Redirect implementation for ENA driver

ENA is adding XDP Redirect support for its driver and some other
small tweaks.

This series adds the following:

- Make log messages in the driver have a uniform format using
  netdev_* function
- Improve code readability
- Add support for XDP Redirect
====================

Link: https://lore.kernel.org/r/20201208180208.26111-1-shayagr@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agonet: ena: introduce ndo_xdp_xmit() function for XDP_REDIRECT
Shay Agroskin [Tue, 8 Dec 2020 18:02:08 +0000 (20:02 +0200)]
net: ena: introduce ndo_xdp_xmit() function for XDP_REDIRECT

This patch implements the ndo_xdp_xmit() net_device function which is
called when a packet is redirected to this driver using an
XDP_REDIRECT directive.

The function receives an array of xdp frames that it needs to xmit.
The TX queues that are used to xmit these frames are the XDP
queues used by the XDP_TX flow. Therefore a lock is added to synchronize
both flows (XDP_TX and XDP_REDIRECT).

Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agonet: ena: use xdp_return_frame() to free xdp frames
Shay Agroskin [Tue, 8 Dec 2020 18:02:07 +0000 (20:02 +0200)]
net: ena: use xdp_return_frame() to free xdp frames

XDP subsystem has a function to free XDP frames and their associated
pages. Using this function would help the driver's XDP implementation to
adjust to new changes in the XDP subsystem in the kernel (e.g.
introduction of XDP MB).

Also, remove 'xdp_rx_page' field from ena_tx_buffer struct since it is
no longer used.

Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agonet: ena: introduce XDP redirect implementation
Shay Agroskin [Tue, 8 Dec 2020 18:02:06 +0000 (20:02 +0200)]
net: ena: introduce XDP redirect implementation

This patch adds a partial support for the XDP_REDIRECT directive which
instructs the driver to pass the packet to an interface specified by the
program. The directive is passed to the driver by calling bpf_redirect()
or bpf_redirect_map() functions from the eBPF program.

To lay the ground for integration with the existing XDP TX
implementation the patch removes the redundant page ref count increase
in ena_xdp_xmit_frame() and then decrease in ena_clean_rx_irq(). Instead
it only DMA unmaps descriptors for which XDP TX or REDIRECT directive
was received.

The XDP Redirect support is still missing .ndo_xdp_xmit function
implementation, which allows to redirect packet to an ENA interface,
which would be added in a later patch.

Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agonet: ena: use xdp_frame in XDP TX flow
Shay Agroskin [Tue, 8 Dec 2020 18:02:05 +0000 (20:02 +0200)]
net: ena: use xdp_frame in XDP TX flow

Rename the ena_xdp_xmit_buff() function to ena_xdp_xmit_frame() and pass
it an xdp_frame struct instead of xdp_buff.
This change lays the ground for XDP redirect implementation which uses
xdp_frames when 'xmit'ing packets.

Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agonet: ena: aggregate stats increase into a function
Shay Agroskin [Tue, 8 Dec 2020 18:02:04 +0000 (20:02 +0200)]
net: ena: aggregate stats increase into a function

Introduce ena_increase_stat() function to increase statistics by a
certain number.
The function includes the
    - lock aquire (on 32bit machines)
    - stat increase
    - lock release (on 32bit machines)

line sequence that is ubiquitous across the driver.

The function increases a single stat at a time and several stats which
are increased together weren't put into a function to avoid
calling the function several times for each stat which looks bad and
might decrease performance.

Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agonet: ena: fix coding style nits
Shay Agroskin [Tue, 8 Dec 2020 18:02:03 +0000 (20:02 +0200)]
net: ena: fix coding style nits

This commit fixes two nits, but it does not generate any change to binary
because of the optimization of gcc.

  - use `count` instead of `channels->combined_count`
  - change return type from `int` to `bool`

Also add spaces and change macro order in OR assignment to make the code
easier to read.

Signed-off-by: Sameeh Jubran <sameehj@amazon.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agonet: ena: store values in their appropriate variables types
Shay Agroskin [Tue, 8 Dec 2020 18:02:02 +0000 (20:02 +0200)]
net: ena: store values in their appropriate variables types

This patch changes some of the variables types to match the values they
hold. These wrong types fail some of our static checkers that search for
accidental conversions in our driver.

Signed-off-by: Ido Segev <idose@amazon.com>
Signed-off-by: Igor Chauskin <igorch@amazon.com>
Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agonet: ena: add device distinct log prefix to files
Shay Agroskin [Tue, 8 Dec 2020 18:02:01 +0000 (20:02 +0200)]
net: ena: add device distinct log prefix to files

ENA logs are adjusted to display the full ENA representation to
distinct each ENA device in case of multiple interfaces.
Using netdev_err/warn and dev_info functions for logging provides
uniform printing with clear distinction of the device and interface.

This patch changes all printing in ena_com files to use netev_* logging
functions except for messages of info level. Log functions of that level
would be printed with dev_info because of the early stage they are
called in when net_device struct isn't yet registered.

To allow using netdev_* functions in all ena_com functions, a pointer to
the net_device was added to ena_com_dev struct.

The patch also adds some log messages to make driver debugging easier.

Signed-off-by: Amit Bernstein <amitbern@amazon.com>
Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agonet: ena: use constant value for net_device allocation
Shay Agroskin [Tue, 8 Dec 2020 18:02:00 +0000 (20:02 +0200)]
net: ena: use constant value for net_device allocation

The patch changes the maximum number of RX/TX queues it advertises to
the kernel (via alloc_etherdev_mq()) from a value received from the
device to a constant value which is the minimum between 128 and the
number of CPUs in the system.

By allocating the net_device struct with a constant number of queues,
the driver is able to allocate it at a much earlier stage, before
calling any ena_com functions. This would allow to make all log prints
in ena_com to use netdev_* log functions instead or current pr_* ones.

Note:
netdev_* prints in ena_com functions that are called before
net_device registration in ena_probe() might print messages that are
a bit ugly (with strings like "(unnamed net_device) (uninitialized)").
However we decided to use netdev_* prints in these functions anyway,
for the sake of getting better messages later, when ena_com functions
are called after ena_probe() form other parts of the driver.
See discussion about this decision in [1].

[1] http://www.mail-archive.com/netdev@vger.kernel.org/msg353590.html

Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agoptp: clockmatrix: deprecate firmware older than 4.8.7
Min Li [Tue, 8 Dec 2020 15:41:57 +0000 (10:41 -0500)]
ptp: clockmatrix: deprecate firmware older than 4.8.7

Add deprecated flag to indicate < v4.8.7.
Fix idtcm_enable_tod() call correct settime().

Signed-off-by: Min Li <min.li.xe@renesas.com>
Link: https://lore.kernel.org/r/1607442117-13661-4-git-send-email-min.li.xe@renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agoptp: clockmatrix: Fix non-zero phase_adj is lost after snap
Min Li [Tue, 8 Dec 2020 15:41:56 +0000 (10:41 -0500)]
ptp: clockmatrix: Fix non-zero phase_adj is lost after snap

Fix non-zero phase_adj is lost after snap. Use ktime_sub
to do ktime_t subtraction.

Signed-off-by: Min Li <min.li.xe@renesas.com>
Link: https://lore.kernel.org/r/1607442117-13661-3-git-send-email-min.li.xe@renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agoptp: clockmatrix: remove 5 second delay before entering write phase mode
Min Li [Tue, 8 Dec 2020 15:41:55 +0000 (10:41 -0500)]
ptp: clockmatrix: remove 5 second delay before entering write phase mode

Remove write phase mode 5 second setup delay, not needed.

Signed-off-by: Min Li <min.li.xe@renesas.com>
Link: https://lore.kernel.org/r/1607442117-13661-2-git-send-email-min.li.xe@renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agoptp: clockmatrix: reset device and check BOOT_STATUS
Min Li [Tue, 8 Dec 2020 15:41:54 +0000 (10:41 -0500)]
ptp: clockmatrix: reset device and check BOOT_STATUS

SM_RESET device only when loading full configuration and check
for BOOT_STATUS. Also remove polling for write trigger done in
_idtcm_settime().

Changes since v1:
-Correct warnings from strict checkpatch

Signed-off-by: Min Li <min.li.xe@renesas.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Link: https://lore.kernel.org/r/1607442117-13661-1-git-send-email-min.li.xe@renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agovrf: handle CONFIG_IPV6 not set for vrf_add_mac_header_if_unset()
Andrea Mayer [Tue, 8 Dec 2020 17:52:10 +0000 (18:52 +0100)]
vrf: handle CONFIG_IPV6 not set for vrf_add_mac_header_if_unset()

The vrf_add_mac_header_if_unset() is defined within a conditional
compilation block which depends on the CONFIG_IPV6 macro.
However, the vrf_add_mac_header_if_unset() needs to be called also by IPv4
related code and when the CONFIG_IPV6 is not set, this function is missing.
As a consequence, the build process stops reporting the error:

 ERROR: implicit declaration of function 'vrf_add_mac_header_if_unset'

The problem is solved by *only* moving functions
vrf_add_mac_header_if_unset() and vrf_prepare_mac_header() out of the
conditional block.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 0489390882202 ("vrf: add mac header for tunneled packets when sniffer is attached")
Signed-off-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20201208175210.8906-1-andrea.mayer@uniroma2.it
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agoice: Add space to unknown speed
Simon Perron Caissy [Thu, 17 Sep 2020 20:13:47 +0000 (13:13 -0700)]
ice: Add space to unknown speed

Add space to the end of 'Unknown' string  in  order to avoid
concatenation with 'bps' string when formatting netdev log message.

Signed-off-by: Simon Perron Caissy <simon.perron.caissy@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
3 years agoice: join format strings to same line as ice_debug
Jacob Keller [Thu, 17 Sep 2020 20:13:46 +0000 (13:13 -0700)]
ice: join format strings to same line as ice_debug

When printing messages with ice_debug, align the printed string to the
origin line of the message in order to ease debugging and tracking
messages back to their source.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
3 years agoice: silence static analysis warning
Bruce Allan [Thu, 17 Sep 2020 20:13:45 +0000 (13:13 -0700)]
ice: silence static analysis warning

sparse warns about cast to/from restricted types which is not
an actual problem; silence the warning.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
3 years agoice: cleanup misleading comment
Bruce Allan [Thu, 17 Sep 2020 20:13:44 +0000 (13:13 -0700)]
ice: cleanup misleading comment

The maximum Admin Queue buffer size and NVM shadow RAM sector size are both
4 Kilobytes. Some comments refer to those as 4Kb which can be confused with
4 Kilobits. Update the comments to use the commonly used KB symbol instead.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
3 years agoice: Remove vlan_ena from vsi structure
Nick Nunley [Thu, 17 Sep 2020 20:13:43 +0000 (13:13 -0700)]
ice: Remove vlan_ena from vsi structure

vlan_ena was introduced to track whether VLAN filters are enabled on
the device, but
1) checking for num_vlan > 1 already gives us this information, and is
currently used in this way throughout the code
2) the logic for vlan_ena is broken when multiple VLANs are active

Just remove vlan_ena and use num_vlan instead.

Signed-off-by: Nick Nunley <nicholas.d.nunley@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
3 years agoice: Remove gate to OROM init
Jeb Cramer [Thu, 17 Sep 2020 20:13:42 +0000 (13:13 -0700)]
ice: Remove gate to OROM init

Remove the gate that prevents the OROM and netlist info from being
populated.  The NVM now has the appropriate section for software to
reference the versioning info.

Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
3 years agoice: Enable Support for FW Override (E82X)
Jeb Cramer [Thu, 17 Sep 2020 20:13:41 +0000 (13:13 -0700)]
ice: Enable Support for FW Override (E82X)

The driver is able to override the firmware when it comes to supporting
a more lenient link mode.  This feature was limited to E810 devices.  It
is now extended to E82X devices.

Signed-off-by: Jeb Cramer <jeb.j.cramer@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
3 years agoice: don't always return an error for Get PHY Abilities AQ command
Paul M Stillwell Jr [Thu, 17 Sep 2020 20:13:40 +0000 (13:13 -0700)]
ice: don't always return an error for Get PHY Abilities AQ command

There are times when the driver shouldn't return an error when the Get
PHY abilities AQ command (0x0600) returns an error. Instead the driver
should log that the error occurred and continue on. This allows the
driver to load even though the AQ command failed. The user can then
later determine the reason for the failure and correct it.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
3 years agoice: cleanup stack hog
Bruce Allan [Mon, 14 Sep 2020 15:37:14 +0000 (08:37 -0700)]
ice: cleanup stack hog

In ice_flow_add_prof_sync(), struct ice_flow_prof_params has recently
grown in size hogging stack space when allocated there.  Hogging stack
space should be avoided.  Change allocation to be on the heap when needed.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Harikumar Bokkena <harikumarx.bokkena@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
3 years agonet: atheros: simplify the return expression of atl2_phy_setup_autoneg_adv()
Zheng Yongjun [Tue, 8 Dec 2020 13:57:30 +0000 (21:57 +0800)]
net: atheros: simplify the return expression of atl2_phy_setup_autoneg_adv()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodrivers: net: qlcnic: simplify the return expression of qlcnic_sriov_vf_shutdown()
Zheng Yongjun [Tue, 8 Dec 2020 13:54:37 +0000 (21:54 +0800)]
drivers: net: qlcnic: simplify the return expression of qlcnic_sriov_vf_shutdown()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agodrivers: net: ionic: simplify the return expression of ionic_set_rxfh()
Zheng Yongjun [Tue, 8 Dec 2020 13:53:53 +0000 (21:53 +0800)]
drivers: net: ionic: simplify the return expression of ionic_set_rxfh()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: openvswitch: conntrack: simplify the return expression of ovs_ct_limit_get_defau...
Zheng Yongjun [Tue, 8 Dec 2020 12:13:53 +0000 (20:13 +0800)]
net: openvswitch: conntrack: simplify the return expression of ovs_ct_limit_get_default_limit()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Reviewed-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: core: devlink: simplify the return expression of devlink_nl_cmd_trap_set_doit()
Zheng Yongjun [Tue, 8 Dec 2020 12:10:46 +0000 (20:10 +0800)]
net: core: devlink: simplify the return expression of devlink_nl_cmd_trap_set_doit()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: ipv6: rpl_iptunnel: simplify the return expression of rpl_do_srh()
Zheng Yongjun [Tue, 8 Dec 2020 12:09:49 +0000 (20:09 +0800)]
net: ipv6: rpl_iptunnel: simplify the return expression of rpl_do_srh()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet/sched: cls_u32: simplify the return expression of u32_reoffload_knode()
Zheng Yongjun [Tue, 8 Dec 2020 12:08:22 +0000 (20:08 +0800)]
net/sched: cls_u32: simplify the return expression of u32_reoffload_knode()

Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: dsa: mt7530: support setting ageing time
DENG Qingfang [Tue, 8 Dec 2020 07:00:28 +0000 (15:00 +0800)]
net: dsa: mt7530: support setting ageing time

MT7530 has a global address age control register, so use it to set
ageing time.

The applied timer is (AGE_CNT + 1) * (AGE_UNIT + 1) seconds

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'GVE-Raw-Addressing'
David S. Miller [Wed, 9 Dec 2020 00:06:29 +0000 (16:06 -0800)]
Merge branch 'GVE-Raw-Addressing'

David Awogbemil says:

====================
GVE Raw Addressing
Patchset description:
This  patchset introduces "raw addressing" mode to the GVE driver.
Previously (in "queue_page_list" or "qpl" mode), the driver would
pre-allocate and dma_map buffers to be used on egress and ingress.
On egress, it would copy data from the skb provided to the
pre-allocated buffers - this was expensive.
In raw addressing mode, the driver can avoid this copy and simply
dma_map the skb's data so that the NIC can use it.
On ingress, the driver passes buffers up to the networking stack and
then frees and reallocates buffers when necessary instead of using
skb_copy_to_linear_data.
Patch 3 separates the page refcount tracking mechanism
into a function gve_rx_can_recycle_buffer which uses get_page - this will
be changed in a future patch to eliminate the use of get_page in tracking
page refcounts.

Changes from v9:
  Patch 4: Use u64, not u32 for new tx stat counters.
====================

Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agogve: Add support for raw addressing in the tx path
Catherine Sullivan [Mon, 7 Dec 2020 22:45:26 +0000 (14:45 -0800)]
gve: Add support for raw addressing in the tx path

During TX, skbs' data addresses are dma_map'ed and passed to the NIC.
This means that the device can perform DMA directly from these addresses
and the driver does not have to copy the buffer content into
pre-allocated buffers/qpls (as in qpl mode).

Reviewed-by: Yangchun Fu <yangchun@google.com>
Signed-off-by: Catherine Sullivan <csully@google.com>
Signed-off-by: David Awogbemila <awogbemila@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agogve: Rx Buffer Recycling
David Awogbemila [Mon, 7 Dec 2020 22:45:25 +0000 (14:45 -0800)]
gve: Rx Buffer Recycling

This patch lets the driver reuse buffers that have been freed by the
networking stack.

In the raw addressing case, this allows the driver avoid allocating new
buffers.
In the qpl case, the driver can avoid copies.

This patch separates the page refcount tracking mechanism
into a function gve_rx_can_recycle_buffer which uses get_page - this will
be changed in a future patch to entirely eliminate the use of get_page in
tracking page refcounts.

Signed-off-by: David Awogbemila <awogbemila@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agogve: Add support for raw addressing to the rx path
Catherine Sullivan [Mon, 7 Dec 2020 22:45:24 +0000 (14:45 -0800)]
gve: Add support for raw addressing to the rx path

Add support to use raw dma addresses in the rx path. Due to this new
support we can alloc a new buffer instead of making a copy.

RX buffers are handed to the networking stack and are
re-allocated as needed, avoiding the need to use
skb_copy_to_linear_data() as in "qpl" mode.

Reviewed-by: Yangchun Fu <yangchun@google.com>
Signed-off-by: Catherine Sullivan <csully@google.com>
Signed-off-by: David Awogbemila <awogbemila@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agogve: Add support for raw addressing device option
Catherine Sullivan [Mon, 7 Dec 2020 22:45:23 +0000 (14:45 -0800)]
gve: Add support for raw addressing device option

Add support to describe device for parsing device options. As
the first device option, add raw addressing.

"Raw Addressing" mode (as opposed to the current "qpl" mode) is an
operational mode which allows the driver avoid bounce buffer copies
which it currently performs using pre-allocated qpls (queue_page_lists)
when sending and receiving packets.
For egress packets, the provided skb data addresses will be dma_map'ed and
passed to the device, allowing the NIC can perform DMA directly - the
driver will not have to copy the buffer content into pre-allocated
buffers/qpls (as in qpl mode).
For ingress packets, copies are also eliminated as buffers are handed to
the networking stack and then recycled or re-allocated as
necessary, avoiding the use of skb_copy_to_linear_data().

This patch only introduces the option to the driver.
Subsequent patches will add the ingress and egress functionality.

Reviewed-by: Yangchun Fu <yangchun@google.com>
Signed-off-by: Catherine Sullivan <csully@google.com>
Signed-off-by: David Awogbemila <awogbemila@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: sched: fix spelling mistake in Kconfig "trys" -> "tries"
Colin Ian King [Mon, 7 Dec 2020 16:12:31 +0000 (16:12 +0000)]
net: sched: fix spelling mistake in Kconfig "trys" -> "tries"

There is a spelling mistake in the Kconfig help text. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
David S. Miller [Tue, 8 Dec 2020 23:58:49 +0000 (15:58 -0800)]
Merge branch 'for-upstream' of git://git./linux/kernel/git/bluetooth/bluetooth-next

Johan Hedberg says:

====================
pull request: bluetooth-next 2020-12-07

Here's the main bluetooth-next pull request for the 5.11 kernel.

 - Updated Bluetooth entries in MAINTAINERS to include Luiz von Dentz
 - Added support for Realtek 8822CE and 8852A devices
 - Added support for MediaTek MT7615E device
 - Improved workarounds for fake CSR devices
 - Fix Bluetooth qualification test case L2CAP/COS/CFD/BV-14-C
 - Fixes for LL Privacy support
 - Enforce 16 byte encryption key size for FIPS security level
 - Added new mgmt commands for extended advertising support
 - Multiple other smaller fixes & improvements

Please let me know if there are any issues pulling. Thanks.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet/af_iucv: use DECLARE_SOCKADDR to cast from sockaddr
Julian Wiedmann [Mon, 7 Dec 2020 12:53:07 +0000 (13:53 +0100)]
net/af_iucv: use DECLARE_SOCKADDR to cast from sockaddr

This gets us compile-time size checking.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'mlxsw-Add-support-for-Q-in-VNI'
David S. Miller [Tue, 8 Dec 2020 23:45:57 +0000 (15:45 -0800)]
Merge branch 'mlxsw-Add-support-for-Q-in-VNI'

Ido Schimmel says:

====================
mlxsw: Add support for Q-in-VNI

This patch set adds support for Q-in-VNI over Spectrum-{2,3} ASICs.
Q-in-VNI is like regular VxLAN encapsulation with the sole difference
that overlay packets can contain a VLAN tag. In Linux, this is achieved
by adding the VxLAN device to a 802.1ad bridge instead of a 802.1q
bridge.

From mlxsw perspective, Q-in-VNI support entails two main changes:

1. An outer VLAN tag should always be pushed to the overlay packet
during decapsulation

2. The EtherType used during decapsulation should be 802.1ad (0x88a8)
instead of the default 802.1q (0x8100)

Patch set overview:

Patches #1-#3 add required device registers and fields

Patch #4 performs small refactoring to allow code re-use

Patches #5-#7 make the EtherType used during decapsulation a property of
the tunnel port (i.e., VxLAN). This leads to the driver vetoing
configurations in which VxLAN devices are member in both 802.1ad and
802.1q/802.1d bridges. Will be handled in the future by determining the
overlay EtherType on the egress port instead

Patch #8 adds support for Q-in-VNI for Spectrum-2 and newer ASICs

Patches #9-#10 veto Q-in-VNI for Spectrum-1 ASICs due to some hardware
limitations. Can be worked around, but decided not to support it for now

Patch #11 adjusts mlxsw to stop vetoing addition of VXLAN devices to
802.1ad bridges

Patch #12 adds a generic forwarding test that can be used with both veth
pairs and physical ports with a loopback

Patch #13 adds a test to make sure mlxsw vetoes unsupported Q-in-VNI
configurations
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoselftests: mlxsw: Add Q-in-VNI veto tests
Amit Cohen [Tue, 8 Dec 2020 09:22:53 +0000 (11:22 +0200)]
selftests: mlxsw: Add Q-in-VNI veto tests

Add tests to ensure that the forbidden and unsupported cases are indeed
vetoed by mlxsw driver.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoselftests: forwarding: Add Q-in-VNI test
Petr Machata [Tue, 8 Dec 2020 09:22:52 +0000 (11:22 +0200)]
selftests: forwarding: Add Q-in-VNI test

Add test to check Q-in-VNI traffic.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomlxsw: spectrum_switchdev: Allow joining VxLAN to 802.1ad bridge
Amit Cohen [Tue, 8 Dec 2020 09:22:51 +0000 (11:22 +0200)]
mlxsw: spectrum_switchdev: Allow joining VxLAN to 802.1ad bridge

The previous patches added support for VxLAN device enslaved to 802.1ad
bridge in Spectrum-2 ASIC and vetoed it in Spectrum-1.

Do not veto VxLAN with 802.1ad bridge.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomlxsw: Veto Q-in-VNI for Spectrum-1 ASIC
Amit Cohen [Tue, 8 Dec 2020 09:22:50 +0000 (11:22 +0200)]
mlxsw: Veto Q-in-VNI for Spectrum-1 ASIC

Implementation of Q-in-VNI is different between ASIC types, this set adds
support only for Spectrum-2.

Return an error when trying to create VxLAN device and enslave it to
802.1ad bridge in Spectrum-1.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomlxsw: spectrum_switchdev: Use ops->vxlan_join() when adding VLAN to VxLAN device
Amit Cohen [Tue, 8 Dec 2020 09:22:49 +0000 (11:22 +0200)]
mlxsw: spectrum_switchdev: Use ops->vxlan_join() when adding VLAN to VxLAN device

Currently mlxsw_sp_switchdev_vxlan_vlan_add() always calls
mlxsw_sp_bridge_8021q_vxlan_join() because VLANs were only ever added to
a VLAN-filtering bridge, which is only 802.1q bridge.

This set adds support for VxLAN with 802.1ad bridge, so VLAN-filtering
bridge is not only 802.1q.

Call ops->vxlan_join(), so mlxsw_sp_bridge_802{1q, 1ad}_vxlan_join()
will be called according to bridge type.

This is needed to ensure that VxLAN with 802.1ad bridge will be vetoed
in Spectrum-1 with the next patch.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomlxsw: spectrum_nve_vxlan: Add support for Q-in-VNI for Spectrum-2 ASIC
Amit Cohen [Tue, 8 Dec 2020 09:22:48 +0000 (11:22 +0200)]
mlxsw: spectrum_nve_vxlan: Add support for Q-in-VNI for Spectrum-2 ASIC

On Spectrum-2, the default setting is not to push VLAN to the decapsulated
packet. This is controlled by SPVTR.ipvid_mode.
Set SPVTR.ipvid_mode to always push VLAN.
Without this setting, Spectrum-2 overtakes the VLAN tag of decapsulated
packet for bridging.

In addition, set SPVID register to use EtherType saved in
mlxsw_sp_nve_config when VLAN is pushed for the NVE tunnel.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomlxsw: spectrum: Publish mlxsw_sp_ethtype_to_sver_type()
Amit Cohen [Tue, 8 Dec 2020 09:22:47 +0000 (11:22 +0200)]
mlxsw: spectrum: Publish mlxsw_sp_ethtype_to_sver_type()

Declare mlxsw_sp_ethtype_to_sver_type() in spectrum.h to enable using it
in other files.

It will be used in the next patch to map between EtherType and the
relevant value configured by SVER register.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomlxsw: Save EtherType as part of mlxsw_sp_nve_config
Amit Cohen [Tue, 8 Dec 2020 09:22:46 +0000 (11:22 +0200)]
mlxsw: Save EtherType as part of mlxsw_sp_nve_config

Add EtherType field to mlxsw_sp_nve_config struct.
Set EtherType according to mlxsw_sp_nve_params.ethertype.

Pass 'mlxsw_sp_nve_params' instead of 'mlxsw_sp_nve_params->dev' to the
function which initializes mlxsw_sp_nve_config struct to know which
EtherType to use.

This field is needed to configure which EtherType will be used when
VLAN is pushed at ingress of the tunnel port.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomlxsw: Save EtherType as part of mlxsw_sp_nve_params
Amit Cohen [Tue, 8 Dec 2020 09:22:45 +0000 (11:22 +0200)]
mlxsw: Save EtherType as part of mlxsw_sp_nve_params

Add EtherType field to mlxsw_sp_nve_params struct.
Set it when VxLAN device is added to bridge device.

This field is needed to configure which EtherType will be used when
VLAN is pushed at ingress of the tunnel port.

Use ETH_P_8021Q for tunnel port enslaved to 802.1d and 802.1q bridges.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomlxsw: spectrum_switchdev: Create common function for joining VxLAN to VLAN-aware...
Amit Cohen [Tue, 8 Dec 2020 09:22:44 +0000 (11:22 +0200)]
mlxsw: spectrum_switchdev: Create common function for joining VxLAN to VLAN-aware bridge

The code in mlxsw_sp_bridge_8021q_vxlan_join() can be used also for
802.1ad bridge.

Move the code to function called mlxsw_sp_bridge_vlan_aware_vxlan_join()
and call it from mlxsw_sp_bridge_8021q_vxlan_join() to enable code
reuse.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomlxsw: reg: Add support for tunnel port in SPVID register
Amit Cohen [Tue, 8 Dec 2020 09:22:43 +0000 (11:22 +0200)]
mlxsw: reg: Add support for tunnel port in SPVID register

Add spvid_tport field which indicates if the port is tunnel port.
When spvid_tport is true, local_port field supposed to be tunnel port
type.

It will be used to configure which Ethertype will be used when VLAN is
pushed at ingress for tunnel port.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomlxsw: reg: Add Switch Port VLAN Stacking Register
Amit Cohen [Tue, 8 Dec 2020 09:22:42 +0000 (11:22 +0200)]
mlxsw: reg: Add Switch Port VLAN Stacking Register

SPVTR register configures the VLAN mode of the port to enable VLAN
stacking.

It will be used to configure VxLAN to push VLAN to the decapsulated packet.
Without this setting, Spectrum-2 overtakes the VLAN tag of decapsulated
packet for bridging.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agomlxsw: Use one enum for all registers that contain tunnel_port field
Amit Cohen [Tue, 8 Dec 2020 09:22:41 +0000 (11:22 +0200)]
mlxsw: Use one enum for all registers that contain tunnel_port field

Currently SFN, TNUMT and TNPC registers use separate enums for
tunnel_port.

Create one enum with a neutral name and use it.
Remove the enums that are not currently required.

The next patches add two more registers that contain tunnel_port field,
the new enum can be used for them also.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge tag 'mlx5-updates-2020-12-01' of git://git.kernel.org/pub/scm/linux/kernel...
David S. Miller [Tue, 8 Dec 2020 23:39:01 +0000 (15:39 -0800)]
Merge tag 'mlx5-updates-2020-12-01' of git://git./linux/kernel/git/saeed/linux

mlx5-updates-2020-12-01

mlx5e port TX timestamping support and MISC updates

1) Add support for port TX timestamping, for better PTP accuracy.

Currently in mlx5 HW TX timestamping is done on CQE (TX completion)
generation, which much earlier than when the packet actually goes out to
the wire, in this series Eran implements the option to do timestamping on
the port using a special SQ (Send Queue), such Send Queue will generate 2
CQEs (TX completions), the original one and a new one when the packet
leaves the port, due to the nature of this special handling, such mechanism
is an opt-in only and it is off by default to avoid any performance
degradation on normal traffic flows.

This patchset improves TX Hardware timestamping offset to be less than
40ns at a 100Gbps line rate, compared to 600ns before.

With that, making our HW compliant with G.8273.2 class C, and allow Linux
systems to be deployed in the 5G telco edge, where this standard is a must.

2) Misc updates and trivial improvements.

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'net-hns3-updates-for-next'
Jakub Kicinski [Tue, 8 Dec 2020 19:58:55 +0000 (11:58 -0800)]
Merge branch 'net-hns3-updates-for-next'

Huazhong Tan says:

====================
net: hns3: updates for -next

There are some updates for the HNS3 ethernet driver.

promiscuous configuration more flexible, #2 adds ethtool
private flags to control whether enable tx unicast promisc.

previous version:
https://patchwork.kernel.org/project/netdevbpf/cover/1606997936-22166-1-git-send-email-tanhuazhong@huawei.com/
====================

Link: https://lore.kernel.org/r/1607227575-56689-1-git-send-email-tanhuazhong@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agonet: hns3: refine the VLAN tag handle for port based VLAN
Guojia Liao [Sun, 6 Dec 2020 04:06:15 +0000 (12:06 +0800)]
net: hns3: refine the VLAN tag handle for port based VLAN

For DEVICE_VERSION_V2, the hardware only supports max two layer
VLAN tags, including port based tag inserted by hardware, tag in
tx buffer descriptor(get from skb->tci) and tag in packet.

For transmit packet:
If port based VLAN disabled, and vf driver gets a VLAN tag from
skb, the VLAN tag must be filled to the Outer_VLAN_TAG field
(tag near to DMAC) of tx buffer descriptor, otherwise it may
be inserted after the tag in packet.

If port based VLAN enabled, and vf driver gets a VLAN tag from
skb, the VLAN tag must be filled to the VLAN_TAG field (tag
far to DMAC) of tx buffer descriptor, otherwise it may be
conflicted with port based VLAN, and raise a hardware error.

For receive packet:
The hardware will strip the VLAN tags and fill them in the rx
buffer descriptor, no matter port based VLAN enable or not.
Because port based VLAN tag is useless for stack, so vf driver
needs to discard the port based VLAN tag get from rx buffer
descriptor when port based VLAN enabled.

So vf must know about the port based VLAN state.

For DEVICE_VERSION_V3, the hardware provides some new
configuration to improve it.

For transmit packet:
When enable tag shift mode, hardware will handle the VLAN tag
in outer_VLAN_TAG field as VLAN_TAG, so it won't conflict with
port based VLAN. And hardware also make sure the tag before
the tag in packet. So vf driver doesn't need to specify the tag
position according to the port based VLAN state anymore.

For receive packet:
When enable discard mode, hardware will strip and discard the
port based VLAN tag, so vf driver doesn't need to identify it
from rx buffer descriptor.

So modify the port based VLAN configuration, simplify the process
for vf handling the VLAN tag.

Signed-off-by: Guojia Liao <liaoguojia@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agonet: hns3: add priv flags support to switch limit promisc mode
Jian Shen [Sun, 6 Dec 2020 04:06:14 +0000 (12:06 +0800)]
net: hns3: add priv flags support to switch limit promisc mode

Currently, the tx unicast promisc is always enabled when promisc
mode on. If tx unicast promisc on, a function will receive all
unicast packet from other functions belong to the same port.
Add a ethtool private flag to control whether enable tx
unicast promisc. Then the function is able to filter the
unknown unicast packets from other function.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agonet: hns3: add support for extended promiscuous command
Guojia Liao [Sun, 6 Dec 2020 04:06:13 +0000 (12:06 +0800)]
net: hns3: add support for extended promiscuous command

For DEVICE_VERSION_V2, the hardware supports enable tx and rx
promiscuous separately. But tx or rx promiscuous is active for
unicast, multicast and broadcast promiscuous simultaneously.
To support traffics between functions belong to the same port,
we always enable tx promiscuous for broadcast promiscuous, so
tx promiscuous for unicast and multicast promiscuous is also
enabled.

For DEVICE_VERSION_V3, the hardware decouples the above
relationship. Tx unicast promiscuous, rx unicast promiscuous,
tx multicast promiscuous, rx multicast promiscuous, tx broadcast
promiscuous and rx broadcast promiscuous can be enabled separately.

So add support for the new promiscuous command.

Signed-off-by: Guojia Liao <liaoguojia@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
3 years agonet/mlx5e: Fill mlx5e_create_cq_param in a function
Maxim Mikityanskiy [Tue, 1 Dec 2020 22:42:08 +0000 (14:42 -0800)]
net/mlx5e: Fill mlx5e_create_cq_param in a function

Create a function to fill the fields of struct mlx5e_create_cq_param
based on a channel. The purpose is code reuse between normal CQs, XSK
CQs and the upcoming QoS CQs.

Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5e: Split between RX/TX tunnel FW support indication
Aya Levin [Tue, 1 Dec 2020 22:42:07 +0000 (14:42 -0800)]
net/mlx5e: Split between RX/TX tunnel FW support indication

Use the new FW caps to advertise for ip-in-ip tunnel support separately
for RX and TX.

Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: Fix passing zero to 'PTR_ERR'
YueHaibing [Tue, 1 Dec 2020 22:42:06 +0000 (14:42 -0800)]
net/mlx5: Fix passing zero to 'PTR_ERR'

Fix smatch warnings:

drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c:105 esw_acl_egress_lgcy_setup() warn: passing zero to 'PTR_ERR'
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_ofld.c:177 esw_acl_egress_ofld_setup() warn: passing zero to 'PTR_ERR'
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c:184 esw_acl_ingress_lgcy_setup() warn: passing zero to 'PTR_ERR'
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c:262 esw_acl_ingress_ofld_setup() warn: passing zero to 'PTR_ERR'

esw_acl_table_create() never returns NULL, so
NULL test should be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: Arm only EQs with EQEs
Shay Drory [Tue, 1 Dec 2020 22:42:05 +0000 (14:42 -0800)]
net/mlx5: Arm only EQs with EQEs

Currently, when more than one EQ is sharing an IRQ, and this IRQ is
being interrupted, all the EQs sharing the IRQ will be armed. This is
done regardless of whether an EQ has EQE.
When multiple EQs are sharing an IRQ, one or more EQs can have valid
EQEs.

Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5e: Remove duplicated include
YueHaibing [Tue, 1 Dec 2020 22:42:04 +0000 (14:42 -0800)]
net/mlx5e: Remove duplicated include

Remove duplicated include.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>