Unverified Commit 1bab7be7 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!6468 v2 scsi: fnic: Move fnic_fnic_flush_tx() to a work queue

parents 7e5b7bd6 27b705b1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -286,6 +286,7 @@ struct fnic {

	struct work_struct link_work;
	struct work_struct frame_work;
	struct work_struct flush_work;
	struct sk_buff_head frame_queue;
	struct sk_buff_head tx_queue;

@@ -341,7 +342,7 @@ void fnic_handle_event(struct work_struct *work);
int fnic_rq_cmpl_handler(struct fnic *fnic, int);
int fnic_alloc_rq_frame(struct vnic_rq *rq);
void fnic_free_rq_buf(struct vnic_rq *rq, struct vnic_rq_buf *buf);
void fnic_flush_tx(struct fnic *);
void fnic_flush_tx(struct work_struct *work);
void fnic_eth_send(struct fcoe_ctlr *, struct sk_buff *skb);
void fnic_set_port_id(struct fc_lport *, u32, struct fc_frame *);
void fnic_update_mac(struct fc_lport *, u8 *new);
+3 −2
Original line number Diff line number Diff line
@@ -1174,7 +1174,7 @@ int fnic_send(struct fc_lport *lp, struct fc_frame *fp)

/**
 * fnic_flush_tx() - send queued frames.
 * @fnic: fnic device
 * @work: pointer to work element
 *
 * Send frames that were waiting to go out in FC or Ethernet mode.
 * Whenever changing modes we purge queued frames, so these frames should
@@ -1182,8 +1182,9 @@ int fnic_send(struct fc_lport *lp, struct fc_frame *fp)
 *
 * Called without fnic_lock held.
 */
void fnic_flush_tx(struct fnic *fnic)
void fnic_flush_tx(struct work_struct *work)
{
	struct fnic *fnic = container_of(work, struct fnic, flush_work);
	struct sk_buff *skb;
	struct fc_frame *fp;

+1 −0
Original line number Diff line number Diff line
@@ -792,6 +792,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
		spin_lock_init(&fnic->vlans_lock);
		INIT_WORK(&fnic->fip_frame_work, fnic_handle_fip_frame);
		INIT_WORK(&fnic->event_work, fnic_handle_event);
		INIT_WORK(&fnic->flush_work, fnic_flush_tx);
		skb_queue_head_init(&fnic->fip_frame_queue);
		INIT_LIST_HEAD(&fnic->evlist);
		INIT_LIST_HEAD(&fnic->vlans);
+2 −2
Original line number Diff line number Diff line
@@ -681,7 +681,7 @@ static int fnic_fcpio_fw_reset_cmpl_handler(struct fnic *fnic,

	spin_unlock_irqrestore(&fnic->fnic_lock, flags);

	fnic_flush_tx(fnic);
	queue_work(fnic_event_queue, &fnic->flush_work);

 reset_cmpl_handler_end:
	fnic_clear_state_flags(fnic, FNIC_FLAGS_FWRESET);
@@ -737,7 +737,7 @@ static int fnic_fcpio_flogi_reg_cmpl_handler(struct fnic *fnic,
		}
		spin_unlock_irqrestore(&fnic->fnic_lock, flags);

		fnic_flush_tx(fnic);
		queue_work(fnic_event_queue, &fnic->flush_work);
		queue_work(fnic_event_queue, &fnic->frame_work);
	} else {
		spin_unlock_irqrestore(&fnic->fnic_lock, flags);