[PATCH net-next] net/mlxfw: Use kzalloc for allocating only one thing

2020-12-30 Thread Zheng Yongjun
Use kzalloc rather than kcalloc(1,...) The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ @@ - kcalloc(1, + kzalloc( ...) // Signed-off-by: Zheng Yongjun --- drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2.c | 2 +- 1 file changed, 1 inserti

Re: [PATCH rfc 2/3] virtio-net: support receive timestamp

2020-12-30 Thread Jason Wang
On 2020/12/29 下午10:20, Willem de Bruijn wrote: On Tue, Dec 29, 2020 at 4:23 AM Jason Wang wrote: - Original Message - On Mon, Dec 28, 2020 at 7:55 PM Michael S. Tsirkin wrote: On Mon, Dec 28, 2020 at 02:30:31PM -0500, Willem de Bruijn wrote: On Mon, Dec 28, 2020 at 12:29 PM Mich

Re: [RFC v2 09/13] vduse: Add support for processing vhost iotlb message

2020-12-30 Thread Jason Wang
On 2020/12/30 下午3:09, Yongji Xie wrote: On Wed, Dec 30, 2020 at 2:11 PM Jason Wang wrote: On 2020/12/29 下午6:26, Yongji Xie wrote: On Tue, Dec 29, 2020 at 5:11 PM Jason Wang wrote: - Original Message - On Mon, Dec 28, 2020 at 4:43 PM Jason Wang wrote: On 2020/12/28 下午4:14, Yong

Re: [PATCH rfc 2/3] virtio-net: support receive timestamp

2020-12-30 Thread Jason Wang
On 2020/12/29 上午8:57, Willem de Bruijn wrote: On Mon, Dec 28, 2020 at 5:59 PM Jakub Kicinski wrote: On Mon, 28 Dec 2020 11:22:32 -0500 Willem de Bruijn wrote: From: Willem de Bruijn Add optional PTP hardware timestamp offload for virtio-net. Accurate RTT measurement requires timestamps cl

[PATCH] Allow user to set metric on default route learned via Router Advertisement.

2020-12-30 Thread Praveen Chaudhary
Allow user to set metric on default route learned via Router Advertisement. Not: RFC 4191 does not say anything for metric for IPv6 default route. Fix: For IPv4, default route is learned via DHCPv4 and user is allowed to change metric using config etc/network/interfaces. But for IPv6, default rout

[PATCH] Allow user to set metric on default route learned via Router Advertisement.

2020-12-30 Thread Praveen Chaudhary
Allow user to set metric on default route learned via Router Advertisement. Not: RFC 4191 does not say anything for metric for IPv6 default route. Fix: For IPv4, default route is learned via DHCPv4 and user is allowed to change metric using config etc/network/interfaces. But for IPv6, default rout

[PATCH] Allow user to set metric on default route learned via Router Advertisement.

2020-12-30 Thread Praveen Chaudhary
Fix: For IPv4, default route is learned via DHCPv4 and user is allowed to change metric using config etc/network/interfaces. But for IPv6, default route can be learned via RA, for which, currently a fixed metric value 1024 is used. Ideally, user should be able to configure metric on default route

Re: BTFIDS: FAILED unresolved symbol udp6_sock

2020-12-30 Thread Jiri Olsa
On Tue, Dec 29, 2020 at 11:28:35PM +, Qais Yousef wrote: > Hi Jiri > > On 12/29/20 18:34, Jiri Olsa wrote: > > On Tue, Dec 29, 2020 at 03:13:52PM +, Qais Yousef wrote: > > > Hi > > > > > > When I enable CONFIG_DEBUG_INFO_BTF I get the following error in the > > > BTFIDS > > > stage > > >

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread DENG Qingfang
Hi Heiner, Thanks for your reply. On Wed, Dec 30, 2020 at 3:39 PM Heiner Kallweit wrote: > I don't think that's the best option. I'm well aware of that. > You may want to add a PHY driver for your chip. Supposedly it > supports at least PHY suspend/resume. You can use the RTL8366RB > PHY driver

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Heiner Kallweit
On 30.12.2020 10:07, DENG Qingfang wrote: > Hi Heiner, > Thanks for your reply. > > On Wed, Dec 30, 2020 at 3:39 PM Heiner Kallweit wrote: >> I don't think that's the best option. > > I'm well aware of that. > >> You may want to add a PHY driver for your chip. Supposedly it >> supports at least

[PATCH v3 net-next] net: kcm: Replace fput with sockfd_put

2020-12-30 Thread Zheng Yongjun
The function sockfd_lookup uses fget on the value that is stored in the file field of the returned structure, so fput should ultimately be applied to this value. This can be done directly, but it seems better to use the specific macro sockfd_put, which does the same thing. Perform a source code r

Re: [PATCH] mlx4: style: replace zero-length array with flexible-array member.

2020-12-30 Thread Tariq Toukan
On 12/30/2020 8:28 AM, YANG LI wrote: There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use "flexible array members"[1] for these cases. The older style of one-element or zero-length a

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Marc Zyngier
Hi Qingfang, On 2020-12-30 04:22, DENG Qingfang wrote: Hi, I added MT7530 IRQ support and registered its internal PHYs to IRQ. It works but my patch used two hacks. 1. Removed phy_drv_supports_irq check, because config_intr and handle_interrupt are not set for Generic PHY. 2. Allocated ds->sl

Re: [PATCH 07/21] vdpa: multiple address spaces support

2020-12-30 Thread Eli Cohen
On Wed, Dec 30, 2020 at 12:04:30PM +0800, Jason Wang wrote: > > On 2020/12/29 下午3:28, Eli Cohen wrote: > > > @@ -43,6 +43,8 @@ struct vdpa_vq_state { > > >* @index: device index > > >* @features_valid: were features initialized? for legacy guests > > >* @nvqs: the number of virtqueues

[PATCH] selftests: xfrm: fix test return value override issue in xfrm_policy.sh

2020-12-30 Thread Po-Hsu Lin
When running this xfrm_policy.sh test script, even with some cases marked as FAIL, the overall test result will still be PASS: $ sudo ./xfrm_policy.sh PASS: policy before exception matches FAIL: expected ping to .254 to fail (exceptions) PASS: direct policy matches (exceptions) PASS: policy matche

Re: [PATCH 12/21] vhost-vdpa: introduce uAPI to get the number of virtqueue groups

2020-12-30 Thread Eli Cohen
On Wed, Dec 16, 2020 at 02:48:09PM +0800, Jason Wang wrote: > Follows the vDPA support for multiple address spaces, this patch > introduce uAPI for the userspace to know the number of virtqueue > groups supported by the vDPA device. > > Signed-off-by: Jason Wang > --- > drivers/vhost/vdpa.c

Re: Re: [RFC v2 09/13] vduse: Add support for processing vhost iotlb message

2020-12-30 Thread Yongji Xie
On Wed, Dec 30, 2020 at 4:41 PM Jason Wang wrote: > > > On 2020/12/30 下午3:09, Yongji Xie wrote: > > On Wed, Dec 30, 2020 at 2:11 PM Jason Wang wrote: > >> > >> On 2020/12/29 下午6:26, Yongji Xie wrote: > >>> On Tue, Dec 29, 2020 at 5:11 PM Jason Wang wrote: > > - Original Message ---

[PATCH v2] net: macb: Correct usage of MACB_CAPS_CLK_HW_CHG flag

2020-12-30 Thread Charles Keepax
A new flag MACB_CAPS_CLK_HW_CHG was added and all callers of macb_set_tx_clk were gated on the presence of this flag. - if (!clk) + if (!bp->tx_clk || !(bp->caps & MACB_CAPS_CLK_HW_CHG)) However the flag was not added to anything other than the new sama7g5_gem, turning that function call into a

[PATCH net] macvlan: fix null pointer dereference in macvlan_changelink_sources()

2020-12-30 Thread wangyunjian
From: Yunjian Wang Currently pointer data is dereferenced when declaring addr before pointer data is null checked. This could lead to a null pointer dereference. Fix this by checking if pointer data is null first. Fixes: 79cf79abce71 ("macvlan: add source mode") Signed-off-by: Yunjian Wang ---

Re: [PATCH net-next] net/mlxfw: Use kzalloc for allocating only one thing

2020-12-30 Thread Ido Schimmel
On Wed, Dec 30, 2020 at 04:18:35PM +0800, Zheng Yongjun wrote: > Use kzalloc rather than kcalloc(1,...) > > The semantic patch that makes this change is as follows: > (http://coccinelle.lip6.fr/) > > // > @@ > @@ > > - kcalloc(1, > + kzalloc( > ...) > // > > Signed-off-by: Zheng Yon

Re: [PATCH] CDC-NCM: remove "connected" log message

2020-12-30 Thread Oliver Neukum
Am Dienstag, den 29.12.2020, 11:50 -0800 schrieb Roland Dreier: > > I looked at them again and found that there is a way to get > > the same effect that will make maintenance easier in the long run. > > Could I send them to you later this week for testing? > > Yes, please. I have a good test setu

[PATCH net] selftests: mlxsw: Set headroom size of correct port

2020-12-30 Thread Ido Schimmel
From: Ido Schimmel The test was setting the headroom size of the wrong port. This was not visible because of a firmware bug that canceled this bug. Set the headroom size of the correct port, so that the test will pass with both old and new firmware versions. Fixes: bfa804784e32 ("selftests: mlx

Re: [PATCH] xfrm: Fix wraparound in xfrm_policy_addr_delta()

2020-12-30 Thread Visa Hankala
On Tue, Dec 29, 2020 at 05:01:27PM +0100, Florian Westphal wrote: > Visa Hankala wrote: > > Use three-way comparison for address elements to avoid integer > > wraparound in the result of xfrm_policy_addr_delta(). > > > > This ensures that the search trees are built and traversed correctly > > whe

[PATCH net] net: ipv6: Validate GSO SKB before finish IPv6 processing

2020-12-30 Thread Aya Levin
There are cases where GSO segment's length exceeds the egress MTU. If so: - Consume the SKB and its segments. - Issue an ICMP packet with 'Packet Too Big' message containing the MTU, allowing the source host to reduce its Path MTU appropriately. Note: These cases are handled in the same manne

Re: [PATCH rfc 2/3] virtio-net: support receive timestamp

2020-12-30 Thread Richard Cochran
On Mon, Dec 28, 2020 at 07:57:20PM -0500, Willem de Bruijn wrote: > There is a well understood method for synchronizing guest and host > clock in KVM using ptp_kvm. For virtual environments without NIC > hardware offload, the when host timestamps in software, this suffices. > > Syncing host with N

Re: [PATCH rfc 3/3] virtio-net: support transmit timestamp

2020-12-30 Thread Richard Cochran
On Mon, Dec 28, 2020 at 11:22:33AM -0500, Willem de Bruijn wrote: > From: Willem de Bruijn > > Add optional delivery time (SO_TXTIME) offload for virtio-net. > > The Linux TCP/IP stack tries to avoid bursty transmission and network > congestion through pacing: computing an skb delivery time base

Re: [PATCH] xfrm: Fix wraparound in xfrm_policy_addr_delta()

2020-12-30 Thread Florian Westphal
Visa Hankala wrote: > On Tue, Dec 29, 2020 at 05:01:27PM +0100, Florian Westphal wrote: > > This is suspicious. Is prefixlen == 0 impossible? > > > > If not, then after patch > > mask = ~0U << 32; > > > > ... and function returns 0. > > With prefixlen == 0, there is only one equivalence class,

[PATCH 2/2] net: ks8851: Register MDIO bus and the internal PHY

2020-12-30 Thread Marek Vasut
The KS8851 has a reduced internal PHY, which is accessible through its registers at offset 0xe4. The PHY is compatible with KS886x PHY present in Micrel switches, except the PHY ID Low/High registers are swapped. Register MDIO bus so this PHY can be detected and probed by phylib. Signed-off-by: Ma

[PATCH 1/2] net: phy: micrel: Add KS8851 PHY support

2020-12-30 Thread Marek Vasut
The KS8851 has a reduced internal PHY, which is accessible through its registers at offset 0xe4. The PHY is compatible with KS886x PHY present in Micrel switches, except the PHY ID Low/High registers are swapped. Add PHY ID for this KS8851 PHY and use custom PHY ID mask due to the swap. Signed-off

Re: [PATCH] selftests: xfrm: fix test return value override issue in xfrm_policy.sh

2020-12-30 Thread Florian Westphal
Po-Hsu Lin wrote: > When running this xfrm_policy.sh test script, even with some cases > marked as FAIL, the overall test result will still be PASS: > > $ sudo ./xfrm_policy.sh > PASS: policy before exception matches > FAIL: expected ping to .254 to fail (exceptions) > PASS: direct policy matches

Announcing Netdev 0x15

2020-12-30 Thread Jamal Hadi Salim
While we bid goodbye to 2020, here's some good hopeful news for 2021. cheers, jamal Forwarded Message Subject: [NetDev-People] Announcing Netdev 0x15 Date: Sun, 27 Dec 2020 15:54:31 -0700 From: Tom Herbert via people Reply-To: Tom Herbert To: peo...@netdevconf.info Hello

Re: BTFIDS: FAILED unresolved symbol udp6_sock

2020-12-30 Thread Jiri Olsa
On Wed, Dec 30, 2020 at 02:28:02PM +0100, Jiri Olsa wrote: > On Wed, Dec 30, 2020 at 10:03:37AM +0100, Jiri Olsa wrote: > > On Tue, Dec 29, 2020 at 11:28:35PM +, Qais Yousef wrote: > > > Hi Jiri > > > > > > On 12/29/20 18:34, Jiri Olsa wrote: > > > > On Tue, Dec 29, 2020 at 03:13:52PM +, Q

Re: BTFIDS: FAILED unresolved symbol udp6_sock

2020-12-30 Thread Jiri Olsa
On Wed, Dec 30, 2020 at 10:03:37AM +0100, Jiri Olsa wrote: > On Tue, Dec 29, 2020 at 11:28:35PM +, Qais Yousef wrote: > > Hi Jiri > > > > On 12/29/20 18:34, Jiri Olsa wrote: > > > On Tue, Dec 29, 2020 at 03:13:52PM +, Qais Yousef wrote: > > > > Hi > > > > > > > > When I enable CONFIG_DEBU

Re: [PATCH v2 2/2] docs: networking: packet_mmap: fix old config reference

2020-12-30 Thread Baruch Siach
Hi Ulises, On Tue, Dec 29 2020, Ulises Alonso wrote: > Can you also replace the sentence > > "(like libpcap always does)." > > with > > "(which old libpcap versions used do)." Are you sure this change is correct? The text says: ... it requires two if you want to get packet's timestamp

Re: [PATCH] ibmvnic: fix: NULL pointer dereference.

2020-12-30 Thread Michal Suchánek
On Wed, Dec 30, 2020 at 03:23:14PM +0800, YANG LI wrote: > The error is due to dereference a null pointer in function > reset_one_sub_crq_queue(): > > if (!scrq) { > netdev_dbg(adapter->netdev, >"Invalid scrq reset. irq (%d) or msgs(%p).\n", > scrq->irq, scrq->msg

Re: [PATCH net-next v2 0/2] Add support for DSFP transceiver type

2020-12-30 Thread Vladyslav Tarasiuk
On 29-Dec-20 18:25, Andrew Lunn wrote: Hi Andrew, Following this conversation, I wrote some pseudocode checking if I'm on right path here. Please review: struct eeprom_page {     u8 page_number;     u8 bank_number;     u16 offset;     u16 data_length;     u8 *data; }

Re: BTFIDS: FAILED unresolved symbol udp6_sock

2020-12-30 Thread Arnaldo Carvalho de Melo
Em Wed, Dec 30, 2020 at 02:28:52PM +0100, Jiri Olsa escreveu: > On Wed, Dec 30, 2020 at 02:28:02PM +0100, Jiri Olsa wrote: > > On Wed, Dec 30, 2020 at 10:03:37AM +0100, Jiri Olsa wrote: > > > On Tue, Dec 29, 2020 at 11:28:35PM +, Qais Yousef wrote: > > > > Hi Jiri > > > > > > > > On 12/29/20 1

[PATCH v1] af/rvu_cgx: Fix missing check bugs in rvu_cgx.c

2020-12-30 Thread wangyingjie55
From: Yingjie Wang In rvu_mbox_handler_cgx_mac_addr_get() and rvu_mbox_handler_cgx_mac_addr_set(), the msg is expected only from PFs that are mapped to CGX LMACs. It should be checked before mapping, so we add the is_cgx_config_permitted() in the functions. Signed-off-by: Yingjie Wang --- dri

[PATCH] mt76: fix enum conversion warning

2020-12-30 Thread Arnd Bergmann
From: Arnd Bergmann A recent patch changed some enum values, but not the type declaration for the assignment: drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:238:9: error: implicit conversion from enumeration type 'enum mt76_mcuq_id' to different enumeration type 'enum mt76_txq_id' [-Werror,-W

Re: BTFIDS: FAILED unresolved symbol udp6_sock

2020-12-30 Thread Jiri Olsa
On Wed, Dec 30, 2020 at 11:19:36AM -0300, Arnaldo Carvalho de Melo wrote: > Em Wed, Dec 30, 2020 at 02:28:52PM +0100, Jiri Olsa escreveu: > > On Wed, Dec 30, 2020 at 02:28:02PM +0100, Jiri Olsa wrote: > > > On Wed, Dec 30, 2020 at 10:03:37AM +0100, Jiri Olsa wrote: > > > > On Tue, Dec 29, 2020 at 1

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Andrew Lunn
> > +static void mt7530_irq_bus_lock(struct irq_data *d) > > +{ > > + struct mt7530_priv *priv = irq_data_get_irq_chip_data(d); > > + > > + mutex_lock(&priv->reg_mutex); > > Are you always guaranteed to be in a thread context? I guess that > is the case, given that you request a threaded inter

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Andrew Lunn
> 2. Allocated ds->slave_mii_bus before calling ds->ops->setup, because > we cannot call dsa_slave_mii_bus_init which is private. > > Any better ideas? Do what mv88e6xxx does, allocate the MDIO bus inside the switch driver. Andrew

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Andrew Lunn
On Wed, Dec 30, 2020 at 09:42:09AM +, Marc Zyngier wrote: > > +static irqreturn_t > > +mt7530_irq(int irq, void *data) > > +{ > > + struct mt7530_priv *priv = data; > > + bool handled = false; > > + int phy; > > + u32 val; > > + > > + val = mt7530_read(priv, MT7530_SYS_INT_STS); > > +

Re: [PATCH rfc 3/3] virtio-net: support transmit timestamp

2020-12-30 Thread Willem de Bruijn
On Wed, Dec 30, 2020 at 7:38 AM Richard Cochran wrote: > > On Mon, Dec 28, 2020 at 11:22:33AM -0500, Willem de Bruijn wrote: > > From: Willem de Bruijn > > > > Add optional delivery time (SO_TXTIME) offload for virtio-net. > > > > The Linux TCP/IP stack tries to avoid bursty transmission and netw

Re: BTFIDS: FAILED unresolved symbol udp6_sock

2020-12-30 Thread Qais Yousef
On 12/30/20 14:28, Jiri Olsa wrote: > On Wed, Dec 30, 2020 at 02:28:02PM +0100, Jiri Olsa wrote: > > On Wed, Dec 30, 2020 at 10:03:37AM +0100, Jiri Olsa wrote: > > > On Tue, Dec 29, 2020 at 11:28:35PM +, Qais Yousef wrote: > > > > Hi Jiri > > > > > > > > On 12/29/20 18:34, Jiri Olsa wrote: > >

[PATCH net,stable] net: usb: qmi_wwan: add Quectel EM160R-GL

2020-12-30 Thread Bjørn Mork
New modem using ff/ff/30 for QCDM, ff/00/00 for AT and NMEA, and ff/ff/ff for RMNET/QMI. T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0 D: Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=2c7c ProdID=0620 Rev= 4.09 S: Manufacturer=Quectel S: Product=EM160R-GL S:

Re: [PATCH net-next v2 0/2] Add support for DSFP transceiver type

2020-12-30 Thread Andrew Lunn
On Wed, Dec 30, 2020 at 03:55:02PM +0200, Vladyslav Tarasiuk wrote: > > On 29-Dec-20 18:25, Andrew Lunn wrote: > > > Hi Andrew, > > > > > > Following this conversation, I wrote some pseudocode checking if I'm on > > > right path here. > > > Please review: > > > > > > struct eeprom_page { > > >

Re: [PATCH 1/2] net: phy: micrel: Add KS8851 PHY support

2020-12-30 Thread Andrew Lunn
On Wed, Dec 30, 2020 at 01:53:57PM +0100, Marek Vasut wrote: > The KS8851 has a reduced internal PHY, which is accessible through its > registers at offset 0xe4. The PHY is compatible with KS886x PHY present > in Micrel switches, except the PHY ID Low/High registers are swapped. Can you intercept

[PATCH 0/4] net: sfp: add support for GPON RTL8672/RTL9601C and Ubiquiti U-Fiber

2020-12-30 Thread Pali Rohár
This patch series add generic workaround for reading EEPROM content from broken GPON SFP modules based on Realtek RTL8672/RTL9601C chips and add another workarounds for GPON SFP module Ubiquiti U-Fiber Instant. GPON SFP modules based on Realtek RTL8672/RTL9601C chips do not have a real EEPROM but

[PATCH 3/4] net: sfp: assume that LOS is not implemented if both LOS normal and inverted is set

2020-12-30 Thread Pali Rohár
Some GPON SFP modules (e.g. Ubiquiti U-Fiber Instant) have set both SFP_OPTIONS_LOS_INVERTED and SFP_OPTIONS_LOS_NORMAL bits in their EEPROM. Such combination of bits is meaningless so assume that LOS signal is not implemented. This patch fixes link carrier for GPON SFP module Ubiquiti U-Fiber In

[PATCH 2/4] net: sfp: allow to use also SFP modules which are detected as SFF

2020-12-30 Thread Pali Rohár
Some GPON SFP modules (e.g. Ubiquiti U-Fiber Instant) have set SFF phys_id in their EEPROM. Kernel SFP subsystem currently does not allow to use modules detected as SFF. This change extends check for SFP modules so also those with SFF phys_id are allowed. With this change also GPON SFP module Ubiq

[PATCH 1/4] net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips

2020-12-30 Thread Pali Rohár
Workaround for GPON SFP modules based on VSOL V2801F brand was added in commit 0d035bed2a4a ("net: sfp: VSOL V2801F / CarlitoxxPro CPGOS03-0490 v2.0 workaround"). But it works only for ids explicitly added to the list. As there are more rebraded VSOL V2801F modules and OEM vendors are putting into

[PATCH 4/4] net: sfp: add mode quirk for GPON module Ubiquiti U-Fiber Instant

2020-12-30 Thread Pali Rohár
SFP GPON module Ubiquiti U-Fiber Instant has in its EEPROM stored nonsense information. It claims that support all transceiver types including 10G Ethernet which is not truth. So clear all claimed modes and set only one mode which module supports: 1000baseX_Full. This change finally allows to dete

Re: [PATCH 2/2] net: ks8851: Register MDIO bus and the internal PHY

2020-12-30 Thread Andrew Lunn
> +static int ks8851_mdio_read(struct mii_bus *bus, int phy_id, int reg) > +{ > + struct ks8851_net *ks = bus->priv; > + > + if (phy_id != 0) > + return 0x; > + Please check for C45 and return -EOPNOTSUPP. Andrew

Re: [PATCH 1/4] net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips

2020-12-30 Thread Russell King - ARM Linux admin
On Wed, Dec 30, 2020 at 04:47:52PM +0100, Pali Rohár wrote: > Workaround for GPON SFP modules based on VSOL V2801F brand was added in > commit 0d035bed2a4a ("net: sfp: VSOL V2801F / CarlitoxxPro CPGOS03-0490 > v2.0 workaround"). But it works only for ids explicitly added to the list. > As there are

Re: [PATCH 2/4] net: sfp: allow to use also SFP modules which are detected as SFF

2020-12-30 Thread Russell King - ARM Linux admin
On Wed, Dec 30, 2020 at 04:47:53PM +0100, Pali Rohár wrote: > Some GPON SFP modules (e.g. Ubiquiti U-Fiber Instant) have set SFF phys_id > in their EEPROM. Kernel SFP subsystem currently does not allow to use > modules detected as SFF. > > This change extends check for SFP modules so also those wi

Re: [PATCH 3/4] net: sfp: assume that LOS is not implemented if both LOS normal and inverted is set

2020-12-30 Thread Russell King - ARM Linux admin
On Wed, Dec 30, 2020 at 04:47:54PM +0100, Pali Rohár wrote: > Some GPON SFP modules (e.g. Ubiquiti U-Fiber Instant) have set both > SFP_OPTIONS_LOS_INVERTED and SFP_OPTIONS_LOS_NORMAL bits in their EEPROM. > > Such combination of bits is meaningless so assume that LOS signal is not > implemented.

[PATCH v2] xfrm: Fix wraparound in xfrm_policy_addr_delta()

2020-12-30 Thread Visa Hankala
Use three-way comparison for address components to avoid integer wraparound in the result of xfrm_policy_addr_delta(). This ensures that the search trees are built and traversed correctly. Treat IPv4 and IPv6 similarly by returning 0 when prefixlen == 0. Prefix /0 has only one equivalence class.

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Florian Fainelli
On 12/30/2020 1:12 AM, Heiner Kallweit wrote: > On 30.12.2020 10:07, DENG Qingfang wrote: >> Hi Heiner, >> Thanks for your reply. >> >> On Wed, Dec 30, 2020 at 3:39 PM Heiner Kallweit wrote: >>> I don't think that's the best option. >> >> I'm well aware of that. >> >>> You may want to add a PHY

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Florian Fainelli
On 12/30/2020 7:16 AM, Andrew Lunn wrote: >> 2. Allocated ds->slave_mii_bus before calling ds->ops->setup, because >> we cannot call dsa_slave_mii_bus_init which is private. >> >> Any better ideas? > > Do what mv88e6xxx does, allocate the MDIO bus inside the switch > driver. Yes, exactly, or y

Re: [PATCH] Allow user to set metric on default route learned via Router Advertisement.

2020-12-30 Thread Andrew Lunn
On Wed, Dec 30, 2020 at 12:48:32AM -0800, Praveen Chaudhary wrote: > Allow user to set metric on default route learned via Router Advertisement. > Not: RFC 4191 does not say anything for metric for IPv6 default route. Hi Praveen Please take a look at https://www.kernel.org/doc/html/latest/proces

Re: [PATCH v2] net: macb: Correct usage of MACB_CAPS_CLK_HW_CHG flag

2020-12-30 Thread Andrew Lunn
On Wed, Dec 30, 2020 at 10:33:09AM +, Charles Keepax wrote: > A new flag MACB_CAPS_CLK_HW_CHG was added and all callers of > macb_set_tx_clk were gated on the presence of this flag. > > - if (!clk) > + if (!bp->tx_clk || !(bp->caps & MACB_CAPS_CLK_HW_CHG)) > > However the flag was not added

Re: Registering IRQ for MT7530 internal PHYs

2020-12-30 Thread Heiner Kallweit
On 30.12.2020 17:15, Florian Fainelli wrote: > > > On 12/30/2020 1:12 AM, Heiner Kallweit wrote: >> On 30.12.2020 10:07, DENG Qingfang wrote: >>> Hi Heiner, >>> Thanks for your reply. >>> >>> On Wed, Dec 30, 2020 at 3:39 PM Heiner Kallweit >>> wrote: I don't think that's the best option. >

Re: [PATCH 1/4] net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips

2020-12-30 Thread Pali Rohár
On Wednesday 30 December 2020 16:10:37 Russell King - ARM Linux admin wrote: > On Wed, Dec 30, 2020 at 04:47:52PM +0100, Pali Rohár wrote: > > Workaround for GPON SFP modules based on VSOL V2801F brand was added in > > commit 0d035bed2a4a ("net: sfp: VSOL V2801F / CarlitoxxPro CPGOS03-0490 > > v2.0

Re: [PATCH 3/4] net: sfp: assume that LOS is not implemented if both LOS normal and inverted is set

2020-12-30 Thread Pali Rohár
On Wednesday 30 December 2020 16:13:10 Russell King - ARM Linux admin wrote: > On Wed, Dec 30, 2020 at 04:47:54PM +0100, Pali Rohár wrote: > > Some GPON SFP modules (e.g. Ubiquiti U-Fiber Instant) have set both > > SFP_OPTIONS_LOS_INVERTED and SFP_OPTIONS_LOS_NORMAL bits in their EEPROM. > > > > S

Re: [PATCH 1/4] net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips

2020-12-30 Thread Russell King - ARM Linux admin
On Wed, Dec 30, 2020 at 05:56:34PM +0100, Pali Rohár wrote: > This change is really required for those Realtek chips. I thought that > it is obvious that from *both* addresses 0x50 and 0x51 can be read only > one byte at the same time. Reading 2 bytes (for be16 value) cannot be > really done by one

Re: [PATCH 3/4] net: sfp: assume that LOS is not implemented if both LOS normal and inverted is set

2020-12-30 Thread Russell King - ARM Linux admin
On Wed, Dec 30, 2020 at 05:57:58PM +0100, Pali Rohár wrote: > On Wednesday 30 December 2020 16:13:10 Russell King - ARM Linux admin wrote: > > On Wed, Dec 30, 2020 at 04:47:54PM +0100, Pali Rohár wrote: > > > Some GPON SFP modules (e.g. Ubiquiti U-Fiber Instant) have set both > > > SFP_OPTIONS_LOS_

Re: [PATCH 2/4] net: sfp: allow to use also SFP modules which are detected as SFF

2020-12-30 Thread Pali Rohár
On Wednesday 30 December 2020 16:11:51 Russell King - ARM Linux admin wrote: > On Wed, Dec 30, 2020 at 04:47:53PM +0100, Pali Rohár wrote: > > Some GPON SFP modules (e.g. Ubiquiti U-Fiber Instant) have set SFF phys_id > > in their EEPROM. Kernel SFP subsystem currently does not allow to use > > mod

Re: [PATCH 1/4] net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips

2020-12-30 Thread Andrew Lunn
On Wed, Dec 30, 2020 at 05:05:46PM +, Russell King - ARM Linux admin wrote: > On Wed, Dec 30, 2020 at 05:56:34PM +0100, Pali Rohár wrote: > > This change is really required for those Realtek chips. I thought that > > it is obvious that from *both* addresses 0x50 and 0x51 can be read only > > on

Re: [PATCH 3/4] net: sfp: assume that LOS is not implemented if both LOS normal and inverted is set

2020-12-30 Thread Andrew Lunn
On Wed, Dec 30, 2020 at 05:06:23PM +, Russell King - ARM Linux admin wrote: > On Wed, Dec 30, 2020 at 05:57:58PM +0100, Pali Rohár wrote: > > On Wednesday 30 December 2020 16:13:10 Russell King - ARM Linux admin wrote: > > > On Wed, Dec 30, 2020 at 04:47:54PM +0100, Pali Rohár wrote: > > > > So

Re: [PATCH 2/4] net: sfp: allow to use also SFP modules which are detected as SFF

2020-12-30 Thread Marek Behún
On Wed, 30 Dec 2020 18:06:52 +0100 Pali Rohár wrote: > if (!sfp->type->module_supported(&id) && > (memcmp(id.base.vendor_name, "UBNT", 16) || >memcmp(id.base.vendor_pn, "UF-INSTANT ", 16))) I would rather add a quirk member (bitfield) to the sfp struc

Re: [PATCH 1/4] net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips

2020-12-30 Thread Pali Rohár
On Wednesday 30 December 2020 17:05:46 Russell King - ARM Linux admin wrote: > On Wed, Dec 30, 2020 at 05:56:34PM +0100, Pali Rohár wrote: > > This change is really required for those Realtek chips. I thought that > > it is obvious that from *both* addresses 0x50 and 0x51 can be read only > > one b

Re: [PATCH 3/4] net: sfp: assume that LOS is not implemented if both LOS normal and inverted is set

2020-12-30 Thread Pali Rohár
On Wednesday 30 December 2020 18:17:41 Andrew Lunn wrote: > On Wed, Dec 30, 2020 at 05:06:23PM +, Russell King - ARM Linux admin > wrote: > > On Wed, Dec 30, 2020 at 05:57:58PM +0100, Pali Rohár wrote: > > > On Wednesday 30 December 2020 16:13:10 Russell King - ARM Linux admin > > > wrote: >

Re: [PATCH 1/4] net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips

2020-12-30 Thread Pali Rohár
On Wednesday 30 December 2020 18:13:15 Andrew Lunn wrote: > On Wed, Dec 30, 2020 at 05:05:46PM +, Russell King - ARM Linux admin > wrote: > > On Wed, Dec 30, 2020 at 05:56:34PM +0100, Pali Rohár wrote: > > > This change is really required for those Realtek chips. I thought that > > > it is obv

Re: [PATCH v2] btf: support ints larger than 128 bits

2020-12-30 Thread Yonghong Song
On 12/19/20 8:36 AM, Sean Young wrote: clang supports arbitrary length ints using the _ExtInt extension. This can be useful to hold very large values, e.g. 256 bit or 512 bit types. Larger types (e.g. 1024 bits) are possible but I am unaware of a use case for these. This requires the _ExtInt

[PATCH net] r8169: work around power-saving bug on some chip versions

2020-12-30 Thread Heiner Kallweit
A user reported failing network with RTL8168dp (a quite rare chip version). Realtek confirmed that few chip versions suffer from a PLL power-down hw bug. Fixes: 07df5bd874f0 ("r8169: power down chip in probe") Signed-off-by: Heiner Kallweit --- Note that since the original change source file r816

Re: [PATCH v2] xfrm: Fix wraparound in xfrm_policy_addr_delta()

2020-12-30 Thread Florian Westphal
Visa Hankala wrote: > Use three-way comparison for address components to avoid integer > wraparound in the result of xfrm_policy_addr_delta(). This ensures > that the search trees are built and traversed correctly. > > Treat IPv4 and IPv6 similarly by returning 0 when prefixlen == 0. > Prefix /0

Re: [PATCH 1/4] net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips

2020-12-30 Thread Russell King - ARM Linux admin
On Wed, Dec 30, 2020 at 06:43:07PM +0100, Pali Rohár wrote: > On Wednesday 30 December 2020 18:13:15 Andrew Lunn wrote: > > Hi Pali > > > > I have to agree with Russell here. I would rather have no diagnostics > > than untrustable diagnostics. > > Ok! > > So should we completely skip hwmon_devic

[RFC PATCH v3 10/12] net: group skb_shinfo zerocopy related bits together.

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon In preparation for expanded zerocopy (TX and RX), move the zerocopy related bits out of tx_flags into their own flag word. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c | 3 +-- drivers/net/tun.c | 3 +-- drivers/net/xen-netback/

[RFC PATCH v3 05/12] skbuff: replace sock_zerocopy_get with skb_zcopy_get

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon Rename the get routines for consistency. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 12 ++-- net/core/skbuff.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index a6c8683

[RFC PATCH v3 06/12] skbuff: Add skb parameter to the ubuf zerocopy callback

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon Add an optional skb parameter to the zerocopy callback parameter, which is passed down from skb_zcopy_clear(). This gives access to the original skb, which is needed for upcoming RX zero-copy error handling. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c

[RFC PATCH v3 03/12] skbuff: Push status and refcounts into sock_zerocopy_callback

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon Before this change, the caller of sock_zerocopy_callback would need to save the zerocopy status, decrement and check the refcount, and then call the callback function - the callback was only invoked when the refcount reached zero. Now, the caller just passes the status into

[RFC PATCH v3 01/12] skbuff: remove unused skb_zcopy_abort function

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon skb_zcopy_abort() has no in-tree consumers, remove it. Signed-off-by: Jonathan Lemon Acked-by: Willem de Bruijn --- include/linux/skbuff.h | 11 --- 1 file changed, 11 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 333bcdc39635..3

[RFC PATCH v3 07/12] skbuff: Call sock_zerocopy_put_abort from skb_zcopy_put_abort

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon The sock_zerocopy_put_abort function contains logic which is specific to the current zerocopy implementation. Add a wrapper which checks the callback and dispatches apppropriately. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 10 ++ net/core/skbuff.c

Re: [PATCH 2/4] net: sfp: allow to use also SFP modules which are detected as SFF

2020-12-30 Thread Russell King - ARM Linux admin
On Wed, Dec 30, 2020 at 06:27:07PM +0100, Marek Behún wrote: > On Wed, 30 Dec 2020 18:06:52 +0100 > Pali Rohár wrote: > > > if (!sfp->type->module_supported(&id) && > > (memcmp(id.base.vendor_name, "UBNT", 16) || > > memcmp(id.base.vendor_pn, "UF-INSTANT ", 1

[PATCH iproute2] build: Fix link errors on some systems

2020-12-30 Thread Roi Dayan
Since moving get_rate() and get_size() from tc to lib, on some systems we fail to link because of missing the math lib. Move the link flag from tc makefile to the main makefile. ../lib/libutil.a(utils.o): In function `get_rate': utils.c:(.text+0x10dc): undefined reference to `floor' ../lib/libutil

[RFC PATCH v3 04/12] skbuff: replace sock_zerocopy_put() with skb_zcopy_put()

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon Replace sock_zerocopy_put with the generic skb_zcopy_put() function. Pass 'true' as the success argument, as this is identical to no change. Signed-off-by: Jonathan Lemon --- include/linux/skbuff.h | 7 ++- net/core/skbuff.c | 9 + net/ipv4/tcp.c

[RFC PATCH v3 00/12] Generic zcopy_* functions

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon This is set of cleanup patches for zerocopy which are intended to allow a introduction of a different zerocopy implementation. The top level API will use the skb_zcopy_*() functions, while the current TCP specific zerocopy ends up using msg_zerocopy_*() calls. There should

[RFC PATCH v3 12/12] tap/tun: add skb_zcopy_init() helper for initialization.

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon Replace direct assignments with skb_zcopy_init() for zerocopy cases where a new skb is initialized, without changing the reference counts. Signed-off-by: Jonathan Lemon --- drivers/net/tap.c | 3 +-- drivers/net/tun.c | 3 +-- drivers/vhost/net.c| 1 + includ

[RFC PATCH v3 11/12] skbuff: add flags to ubuf_info for ubuf setup

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon Currently, when an ubuf is attached to a new skb, the shared flags word is initialized to a fixed value. Instead of doing this, set the default flags in the ubuf, and have new skbs inherit from this default. This is needed when setting up different zerocopy types. Signed-o

[RFC PATCH v3 09/12] skbuff: rename sock_zerocopy_* to msg_zerocopy_*

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon At Willem's suggestion, rename the sock_zerocopy_* functions so that they match the MSG_ZEROCOPY flag, which makes it clear they are specific to this zerocopy implementation. Signed-off-by: Jonathan Lemon Acked-by: Willem de Bruijn --- include/linux/skbuff.h | 16

[RFC PATCH v3 08/12] skbuff: Call skb_zcopy_clear() before unref'ing fragments

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon RX zerocopy fragment pages which are not allocated from the system page pool require special handling. Give the callback in skb_zcopy_clear() a chance to process them first. Signed-off-by: Jonathan Lemon --- net/core/skbuff.c | 3 ++- 1 file changed, 2 insertions(+), 1 de

[RFC PATCH v3 02/12] skbuff: simplify sock_zerocopy_put

2020-12-30 Thread Jonathan Lemon
From: Jonathan Lemon All 'struct ubuf_info' users should have a callback defined as of commit 0a4a060bb204 ("sock: fix zerocopy_success regression with msg_zerocopy"). Remove the dead code path to consume_skb(), which makes assumptions about how the structure was allocated. Signed-off-by: Jonat

Re: [PATCH 1/4] net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips

2020-12-30 Thread Russell King - ARM Linux admin
On Wed, Dec 30, 2020 at 06:31:52PM +0100, Pali Rohár wrote: > On Wednesday 30 December 2020 17:05:46 Russell King - ARM Linux admin wrote: > > On Wed, Dec 30, 2020 at 05:56:34PM +0100, Pali Rohár wrote: > > > This change is really required for those Realtek chips. I thought that > > > it is obvious

Re: [PATCH 1/4] net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips

2020-12-30 Thread Andrew Lunn
> Ok! > > So should we completely skip hwmon_device_register_with_info() call > if (i2c_block_size < 2) ? Yep. That would be a nice simple test. But does ethtool -m still export the second page? That is also unreliable. Andrew

general protection fault in dst_dev_put (6)

2020-12-30 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:40f78232 Merge tag 'pci-v5.11-fixes-1' of git://git.kernel.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1731027750 kernel config: https://syzkaller.appspot.com/x/.config?x=9798d6898fec8a72 das

KASAN: use-after-free Read in vlan_dev_real_dev

2020-12-30 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:1f45dc22 ibmvnic: continue fatal error reset after passive.. git tree: net console output: https://syzkaller.appspot.com/x/log.txt?x=10dbe3ff50 kernel config: https://syzkaller.appspot.com/x/.config?x=9c6feb14e07e1220 dashboar

Re: [PATCH 1/4] net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips

2020-12-30 Thread Russell King - ARM Linux admin
On Wed, Dec 30, 2020 at 08:30:52PM +0100, Andrew Lunn wrote: > > Ok! > > > > So should we completely skip hwmon_device_register_with_info() call > > if (i2c_block_size < 2) ? > > Yep. That would be a nice simple test. > > But does ethtool -m still export the second page? That is also > unreliabl

Re: [PATCH 1/4] net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips

2020-12-30 Thread Andrew Lunn
> Which shows why it's pointless producing an EEPROM validation tool that > runs under Linux (as has been your suggestion). They won't use it, > since their testing only goes as far as "does it work in our product?" Yes, i would need SNIA to push for conformance testing, hold plug-testing events,

Re: [PATCH 2/3] vhost/vsock: support for SOCK_SEQPACKET socket.

2020-12-30 Thread Michael S. Tsirkin
On Tue, Dec 29, 2020 at 02:06:33PM +0300, Arseny Krasnov wrote: > This patch simply adds transport ops and removes > ignore of non-stream type of packets. > > Signed-off-by: Arseny Krasnov How is this supposed to work? virtio vsock at the moment has byte level end to end credit accounting

  1   2   >