ionic: housekeeping updates
Subsystems (3)
v2 cover ionic: housekeeping updates
These are a few changes for code clean up and a couple more lock management tweaks.
v2: rebased
Shannon Nelson (7):
ionic: remove debug stats
ionic: check for binary values in FW ver string
ionic: move lif mutex setup and delete
ionic: widen queue_lock use around lif init and deinit
ionic: add polling to adminq wait
ionic: have ionic_qcq_disable decide on sending to hardware
ionic: add lif param to ionic_qcq_disable
drivers/net/ethernet/pensando/ionic/ionic.h | 1 + .../ethernet/pensando/ionic/ionic_debugfs.c | 2 - .../net/ethernet/pensando/ionic/ionic_dev.c | 1 - .../net/ethernet/pensando/ionic/ionic_dev.h | 4 - .../ethernet/pensando/ionic/ionic_ethtool.c | 38 ------ .../net/ethernet/pensando/ionic/ionic_lif.c | 74 ++++++----- .../net/ethernet/pensando/ionic/ionic_lif.h | 45 ------- .../net/ethernet/pensando/ionic/ionic_main.c | 53 ++++++-- .../net/ethernet/pensando/ionic/ionic_stats.c | 121 ------------------ .../net/ethernet/pensando/ionic/ionic_txrx.c | 14 -- 10 files changed, 89 insertions(+), 264 deletions(-)
Signature · 1 line
2.17.1
PATCH v2 1/7 ionic: remove debug stats
These debug stats are not really useful, their collection is likely detrimental to performance, and they suck up a lot of memory which never gets used if no one ever enables the priv-flag to print them, so just remove these bits.
--- .../ethernet/pensando/ionic/ionic_debugfs.c | 2 - .../net/ethernet/pensando/ionic/ionic_dev.c | 1 - .../net/ethernet/pensando/ionic/ionic_dev.h | 4 - .../ethernet/pensando/ionic/ionic_ethtool.c | 38 ------ .../net/ethernet/pensando/ionic/ionic_lif.h | 45 ------- .../net/ethernet/pensando/ionic/ionic_stats.c | 121 ------------------ .../net/ethernet/pensando/ionic/ionic_txrx.c | 14 -- 7 files changed, 225 deletions(-)
drivers/net/ethernet/pensando/ionic/ionic_debugfs.c +0 -2
@@ -143,8 +143,6 @@ void ionic_debugfs_add_qcq(struct ionic_lif *lif, struct ionic_qcq *qcq)debugfs_create_u32 ("qid" ,0400 , q_dentry, &q->hw_index);debugfs_create_u32 ("qtype" ,0400 , q_dentry, &q->hw_type);debugfs_create_u64 ("drop" ,0400 , q_dentry, &q->drop); -debugfs_create_u64 ("stop" ,0400 , q_dentry, &q->stop); -debugfs_create_u64 ("wake" ,0400 , q_dentry, &q->wake);debugfs_create_file ("tail" ,0400 , q_dentry, q, &q_tail_fops);debugfs_create_file ("head" ,0400 , q_dentry, q, &q_head_fops);
drivers/net/ethernet/pensando/ionic/ionic_dev.c +0 -1
@@ -581,7 +581,6 @@ unsigned int ionic_cq_service(struct ionic_cq *cq, unsigned int work_to_do, cq->done_color = !cq->done_color; cq->tail_idx = (cq->tail_idx +1 ) & (cq->num_descs -1 ); cq_info = &cq->info[cq->tail_idx]; -DEBUG_STATS_CQE_CNT (cq);if (++work_done >= work_to_do)break ;
drivers/net/ethernet/pensando/ionic/ionic_dev.h +0 -4
@@ -220,9 +220,6 @@ struct ionic_queue {unsigned int num_descs;unsigned int max_sg_elems;u64 features; -u64 dbell_count; -u64 stop; -u64 wake;u64 drop;struct ionic_dev *idev;unsigned int type;
@@ -269,7 +266,6 @@ struct ionic_cq {bool done_color;unsigned int num_descs;unsigned int desc_size; -u64 compl_count;void *base;dma_addr_t base_pa; }____cacheline_aligned_in_smp ;
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +0 -38
@@ -11,13 +11,6 @@#include "ionic_ethtool.h" #include "ionic_stats.h" -static const char ionic_priv_flags_strings[][ETH_GSTRING_LEN ] = { -#define IONIC_PRIV_F_SW_DBG_STATS BIT(0) -"sw-dbg-stats" , -}; - -#define IONIC_PRIV_FLAGS_COUNT ARRAY_SIZE(ionic_priv_flags_strings) -static void ionic_get_stats_strings (struct ionic_lif *lif,u8 *buf) {u32 i;
@@ -59,9 +52,6 @@ static int ionic_get_sset_count(struct net_device *netdev, int sset)case ETH_SS_STATS : count =ionic_get_stats_count (lif);break ; -case ETH_SS_PRIV_FLAGS : - count =IONIC_PRIV_FLAGS_COUNT ; -break ; }return count; }
@@ -75,10 +65,6 @@ static void ionic_get_strings(struct net_device *netdev,case ETH_SS_STATS :ionic_get_stats_strings (lif, buf);break ; -case ETH_SS_PRIV_FLAGS : -memcpy (buf, ionic_priv_flags_strings, -IONIC_PRIV_FLAGS_COUNT *ETH_GSTRING_LEN ); -break ; } }
@@ -691,28 +677,6 @@ static int ionic_set_channels(struct net_device *netdev,return err; } -static u32 ionic_get_priv_flags (struct net_device *netdev) -{ -struct ionic_lif *lif =netdev_priv (netdev); -u32 priv_flags =0 ; - -if (test_bit (IONIC_LIF_F_SW_DEBUG_STATS , lif->state)) - priv_flags |=IONIC_PRIV_F_SW_DBG_STATS ; - -return priv_flags; -} - -static int ionic_set_priv_flags (struct net_device *netdev,u32 priv_flags) -{ -struct ionic_lif *lif =netdev_priv (netdev); - -clear_bit (IONIC_LIF_F_SW_DEBUG_STATS , lif->state); -if (priv_flags &IONIC_PRIV_F_SW_DBG_STATS ) -set_bit (IONIC_LIF_F_SW_DEBUG_STATS , lif->state); - -return 0 ; -} -static int ionic_get_rxnfc (struct net_device *netdev,struct ethtool_rxnfc *info,u32 *rules) {
@@ -1013,8 +977,6 @@ static const struct ethtool_ops ionic_ethtool_ops = { .get_strings = ionic_get_strings, .get_ethtool_stats = ionic_get_stats, .get_sset_count = ionic_get_sset_count, - .get_priv_flags = ionic_get_priv_flags, - .set_priv_flags = ionic_set_priv_flags, .get_rxnfc = ionic_get_rxnfc, .get_rxfh_indir_size = ionic_get_rxfh_indir_size, .get_rxfh_key_size = ionic_get_rxfh_key_size,
drivers/net/ethernet/pensando/ionic/ionic_lif.h +0 -45
85 lines not on this page · raw message
drivers/net/ethernet/pensando/ionic/ionic_stats.c +0 -121
174 lines not on this page · raw message
drivers/net/ethernet/pensando/ionic/ionic_txrx.c +0 -14
@@ -14,8 +14,6 @@static inline void ionic_txq_post (struct ionic_queue *q,bool ring_dbell,ionic_desc_cb cb_func,void *cb_arg) { -DEBUG_STATS_TXQ_POST (q, ring_dbell); -ionic_q_post (q, ring_dbell, cb_func, cb_arg); }
@@ -23,8 +21,6 @@ static inline void ionic_rxq_post(struct ionic_queue *q, bool ring_dbell, ionic_desc_cb cb_func, void *cb_arg) {ionic_q_post (q ,ring_dbell ,cb_func ,cb_arg ); - -DEBUG_STATS_RX_BUFF_CNT (q); }static inline struct netdev_queue *q_to_ndq (struct ionic_queue *q)
@@ -507,8 +503,6 @@ int ionic_tx_napi(struct napi_struct *napi, int budget) work_done, flags); } -DEBUG_STATS_NAPI_POLL (qcq, work_done); -return work_done; }
@@ -546,8 +540,6 @@ int ionic_rx_napi(struct napi_struct *napi, int budget) work_done, flags); } -DEBUG_STATS_NAPI_POLL (qcq, work_done); -return work_done; }
@@ -591,9 +583,6 @@ int ionic_txrx_napi(struct napi_struct *napi, int budget) tx_work_done + rx_work_done, flags); } -DEBUG_STATS_NAPI_POLL (qcq, rx_work_done); -DEBUG_STATS_NAPI_POLL (qcq, tx_work_done); -return rx_work_done; }
@@ -735,7 +724,6 @@ static void ionic_tx_clean(struct ionic_queue *q, }else if (unlikely (__netif_subqueue_stopped (q->lif->netdev, qi))) {netif_wake_subqueue (q->lif->netdev, qi); - q->wake++; } desc_info->bytes = skb->len;
@@ -1174,7 +1162,6 @@ static int ionic_maybe_stop_tx(struct ionic_queue *q, int ndescs)if (unlikely (!ionic_q_has_space (q, ndescs))) {netif_stop_subqueue (q->lif->netdev, q->index); - q->stop++; stopped =1 ;/* Might race with ionic_tx_clean, check again */
@@ -1269,7 +1256,6 @@ netdev_tx_t ionic_start_xmit(struct sk_buff *skb, struct net_device *netdev)return NETDEV_TX_OK ; err_out_drop: - q->stop++; q->drop++;dev_kfree_skb (skb);return NETDEV_TX_OK ;
Signature · 1 line
2.17.1
PATCH v2 2/7 ionic: check for binary values in FW ver string
In reply to Shannon NelsonIf the PCI connection is broken, reading the FW version string will only get 0xff bytes, which shouldn't get printed. This checks the first byte and prints only the first 4 bytes if non-ASCII.
Also, add a limit to the string length printed when a valid string is found, just in case it is not properly terminated.
--- .../net/ethernet/pensando/ionic/ionic_main.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/net/ethernet/pensando/ionic/ionic_main.c +14 -3
@@ -7,6 +7,7 @@#include <linux/netdevice.h> #include <linux/utsname.h> #include <generated/utsrelease.h> +#include <linux/ctype.h> #include "ionic.h" #include "ionic_bus.h"
@@ -450,13 +451,23 @@ int ionic_identify(struct ionic *ionic) }mutex_unlock (&ionic->dev_cmd_lock); -dev_info (ionic->dev,"FW: %s\n" , idev->dev_info.fw_version); -if (err) { -dev_err (ionic->dev,"Cannot identify ionic: %dn" , err); +dev_err (ionic->dev,"Cannot identify ionic: %d\n" , err); goto err_out; } +if (isprint (idev->dev_info.fw_version[0 ]) && +isascii (idev->dev_info.fw_version[0 ])) +dev_info (ionic->dev,"FW: %.*s\n" , + (int )(sizeof (idev->dev_info.fw_version) -1 ), + idev->dev_info.fw_version); +else +dev_info (ionic->dev,"FW: (invalid string) 0x%02x 0x%02x 0x%02x 0x%02x ...\n" , + (u8 )idev->dev_info.fw_version[0 ], + (u8 )idev->dev_info.fw_version[1 ], + (u8 )idev->dev_info.fw_version[2 ], + (u8 )idev->dev_info.fw_version[3 ]); + err =ionic_lif_identify (ionic,IONIC_LIF_TYPE_CLASSIC , &ionic->ident.lif);if (err) {
Signature · 1 line
2.17.1
PATCH v2 3/7 ionic: move lif mutex setup and delete
In reply to Shannon NelsonMove creation and deletion of lif mutex a level out to lif creation and delete, rather than in init and deinit. This assures that nothing will get hung if anything is waiting on the mutex while the driver is clearing the lif while handling the fw_down/fw_up cycle.
--- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/net/ethernet/pensando/ionic/ionic_lif.c +10 -5
@@ -2890,6 +2890,9 @@ int ionic_lif_alloc(struct ionic *ionic)snprintf (lif->name,sizeof (lif->name),"lif%u" , lif->index); +mutex_init (&lif->queue_lock); +mutex_init (&lif->config_lock); +spin_lock_init (&lif->adminq_lock);spin_lock_init (&lif->deferred.lock);
@@ -2903,7 +2906,7 @@ int ionic_lif_alloc(struct ionic *ionic)if (!lif->info) {dev_err (dev,"Failed to allocate lif info, aborting\n" ); err = -ENOMEM ; - goto err_out_free_netdev; + goto err_out_free_mutex; }ionic_debugfs_add_lif (lif);
@@ -2938,6 +2941,9 @@ int ionic_lif_alloc(struct ionic *ionic)dma_free_coherent (dev, lif->info_sz, lif->info, lif->info_pa); lif->info =NULL ; lif->info_pa =0 ; +err_out_free_mutex: +mutex_destroy (&lif->config_lock); +mutex_destroy (&lif->queue_lock); err_out_free_netdev:free_netdev (lif->netdev); lif =NULL ;
@@ -3078,6 +3084,9 @@ void ionic_lif_free(struct ionic_lif *lif)kfree (lif->dbid_inuse); lif->dbid_inuse =NULL ; +mutex_destroy (&lif->config_lock); +mutex_destroy (&lif->queue_lock); +/* free netdev & lif */ ionic_debugfs_del_lif (lif);free_netdev (lif->netdev);
@@ -3100,8 +3109,6 @@ void ionic_lif_deinit(struct ionic_lif *lif)ionic_lif_qcq_deinit (lif, lif->notifyqcq);ionic_lif_qcq_deinit (lif, lif->adminqcq); -mutex_destroy (&lif->config_lock); -mutex_destroy (&lif->queue_lock);ionic_lif_reset (lif); }
@@ -3267,8 +3274,6 @@ int ionic_lif_init(struct ionic_lif *lif)return err; lif->hw_index =le16_to_cpu (comp.hw_index); -mutex_init (&lif->queue_lock); -mutex_init (&lif->config_lock);/* now that we have the hw_index we can figure out our doorbell page */ lif->dbid_count =le32_to_cpu (lif->ionic->ident.dev.ndbpgs_per_lif);
Signature · 1 line
2.17.1
PATCH v2 4/7 ionic: widen queue_lock use around lif init and deinit
In reply to Shannon NelsonWiden the coverage of the queue_lock to be sure the lif init and lif deinit actions are protected. This addresses a hang seen when a Tx Timeout action was attempted at the same time as a FW Reset was started.
--- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/net/ethernet/pensando/ionic/ionic_lif.c +11 -3
@@ -2974,11 +2974,10 @@ static void ionic_lif_handle_fw_down(struct ionic_lif *lif)netif_device_detach (lif->netdev); +mutex_lock (&lif->queue_lock);if (test_bit (IONIC_LIF_F_UP , lif->state)) {dev_info (ionic->dev,"Surprise FW stop, stopping queues\n" ); -mutex_lock (&lif->queue_lock);ionic_stop_queues (lif); -mutex_unlock (&lif->queue_lock); }if (netif_running (lif->netdev)) {
@@ -2989,6 +2988,8 @@ static void ionic_lif_handle_fw_down(struct ionic_lif *lif)ionic_reset (ionic);ionic_qcqs_free (lif); +mutex_unlock (&lif->queue_lock); +dev_info (ionic->dev,"FW Down: LIFs stopped\n" ); }
@@ -3012,9 +3013,12 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif) err =ionic_port_init (ionic);if (err) goto err_out; + +mutex_lock (&lif->queue_lock); + err =ionic_qcqs_alloc (lif);if (err) - goto err_out; + goto err_unlock; err =ionic_lif_init (lif);if (err)
@@ -3035,6 +3039,8 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif) goto err_txrx_free; } +mutex_unlock (&lif->queue_lock); +clear_bit (IONIC_LIF_F_FW_RESET , lif->state);ionic_link_status_check_request (lif,CAN_SLEEP );netif_device_attach (lif->netdev);
@@ -3051,6 +3057,8 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif)ionic_lif_deinit (lif); err_qcqs_free:ionic_qcqs_free (lif); +err_unlock: +mutex_unlock (&lif->queue_lock); err_out:dev_err (ionic->dev,"FW Up: LIFs restart failed - err %d\n" , err); }
Signature · 1 line
2.17.1
PATCH v2 5/7 ionic: add polling to adminq wait
In reply to Shannon NelsonSplit the adminq wait into smaller polling periods in order to watch for broken firmware and not have to wait for the full adminq devcmd_timeout.
Generally, adminq commands take fewer than 2 msecs. If the FW is busy they can take longer, but usually still under 100 msecs. We set the polling period to 100 msecs in order to start snooping on FW status when a command is taking longer than usual.
--- drivers/net/ethernet/pensando/ionic/ionic.h | 1 + .../net/ethernet/pensando/ionic/ionic_main.c | 36 +++++++++++++++---- 2 files changed, 31 insertions(+), 6 deletions(-)
drivers/net/ethernet/pensando/ionic/ionic.h +1 -0
@@ -19,6 +19,7 @@ struct ionic_lif;#define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF 0x1003#define DEVCMD_TIMEOUT 10 +#define IONIC_ADMINQ_TIME_SLICE msecs_to_jiffies(100)#define IONIC_PHC_UPDATE_NS 10000000000/* 10s in nanoseconds */ #define NORMAL_PPB 1000000000/* one billion parts per billion */
drivers/net/ethernet/pensando/ionic/ionic_main.c +30 -6
@@ -301,21 +301,45 @@ int ionic_adminq_post(struct ionic_lif *lif, struct ionic_admin_ctx *ctx)int ionic_adminq_wait (struct ionic_lif *lif,struct ionic_admin_ctx *ctx,int err) {struct net_device *netdev = lif->netdev; +unsigned long time_limit; +unsigned long time_start; +unsigned long time_done;unsigned long remaining;const char *name; + name =ionic_opcode_to_str (ctx->cmd.cmd.opcode); +if (err) { -if (!test_bit (IONIC_LIF_F_FW_RESET , lif->state)) { - name =ionic_opcode_to_str (ctx->cmd.cmd.opcode); +if (!test_bit (IONIC_LIF_F_FW_RESET , lif->state))netdev_err (netdev,"Posting of %s (%d) failed: %d\n" , name, ctx->cmd.cmd.opcode, err); - }return err; } - remaining =wait_for_completion_timeout (&ctx->work, -HZ * (ulong )DEVCMD_TIMEOUT ); -return ionic_adminq_check_err (lif, ctx, (remaining ==0 )); + time_start = jiffies; + time_limit = time_start +HZ * (ulong )DEVCMD_TIMEOUT ; +do { + remaining =wait_for_completion_timeout (&ctx->work, +IONIC_ADMINQ_TIME_SLICE ); + +/* check for done */ +if (remaining) +break ; + +/* interrupt the wait if FW stopped */ +if (test_bit (IONIC_LIF_F_FW_RESET , lif->state)) { +netdev_err (netdev,"%s (%d) interrupted, FW in reset\n" , + name, ctx->cmd.cmd.opcode); +return -ENXIO ; + } + + }while (time_before (jiffies, time_limit)); + time_done = jiffies; + +dev_dbg (lif->ionic->dev,"%s: elapsed %d msecs\n" , + __func__,jiffies_to_msecs (time_done - time_start)); + +return ionic_adminq_check_err (lif, ctx,time_after_eq (time_done, time_limit)); }int ionic_adminq_post_wait (struct ionic_lif *lif,struct ionic_admin_ctx *ctx)
Signature · 1 line
2.17.1
PATCH v2 6/7 ionic: have ionic_qcq_disable decide on sending to hardware
In reply to Shannon NelsonSimplify the code a little by keeping the send_to_hw decision inside of ionic_qcq_disable rather than in the callers. Also, add ENXIO to the decision expression.
--- .../net/ethernet/pensando/ionic/ionic_lif.c | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-)
drivers/net/ethernet/pensando/ionic/ionic_lif.c +20 -19
@@ -287,11 +287,10 @@ static int ionic_qcq_enable(struct ionic_qcq *qcq)return ionic_adminq_post_wait (lif, &ctx); } -static int ionic_qcq_disable (struct ionic_qcq *qcq,bool send_to_hw) +static int ionic_qcq_disable (struct ionic_qcq *qcq,int fw_err) {struct ionic_queue *q;struct ionic_lif *lif; -int err =0 ;struct ionic_admin_ctx ctx = { .work =COMPLETION_INITIALIZER_ONSTACK (ctx.work),
@@ -318,17 +317,19 @@ static int ionic_qcq_disable(struct ionic_qcq *qcq, bool send_to_hw)napi_disable (&qcq->napi); } -if (send_to_hw) { - ctx.cmd.q_control.lif_index =cpu_to_le16 (lif->index); - ctx.cmd.q_control.type = q->type; - ctx.cmd.q_control.index =cpu_to_le32 (q->index); -dev_dbg (lif->ionic->dev,"q_disable.index %d q_disable.qtype %d\n" , - ctx.cmd.q_control.index, ctx.cmd.q_control.type); +/* If there was a previous fw communcation error, don't bother with +* sending the adminq command and just return the same error value. +*/ +if (fw_err == -ETIMEDOUT || fw_err == -ENXIO ) +return fw_err; - err =ionic_adminq_post_wait (lif, &ctx); - } + ctx.cmd.q_control.lif_index =cpu_to_le16 (lif->index); + ctx.cmd.q_control.type = q->type; + ctx.cmd.q_control.index =cpu_to_le32 (q->index); +dev_dbg (lif->ionic->dev,"q_disable.index %d q_disable.qtype %d\n" , + ctx.cmd.q_control.index, ctx.cmd.q_control.type); -return err; +return ionic_adminq_post_wait (lif, &ctx); }static void ionic_lif_qcq_deinit (struct ionic_lif *lif,struct ionic_qcq *qcq)
@@ -1947,19 +1948,19 @@ static void ionic_txrx_disable(struct ionic_lif *lif)if (lif->txqcqs) {for (i =0 ; i < lif->nxqs; i++) - err =ionic_qcq_disable (lif->txqcqs[i], (err != -ETIMEDOUT )); + err =ionic_qcq_disable (lif->txqcqs[i], err); }if (lif->hwstamp_txq) - err =ionic_qcq_disable (lif->hwstamp_txq, (err != -ETIMEDOUT )); + err =ionic_qcq_disable (lif->hwstamp_txq, err);if (lif->rxqcqs) {for (i =0 ; i < lif->nxqs; i++) - err =ionic_qcq_disable (lif->rxqcqs[i], (err != -ETIMEDOUT )); + err =ionic_qcq_disable (lif->rxqcqs[i], err); }if (lif->hwstamp_rxq) - err =ionic_qcq_disable (lif->hwstamp_rxq, (err != -ETIMEDOUT )); + err =ionic_qcq_disable (lif->hwstamp_rxq, err);ionic_lif_quiesce (lif); }
@@ -2159,7 +2160,7 @@ static int ionic_txrx_enable(struct ionic_lif *lif) err =ionic_qcq_enable (lif->txqcqs[i]);if (err) { - derr =ionic_qcq_disable (lif->rxqcqs[i], (err != -ETIMEDOUT )); + derr =ionic_qcq_disable (lif->rxqcqs[i], err); goto err_out; } }
@@ -2181,13 +2182,13 @@ static int ionic_txrx_enable(struct ionic_lif *lif) err_out_hwstamp_tx:if (lif->hwstamp_rxq) - derr =ionic_qcq_disable (lif->hwstamp_rxq, (derr != -ETIMEDOUT )); + derr =ionic_qcq_disable (lif->hwstamp_rxq, derr); err_out_hwstamp_rx: i = lif->nxqs; err_out:while (i--) { - derr =ionic_qcq_disable (lif->txqcqs[i], (derr != -ETIMEDOUT )); - derr =ionic_qcq_disable (lif->rxqcqs[i], (derr != -ETIMEDOUT )); + derr =ionic_qcq_disable (lif->txqcqs[i], derr); + derr =ionic_qcq_disable (lif->rxqcqs[i], derr); }return err;
Signature · 1 line
2.17.1
PATCH v2 7/7 ionic: add lif param to ionic_qcq_disable
In reply to Shannon NelsonAdd the lif parameter for use in an error message, and to better match the style of most of the functions calls.
--- .../net/ethernet/pensando/ionic/ionic_lif.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/net/ethernet/pensando/ionic/ionic_lif.c +12 -12
@@ -287,10 +287,9 @@ static int ionic_qcq_enable(struct ionic_qcq *qcq)return ionic_adminq_post_wait (lif, &ctx); } -static int ionic_qcq_disable (struct ionic_qcq *qcq,int fw_err) +static int ionic_qcq_disable (struct ionic_lif *lif,struct ionic_qcq *qcq,int fw_err) {struct ionic_queue *q; -struct ionic_lif *lif;struct ionic_admin_ctx ctx = { .work =COMPLETION_INITIALIZER_ONSTACK (ctx.work),
@@ -300,11 +299,12 @@ static int ionic_qcq_disable(struct ionic_qcq *qcq, int fw_err) }, }; -if (!qcq) +if (!qcq) { +netdev_err (lif->netdev,"%s: bad qcq\n" , __func__);return -ENXIO ; + } q = &qcq->q; - lif = q->lif;if (qcq->flags &IONIC_QCQ_F_INTR ) {struct ionic_dev *idev = &lif->ionic->idev;
@@ -1948,19 +1948,19 @@ static void ionic_txrx_disable(struct ionic_lif *lif)if (lif->txqcqs) {for (i =0 ; i < lif->nxqs; i++) - err =ionic_qcq_disable (lif->txqcqs[i], err); + err =ionic_qcq_disable (lif, lif->txqcqs[i], err); }if (lif->hwstamp_txq) - err =ionic_qcq_disable (lif->hwstamp_txq, err); + err =ionic_qcq_disable (lif, lif->hwstamp_txq, err);if (lif->rxqcqs) {for (i =0 ; i < lif->nxqs; i++) - err =ionic_qcq_disable (lif->rxqcqs[i], err); + err =ionic_qcq_disable (lif, lif->rxqcqs[i], err); }if (lif->hwstamp_rxq) - err =ionic_qcq_disable (lif->hwstamp_rxq, err); + err =ionic_qcq_disable (lif, lif->hwstamp_rxq, err);ionic_lif_quiesce (lif); }
@@ -2160,7 +2160,7 @@ static int ionic_txrx_enable(struct ionic_lif *lif) err =ionic_qcq_enable (lif->txqcqs[i]);if (err) { - derr =ionic_qcq_disable (lif->rxqcqs[i], err); + derr =ionic_qcq_disable (lif, lif->rxqcqs[i], err); goto err_out; } }
@@ -2182,13 +2182,13 @@ static int ionic_txrx_enable(struct ionic_lif *lif) err_out_hwstamp_tx:if (lif->hwstamp_rxq) - derr =ionic_qcq_disable (lif->hwstamp_rxq, derr); + derr =ionic_qcq_disable (lif, lif->hwstamp_rxq, derr); err_out_hwstamp_rx: i = lif->nxqs; err_out:while (i--) { - derr =ionic_qcq_disable (lif->txqcqs[i], derr); - derr =ionic_qcq_disable (lif->rxqcqs[i], derr); + derr =ionic_qcq_disable (lif, lif->txqcqs[i], derr); + derr =ionic_qcq_disable (lif, lif->rxqcqs[i], derr); }return err;
Signature · 1 line
2.17.1
This series was applied to netdev/net-next.git (refs/heads/master):
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
Quoted 14 lines · On Fri, 1 Oct 2021 11:05:50 -0700 you wrote:
These are a few changes for code clean up and a couple more lock management tweaks.
v2: rebased
Shannon Nelson (7):
ionic: remove debug stats
ionic: check for binary values in FW ver string
ionic: move lif mutex setup and delete
ionic: widenqueue_lockuse around lif init and deinit
ionic: add polling to adminq wait
ionic: haveionic_qcq_disabledecide on sending to hardware
ionic: add lif param toionic_qcq_disable
Quoted 1 line
[...]
Here is the summary with links:
- [v2,net-next,1/7] ionic: remove debug stats
https://git.kernel.org/netdev/net-next/c/ebc792e26cb0 - [v2,net-next,2/7] ionic: check for binary values in FW ver string https://git.kernel.org/netdev/net-next/c/36b20b7fb1c3 - [v2,net-next,3/7] ionic: move lif mutex setup and delete https://git.kernel.org/netdev/net-next/c/26671ff92c63 - [v2,net-next,4/7] ionic: widen queue_lock use around lif init and deinit https://git.kernel.org/netdev/net-next/c/2624d95972db - [v2,net-next,5/7] ionic: add polling to adminq wait https://git.kernel.org/netdev/net-next/c/a095e4775b7c - [v2,net-next,6/7] ionic: have ionic_qcq_disable decide on sending to hardware https://git.kernel.org/netdev/net-next/c/3a5e0fafefe0 - [v2,net-next,7/7] ionic: add lif param to ionic_qcq_disable https://git.kernel.org/netdev/net-next/c/7dd22a864e0c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html