linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/8] net: hns3: add some fixes for -net
@ 2021-10-19 14:16 Guangbin Huang
  2021-10-19 14:16 ` [PATCH net 1/8] net: hns3: Add configuration of TM QCN error event Guangbin Huang
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Guangbin Huang @ 2021-10-19 14:16 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288

This series adds some fixes for the HNS3 ethernet driver.

Guangbin Huang (2):
  net: hns3: reset DWRR of unused tc to zero
  net: hns3: add limit ets dwrr bandwidth cannot be 0

Jiaran Zhang (1):
  net: hns3: Add configuration of TM QCN error event

Peng Li (1):
  net: hns3: disable sriov before unload hclge layer

Yufeng Mo (1):
  net: hns3: fix vf reset workqueue cannot exit

Yunsheng Lin (3):
  net: hns3: fix the max tx size according to user manual
  net: hns3: fix for miscalculation of rx unused desc
  net: hns3: schedule the polling again when allocation fails

 drivers/net/ethernet/hisilicon/hns3/hnae3.c   | 21 +++++++++++
 drivers/net/ethernet/hisilicon/hns3/hnae3.h   |  1 +
 .../net/ethernet/hisilicon/hns3/hns3_enet.c   | 37 +++++++++++--------
 .../net/ethernet/hisilicon/hns3/hns3_enet.h   |  7 ++--
 .../hisilicon/hns3/hns3pf/hclge_dcb.c         |  9 +++++
 .../hisilicon/hns3/hns3pf/hclge_err.c         |  5 ++-
 .../hisilicon/hns3/hns3pf/hclge_err.h         |  2 +
 .../hisilicon/hns3/hns3pf/hclge_main.c        |  1 +
 .../ethernet/hisilicon/hns3/hns3pf/hclge_tm.c |  2 +
 .../hisilicon/hns3/hns3vf/hclgevf_main.c      |  6 +--
 10 files changed, 68 insertions(+), 23 deletions(-)

-- 
2.33.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH net 1/8] net: hns3: Add configuration of TM QCN error event
  2021-10-19 14:16 [PATCH net 0/8] net: hns3: add some fixes for -net Guangbin Huang
@ 2021-10-19 14:16 ` Guangbin Huang
  2021-10-19 14:16 ` [PATCH net 2/8] net: hns3: reset DWRR of unused tc to zero Guangbin Huang
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2021-10-19 14:16 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288

From: Jiaran Zhang <zhangjiaran@huawei.com>

Add configuration of interrupt type and fifo interrupt enable of TM QCN
error event if enabled, otherwise this event will not be reported when
there is error.

Fixes: d914971df022 ("net: hns3: remove redundant query in hclge_config_tm_hw_err_int()")
Signed-off-by: Jiaran Zhang <zhangjiaran@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c | 5 ++++-
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
index bb9b026ae88e..93aa7f2bdc13 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
@@ -1560,8 +1560,11 @@ static int hclge_config_tm_hw_err_int(struct hclge_dev *hdev, bool en)
 
 	/* configure TM QCN hw errors */
 	hclge_cmd_setup_basic_desc(&desc, HCLGE_TM_QCN_MEM_INT_CFG, false);
-	if (en)
+	desc.data[0] = cpu_to_le32(HCLGE_TM_QCN_ERR_INT_TYPE);
+	if (en) {
+		desc.data[0] |= cpu_to_le32(HCLGE_TM_QCN_FIFO_INT_EN);
 		desc.data[1] = cpu_to_le32(HCLGE_TM_QCN_MEM_ERR_INT_EN);
+	}
 
 	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
 	if (ret)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h
index 07987fb8332e..d811eeefe2c0 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h
@@ -50,6 +50,8 @@
 #define HCLGE_PPP_MPF_ECC_ERR_INT3_EN	0x003F
 #define HCLGE_PPP_MPF_ECC_ERR_INT3_EN_MASK	0x003F
 #define HCLGE_TM_SCH_ECC_ERR_INT_EN	0x3
+#define HCLGE_TM_QCN_ERR_INT_TYPE	0x29
+#define HCLGE_TM_QCN_FIFO_INT_EN	0xFFFF00
 #define HCLGE_TM_QCN_MEM_ERR_INT_EN	0xFFFFFF
 #define HCLGE_NCSI_ERR_INT_EN	0x3
 #define HCLGE_NCSI_ERR_INT_TYPE	0x9
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net 2/8] net: hns3: reset DWRR of unused tc to zero
  2021-10-19 14:16 [PATCH net 0/8] net: hns3: add some fixes for -net Guangbin Huang
  2021-10-19 14:16 ` [PATCH net 1/8] net: hns3: Add configuration of TM QCN error event Guangbin Huang
