From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dmitry Antipov , syzbot+253cd2d2491df77c93ac@syzkaller.appspotmail.com, Johannes Berg , Sasha Levin , johannes@sipsolutions.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 6.1 1/5] wifi: cfg80211: wext: add extra SIOCSIWSCAN data check Date: Sun, 30 Jun 2024 20:14:11 -0400 Message-ID: <20240701001420.2921203-1-sashal@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.96 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1263444 org.kernel.vger.linux-wireless:85481 org.kernel.vger.netdev:355334 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-wireless,org.kernel.vger.netdev,org.kernel.vger.stable Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Dmitry Antipov [ Upstream commit 6ef09cdc5ba0f93826c09d810c141a8d103a80fc ] In 'cfg80211_wext_siwscan()', add extra check whether number of channels passed via 'ioctl(sock, SIOCSIWSCAN, ...)' doesn't exceed IW_MAX_FREQUENCIES and reject invalid request with -EINVAL otherwise. Reported-by: syzbot+253cd2d2491df77c93ac@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=253cd2d2491df77c93ac Signed-off-by: Dmitry Antipov Link: https://msgid.link/20240531032010.451295-1-dmantipov@yandex.ru Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/scan.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 3ad4c1032c038..68c9f658ce385 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -2704,10 +2704,14 @@ int cfg80211_wext_siwscan(struct net_device *dev, wiphy = &rdev->wiphy; /* Determine number of channels, needed to allocate creq */ - if (wreq && wreq->num_channels) + if (wreq && wreq->num_channels) { + /* Passed from userspace so should be checked */ + if (unlikely(wreq->num_channels > IW_MAX_FREQUENCIES)) + return -EINVAL; n_channels = wreq->num_channels; - else + } else { n_channels = ieee80211_get_num_supported_channels(wiphy); + } creq = kzalloc(sizeof(*creq) + sizeof(struct cfg80211_ssid) + n_channels * sizeof(void *), -- 2.43.0 . From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dmitry Antipov , syzbot+253cd2d2491df77c93ac@syzkaller.appspotmail.com, Johannes Berg , Sasha Levin , johannes@sipsolutions.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 1/5] wifi: cfg80211: wext: add extra SIOCSIWSCAN data check Date: Sun, 30 Jun 2024 20:14:29 -0400 Message-ID: <20240701001438.2921324-1-sashal@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.15.161 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1263449 org.kernel.vger.linux-wireless:85482 org.kernel.vger.netdev:355335 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.linux-wireless,org.kernel.vger.netdev,org.kernel.vger.stable Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Dmitry Antipov [ Upstream commit 6ef09cdc5ba0f93826c09d810c141a8d103a80fc ] In 'cfg80211_wext_siwscan()', add extra check whether number of channels passed via 'ioctl(sock, SIOCSIWSCAN, ...)' doesn't exceed IW_MAX_FREQUENCIES and reject invalid request with -EINVAL otherwise. Reported-by: syzbot+253cd2d2491df77c93ac@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=253cd2d2491df77c93ac Signed-off-by: Dmitry Antipov Link: https://msgid.link/20240531032010.451295-1-dmantipov@yandex.ru Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/scan.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 2898df10a72ae..a444eb84d621e 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -2782,10 +2782,14 @@ int cfg80211_wext_siwscan(struct net_device *dev, wiphy = &rdev->wiphy; /* Determine number of channels, needed to allocate creq */ - if (wreq && wreq->num_channels) + if (wreq && wreq->num_channels) { + /* Passed from userspace so should be checked */ + if (unlikely(wreq->num_channels > IW_MAX_FREQUENCIES)) + return -EINVAL; n_channels = wreq->num_channels; - else + } else { n_channels = ieee80211_get_num_supported_channels(wiphy); + } creq = kzalloc(sizeof(*creq) + sizeof(struct cfg80211_ssid) + n_channels * sizeof(void *), -- 2.43.0 . From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dmitry Antipov , syzbot+253cd2d2491df77c93ac@syzkaller.appspotmail.com, Johannes Berg , Sasha Levin , johannes@sipsolutions.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 1/4] wifi: cfg80211: wext: add extra SIOCSIWSCAN data check Date: Sun, 30 Jun 2024 20:14:49 -0400 Message-ID: <20240701001457.2921445-1-sashal@kernel.org> X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.10.220 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-wireless:85483 org.kernel.vger.linux-kernel:1263452 org.kernel.vger.netdev:355336 Newsgroups: org.kernel.vger.linux-wireless,org.kernel.vger.linux-kernel,org.kernel.vger.netdev,org.kernel.vger.stable Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Dmitry Antipov [ Upstream commit 6ef09cdc5ba0f93826c09d810c141a8d103a80fc ] In 'cfg80211_wext_siwscan()', add extra check whether number of channels passed via 'ioctl(sock, SIOCSIWSCAN, ...)' doesn't exceed IW_MAX_FREQUENCIES and reject invalid request with -EINVAL otherwise. Reported-by: syzbot+253cd2d2491df77c93ac@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=253cd2d2491df77c93ac Signed-off-by: Dmitry Antipov Link: https://msgid.link/20240531032010.451295-1-dmantipov@yandex.ru Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/scan.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/wireless/scan.c b/net/wireless/scan.c index a6c289a61d30c..76a27b6d45d28 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -2772,10 +2772,14 @@ int cfg80211_wext_siwscan(struct net_device *dev, wiphy = &rdev->wiphy; /* Determine number of channels, needed to allocate creq */ - if (wreq && wreq->num_channels) + if (wreq && wreq->num_channels) { + /* Passed from userspace so should be checked */ + if (unlikely(wreq->num_channels > IW_MAX_FREQUENCIES)) + return -EINVAL; n_channels = wreq->num_channels; - else + } else { n_channels = ieee80211_get_num_supported_channels(wiphy); + } creq = kzalloc(sizeof(*creq) + sizeof(struct cfg80211_ssid) + n_channels * sizeof(void *), -- 2.43.0 . From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dmitry Antipov , syzbot+253cd2d2491df77c93ac@syzkaller.appspotmail.com, Johannes Berg , Sasha Levin , johannes@sipsolutions.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 1/4] wifi: cfg80211: wext: add extra SIOCSIWSCAN data check Date: Sun, 30 Jun 2024 20:15:06 -0400 Message-ID: <20240701001514.2921545-1-sashal@kernel.org> X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.4.278 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-wireless:85484 org.kernel.vger.linux-kernel:1263453 org.kernel.vger.netdev:355337 Newsgroups: org.kernel.vger.linux-wireless,org.kernel.vger.linux-kernel,org.kernel.vger.netdev,org.kernel.vger.stable Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Dmitry Antipov [ Upstream commit 6ef09cdc5ba0f93826c09d810c141a8d103a80fc ] In 'cfg80211_wext_siwscan()', add extra check whether number of channels passed via 'ioctl(sock, SIOCSIWSCAN, ...)' doesn't exceed IW_MAX_FREQUENCIES and reject invalid request with -EINVAL otherwise. Reported-by: syzbot+253cd2d2491df77c93ac@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=253cd2d2491df77c93ac Signed-off-by: Dmitry Antipov Link: https://msgid.link/20240531032010.451295-1-dmantipov@yandex.ru Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/scan.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/wireless/scan.c b/net/wireless/scan.c index a1c53d4b6711b..c74882e3c3096 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -2212,10 +2212,14 @@ int cfg80211_wext_siwscan(struct net_device *dev, wiphy = &rdev->wiphy; /* Determine number of channels, needed to allocate creq */ - if (wreq && wreq->num_channels) + if (wreq && wreq->num_channels) { + /* Passed from userspace so should be checked */ + if (unlikely(wreq->num_channels > IW_MAX_FREQUENCIES)) + return -EINVAL; n_channels = wreq->num_channels; - else + } else { n_channels = ieee80211_get_num_supported_channels(wiphy); + } creq = kzalloc(sizeof(*creq) + sizeof(struct cfg80211_ssid) + n_channels * sizeof(void *), -- 2.43.0 . From: Tom Herbert To: davem@davemloft.net, kuba@kernel.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, cai.huoqing@linux.dev, netdev@vger.kernel.org, felipe@sipanda.io Cc: Tom Herbert Subject: [PATCH net-next 0/7] drivers: Fix drivers doing TX csum offload with EH Date: Sun, 30 Jun 2024 18:20:54 -0700 Message-Id: <20240701012101.182784-1-tom@herbertland.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.netdev:355338 Newsgroups: org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Several NICs would seem to support protocol specific TX checksum offload and allow for cases where an IPv6 packet contains extension headers. When deciding whether to offload a packet, ipv6_skip_exthdr is called to skip extension headers. The problem is that if a packet contains an IPv6 Routing Header then protocol specific checksum offload can't work, the destination IP address in the IPv6 header is not the same one that is used in the pseudo header for TCP or UDP. The correct address is derived from the last segment in the routing list (which itself might be obfuscated so that a device could even read it). This patch set adds a new function ipv6_skip_exthdr_no_rthdr to be called in lieu of ipv6_skip_exthdr. If a routing header is present in a packet then ipv6_skip_exthdr_no_rthdr returns a value less than zero, this is an indication to the driver that TX checksum offload is not viable and it should call skb_checksum_help instead of offloading the checksum. The i40e, iavf, ice, idpf, hinic, and fm10k are updated accordingly to call ipv6_skip_exthdr_no_rthdr. Testing: The code compiles, but is otherwise untested due to lack of NIC hardware. It would be appreciated if someone with access to the hardware could test. Tom Herbert (7): ipv6: Add ipv6_skip_exthdr_no_rthdr i40e: Don't do TX csum offload with routing header present iavf: Don't do TX csum offload with routing header present ice: Don't do TX csum offload with routing header present idpf: Don't do TX csum offload with routing header present hinic: Don't do TX csum offload with routing header present fm10k: Don't do TX csum offload with routing header present drivers/net/ethernet/huawei/hinic/hinic_tx.c | 23 +++++++++++---- drivers/net/ethernet/intel/fm10k/fm10k_main.c | 9 ++++-- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 22 ++++++--------- drivers/net/ethernet/intel/iavf/iavf_txrx.c | 20 ++++++------- drivers/net/ethernet/intel/ice/ice_txrx.c | 22 ++++++--------- .../ethernet/intel/idpf/idpf_singleq_txrx.c | 28 +++++++++---------- include/net/ipv6.h | 17 +++++++++-- net/ipv6/exthdrs_core.c | 22 +++++++++++---- 8 files changed, 96 insertions(+), 67 deletions(-) -- 2.34.1 . From: Jiawen Wu To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, andrew@lunn.ch, netdev@vger.kernel.org, przemyslaw.kitszel@intel.com Cc: mengyuanlou@net-swift.com, duanqiangwen@net-swift.com, Jiawen Wu Subject: [PATCH net v3 0/4] net: txgbe: fix MSI and INTx interrupts Date: Mon, 1 Jul 2024 15:14:12 +0800 Message-Id: <20240701071416.8468-1-jiawenwu@trustnetic.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.netdev:355350 Newsgroups: org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Fix MSI and INTx interrupts for txgbe driver. changes in v3: - Add flag wx->misc_irq_domain. - Separate commits. - Detail null-defer events. changes in v2: https://lore.kernel.org/all/20240626060703.31652-1-jiawenwu@trustnetic.com - Split into two commits. - Detail commit description. v1: https://lore.kernel.org/all/20240621080951.14368-1-jiawenwu@trustnetic.com Jiawen Wu (4): net: txgbe: initialize num_q_vectors for MSI/INTx interrupts net: txgbe: remove separate irq request for MSI and INTx net: txgbe: add extra handle for MSI/INTx into thread irq handle net: txgbe: free isb resources at the right time drivers/net/ethernet/wangxun/libwx/wx_hw.c | 1 + drivers/net/ethernet/wangxun/libwx/wx_lib.c | 10 +- drivers/net/ethernet/wangxun/libwx/wx_type.h | 1 + drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 2 + .../net/ethernet/wangxun/txgbe/txgbe_irq.c | 124 +++++++----------- .../net/ethernet/wangxun/txgbe/txgbe_irq.h | 2 +- .../net/ethernet/wangxun/txgbe/txgbe_main.c | 9 +- 7 files changed, 64 insertions(+), 85 deletions(-) -- 2.27.0 . From: Romain Gantois Subject: [PATCH net-next 0/6] net: phy: dp83869: Add support for downstream SFP cages Date: Mon, 01 Jul 2024 10:51:02 +0200 Message-Id: <20240701-b4-dp83869-sfp-v1-0-a71d6d0ad5f8@bootlin.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Romain Gantois Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1263786 org.kernel.vger.netdev:355355 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hello everyone, This is version one of my series that adds support for downstream SFP cages to the DP83869 PHY driver. The DP83869HM PHY transceiver supports a variety of different conversion modes, including RGMII to SGMII and RGMII to 1000Base-X. With these last two modes, the DP83869 can act as a bridge between an Ethernet MAC and an SFP cage in one of the following two configurations: RGMII-SGMII bridge: +-------+ +------------+ +-----------+--------------------+ | |RGMII | | SGMII | | | MAC |<----->| DP83869HM |<------>| SFP cage with SGMII SFP module | | | | | | | +-------+ +------------+ +-----------+--------------------+ RGMII-1000Base-X converter: +-------+ +------------+1000Base-X+-----------+--------------------+ | |RGMII | | | | | MAC |<------>| DP83869HM |<-------->| SFP cage with DAC/fiber module | | | | | | | +-------+ +------------+ +-----------+--------------------+ The RGMII-SGMII and RGMII-1000Base-X are currently supported in the PHY driver, but there are some flaws that prevent proper operation with downstream SFP modules. Additionally, the sfp_upstream_ops callbacks which are needed to interact with the downstream SFP modules are not yet implemented. This series adds full support for both SGMII and DAC SFP modules by implementing these sfp_upstream_ops callbacks and fixing relevant issues in the existing DP83869 operational modes. Best Regards, Romain Signed-off-by: Romain Gantois --- Romain Gantois (6): net: phy: dp83869: Disable autonegotiation in RGMII/1000Base-X mode net: phy: dp83869: Perform software restart after configuring op mode net: phy: dp83869: Ensure that the FORCE_LINK_GOOD bit is cleared net: phy: dp83869: Support 1000Base-X and 100Base-FX SFP modules net: phy: dp83869: Support SGMII SFP modules net: phy: dp83869: Fix link up reporting in SGMII bridge mode drivers/net/phy/dp83869.c | 269 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 233 insertions(+), 36 deletions(-) --- base-commit: 30972a4ea092bacb9784fe251327571be6a99f9c change-id: 20240628-b4-dp83869-sfp-8ea96b3f438c Best regards, -- Romain Gantois . X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Mon, 01 Jul 2024 03:28:20 -0700 Message-ID: <00000000000064614b061c2d0e69@google.com> Subject: [syzbot] Monthly net report (Jul 2024) From: syzbot To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1263911 org.kernel.vger.netdev:355363 Newsgroups: org.kernel.vger.linux-kernel,org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hello net maintainers/developers, This is a 31-day syzbot report for the net subsystem. All related reports/information can be found at: https://syzkaller.appspot.com/upstream/s/net During the period, 15 new issues were detected and 17 were fixed. In total, 99 issues are still open and 1471 have been fixed so far. Some of the still happening issues: Ref Crashes Repro Title <1> 61814 Yes possible deadlock in team_del_slave (3) https://syzkaller.appspot.com/bug?extid=705c61d60b091ef42c04 <2> 6379 Yes unregister_netdevice: waiting for DEV to become free (8) https://syzkaller.appspot.com/bug?extid=881d65229ca4f9ae8c84 <3> 999 Yes possible deadlock in __dev_queue_xmit (3) https://syzkaller.appspot.com/bug?extid=3b165dac15094065651e <4> 927 Yes WARNING in inet_sock_destruct (4) https://syzkaller.appspot.com/bug?extid=de6565462ab540f50e47 <5> 911 Yes WARNING in rcu_check_gp_start_stall https://syzkaller.appspot.com/bug?extid=111bc509cd9740d7e4aa <6> 670 Yes general protection fault in skb_release_data (2) https://syzkaller.appspot.com/bug?extid=ccfa5775bc1bda21ddd1 <7> 523 Yes WARNING in kcm_write_msgs https://syzkaller.appspot.com/bug?extid=52624bdfbf2746d37d70 <8> 479 Yes INFO: rcu detected stall in tc_modify_qdisc https://syzkaller.appspot.com/bug?extid=9f78d5c664a8c33f4cce <9> 432 Yes memory leak in corrupted (2) https://syzkaller.appspot.com/bug?extid=e1c69cadec0f1a078e3d <10> 347 Yes INFO: task hung in synchronize_rcu (4) https://syzkaller.appspot.com/bug?extid=222aa26d0a5dbc2e84fe --- This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkaller@googlegroups.com. To disable reminders for individual bugs, reply with the following command: #syz set no-reminders To change bug's subsystems, reply with: #syz set subsystems: new-subsystem You may send multiple commands in a single email message. . From: Sky Huang To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Daniel Golle , Qingfang Deng , SkyLake Huang , Matthias Brugger , AngeloGioacchino Del Regno , , , , CC: Steven Liu , SkyLake.Huang Subject: [PATCH net-next v10 00/13] net: phy: mediatek: Introduce mtk-phy-lib and add 2.5Gphy support Date: Mon, 1 Jul 2024 18:54:04 +0800 Message-ID: <20240701105417.19941-1-SkyLake.Huang@mediatek.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1263935 org.kernel.vger.netdev:355369 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-mediatek,org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: "SkyLake.Huang" This patch series integrate MediaTek's built-in Ethernet PHY helper functions into mtk-phy-lib and add more functions into it. Also, add support for 2.5Gphy on MT7988 SoC. Signed-off-by: SkyLake.Huang --- Changes in v2: - Apply correct PATCH tag. - Break LED/Token ring/Extend-link-pulse-time features into 3 patches. - Fix contents according to v1 comments. Changes in v3: - Rebase code and now this patch series can apply to net-next tree. [PATCH 4/5] Refactor mtk_gphy_cl22_read_status() with genphy_read_status(). [PATCH 5/5] 1. Add range check for firmware. 2. Fix c45_ids.mmds_present in probe function. 3. Still use genphy_update_link() in read_status because genphy_c45_read_link() can't correct detect link on this phy. Changes in v4: [PATCH 4/5] 1. Change extend_an_new_lp_cnt_limit()'s return type and all return values 2. Refactor comments in extend_an_new_lp_cnt_limit() [PATCH 5/5] 1. Move firmware loading function to mt798x_2p5ge_phy_load_fw() 2. Add AN disable warning in mt798x_2p5ge_phy_config_aneg() 3. Clarify the HDX comments in mt798x_2p5ge_phy_get_features() Changes in v5: - Fix syntax errors of comments in drivers/net/phy/mediatek/* [PATCH 1/5] - Change MEDIATEK_GE_SOC_PHY from bool back to tristate. [PATCH 5/5] 1. Move md32_en_cfg_base & pmb_addr to local variables to achieve symmetric code. 2. Print out firmware date code & version. 3. Don't return error if LED pinctrl switching fails. Also, add comments to this unusual operations. 4. Return -EOPNOTSUPP for AN off case in config_aneg(). Changes in v6: - Re-arrange patch and changes description in cover letter. - Contraint code inside 80 columns wide. [PATCH 4/5] 1. Add LP_DETECTED so extend_an_new_lp_cnt_limit() won't be called every time we poll the PHY for its status. It'll be called only when cable is plugged in and 1G training starts. 2. Call phy_read_paged() instead of calling phy_select_page() & phy_restore_page() pair. [PATCH 5/5] 1. Force casting (fw->data + MT7988_2P5GE_PMB_SIZE - 8) with __be16. 2. Remove parens on RHS of "phydev->c45_ids.mmds_present |=". 3. Add PHY_INTERFACE_MODE_INTERNAL check in mt798x_2p5ge_phy_get_rate_matching() 4. Arrange local variables in reverse Xmas tree order. Changes in v7: [PATCH 5/5] 1. Add phy mode check(PHY_INTERFACE_MODE_INTERNAL) in config_init(). 2. Always return RATE_MATCH_PAUSE in get_rate_matching(). Changes in v8: - Make sure that each variables in drivers/net/phy/mediatek/* follows reverse Xmas tree order. - Split v7 patches in this way: [PATCH net-next v7 1/5] net: phy: mediatek: Re-organize MediaTek ethernet phy drivers -> [PATCH net-next v8 01/13] net: phy: mediatek: Re-organize MediaTek ethernet phy drivers -> [PATCH net-next v8 02/13] net: phy: mediatek: Fix spelling errors and rearrange variables [PATCH net-next v7 2/5] net: phy: mediatek: Move LED and read/write page helper functions into mtk phy lib -> [PATCH net-next v8 03/13] net: phy: mediatek: Move LED helper functions into mtk phy lib -> [PATCH net-next v8 04/13] net: phy: mediatek: Improve readability of mtk-phy-lib.c's mtk_phy_led_hw_ctrl_set() -> [PATCH net-next v8 05/13] net: phy: mediatek: Integrate read/write page helper functions -> [PATCH net-next v8 06/13] net: phy: mediatek: Hook LED helper functions in mtk-ge.c -> [PATCH net-next v8 07/13] net: phy: mediatek: add MT7530 & MT7531's PHY ID macros -> [PATCH net-next v8 08/13] net: phy: mediatek: Change mtk-ge-soc.c line wrapping [PATCH net-next v7 3/5] net: phy: mediatek: Add token ring access helper functions in mtk-phy-lib -> [PATCH net-next v8 09/13] net: phy: mediatek: Add token ring access helper functions in mtk-phy-lib [PATCH net-next v7 4/5] net: phy: mediatek: Extend 1G TX/RX link pulse time -> [PATCH net-next v8 10/13] net: phy: mediatek: Extend 1G TX/RX link pulse time [PATCH net-next v7 5/5] net: phy: add driver for built-in 2.5G ethernet PHY on MT7988 -> [PATCH net-next v8 11/13] net: phy: add driver for built-in 2.5G ethernet PHY on MT7988 - Create another 2 patches to: - fix alignment in callback functions declarations in mtk-ge.c & mtk-ge-soc.c - Remove unnecessary outer parens of "supported_triggers" var - Replace token ring API, tr* & __tr* with mtk_tr* & __mtk_tr* and fix alignment. Changes in v9: [PATCH 03/13][PATCH 06/13][PATCH 11/13] - Add mtk_phy_led_num_dly_cfg helper function to check led number & set delay on/off time. [PATCH 07/13][PATCH 12/13] - Remove "mt753x_phy_led_hw_is_supported," callback function hook in MT7530 part of mtk-ge.c [PATCH 09/13] - Replace EEE1000_SELECT_SIGNEL_DETECTION_FROM_DFE with EEE1000_SELECT_SIGNAL_DETECTION_FROM_DFE. SIGNEL->SIGNAL. [PATCH 11/13] - Add MODULE_FIRMARE() - Replace "MT7988_2P5GE_PMB" with "MT7988_2P5GE_PMB_FW" so we can recognize it literally. - Remove unused macro names: 1. BASE100T_STATUS_EXTEND 2. BASE1000T_STATUS_EXTEND 3. EXTEND_CTRL_AND_STATUS 4. PHY_AUX_DPX_MASK Changes in v10: [PATCH 11/13] - Move release_firmware() to correct position. - Return ret directly in mt798x_2p5ge_phy_load_fw(). --- SkyLake.Huang (13): net: phy: mediatek: Re-organize MediaTek ethernet phy drivers net: phy: mediatek: Fix spelling errors and rearrange variables net: phy: mediatek: Move LED helper functions into mtk phy lib net: phy: mediatek: Improve readability of mtk-phy-lib.c's mtk_phy_led_hw_ctrl_set() net: phy: mediatek: Integrate read/write page helper functions net: phy: mediatek: Hook LED helper functions in mtk-ge.c net: phy: mediatek: add MT7530 & MT7531's PHY ID macros net: phy: mediatek: Change mtk-ge-soc.c line wrapping net: phy: mediatek: Add token ring access helper functions in mtk-phy-lib net: phy: mediatek: Extend 1G TX/RX link pulse time net: phy: add driver for built-in 2.5G ethernet PHY on MT7988 net: phy: mediatek: Fix alignment in callback functions' hook net: phy: mediatek: Remove unnecessary outer parens of "supported_triggers" var MAINTAINERS | 7 +- drivers/net/phy/Kconfig | 17 +- drivers/net/phy/Makefile | 3 +- drivers/net/phy/mediatek-ge.c | 111 --- drivers/net/phy/mediatek/Kconfig | 38 + drivers/net/phy/mediatek/Makefile | 5 + drivers/net/phy/mediatek/mtk-2p5ge.c | 432 +++++++++++ .../mtk-ge-soc.c} | 693 ++++++++---------- drivers/net/phy/mediatek/mtk-ge.c | 243 ++++++ drivers/net/phy/mediatek/mtk-phy-lib.c | 450 ++++++++++++ drivers/net/phy/mediatek/mtk.h | 119 +++ 11 files changed, 1586 insertions(+), 532 deletions(-) delete mode 100644 drivers/net/phy/mediatek-ge.c create mode 100644 drivers/net/phy/mediatek/Kconfig create mode 100644 drivers/net/phy/mediatek/Makefile create mode 100644 drivers/net/phy/mediatek/mtk-2p5ge.c rename drivers/net/phy/{mediatek-ge-soc.c => mediatek/mtk-ge-soc.c} (73%) create mode 100644 drivers/net/phy/mediatek/mtk-ge.c create mode 100644 drivers/net/phy/mediatek/mtk-phy-lib.c create mode 100644 drivers/net/phy/mediatek/mtk.h -- 2.18.0 . From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?UTF-8?q?K=C3=B6ry=20Maincent?= , Jesse Brandeburg , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Piergiorgio Beruto , Oleksij Rempel , =?UTF-8?q?Nicol=C3=B2=20Veronese?= , Simon Horman , mwojtas@chromium.org, Nathan Chancellor , Antoine Tenart , Marc Kleine-Budde Subject: [PATCH net-next v13 00/13] Introduce PHY listing and link_topology tracking Date: Mon, 1 Jul 2024 15:17:46 +0200 Message-ID: <20240701131801.1227740-1-maxime.chevallier@bootlin.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.linux-kernel:1264109 org.kernel.vger.netdev:355388 Newsgroups: org.kernel.vger.linux-kernel,org.infradead.lists.linux-arm-kernel,org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Hello everyone, This is V14 on the phy_link_topology series, aiming at supporting ethernet devices where multiple PHYs sit between the MAC and the front-facing port. I've addressed comments, reviews and bug reports in that series (thanks Jakub, Andrew, Russell and Marc for stepping-in for V13 review, tests and discussions). The notable changes in V14 are : - Fixed some typos reported by Jakub - Don't copy the phy_device_node in the dump iterations (patch 7) - Don't call ethnl_parse_header_dev_put() inconditionally for dumps (Thanks Marc for the report) (patch 7) - Don't store the phy_device pointer in the ethnl_req_info, instead only store the index (patch 5) - Add dedicated helper to get the phy from the req_info, enforcing rtnl_lock() to be held (patch 5) - Make use of that header in commands that rely on it (patches 9 to 12) Due to the rework of the way we get the phy_device from the ethnl request, I dropped the reviewed-by on patches 9 to 12 as well as on patches 5 and 7 that were heavily reworked. As a remainder, here's what the PHY listings would look like : - eth0 has a 88x3310 acting as media converter, and an SFP module with an embedded 88e1111 PHY - eth2 has a 88e1510 PHY # ethtool --show-phys * PHY for eth0: PHY index: 1 Driver name: mv88x3310 PHY device name: f212a600.mdio-mii:00 Downstream SFP bus name: sfp-eth0 PHY id: 0 Upstream type: MAC PHY for eth0: PHY index: 2 Driver name: Marvell 88E1111 PHY device name: i2c:sfp-eth0:16 PHY id: 21040322 Upstream type: PHY Upstream PHY index: 1 Upstream SFP name: sfp-eth0 PHY for eth2: PHY index: 1 Driver name: Marvell 88E1510 PHY device name: f212a200.mdio-mii:00 PHY id: 21040593 Upstream type: MAC Ethtool patches : https://github.com/minimaxwell/ethtool/tree/mc/topo-v14 Link to V13: https://lore.kernel.org/netdev/20240607071836.911403-1-maxime.chevallier@bootlin.com/ Link to v12: https://lore.kernel.org/netdev/20240605124920.720690-1-maxime.chevallier@bootlin.com/ Link to v11: https://lore.kernel.org/netdev/20240404093004.2552221-1-maxime.chevallier@bootlin.com/ Link to V10: https://lore.kernel.org/netdev/20240304151011.1610175-1-maxime.chevallier@bootlin.com/ Link to V9: https://lore.kernel.org/netdev/20240228114728.51861-1-maxime.chevallier@bootlin.com/ Link to V8: https://lore.kernel.org/netdev/20240220184217.3689988-1-maxime.chevallier@bootlin.com/ Link to V7: https://lore.kernel.org/netdev/20240213150431.1796171-1-maxime.chevallier@bootlin.com/ Link to V6: https://lore.kernel.org/netdev/20240126183851.2081418-1-maxime.chevallier@bootlin.com/ Link to V5: https://lore.kernel.org/netdev/20231221180047.1924733-1-maxime.chevallier@bootlin.com/ Link to V4: https://lore.kernel.org/netdev/20231215171237.1152563-1-maxime.chevallier@bootlin.com/ Link to V3: https://lore.kernel.org/netdev/20231201163704.1306431-1-maxime.chevallier@bootlin.com/ Link to V2: https://lore.kernel.org/netdev/20231117162323.626979-1-maxime.chevallier@bootlin.com/ Link to V1: https://lore.kernel.org/netdev/20230907092407.647139-1-maxime.chevallier@bootlin.com/ More discussions on specific issues that happened in 6.9-rc: https://lore.kernel.org/netdev/20240412104615.3779632-1-maxime.chevallier@bootlin.com/ https://lore.kernel.org/netdev/20240429131008.439231-1-maxime.chevallier@bootlin.com/ https://lore.kernel.org/netdev/20240507102822.2023826-1-maxime.chevallier@bootlin.com/ Maxime Chevallier (13): net: phy: Introduce ethernet link topology representation net: sfp: pass the phy_device when disconnecting an sfp module's PHY net: phy: add helpers to handle sfp phy connect/disconnect net: sfp: Add helper to return the SFP bus name net: ethtool: Allow passing a phy index for some commands netlink: specs: add phy-index as a header parameter net: ethtool: Introduce a command to list PHYs on an interface netlink: specs: add ethnl PHY_GET command set net: ethtool: plca: Target the command to the requested PHY net: ethtool: pse-pd: Target the command to the requested PHY net: ethtool: cable-test: Target the command to the requested PHY net: ethtool: strset: Allow querying phy stats by index Documentation: networking: document phy_link_topology Documentation/netlink/specs/ethtool.yaml | 62 ++++ Documentation/networking/ethtool-netlink.rst | 52 +++ Documentation/networking/index.rst | 1 + .../networking/phy-link-topology.rst | 121 +++++++ MAINTAINERS | 1 + drivers/net/phy/Makefile | 2 +- drivers/net/phy/marvell-88x2222.c | 2 + drivers/net/phy/marvell.c | 2 + drivers/net/phy/marvell10g.c | 2 + drivers/net/phy/phy_device.c | 48 +++ drivers/net/phy/phy_link_topology.c | 105 ++++++ drivers/net/phy/phylink.c | 3 +- drivers/net/phy/qcom/at803x.c | 2 + drivers/net/phy/qcom/qca807x.c | 2 + drivers/net/phy/sfp-bus.c | 15 +- include/linux/netdevice.h | 4 +- include/linux/phy.h | 6 + include/linux/phy_link_topology.h | 82 +++++ include/linux/sfp.h | 8 +- include/uapi/linux/ethtool.h | 16 + include/uapi/linux/ethtool_netlink.h | 21 ++ net/core/dev.c | 15 + net/ethtool/Makefile | 3 +- net/ethtool/cabletest.c | 35 +- net/ethtool/netlink.c | 66 +++- net/ethtool/netlink.h | 33 ++ net/ethtool/phy.c | 312 ++++++++++++++++++ net/ethtool/plca.c | 30 +- net/ethtool/pse-pd.c | 30 +- net/ethtool/strset.c | 24 +- 30 files changed, 1055 insertions(+), 50 deletions(-) create mode 100644 Documentation/networking/phy-link-topology.rst create mode 100644 drivers/net/phy/phy_link_topology.c create mode 100644 include/linux/phy_link_topology.h create mode 100644 net/ethtool/phy.c -- 2.45.1 . From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Petr Machata , Ido Schimmel , Subject: [PATCH net-next 0/3] mlxsw: Improvements Date: Mon, 1 Jul 2024 18:41:52 +0200 Message-ID: X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Xref: photonic.trudheim.com org.kernel.vger.netdev:355414 Newsgroups: org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail This patchset contains assortments of improvements to the mlxsw driver. Please see individual patches for details. Ido Schimmel (2): mlxsw: core_thermal: Report valid current state during cooling device registration mlxsw: pci: Lock configuration space of upstream bridge during reset Petr Machata (1): mlxsw: Warn about invalid accesses to array fields .../ethernet/mellanox/mlxsw/core_thermal.c | 50 ++++++++++--------- drivers/net/ethernet/mellanox/mlxsw/item.h | 2 + drivers/net/ethernet/mellanox/mlxsw/pci.c | 6 +++ 3 files changed, 34 insertions(+), 24 deletions(-) -- 2.45.0 . From: Tom Herbert To: davem@davemloft.net, kuba@kernel.org, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, cai.huoqing@linux.dev, netdev@vger.kernel.org, felipe@sipanda.io, justin.iurman@uliege.be Cc: Tom Herbert Subject: [PATCH net-next v2 0/7] drivers: Fix drivers doing TX csum offload with EH Date: Mon, 1 Jul 2024 12:55:00 -0700 Message-Id: <20240701195507.256374-1-tom@herbertland.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.netdev:355427 Newsgroups: org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail Several NICs would seem to support protocol specific TX checksum offload and allow for cases where an IPv6 packet contains extension headers. When deciding whether to offload a packet, ipv6_skip_exthdr is called to skip extension headers. The problem is that if a packet contains an IPv6 Routing Header then protocol specific checksum offload can't work, the destination IP address in the IPv6 header is not the same one that is used in the pseudo header for TCP or UDP. The correct address is derived from the last segment in the routing list (which itself might be obfuscated so that a device could even read it). This patch set adds a new function ipv6_skip_exthdr_no_rthdr to be called in lieu of ipv6_skip_exthdr. If a routing header is present in a packet then ipv6_skip_exthdr_no_rthdr returns a value less than zero, this is an indication to the driver that TX checksum offload is not viable and it should call skb_checksum_help instead of offloading the checksum. The i40e, iavf, ice, idpf, hinic, and fm10k are updated accordingly to call ipv6_skip_exthdr_no_rthdr. Testing: The code compiles, but is otherwise untested due to lack of NIC hardware. It would be appreciated if someone with access to the hardware could test. v2: Fixed uninitialized variable in exthdrs_core.c Tom Herbert (7): ipv6: Add ipv6_skip_exthdr_no_rthdr i40e: Don't do TX csum offload with routing header present iavf: Don't do TX csum offload with routing header present ice: Don't do TX csum offload with routing header present idpf: Don't do TX csum offload with routing header present hinic: Don't do TX csum offload with routing header present fm10k: Don't do TX csum offload with routing header present drivers/net/ethernet/huawei/hinic/hinic_tx.c | 23 +++++++++++---- drivers/net/ethernet/intel/fm10k/fm10k_main.c | 9 ++++-- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 22 ++++++--------- drivers/net/ethernet/intel/iavf/iavf_txrx.c | 20 ++++++------- drivers/net/ethernet/intel/ice/ice_txrx.c | 22 ++++++--------- .../ethernet/intel/idpf/idpf_singleq_txrx.c | 28 +++++++++---------- include/net/ipv6.h | 17 +++++++++-- net/ipv6/exthdrs_core.c | 25 ++++++++++++----- 8 files changed, 98 insertions(+), 68 deletions(-) -- 2.34.1 . From: zijianzhang@bytedance.com To: netdev@vger.kernel.org Cc: edumazet@google.com, willemdebruijn.kernel@gmail.com, cong.wang@bytedance.com, xiaochun.lu@bytedance.com, Zijian Zhang Subject: [PATCH] selftests: fix OOM problem in msg_zerocopy selftest Date: Mon, 1 Jul 2024 20:23:38 +0000 Message-Id: <20240701202338.2806388-1-zijianzhang@bytedance.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Xref: photonic.trudheim.com org.kernel.vger.netdev:355437 Newsgroups: org.kernel.vger.netdev Path: photonic.trudheim.com!nntp.lore.kernel.org!not-for-mail From: Zijian Zhang In selftests/net/msg_zerocopy.c, it has a while loop keeps calling sendmsg on a socket with MSG_ZEROCOPY flag, and it will recv the notifications until the socket is not writable. Typically, it will start the receiving process after around 30+ sendmsgs. However, because of the commit dfa2f0483360 ("tcp: get rid of sysctl_tcp_adv_win_scale") the sender is always writable and does not get any chance to run recv notifications. The selftest always exits with OUT_OF_MEMORY because the memory used by opt_skb exceeds the core.sysctl_optmem_max. We introduce "cfg_notification_limit" to force sender to receive notifications after some number of sendmsgs. And, notifications may not come in order, because of the reason we present above. We have order checking code managed by cfg_verbose. Signed-off-by: Zijian Zhang Signed-off-by: Xiaochun Lu --- tools/testing/selftests/net/msg_zerocopy.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/msg_zerocopy.c b/tools/testing/selftests/net/msg_zerocopy.c index bdc03a2097e8..7ea5fb28c93d 100644 --- a/tools/testing/selftests/net/msg_zerocopy.c +++ b/tools/testing/selftests/net/msg_zerocopy.c @@ -85,6 +85,7 @@ static bool cfg_rx; static int cfg_runtime_ms = 4200; static int cfg_verbose; static int cfg_waittime_ms = 500; +static int cfg_notification_limit = 32; static bool cfg_zerocopy; static socklen_t cfg_alen; @@ -95,6 +96,7 @@ static char payload[IP_MAXPACKET]; static long packets, bytes, completions, expected_completions; static int zerocopied = -1; static uint32_t next_completion; +static uint32_t sends_since_notify; static unsigned long gettimeofday_ms(void) { @@ -208,6 +210,7 @@ static bool do_sendmsg(int fd, struct msghdr *msg, bool do_zerocopy, int domain) error(1, errno, "send"); if (cfg_verbose && ret != len) fprintf(stderr, "send: ret=%u != %u\n", ret, len); + sends_since_notify++; if (len) { packets++; @@ -435,7 +438,7 @@ static bool do_recv_completion(int fd, int domain) /* Detect notification gaps. These should not happen often, if at all. * Gaps can occur due to drops, reordering and retransmissions. */ - if (lo != next_completion) + if (cfg_verbose && lo != next_completion) fprintf(stderr, "gap: %u..%u does not append to %u\n", lo, hi, next_completion); next_completion = hi + 1; @@ -460,6 +463,7 @@ static bool do_recv_completion(int fd, int domain) static void do_recv_completions(int fd, int domain) { while (do_recv_completion(fd, domain)) {} + sends_since_notify = 0; } /* Wait for all remaining completions on the errqueue */ @@ -549,6 +553,9 @@ static void do_tx(int domain, int type, int protocol) else do_sendmsg(fd, &msg, cfg_zerocopy, domain); + if (cfg_zerocopy && sends_since_notify >= cfg_notification_limit) + do_recv_completions(fd, domain); + while (!do_poll(fd, POLLOUT)) { if (cfg_zerocopy) do_recv_completions(fd, domain); @@ -708,7 +715,7 @@ static void parse_opts(int argc, char **argv) cfg_payload_len = max_payload_len; - while ((c = getopt(argc, argv, "46c:C:D:i:mp:rs:S:t:vz")) != -1) { + while ((c = getopt(argc, argv, "46c:C:D:i:l:mp:rs:S:t:vz")) != -1) { switch (c) { case '4': if (cfg_family != PF_UNSPEC) @@ -736,6 +743,9 @@ static void parse_opts(int argc, char **argv) if (cfg_ifindex == 0) error(1, errno, "invalid iface: %s", optarg); break; + case 'l': + cfg_notification_limit = strtoul(optarg, NULL, 0); + break; case 'm': cfg_cork_mixed = true; break; -- 2.20.1 .