From: Shannon Nelson <hidden> Date: 2021-07-27 17:43:48
This is a collection of small driver updates for adding a couple of
small features and for a bit of code cleaning.
Shannon Nelson (10):
ionic: minimize resources when under kdump
ionic: monitor fw status generation
ionic: print firmware version on identify
ionic: init reconfig err to 0
ionic: use fewer inits on the buf_info struct
ionic: increment num-vfs before configure
ionic: remove unneeded comp union fields
ionic: block some ethtool operations when fw in reset
ionic: enable rxhash only with multiple queues
ionic: add function tag to debug string
.../ethernet/pensando/ionic/ionic_bus_pci.c | 2 +-
.../net/ethernet/pensando/ionic/ionic_dev.c | 28 +++++++++++++-
.../net/ethernet/pensando/ionic/ionic_dev.h | 3 +-
.../ethernet/pensando/ionic/ionic_ethtool.c | 21 ++++++++++
.../net/ethernet/pensando/ionic/ionic_if.h | 5 ++-
.../net/ethernet/pensando/ionic/ionic_lif.c | 38 ++++++++++++++++---
.../net/ethernet/pensando/ionic/ionic_main.c | 2 +
.../net/ethernet/pensando/ionic/ionic_phc.c | 4 +-
.../net/ethernet/pensando/ionic/ionic_txrx.c | 27 ++++++-------
9 files changed, 100 insertions(+), 30 deletions(-)
--
2.17.1
From: Shannon Nelson <hidden> Date: 2021-07-27 17:43:45
When running in a small kdump kernel, we can play nice and
minimize our resource use to help make sure that kdump is
successful in its mission.
Signed-off-by: Shannon Nelson <redacted>
---
.../net/ethernet/pensando/ionic/ionic_lif.c | 21 +++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
@@ -2834,8 +2835,14 @@ int ionic_lif_alloc(struct ionic *ionic)lif->ionic=ionic;lif->index=0;-lif->ntxq_descs=IONIC_DEF_TXRX_DESC;-lif->nrxq_descs=IONIC_DEF_TXRX_DESC;++if(is_kdump_kernel()){+lif->ntxq_descs=IONIC_MIN_TXRX_DESC;+lif->nrxq_descs=IONIC_MIN_TXRX_DESC;+}else{+lif->ntxq_descs=IONIC_DEF_TXRX_DESC;+lif->nrxq_descs=IONIC_DEF_TXRX_DESC;+}/* Convert the default coalesce value to actual hw resolution */lif->rx_coalesce_usecs=IONIC_ITR_COAL_USEC_DEFAULT;
@@ -3519,6 +3526,7 @@ int ionic_lif_size(struct ionic *ionic)unsignedintmin_intrs;interr;+/* retrieve basic values from FW */lc=&ident->lif.eth.config;dev_nintrs=le32_to_cpu(ident->dev.nintrs);neqs_per_lif=le32_to_cpu(ident->lif.rdma.eq_qtype.qid_count);
@@ -3526,6 +3534,15 @@ int ionic_lif_size(struct ionic *ionic)ntxqs_per_lif=le32_to_cpu(lc->queue_count[IONIC_QTYPE_TXQ]);nrxqs_per_lif=le32_to_cpu(lc->queue_count[IONIC_QTYPE_RXQ]);+/* limit values to play nice with kdump */+if(is_kdump_kernel()){+dev_nintrs=2;+neqs_per_lif=0;+nnqs_per_lif=0;+ntxqs_per_lif=1;+nrxqs_per_lif=1;+}+/* reserve last queue id for hardware timestamping */if(lc->features&cpu_to_le64(IONIC_ETH_HW_TIMESTAMP)){if(ntxqs_per_lif<=1||nrxqs_per_lif<=1){
From: Shannon Nelson <hidden> Date: 2021-07-27 17:43:51
Print the version of the DSC firmware seen when we do a fresh
ident check. Because the FW can be updated by the external
orchestration system, this helps us track that FW has been
updated on the DSC.
Signed-off-by: Shannon Nelson <redacted>
---
drivers/net/ethernet/pensando/ionic/ionic_main.c | 2 ++
1 file changed, 2 insertions(+)
From: Shannon Nelson <hidden> Date: 2021-07-27 17:43:52
The top 4 bits of the fw_status in dev_info_regs is reserved
for the status generation. This generation number is an
arbitrary value defined when firmware starts up. If the FW
is killed/crashed/stopped and then restarted, it will create
a different generation number. With this mechanism, the host
driver can detect that the FW has crashed and restarted, and
the driver can then take steps to re-initialize its connection.
Signed-off-by: Shannon Nelson <redacted>
---
.../net/ethernet/pensando/ionic/ionic_dev.c | 28 +++++++++++++++++--
.../net/ethernet/pensando/ionic/ionic_dev.h | 1 +
.../net/ethernet/pensando/ionic/ionic_if.h | 5 +++-
3 files changed, 31 insertions(+), 3 deletions(-)
@@ -106,6 +106,8 @@ int ionic_dev_setup(struct ionic *ionic)idev->last_fw_hb=0;idev->fw_hb_ready=true;idev->fw_status_ready=true;+idev->fw_generation=IONIC_FW_STS_F_GENERATION&+ioread8(&idev->dev_info_regs->fw_status);mod_timer(&ionic->watchdog_timer,round_jiffies(jiffies+ionic->watchdog_period));
@@ -121,7 +123,9 @@ int ionic_heartbeat_check(struct ionic *ionic){structionic_dev*idev=&ionic->idev;unsignedlongcheck_time,last_check_time;-boolfw_status_ready,fw_hb_ready;+boolfw_status_ready=true;+boolfw_hb_ready;+u8fw_generation;u8fw_status;u32fw_hb;
@@ -140,9 +144,29 @@ int ionic_heartbeat_check(struct ionic *ionic)/* firmware is useful only if the running bit is set and*fw_status!=0xff(badPCIread)+*Iffw_statusisnotreadydon'tbotherwiththegeneration.*/fw_status=ioread8(&idev->dev_info_regs->fw_status);-fw_status_ready=(fw_status!=0xff)&&(fw_status&IONIC_FW_STS_F_RUNNING);++if(fw_status==0xff||!(fw_status&IONIC_FW_STS_F_RUNNING)){+fw_status_ready=false;+}else{+fw_generation=fw_status&IONIC_FW_STS_F_GENERATION;+if(idev->fw_generation!=fw_generation){+dev_info(ionic->dev,"FW generation 0x%02x -> 0x%02x\n",+idev->fw_generation,fw_generation);++idev->fw_generation=fw_generation;++/* If the generation changed, the fw status is not+*readysoweneedtotriggerafw-downcycle.After+*thedown,thenextwatchdogwillseethefwisup+*andthegenerationvaluestable,sowilltrigger+*thefw-upactivity.+*/+fw_status_ready=false;+}+}/* is this a transition? */if(fw_status_ready!=idev->fw_status_ready){
From: Shannon Nelson <hidden> Date: 2021-07-27 17:43:53
Initialize err to 0 instead of ENOMEM, and specifically set
err to ENOMEM in the devm_kcalloc() failure cases.
Also, add an error message to the end of reconfig.
Signed-off-by: Shannon Nelson <redacted>
---
drivers/net/ethernet/pensando/ionic/ionic_lif.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
@@ -2588,22 +2588,26 @@ int ionic_reconfigure_queues(struct ionic_lif *lif,structionic_qcq**tx_qcqs=NULL;structionic_qcq**rx_qcqs=NULL;unsignedintflags,i;-interr=-ENOMEM;+interr=0;/* allocate temporary qcq arrays to hold new queue structs */if(qparam->nxqs!=lif->nxqs||qparam->ntxq_descs!=lif->ntxq_descs){tx_qcqs=devm_kcalloc(lif->ionic->dev,lif->ionic->ntxqs_per_lif,sizeof(structionic_qcq*),GFP_KERNEL);-if(!tx_qcqs)+if(!tx_qcqs){+err=-ENOMEM;gotoerr_out;+}}if(qparam->nxqs!=lif->nxqs||qparam->nrxq_descs!=lif->nrxq_descs||qparam->rxq_features!=lif->rxq_features){rx_qcqs=devm_kcalloc(lif->ionic->dev,lif->ionic->nrxqs_per_lif,sizeof(structionic_qcq*),GFP_KERNEL);-if(!rx_qcqs)+if(!rx_qcqs){+err=-ENOMEM;gotoerr_out;+}}/* allocate new desc_info and rings, but leave the interrupt setup
@@ -2782,6 +2786,9 @@ int ionic_reconfigure_queues(struct ionic_lif *lif,ionic_qcq_free(lif,lif->rxqcqs[i]);}+if(err)+netdev_info(lif->netdev,"%s: failed %d\n",__func__,err);+returnerr;}
From: Shannon Nelson <hidden> Date: 2021-07-27 17:43:55
Based on Alex's review notes on [1], we don't need to write
to the buf_info elements as often, and can tighten up how they
are used. Also, use prefetchw() to warm up the page struct
for a later get_page().
[1] https://lore.kernel.org/netdev/CAKgT0UfyjoAN7LTnq0NMZfXRv4v7iTCPyAb9pVr3qWMhop_BVw@mail.gmail.com/
Signed-off-by: Shannon Nelson <redacted>
---
.../net/ethernet/pensando/ionic/ionic_txrx.c | 27 ++++++++-----------
1 file changed, 11 insertions(+), 16 deletions(-)
From: Shannon Nelson <hidden> Date: 2021-07-27 17:43:58
Add the new VF to our internal count before we start configuring it.
Signed-off-by: Shannon Nelson <redacted>
---
drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -165,10 +165,10 @@ static int ionic_vf_alloc(struct ionic *ionic, int num_vfs)gotoout;}+ionic->num_vfs++;/* ignore failures from older FW, we just won't get stats */(void)ionic_set_vf_config(ionic,i,IONIC_VF_ATTR_STATSADDR,(u8*)&v->stats_pa);-ionic->num_vfs++;}out:
From: Shannon Nelson <hidden> Date: 2021-07-27 17:43:59
We don't use these fields, so remove them from
the definition.
Signed-off-by: Shannon Nelson <redacted>
---
drivers/net/ethernet/pensando/ionic/ionic_dev.h | 2 --
1 file changed, 2 deletions(-)
From: Shannon Nelson <hidden> Date: 2021-07-27 17:44:00
There are a few things that we can't safely do when the fw is
resetting, as the driver may be in the middle of rebuilding
queue structures.
Signed-off-by: Shannon Nelson <redacted>
---
.../ethernet/pensando/ionic/ionic_ethtool.c | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
@@ -274,6 +277,9 @@ static int ionic_set_link_ksettings(struct net_device *netdev,structionic*ionic=lif->ionic;interr=0;+if(test_bit(IONIC_LIF_F_FW_RESET,lif->state))+return-EBUSY;+/* set autoneg */if(ks->base.autoneg!=idev->port_info->config.an_enable){mutex_lock(&ionic->dev_cmd_lock);
@@ -320,6 +326,9 @@ static int ionic_set_pauseparam(struct net_device *netdev,u32requested_pause;interr;+if(test_bit(IONIC_LIF_F_FW_RESET,lif->state))+return-EBUSY;+if(pause->autoneg)return-EOPNOTSUPP;
@@ -372,6 +381,9 @@ static int ionic_set_fecparam(struct net_device *netdev,u8fec_type;intret=0;+if(test_bit(IONIC_LIF_F_FW_RESET,lif->state))+return-EBUSY;+if(lif->ionic->idev.port_info->config.an_enable){netdev_err(netdev,"FEC request not allowed while autoneg is enabled\n");return-EINVAL;
@@ -528,6 +540,9 @@ static int ionic_set_ringparam(struct net_device *netdev,structionic_queue_paramsqparam;interr;+if(test_bit(IONIC_LIF_F_FW_RESET,lif->state))+return-EBUSY;+ionic_init_queue_params(lif,&qparam);if(ring->rx_mini_pending||ring->rx_jumbo_pending){
@@ -597,6 +612,9 @@ static int ionic_set_channels(struct net_device *netdev,intmax_cnt;interr;+if(test_bit(IONIC_LIF_F_FW_RESET,lif->state))+return-EBUSY;+ionic_init_queue_params(lif,&qparam);if(ch->rx_count!=ch->tx_count){
@@ -947,6 +965,9 @@ static int ionic_nway_reset(struct net_device *netdev)structionic*ionic=lif->ionic;interr=0;+if(test_bit(IONIC_LIF_F_FW_RESET,lif->state))+return-EBUSY;+/* flap the link to force auto-negotiation */mutex_lock(&ionic->dev_cmd_lock);
From: Shannon Nelson <hidden> Date: 2021-07-27 17:44:03
If there's only one queue, there is no need to enable
the rxhashing.
Signed-off-by: Shannon Nelson <redacted>
---
drivers/net/ethernet/pensando/ionic/ionic_lif.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
From: Shannon Nelson <hidden> Date: 2021-07-27 17:44:04
Prefix the log output with the function string as in other
debug messages.
Signed-off-by: Shannon Nelson <redacted>
---
drivers/net/ethernet/pensando/ionic/ionic_phc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Tue, 27 Jul 2021 10:43:24 -0700 you wrote:
This is a collection of small driver updates for adding a couple of
small features and for a bit of code cleaning.
Shannon Nelson (10):
ionic: minimize resources when under kdump
ionic: monitor fw status generation
ionic: print firmware version on identify
ionic: init reconfig err to 0
ionic: use fewer inits on the buf_info struct
ionic: increment num-vfs before configure
ionic: remove unneeded comp union fields
ionic: block some ethtool operations when fw in reset
ionic: enable rxhash only with multiple queues
ionic: add function tag to debug string
[...]