@ 2021-10-19 14:16 ` Guangbin Huang
  2021-10-19 14:16 ` [PATCH net 3/8] net: hns3: add limit ets dwrr bandwidth cannot be 0 Guangbin Huang
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2021-10-19 14:16 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288

Currently, DWRR of tc will be initialized to a fixed value when this tc
is enabled, but it is not been reset to 0 when this tc is disabled. It
cause a problem that the DWRR of unused tc is not 0 after using tc tool
to add and delete multi-tc parameters.

For examples, after enabling 4 TCs and restoring to 1 TC by follow
tc commands:

$ tc qdisc add dev eth0 root mqprio num_tc 4 map 0 1 2 3 0 1 2 3 queues \
  8@0 8@8 8@16 8@24 hw 1 mode channel
$ tc qdisc del dev eth0 root

Now there is just one TC is enabled for eth0, but the tc info querying by
debugfs is shown as follow:

$ cat /mnt/hns3/0000:7d:00.0/tm/tc_sch_info
enabled tc number: 1
weight_offset: 14
TC    MODE  WEIGHT
0     dwrr    100
1     dwrr    100
2     dwrr    100
3     dwrr    100
4     dwrr      0
5     dwrr      0
6     dwrr      0
7     dwrr      0

This patch fixes it by resetting DWRR of tc to 0 when tc is disabled.

Fixes: 848440544b41 ("net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver")
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
index f314dbd3ce11..95074e91a846 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
@@ -752,6 +752,8 @@ static void hclge_tm_pg_info_init(struct hclge_dev *hdev)
 		hdev->tm_info.pg_info[i].tc_bit_map = hdev->hw_tc_map;
 		for (k = 0; k < hdev->tm_info.num_tc; k++)
 			hdev->tm_info.pg_info[i].tc_dwrr[k] = BW_PERCENT;
+		for (; k < HNAE3_MAX_TC; k++)
+			hdev->tm_info.pg_info[i].tc_dwrr[k] = 0;
 	}
 }
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net 3/8] net: hns3: add limit ets dwrr bandwidth cannot be 0
  2021-10-19 14:16 [PATCH net 0/8] net: hns3: add some fixes for -net Guangbin Huang
  2021-10-19 14:16 ` [PATCH net 1/8] net: hns3: Add configuration of TM QCN error event Guangbin Huang
  2021-10-19 14:16 ` [PATCH net 2/8] net: hns3: reset DWRR of unused tc to zero Guangbin Huang
@ 2021-10-19 14:16 ` Guangbin Huang
  2021-10-19 14:16 ` [PATCH net 4/8] net: hns3: fix the max tx size according to user manual Guangbin Huang
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2021-10-19 14:16 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288

If ets dwrr bandwidth of tc is set to 0, the hardware will switch to SP
mode. In this case, this tc may occupy all the tx bandwidth if it has
huge traffic, so it violates the purpose of the user setting.

To fix this problem, limit the ets dwrr bandwidth must greater than 0.

Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature")
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
index 307c9e830510..91cb578f56b8 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
@@ -137,6 +137,15 @@ static int hclge_ets_sch_mode_validate(struct hclge_dev *hdev,
 				*changed = true;
 			break;
 		case IEEE_8021QAZ_TSA_ETS:
+			/* The hardware will switch to sp mode if bandwidth is
+			 * 0, so limit ets bandwidth must be greater than 0.
+			 */
+			if (!ets->tc_tx_bw[i]) {
+				dev_err(&hdev->pdev->dev,
+					"tc%u ets bw cannot be 0\n", i);
+				return -EINVAL;
+			}
+
 			if (hdev->tm_info.tc_info[i].tc_sch_mode !=
 				HCLGE_SCH_MODE_DWRR)
 				*changed = true;
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net 4/8] net: hns3: fix the max tx size according to user manual
  2021-10-19 14:16 [PATCH net 0/8] net: hns3: add some fixes for -net Guangbin Huang
                   ` (2 preceding siblings ...)
  2021-10-19 14:16 ` [PATCH net 3/8] net: hns3: add limit ets dwrr bandwidth cannot be 0 Guangbin Huang
@ 2021-10-19 14:16 ` Guangbin Huang
  2021-10-19 14:16 ` [PATCH net 5/8] net: hns3: fix for miscalculation of rx unused desc Guangbin Huang
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2021-10-19 14:16 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288

From: Yunsheng Lin <linyunsheng@huawei.com>

Currently the max tx size supported by the hw is calculated by
using the max BD num supported by the hw. According to the hw
user manual, the max tx size is fixed value for both non-TSO and
TSO skb.

This patch updates the max tx size according to the manual.

