Re: [PATCH net] hinic: fix wrong return value of mac-set cmd

2020-09-23 Thread luobin (L)
On 2020/9/24 8:43, David Miller wrote: > From: Luo bin > Date: Tue, 22 Sep 2020 19:26:43 +0800 > >> It should also be regarded as an error when hw return status=4 for PF's >> setting mac cmd. Only if PF return status=4 to VF should this cmd be >> taken special treatment. >> >> Signed-off-by: Luo

Re: [PATCH] hinic: fix potential resource leak

2020-09-16 Thread luobin (L)
On 2020/9/17 11:03, Wei Li wrote: > + err = irq_set_affinity_hint(rq->irq, >affinity_mask); > + if (err) > + goto err_irq; > + > + return 0; > + > +err_irq: > + rx_del_napi(rxq); > + return err; If irq_set_affinity_hint fails, irq should be freed as well.

Re: [PATCH net] hinic: fix rewaking txq after netif_tx_disable

2020-09-08 Thread luobin (L)
On 2020/9/8 5:28, Jakub Kicinski wrote: > On Mon, 7 Sep 2020 22:15:16 +0800 Luo bin wrote: >> When calling hinic_close in hinic_set_channels, all queues are >> stopped after netif_tx_disable, but some queue may be rewaken in >> free_tx_poll by mistake while drv is handling tx irq. If one queue >>

Re: [PATCH net 3/3] hinic: fix bug of send pkts while setting channels

2020-09-03 Thread luobin (L)
On 2020/9/2 18:16, Eric Dumazet wrote: > > > On 9/2/20 2:41 AM, Luo bin wrote: >> When calling hinic_close in hinic_set_channels, netif_carrier_off >> and netif_tx_disable are excuted, and TX host resources are freed >> after that. Core may call hinic_xmit_frame to send pkt after >>

Re: [PATCH net 3/3] hinic: fix bug of send pkts while setting channels

2020-09-03 Thread luobin (L)
On 2020/9/3 3:52, David Miller wrote: > From: Luo bin > Date: Wed, 2 Sep 2020 17:41:45 +0800 > >> @@ -531,6 +531,11 @@ netdev_tx_t hinic_xmit_frame(struct sk_buff *skb, >> struct net_device *netdev) >> struct hinic_txq *txq; >> struct hinic_qp *qp; >> >> +if

Re: [PATCH net-next v1 3/3] hinic: add support to query function table