Fixes: 8ae10cfb5089("net: hns3: support tx-scatter-gather-fraglist feature")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 7 ++-----
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 6 ++----
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 468b8f07bf47..ea89772e8952 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -1847,7 +1847,6 @@ void hns3_shinfo_pack(struct skb_shared_info *shinfo, __u32 *size)
 
 static int hns3_skb_linearize(struct hns3_enet_ring *ring,
 			      struct sk_buff *skb,
-			      u8 max_non_tso_bd_num,
 			      unsigned int bd_num)
 {
 	/* 'bd_num == UINT_MAX' means the skb' fraglist has a
@@ -1864,8 +1863,7 @@ static int hns3_skb_linearize(struct hns3_enet_ring *ring,
 	 * will not help.
 	 */
 	if (skb->len > HNS3_MAX_TSO_SIZE ||
-	    (!skb_is_gso(skb) && skb->len >
-	     HNS3_MAX_NON_TSO_SIZE(max_non_tso_bd_num))) {
+	    (!skb_is_gso(skb) && skb->len > HNS3_MAX_NON_TSO_SIZE)) {
 		u64_stats_update_begin(&ring->syncp);
 		ring->stats.hw_limitation++;
 		u64_stats_update_end(&ring->syncp);
@@ -1900,8 +1898,7 @@ static int hns3_nic_maybe_stop_tx(struct hns3_enet_ring *ring,
 			goto out;
 		}
 
-		if (hns3_skb_linearize(ring, skb, max_non_tso_bd_num,
-				       bd_num))
+		if (hns3_skb_linearize(ring, skb, bd_num))
 			return -ENOMEM;
 
 		bd_num = hns3_tx_bd_count(skb->len);
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
index 6162d9f88e37..9d9be3665bb1 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
@@ -186,11 +186,9 @@ enum hns3_nic_state {
 
 #define HNS3_MAX_BD_SIZE			65535
 #define HNS3_MAX_TSO_BD_NUM			63U
-#define HNS3_MAX_TSO_SIZE \
-	(HNS3_MAX_BD_SIZE * HNS3_MAX_TSO_BD_NUM)
+#define HNS3_MAX_TSO_SIZE			1048576U
+#define HNS3_MAX_NON_TSO_SIZE			9728U
 
-#define HNS3_MAX_NON_TSO_SIZE(max_non_tso_bd_num) \
-	(HNS3_MAX_BD_SIZE * (max_non_tso_bd_num))
 
 #define HNS3_VECTOR_GL0_OFFSET			0x100
 #define HNS3_VECTOR_GL1_OFFSET			0x200
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net 5/8] net: hns3: fix for miscalculation of rx unused desc
  2021-10-19 14:16 [PATCH net 0/8] net: hns3: add some fixes for -net Guangbin Huang
                   ` (3 preceding siblings ...)
  2021-10-19 14:16 ` [PATCH net 4/8] net: hns3: fix the max tx size according to user manual Guangbin Huang
@ 2021-10-19 14:16 ` Guangbin Huang
  2021-10-19 14:16 ` [PATCH net 6/8] net: hns3: schedule the polling again when allocation fails Guangbin Huang
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2021-10-19 14:16 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288

From: Yunsheng Lin <linyunsheng@huawei.com>

rx unused desc is the desc that need attatching new buffer
before refilling to hw to receive new packet, the number of
desc need attatching new buffer is calculated using next_to_use
and next_to_clean. when next_to_use == next_to_clean, currently
hns3 driver assumes that all the desc has the buffer attatched,
but 'next_to_use == next_to_clean' also means all the desc need
attatching new buffer if hw has comsumed all the desc and the
driver has not attatched any buffer to the desc yet.

This patch adds 'refill' in desc_cb to indicate whether a new
buffer has been refilled to a desc.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 8 ++++++++
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index ea89772e8952..2ecc9abc02d6 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -3255,6 +3255,7 @@ static void hns3_buffer_detach(struct hns3_enet_ring *ring, int i)
 {
 	hns3_unmap_buffer(ring, &ring->desc_cb[i]);
 	ring->desc[i].addr = 0;
+	ring->desc_cb[i].refill = 0;
 }
 
 static void hns3_free_buffer_detach(struct hns3_enet_ring *ring, int i,
@@ -3333,6 +3334,7 @@ static int hns3_alloc_and_attach_buffer(struct hns3_enet_ring *ring, int i)
 
 	ring->desc[i].addr = cpu_to_le64(ring->desc_cb[i].dma +
 					 ring->desc_cb[i].page_offset);
+	ring->desc_cb[i].refill = 1;
 
 	return 0;
 }
@@ -3362,6 +3364,7 @@ static void hns3_replace_buffer(struct hns3_enet_ring *ring, int i,
 {
 	hns3_unmap_buffer(ring, &ring->desc_cb[i]);
 	ring->desc_cb[i] = *res_cb;
+	ring->desc_cb[i].refill = 1;
 	ring->desc[i].addr = cpu_to_le64(ring->desc_cb[i].dma +
 					 ring->desc_cb[i].page_offset);
 	ring->desc[i].rx.bd_base_info = 0;
@@ -3370,6 +3373,7 @@ static void hns3_replace_buffer(struct hns3_enet_ring *ring, int i,
 static void hns3_reuse_buffer(struct hns3_enet_ring *ring, int i)
 {
 	ring->desc_cb[i].reuse_flag = 0;
+	ring->desc_cb[i].refill = 1;
 	ring->desc[i].addr = cpu_to_le64(ring->desc_cb[i].dma +
 					 ring->desc_cb[i].page_offset);
 	ring->desc[i].rx.bd_base_info = 0;
@@ -3476,6 +3480,9 @@ static int hns3_desc_unused(struct hns3_enet_ring *ring)
 	int ntc = ring->next_to_clean;
 	int ntu = ring->next_to_use;
 
+	if (unlikely(ntc == ntu && !ring->desc_cb[ntc].refill))
+		return ring->desc_num;
+
 	return ((ntc >= ntu) ? 0 : ring->desc_num) + ntc - ntu;
 }
 
@@ -3821,6 +3828,7 @@ static void hns3_rx_ring_move_fw(struct hns3_enet_ring *ring)
 {
 	ring->desc[ring->next_to_clean].rx.bd_base_info &=
 		cpu_to_le32(~BIT(HNS3_RXD_VLD_B));
+	ring->desc_cb[ring->next_to_clean].refill = 0;
 	ring->next_to_clean += 1;
 
 	if (unlikely(ring->next_to_clean == ring->desc_num))
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
index 9d9be3665bb1..f09a61d9c626 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
@@ -330,6 +330,7 @@ struct hns3_desc_cb {
 	u32 length;     /* length of the buffer */
 
 	u16 reuse_flag;
+	u16 refill;
 
 	/* desc type, used by the ring user to mark the type of the priv data */
 	u16 type;
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net 6/8] net: hns3: schedule the polling again when allocation fails
  2021-10-19 14:16 [PATCH net 0/8] net: hns3: add some fixes for -net Guangbin Huang
                   ` (4 preceding siblings ...)
  2021-10-19 14:16 ` [PATCH net 5/8] net: hns3: fix for miscalculation of rx unused desc Guangbin Huang
@ 2021-10-19 14:16 ` Guangbin Huang
  2021-10-19 14:16 ` [PATCH net 7/8] net: hns3: fix vf reset workqueue cannot exit Guangbin Huang
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2021-10-19 14:16 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288

From: Yunsheng Lin <linyunsheng@huawei.com>

Currently when there is a rx page allocation failure, it is
possible that polling may be stopped if there is no more packet
to be reveiced, which may cause queue stall problem under memory
pressure.

This patch makes sure polling is scheduled again when there is
any rx page allocation failure, and polling will try to allocate
receive buffers until it succeeds.

Now the allocation retry is added, it is unnecessary to do the rx
page allocation at the end of rx cleaning, so remove it. And reset
the unused_count to zero after calling hns3_nic_alloc_rx_buffers()
to avoid calling hns3_nic_alloc_rx_buffers() repeatedly under
memory pressure.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
 .../net/ethernet/hisilicon/hns3/hns3_enet.c   | 22 ++++++++++---------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 2ecc9abc02d6..4b886a13e079 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -3486,7 +3486,8 @@ static int hns3_desc_unused(struct hns3_enet_ring *ring)
 	return ((ntc >= ntu) ? 0 : ring->desc_num) + ntc - ntu;
 }
 
-static void hns3_nic_alloc_rx_buffers(struct hns3_enet_ring *ring,
+/* Return true if there is any allocation failure */
+static bool hns3_nic_alloc_rx_buffers(struct hns3_enet_ring *ring,
 				      int cleand_count)
 {
 	struct hns3_desc_cb *desc_cb;
@@ -3511,7 +3512,10 @@ static void hns3_nic_alloc_rx_buffers(struct hns3_enet_ring *ring,
 				hns3_rl_err(ring_to_netdev(ring),
 					    "alloc rx buffer failed: %d\n",
 					    ret);
-				break;
+
+				writel(i, ring->tqp->io_base +
+				       HNS3_RING_RX_RING_HEAD_REG);
+				return true;
 			}
 			hns3_replace_buffer(ring, ring->next_to_use, &res_cbs);
 
@@ -3524,6 +3528,7 @@ static void hns3_nic_alloc_rx_buffers(struct hns3_enet_ring *ring,
 	}
 
 	writel(i, ring->tqp->io_base + HNS3_RING_RX_RING_HEAD_REG);
+	return false;
 }
 
 static bool hns3_can_reuse_page(struct hns3_desc_cb *cb)
@@ -4175,6 +4180,7 @@ int hns3_clean_rx_ring(struct hns3_enet_ring *ring, int budget,
 {
 #define RCB_NOF_ALLOC_RX_BUFF_ONCE 16
 	int unused_count = hns3_desc_unused(ring);
+	bool failure = false;
 	int recv_pkts = 0;
 	int err;
 
@@ -4183,9 +4189,9 @@ int hns3_clean_rx_ring(struct hns3_enet_ring *ring, int budget,
 	while (recv_pkts < budget) {
 		/* Reuse or realloc buffers */
 		if (unused_count >= RCB_NOF_ALLOC_RX_BUFF_ONCE) {
-			hns3_nic_alloc_rx_buffers(ring, unused_count);
-			unused_count = hns3_desc_unused(ring) -
-					ring->pending_buf;
+			failure = failure ||
+				hns3_nic_alloc_rx_buffers(ring, unused_count);
+			unused_count = 0;
 		}
 
 		/* Poll one pkt */
@@ -4204,11 +4210,7 @@ int hns3_clean_rx_ring(struct hns3_enet_ring *ring, int budget,
 	}
 
 out:
-	/* Make all data has been write before submit */
-	if (unused_count > 0)
-		hns3_nic_alloc_rx_buffers(ring, unused_count);
-
-	return recv_pkts;
+	return failure ? budget : recv_pkts;
 }
 
 static void hns3_update_rx_int_coalesce(struct hns3_enet_tqp_vector *tqp_vector)
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net 7/8] net: hns3: fix vf reset workqueue cannot exit
  2021-10-19 14:16 [PATCH net 0/8] net: hns3: add some fixes for -net Guangbin Huang
                   ` (5 preceding siblings ...)
  2021-10-19 14:16 ` [PATCH net 6/8] net: hns3: schedule the polling again when allocation fails Guangbin Huang
@ 2021-10-19 14:16 ` Guangbin Huang
  2021-10-19 14:16 ` [PATCH net 8/8] net: hns3: disable sriov before unload hclge layer Guangbin Huang
  2021-10-20 11:10 ` [PATCH net 0/8] net: hns3: add some fixes for -net patchwork-bot+netdevbpf
  8 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2021-10-19 14:16 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288

From: Yufeng Mo <moyufeng@huawei.com>

The task of VF reset is performed through the workqueue. It checks the
value of hdev->reset_pending to determine whether to exit the loop.
However, the value of hdev->reset_pending may also be assigned by
the interrupt function hclgevf_misc_irq_handle(), which may cause the
loop fail to exit and keep occupying the workqueue. This loop is not
necessary, so remove it and the workqueue will be rescheduled if the
reset needs to be retried or a new reset occurs.

Fixes: 1cc9bc6e5867 ("net: hns3: split hclgevf_reset() into preparing and rebuilding part")
Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
index 5fdac8685f95..bef6b98e2f50 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -2273,9 +2273,9 @@ static void hclgevf_reset_service_task(struct hclgevf_dev *hdev)
 		hdev->reset_attempts = 0;
 
 		hdev->last_reset_time = jiffies;
-		while ((hdev->reset_type =
-			hclgevf_get_reset_level(hdev, &hdev->reset_pending))
-		       != HNAE3_NONE_RESET)
+		hdev->reset_type =
+			hclgevf_get_reset_level(hdev, &hdev->reset_pending);
+		if (hdev->reset_type != HNAE3_NONE_RESET)
 			hclgevf_reset(hdev);
 	} else if (test_and_clear_bit(HCLGEVF_RESET_REQUESTED,
 				      &hdev->reset_state)) {
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net 8/8] net: hns3: disable sriov before unload hclge layer
  2021-10-19 14:16 [PATCH net 0/8] net: hns3: add some fixes for -net Guangbin Huang
                   ` (6 preceding siblings ...)
  2021-10-19 14:16 ` [PATCH net 7/8] net: hns3: fix vf reset workqueue cannot exit Guangbin Huang
@ 2021-10-19 14:16 ` Guangbin Huang
  2021-10-20 11:10 ` [PATCH net 0/8] net: hns3: add some fixes for -net patchwork-bot+netdevbpf
  8 siblings, 0 replies; 14+ messages in thread
From: Guangbin Huang @ 2021-10-19 14:16 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288

From: Peng Li <lipeng321@huawei.com>

HNS3 driver includes hns3.ko, hnae3.ko and hclge.ko.
hns3.ko includes network stack and pci_driver, hclge.ko includes
HW device action, algo_ops and timer task, hnae3.ko includes some
register function.

When SRIOV is enable and hclge.ko is removed, HW device is unloaded
but VF still exists, PF will not reply VF mbx messages, and cause
errors.

This patch fix it by disable SRIOV before remove hclge.ko.

Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support")
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hnae3.c   | 21 +++++++++++++++++++
 drivers/net/ethernet/hisilicon/hns3/hnae3.h   |  1 +
 .../hisilicon/hns3/hns3pf/hclge_main.c        |  1 +
 3 files changed, 23 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.c b/drivers/net/ethernet/hisilicon/hns3/hnae3.c
index eef1b2764d34..67b0bf310daa 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.c
@@ -10,6 +10,27 @@ static LIST_HEAD(hnae3_ae_algo_list);
 static LIST_HEAD(hnae3_client_list);
 static LIST_HEAD(hnae3_ae_dev_list);
 
+void hnae3_unregister_ae_algo_prepare(struct hnae3_ae_algo *ae_algo)
+{
+	const struct pci_device_id *pci_id;
+	struct hnae3_ae_dev *ae_dev;
+
+	if (!ae_algo)
+		return;
+
+	list_for_each_entry(ae_dev, &hnae3_ae_dev_list, node) {
+		if (!hnae3_get_bit(ae_dev->flag, HNAE3_DEV_INITED_B))
+			continue;
+
+		pci_id = pci_match_id(ae_algo->pdev_id_table, ae_dev->pdev);
+		if (!pci_id)
+			continue;
+		if (IS_ENABLED(CONFIG_PCI_IOV))
+			pci_disable_sriov(ae_dev->pdev);
+	}
+}
+EXPORT_SYMBOL(hnae3_unregister_ae_algo_prepare);
+
 /* we are keeping things simple and using single lock for all the
  * list. This is a non-critical code so other updations, if happen
  * in parallel, can wait.
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index 8ba21d6dc220..d701451596c8 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -853,6 +853,7 @@ struct hnae3_handle {
 int hnae3_register_ae_dev(struct hnae3_ae_dev *ae_dev);
 void hnae3_unregister_ae_dev(struct hnae3_ae_dev *ae_dev);
 
+void hnae3_unregister_ae_algo_prepare(struct hnae3_ae_algo *ae_algo);
 void hnae3_unregister_ae_algo(struct hnae3_ae_algo *ae_algo);
 void hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo);
 
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index f5b8d1fee0f1..dcd40cc73082 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -13065,6 +13065,7 @@ static int hclge_init(void)
 
 static void hclge_exit(void)
 {
+	hnae3_unregister_ae_algo_prepare(&ae_algo);
 	hnae3_unregister_ae_algo(&ae_algo);
 	destroy_workqueue(hclge_wq);
 }
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH net 0/8] net: hns3: add some fixes for -net
  2021-10-19 14:16 [PATCH net 0/8] net: hns3: add some fixes for -net Guangbin Huang
                   ` (7 preceding siblings ...)
  2021-10-19 14:16 ` [PATCH net 8/8] net: hns3: disable sriov before unload hclge layer Guangbin Huang
@ 2021-10-20 11:10 ` patchwork-bot+netdevbpf
  8 siblings, 0 replies; 14+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-20 11:10 UTC (permalink / raw)
  To: Guangbin Huang; +Cc: davem, kuba, netdev, linux-kernel, lipeng321, chenhao288

Hello:

This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue, 19 Oct 2021 22:16:27 +0800 you wrote:
> This series adds some fixes for the HNS3 ethernet driver.
> 
> Guangbin Huang (2):
>   net: hns3: reset DWRR of unused tc to zero
>   net: hns3: add limit ets dwrr bandwidth cannot be 0
> 
> Jiaran Zhang (1):
>   net: hns3: Add configuration of TM QCN error event
> 
> [...]

Here is the summary with links:
  - [net,1/8] net: hns3: Add configuration of TM QCN error event
    https://git.kernel.org/netdev/net/c/60484103d5c3
  - [net,2/8] net: hns3: reset DWRR of unused tc to zero
    https://git.kernel.org/netdev/net/c/b63fcaab9598
  - [net,3/8] net: hns3: add limit ets dwrr bandwidth cannot be 0
    https://git.kernel.org/netdev/net/c/731797fdffa3
  - [net,4/8] net: hns3: fix the max tx size according to user manual
    https://git.kernel.org/netdev/net/c/adfb7b4966c0
  - [net,5/8] net: hns3: fix for miscalculation of rx unused desc
    https://git.kernel.org/netdev/net/c/9f9f0f19994b
  - [net,6/8] net: hns3: schedule the polling again when allocation fails
    https://git.kernel.org/netdev/net/c/68752b24f51a
  - [net,7/8] net: hns3: fix vf reset workqueue cannot exit
    https://git.kernel.org/netdev/net/c/1385cc81baeb
  - [net,8/8] net: hns3: disable sriov before unload hclge layer
    https://git.kernel.org/netdev/net/c/0dd8a25f355b

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net 0/8] net: hns3: add some fixes for -net
  2021-11-10 13:42 Guangbin Huang
@ 2021-11-10 14:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 14+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-11-10 14:30 UTC (permalink / raw)
  To: Guangbin Huang
  Cc: davem, kuba, wangjie125, netdev, linux-kernel, lipeng321, chenhao288

Hello:

This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Wed, 10 Nov 2021 21:42:48 +0800 you wrote:
> This series adds some fixes for the HNS3 ethernet driver.
> 
> Guangbin Huang (4):
>   net: hns3: fix failed to add reuse multicast mac addr to hardware when
>     mc mac table is full
>   net: hns3: fix some mac statistics is always 0 in device version V2
>   net: hns3: remove check VF uc mac exist when set by PF
>   net: hns3: allow configure ETS bandwidth of all TCs
> 
> [...]

Here is the summary with links:
  - [net,1/8] net: hns3: fix failed to add reuse multicast mac addr to hardware when mc mac table is full
    https://git.kernel.org/netdev/net/c/3b4c6566c158
  - [net,2/8] net: hns3: fix ROCE base interrupt vector initialization bug
    https://git.kernel.org/netdev/net/c/beb27ca451a5
  - [net,3/8] net: hns3: fix pfc packet number incorrect after querying pfc parameters
    https://git.kernel.org/netdev/net/c/0b653a81a26d
  - [net,4/8] net: hns3: sync rx ring head in echo common pull
    https://git.kernel.org/netdev/net/c/3b6db4a0492b
  - [net,5/8] net: hns3: fix kernel crash when unload VF while it is being reset
    https://git.kernel.org/netdev/net/c/e140c7983e30
  - [net,6/8] net: hns3: fix some mac statistics is always 0 in device version V2
    https://git.kernel.org/netdev/net/c/1122eac19476
  - [net,7/8] net: hns3: remove check VF uc mac exist when set by PF
    https://git.kernel.org/netdev/net/c/91fcc79bff40
  - [net,8/8] net: hns3: allow configure ETS bandwidth of all TCs
    https://git.kernel.org/netdev/net/c/688db0c7a4a6

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH net 0/8] net: hns3: add some fixes for -net
@ 2021-11-10 13:42 Guangbin Huang
  2021-11-10 14:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 14+ messages in thread
From: Guangbin Huang @ 2021-11-10 13:42 UTC (permalink / raw)
  To: davem, kuba, wangjie125
  Cc: netdev, linux-kernel, lipeng321, huangguangbin2, chenhao288

This series adds some fixes for the HNS3 ethernet driver.

Guangbin Huang (4):
  net: hns3: fix failed to add reuse multicast mac addr to hardware when
    mc mac table is full
  net: hns3: fix some mac statistics is always 0 in device version V2
  net: hns3: remove check VF uc mac exist when set by PF
  net: hns3: allow configure ETS bandwidth of all TCs

Jie Wang (2):
  net: hns3: fix ROCE base interrupt vector initialization bug
  net: hns3: fix pfc packet number incorrect after querying pfc
    parameters

Yufeng Mo (2):
  net: hns3: sync rx ring head in echo common pull
  net: hns3: fix kernel crash when unload VF while it is being reset

 .../net/ethernet/hisilicon/hns3/hns3_enet.c   |   7 ++
 .../hisilicon/hns3/hns3pf/hclge_cmd.c         |   1 +
 .../hisilicon/hns3/hns3pf/hclge_cmd.h         |   1 +
 .../hisilicon/hns3/hns3pf/hclge_dcb.c         |  20 ++--
 .../hisilicon/hns3/hns3pf/hclge_main.c        | 106 +++++++-----------
 .../hisilicon/hns3/hns3pf/hclge_main.h        |   8 +-
 .../ethernet/hisilicon/hns3/hns3pf/hclge_tm.c |  77 ++++++-------
 .../ethernet/hisilicon/hns3/hns3pf/hclge_tm.h |   4 +-
 .../hisilicon/hns3/hns3vf/hclgevf_cmd.c       |  32 ++++++
 .../hisilicon/hns3/hns3vf/hclgevf_cmd.h       |   9 ++
 .../hisilicon/hns3/hns3vf/hclgevf_main.c      |  10 +-
 .../hisilicon/hns3/hns3vf/hclgevf_main.h      |   4 +-
 12 files changed, 147 insertions(+), 132 deletions(-)

-- 
2.33.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net 0/8] net: hns3: add some fixes for -net
  2021-09-29  9:35 Guangbin Huang
@ 2021-09-29 10:10 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 14+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-09-29 10:10 UTC (permalink / raw)
  To: Guangbin Huang; +Cc: davem, kuba, netdev, linux-kernel, lipeng321

Hello:

This series was applied to netdev/net.git (refs/heads/master):

On Wed, 29 Sep 2021 17:35:48 +0800 you wrote:
> This series adds some fixes for the HNS3 ethernet driver.
> 
> Guangbin Huang (3):
>   net: hns3: PF enable promisc for VF when mac table is overflow
>   net: hns3: fix always enable rx vlan filter problem after selftest
>   net: hns3: disable firmware compatible features when uninstall PF
> 
> [...]

Here is the summary with links:
  - [net,1/8] net: hns3: do not allow call hns3_nic_net_open repeatedly
    https://git.kernel.org/netdev/net/c/5b09e88e1bf7
  - [net,2/8] net: hns3: remove tc enable checking
    https://git.kernel.org/netdev/net/c/a8e76fefe3de
  - [net,3/8] net: hns3: don't rollback when destroy mqprio fail
    https://git.kernel.org/netdev/net/c/d82650be60ee
  - [net,4/8] net: hns3: fix mixed flag HCLGE_FLAG_MQPRIO_ENABLE and HCLGE_FLAG_DCB_ENABLE
    https://git.kernel.org/netdev/net/c/0472e95ffeac
  - [net,5/8] net: hns3: fix show wrong state when add existing uc mac address
    https://git.kernel.org/netdev/net/c/108b3c7810e1
  - [net,6/8] net: hns3: PF enable promisc for VF when mac table is overflow
    https://git.kernel.org/netdev/net/c/276e60421668
  - [net,7/8] net: hns3: fix always enable rx vlan filter problem after selftest
    https://git.kernel.org/netdev/net/c/27bf4af69fcb
  - [net,8/8] net: hns3: disable firmware compatible features when uninstall PF
    https://git.kernel.org/netdev/net/c/0178839ccca3

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH net 0/8] net: hns3: add some fixes for -net
@ 2021-09-29  9:35 Guangbin Huang
  2021-09-29 10:10 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 14+ messages in thread
From: Guangbin Huang @ 2021-09-29  9:35 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, linux-kernel, lipeng321, huangguangbin2

This series adds some fixes for the HNS3 ethernet driver.

Guangbin Huang (3):
  net: hns3: PF enable promisc for VF when mac table is overflow
  net: hns3: fix always enable rx vlan filter problem after selftest
  net: hns3: disable firmware compatible features when uninstall PF

Jian Shen (5):
  net: hns3: do not allow call hns3_nic_net_open repeatedly
  net: hns3: remove tc enable checking
  net: hns3: don't rollback when destroy mqprio fail
  net: hns3: fix mixed flag HCLGE_FLAG_MQPRIO_ENABLE and
    HCLGE_FLAG_DCB_ENABLE
  net: hns3: fix show wrong state when add existing uc mac address

 drivers/net/ethernet/hisilicon/hns3/hnae3.h   |  1 -
 .../net/ethernet/hisilicon/hns3/hns3_enet.c   | 16 ++++-----
 .../ethernet/hisilicon/hns3/hns3_ethtool.c    |  6 ++--
 .../hisilicon/hns3/hns3pf/hclge_cmd.c         | 21 +++++++-----
 .../hisilicon/hns3/hns3pf/hclge_dcb.c         | 29 ++++++++--------
 .../hisilicon/hns3/hns3pf/hclge_main.c        | 27 ++++++++-------
 .../ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 33 +++----------------
 7 files changed, 60 insertions(+), 73 deletions(-)

-- 
2.33.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-11-10 14:30 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19 14:16 [PATCH net 0/8] net: hns3: add some fixes for -net Guangbin Huang
2021-10-19 14:16 ` [PATCH net 1/8] net: hns3: Add configuration of TM QCN error event Guangbin Huang
2021-10-19 14:16 ` [PATCH net 2/8] net: hns3: reset DWRR of unused tc to zero Guangbin Huang
2021-10-19 14:16 ` [PATCH net 3/8] net: hns3: add limit ets dwrr bandwidth cannot be 0 Guangbin Huang
2021-10-19 14:16 ` [PATCH net 4/8] net: hns3: fix the max tx size according to user manual Guangbin Huang
2021-10-19 14:16 ` [PATCH net 5/8] net: hns3: fix for miscalculation of rx unused desc Guangbin Huang
2021-10-19 14:16 ` [PATCH net 6/8] net: hns3: schedule the polling again when allocation fails Guangbin Huang
2021-10-19 14:16 ` [PATCH net 7/8] net: hns3: fix vf reset workqueue cannot exit Guangbin Huang
2021-10-19 14:16 ` [PATCH net 8/8] net: hns3: disable sriov before unload hclge layer Guangbin Huang
2021-10-20 11:10 ` [PATCH net 0/8] net: hns3: add some fixes for -net patchwork-bot+netdevbpf
  -- strict thread matches above, loose matches on Subject: below --
2021-11-10 13:42 Guangbin Huang
2021-11-10 14:30 ` patchwork-bot+netdevbpf
2021-09-29  9:35 Guangbin Huang
2021-09-29 10:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).