2020-08-28 Thread luobin (L)
On 2020/8/29 1:19, Jakub Kicinski wrote: > On Fri, 28 Aug 2020 11:16:22 +0800 luobin (L) wrote: >> On 2020/8/28 3:44, Jakub Kicinski wrote: >>> On Thu, 27 Aug 2020 19:13:21 +0800 Luo bin wrote: >>>> + switch (idx) { >>>> + case VALID: >>>

Re: [PATCH net-next v1 3/3] hinic: add support to query function table

2020-08-27 Thread luobin (L)
On 2020/8/28 3:44, Jakub Kicinski wrote: > On Thu, 27 Aug 2020 19:13:21 +0800 Luo bin wrote: >> +switch (idx) { >> +case VALID: >> +return funcfg_table_elem->dw0.bs.valid; >> +case RX_MODE: >> +return funcfg_table_elem->dw0.bs.nic_rx_mode; >> +case MTU: >> +

Re: [PATCH net-next] hinic: add debugfs support

2020-08-20 Thread luobin (L)
On 2020/8/21 0:02, Jakub Kicinski wrote: > On Thu, 20 Aug 2020 20:14:32 +0800 Luo bin wrote: >> +static int hinic_dbg_help(struct hinic_dev *nic_dev, const char *cmd_buf) >> +{ >> +netif_info(nic_dev, drv, nic_dev->netdev, "Available commands:\n"); >> +netif_info(nic_dev, drv,

Re: [PATCH net-next v1] hinic: fix strncpy output truncated compile warnings

2020-08-08 Thread luobin (L)
On 2020/8/8 20:50, David Laight wrote: > From: luobin (L) >> Sent: 08 August 2020 04:37 >> >> On 2020/8/7 17:32, David Laight wrote: >>> From: Luo bin >>>> Sent: 07 August 2020 03:09 >>>> >>>> fix the compile warnings of 'strncpy'

Re: [PATCH net-next v1] hinic: fix strncpy output truncated compile warnings

2020-08-08 Thread luobin (L)
On 2020/8/8 14:44, Kees Cook wrote: > On Fri, Aug 07, 2020 at 08:42:43PM -0700, David Miller wrote: >> From: "luobin (L)" >> Date: Sat, 8 Aug 2020 11:36:42 +0800 >> >>> On 2020/8/7 17:32, David Laight wrote: >>>>> diff --git a/drivers/net/et

Re: [PATCH net-next v1] hinic: fix strncpy output truncated compile warnings

2020-08-08 Thread luobin (L)
On 2020/8/8 11:42, David Miller wrote: > From: "luobin (L)" > Date: Sat, 8 Aug 2020 11:36:42 +0800 > >> On 2020/8/7 17:32, David Laight wrote: >>>> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c >>>> b/drivers/net/ethernet/hua

Re: [PATCH net-next v1] hinic: fix strncpy output truncated compile warnings

2020-08-07 Thread luobin (L)
On 2020/8/7 17:32, David Laight wrote: > From: Luo bin >> Sent: 07 August 2020 03:09 >> >> fix the compile warnings of 'strncpy' output truncated before >> terminating nul copying N bytes from a string of the same length >> >> Signed-off-by: Luo bin >> Reported-by: kernel test robot >> --- >>

Re: [PATCH net-next] hinic: fix strncpy output truncated compile warnings

2020-08-06 Thread luobin (L)
On 2020/8/7 8:57, luobin (L) wrote: > On 2020/8/7 3:01, David Miller wrote: >> From: Luo bin >> Date: Thu, 6 Aug 2020 15:48:30 +0800 >> >>> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c >>> b/drivers/net/ethernet/huawei/hinic/hinic_devlink

Re: [PATCH net-next] hinic: fix strncpy output truncated compile warnings

2020-08-06 Thread luobin (L)
On 2020/8/7 3:01, David Miller wrote: > From: Luo bin > Date: Thu, 6 Aug 2020 15:48:30 +0800 > >> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c >> b/drivers/net/ethernet/huawei/hinic/hinic_devlink.c >> index c6adc776f3c8..1dc948c07b94 100644 >> ---

Re: [PATCH net-next v3 1/2] hinic: add generating mailbox random index support

2020-08-03 Thread luobin (L)
On 2020/8/4 6:05, Jakub Kicinski wrote: > On Sat, 1 Aug 2020 10:49:34 +0800 Luo bin wrote: >> add support to generate mailbox random id of VF to ensure that >> mailbox messages PF received are from the correct VF. >> >> Signed-off-by: Luo bin >> --- >> V2~V3 fix review opinions pointed out by

Re: [PATCH net-next v2 1/2] hinic: add generating mailbox random index support

2020-07-31 Thread luobin (L)
On 2020/8/1 3:52, Jakub Kicinski wrote: > On Fri, 31 Jul 2020 09:56:41 +0800 Luo bin wrote: >> add support to generate mailbox random id of VF to ensure that >> mailbox messages PF received are from the correct VF. >> >> Signed-off-by: Luo bin > >> diff --git

Re: [PATCH net-next v1 1/2] hinic: add generating mailbox random index support

2020-07-30 Thread luobin (L)
On 2020/7/31 0:25, Jakub Kicinski wrote: > On Thu, 30 Jul 2020 16:37:15 +0800 Luo bin wrote: >> +bool check_vf_mbox_random_id(struct hinic_mbox_func_to_func *func_to_func, >> + u8 *header) > > This set seems to add new W=1 C=1 warnings: > >

Re: [PATCH net-next] hinic: add generating mailbox random index support

2020-07-29 Thread luobin (L)
On 2020/7/30 6:03, Jakub Kicinski wrote: > On Wed, 29 Jul 2020 08:59:19 +0800 Luo bin wrote: >> add support to generate mailbox random id for VF to ensure that >> the mailbox message from VF is valid and PF should check whether >> the cmd from VF is supported before passing it to hw. > > This is

Re: [PATCH net-next v4 1/2] hinic: add support to handle hw abnormal event

2020-07-24 Thread luobin (L)
On 2020/7/25 8:04, David Miller wrote: > From: Luo bin > Date: Fri, 24 Jul 2020 17:17:31 +0800 > >> +static int hinic_fw_reporter_dump(struct devlink_health_reporter *reporter, >> + struct devlink_fmsg *fmsg, void *priv_ctx, >> + struct

Re: [PATCH net-next v3 1/2] hinic: add support to handle hw abnormal event

2020-07-24 Thread luobin (L)
On 2020/7/24 17:57, Edward Cree wrote: > On 23/07/2020 20:08, David Miller wrote: >> From: Luo bin >> Date: Thu, 23 Jul 2020 22:40:37 +0800 >> >>> +static int hinic_fw_reporter_dump(struct devlink_health_reporter *reporter, >>> + struct devlink_fmsg *fmsg, void

Re: [PATCH net-next v3 1/2] hinic: add support to handle hw abnormal event

2020-07-23 Thread luobin (L)
On 2020/7/24 3:08, David Miller wrote: > From: Luo bin > Date: Thu, 23 Jul 2020 22:40:37 +0800 > >> +static int hinic_fw_reporter_dump(struct devlink_health_reporter *reporter, >> + struct devlink_fmsg *fmsg, void *priv_ctx, >> + struct

Re: [PATCH net-next v2 1/2] hinic: add support to handle hw abnormal event

2020-07-20 Thread luobin (L)
On 2020/7/21 2:13, Jakub Kicinski wrote: > On Sat, 18 Jul 2020 16:58:29 +0800 Luo bin wrote: >> add support to handle hw abnormal event such as hardware failure, >> cable unplugged,link error >> >> Signed-off-by: Luo bin >> --- >> V1~V2: add link extended state >> V0~V1: fix auto build test

Re: [PATCH net-next v1 1/2] hinic: add support to handle hw abnormal event

2020-07-18 Thread luobin (L)
On 2020/7/18 3:11, Jakub Kicinski wrote: > On Fri, 17 Jul 2020 16:34:47 +0800 Luo bin wrote: >> add support to handle hw abnormal event such as hardware failure, >> cable unplugged,link error >> >> Signed-off-by: Luo bin >> Reported-by: kernel test robot > >> +static void

Re: [PATCH net-next 2/2] hinic: add log in exception handling processes

2020-07-16 Thread luobin (L)
On 2020/7/16 23:27, Jakub Kicinski wrote: > On Thu, 16 Jul 2020 20:50:56 +0800 Luo bin wrote: >> improve the error message when functions return failure and dump >> relevant registers in some exception handling processes >> >> Signed-off-by: Luo bin > > For kernel builds with W=1 C=1 flags this

Re: [PATCH net-next v2] hinic: add firmware update support

2020-07-14 Thread luobin (L)
On 2020/7/15 2:37, Jakub Kicinski wrote: > On Tue, 14 Jul 2020 20:54:33 +0800 Luo bin wrote: >> add support to update firmware by the devlink flashing API >> >> Signed-off-by: Luo bin > > Minor nits below, otherwise I think this looks good. > >> +static int hinic_firmware_update(struct

Re: [PATCH net-next v1] hinic: add firmware update support

2020-07-13 Thread luobin (L)
On 2020/7/14 6:42, Jakub Kicinski wrote: > On Mon, 13 Jul 2020 22:05:22 +0800 Luo bin wrote: >> add support to update firmware by the devlink flashing API >> >> Signed-off-by: Luo bin >> --- >> V0~V1: remove the implementation from ethtool to devlink > > Thanks! > >> +static int

Re: [PATCH net-next] hinic: add firmware update support

2020-07-07 Thread luobin (L)
On 2020/7/7 0:57, Jakub Kicinski wrote: > On Mon, 6 Jul 2020 22:54:06 +0800 Luo bin wrote: >> add support to update firmware with with "ethtool -f" cmd >> >> Signed-off-by: Luo bin > > drivers/net/ethernet/huawei/hinic/hinic_ethtool.c:1996:44: warning: missing > braces around initializer >

Re: [PATCH net] hinic: fix passing non negative value to ERR_PTR

2020-06-30 Thread luobin (L)
On 2020/7/1 0:20, Jakub Kicinski wrote: > On Tue, 30 Jun 2020 14:35:54 +0800 Luo bin wrote: >> get_dev_cap and set_resources_state functions may return a positive >> value because of hardware failure, and the positive return value >> can not be passed to ERR_PTR directly. >> >> Fixes: 7dd29ee12865

Re: [PATCH net-next v3 0/5] hinic: add some ethtool ops support

2020-06-27 Thread luobin (L)
On 2020/6/28 8:52, David Miller wrote: > From: Luo bin > Date: Sat, 27 Jun 2020 14:52:37 +0800 > >> patch #1: support to set and get pause params with >> "ethtool -A/a" cmd >> patch #2: support to set and get irq coalesce params with >> "ethtool -C/c" cmd >> patch #3: support

Re: [PATCH net-next v2 5/5] hinic: add support to get eeprom information

2020-06-26 Thread luobin (L)
On 2020/6/24 6:02, Jakub Kicinski wrote: > On Tue, 23 Jun 2020 22:24:09 +0800 Luo bin wrote: >> +int hinic_get_sfp_type(struct hinic_hwdev *hwdev, u8 *data0, u8 *data1) >> +{ >> +u8 sfp_data[STD_SFP_INFO_MAX_SIZE]; >> +u16 len; >> +int err; >> + >> +if (!hwdev || !data0 || !data1)

Re: [PATCH net-next v2 1/5] hinic: add support to set and get pause params

2020-06-26 Thread luobin (L)
On 2020/6/24 5:54, Jakub Kicinski wrote: > On Tue, 23 Jun 2020 22:24:05 +0800 Luo bin wrote: >> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c >> b/drivers/net/ethernet/huawei/hinic/hinic_main.c >> index e9e6f4c9309a..e69edb01fd9b 100644 >> ---

Re: [PATCH net-next v1 5/5] hinic: add support to get eeprom information

2020-06-23 Thread luobin (L)
On 2020/6/23 6:15, Jakub Kicinski wrote: > On Sat, 20 Jun 2020 17:42:58 +0800 Luo bin wrote: >> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_port.h >> b/drivers/net/ethernet/huawei/hinic/hinic_port.h >> index 5c916875f295..0d0354241345 100644 >> ---

Re: [PATCH net-next v1 2/5] hinic: add support to set and get irq coalesce

2020-06-23 Thread luobin (L)
On 2020/6/23 6:08, Jakub Kicinski wrote: >> +if (coal->tx_max_coalesced_frames > COALESCE_MAX_PENDING_LIMIT) { >> +netif_err(nic_dev, drv, netdev, >> + "Tx_max_coalesced_frames out of range[%d-%d]\n", 0, >> + COALESCE_MAX_PENDING_LIMIT); >>

Re: [PATCH net-next v1 2/5] hinic: add support to set and get irq coalesce

2020-06-23 Thread luobin (L)
On 2020/6/23 6:07, Jakub Kicinski wrote: > On Sat, 20 Jun 2020 17:42:55 +0800 Luo bin wrote: >> @@ -1144,8 +1190,16 @@ static int nic_dev_init(struct pci_dev *pdev) >> goto err_reg_netdev; >> } >> >> +err = hinic_init_intr_coalesce(nic_dev); >> +if (err) { >> +

Re: [PATCH net-next v1 5/5] hinic: add support to get eeprom information

2020-06-21 Thread luobin (L)
On 2020/6/21 0:00, Andrew Lunn wrote: >> +static int hinic_get_module_eeprom(struct net_device *netdev, >> + struct ethtool_eeprom *ee, u8 *data) >> +{ >> +struct hinic_dev *nic_dev = netdev_priv(netdev); >> +u8 sfp_data[STD_SFP_INFO_MAX_SIZE]; > > sfp_data

Re: [PATCH net-next 5/5] hinic: add support to get eeprom information

2020-06-03 Thread luobin (L)
On 2020/6/4 11:01, Jakub Kicinski wrote: > On Wed, 3 Jun 2020 14:20:15 +0800 Luo bin wrote: >> add support to get eeprom information from the plug-in module >> with ethtool -m cmd. >> >> Signed-off-by: Luo bin > > drivers/net/ethernet/huawei/hinic/hinic_port.c:1386:5: warning: variable >

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

2020-06-01 Thread luobin (L)
On 2020/6/2 1:53, David Miller wrote: From: Luo bin Date: Mon, 1 Jun 2020 18:57:48 +0800 @@ -470,6 +470,11 @@ netdev_tx_t hinic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) struct hinic_txq *txq; struct hinic_qp *qp; + if (unlikely(!netif_carrier_ok(netdev)))

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

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

Re: [PATCH net-next] hinic: add support to set and get pause param

2020-05-17 Thread luobin (L)
Will fix. Thanks. On 2020/5/17 4:25, David Miller wrote: From: Luo bin Date: Sat, 16 May 2020 02:00:30 + add support to set pause param with ethtool -A and get pause param with ethtool -a. Also remove set_link_ksettings ops for VF. Signed-off-by: Luo bin Why are you using a semaphore

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

2020-05-15 Thread luobin (L)
On 2020/5/16 2:13, Michal Kubecek wrote: On Fri, May 15, 2020 at 12:35:47AM +, Luo bin wrote: add support to change TX/RX queue number with ethtool -L Signed-off-by: Luo bin --- .../net/ethernet/huawei/hinic/hinic_ethtool.c | 67 +--

Re: linux-next: manual merge of the net-next tree with the net tree

2020-05-12 Thread luobin (L)
On 2020/5/13 0:47, Jakub Kicinski wrote: On Tue, 12 May 2020 13:30:51 +1000 Stephen Rothwell wrote: Hi all, Today's linux-next merge of the net-next tree got conflicts in: drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c drivers/net/ethernet/huawei/hinic/hinic_main.c between commit:

Re: [PATCH net v2] hinic: fix a bug of ndo_stop

2020-05-10 Thread luobin (L)
Will fix. Thanks. On 2020/5/10 6:37, Jakub Kicinski wrote: On Fri, 8 May 2020 20:19:33 + Luo bin wrote: if some function in ndo_stop interface returns failure because of hardware fault, must go on excuting rest steps rather than return failure directly, otherwise will cause memory leak.And

Re: [PATCH net-next v1] hinic: add three net_device_ops of vf

2020-05-08 Thread luobin (L)
Will fix. Thanks for your review. On 2020/5/9 5:36, Jakub Kicinski wrote: On Thu, 7 May 2020 18:21:19 + Luo bin wrote: + return hinic_msg_to_mgmt(>pf_to_mgmt, HINIC_MOD_COMM, +HINIC_COMM_CMD_HWCTXT_SET, +_ioctxt,

Re: [PATCH net v1] hinic: fix a bug of ndo_stop

2020-05-08 Thread luobin (L)
The two modified points are relevant. We bump the timeout for SET_FUNC_STATE to ensure that cmd won't return failure when hw is busy. Otherwise hw may stomp host memory if we free memory regardless of the return value of SET_FUNC_STATE. I will mention the timeout changes in the commit

Re: [PATCH net] hinic: fix a bug of ndo_stop

2020-05-07 Thread luobin (L)
All right,will fix. On 2020/5/8 9:00, David Miller wrote: From: Luo bin Date: Thu, 7 May 2020 04:32:22 + + ulong timeo; Please fully spell out "unsigned long" for this type. The same problem exists in your net-next patch submission as well. Thank you. .