All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Maurizio Lombardi <mlombard@redhat.com>
Cc: linux-scsi@vger.kernel.org, sramars@cisco.com, jbottomley@parallels.com
Subject: Re: [PATCH V2] fnic: check pci_map_single() return value
Date: Wed, 12 Aug 2015 15:33:30 +0200	[thread overview]
Message-ID: <mqdmvxwk4wl.fsf@c203.arch.suse.de> (raw)
In-Reply-To: <1439385964-4599-1-git-send-email-mlombard@redhat.com> (Maurizio Lombardi's message of "Wed, 12 Aug 2015 15:26:04 +0200")

Hi Maurizio,

Sorry but it looks like you've forgotten one change in fnic_eth_send().

Maurizio Lombardi <mlombard@redhat.com> writes:

> the kernel prints some warnings when compiled with CONFIG_DMA_API_DEBUG.
> This is because the fnic driver doesn't check the return value of
> pci_map_single().
>
> [   11.942770] scsi host12: fnic
>  }

[..]
>  
>  void fnic_free_rq_buf(struct vnic_rq *rq, struct vnic_rq_buf *buf)
> @@ -981,6 +993,7 @@ void fnic_eth_send(struct fcoe_ctlr *fip, struct sk_buff *skb)
>  	struct ethhdr *eth_hdr;
>  	struct vlan_ethhdr *vlan_hdr;
>  	unsigned long flags;
> +	int r;
>  
>  	if (!fnic->vlan_hw_insert) {
>  		eth_hdr = (struct ethhdr *)skb_mac_header(skb);
> @@ -1003,6 +1016,13 @@ void fnic_eth_send(struct fcoe_ctlr *fip, struct sk_buff *skb)
>  
>  	pa = pci_map_single(fnic->pdev, skb->data, skb->len, PCI_DMA_TODEVICE);
>  
> +	r = pci_dma_mapping_error(fnic->pdev, pa);
> +	if (r) {
> +		printk(KERN_ERR "PCI mapping failed with error %d\n", r);
> +		kfree_skb(skb);
> +		return;
> +	}
> +
>  	spin_lock_irqsave(&fnic->wq_lock[0], flags);
>  	if (!vnic_wq_desc_avail(wq)) {
>  		pci_unmap_single(fnic->pdev, pa, skb->len, PCI_DMA_TODEVICE);
> @@ -1071,6 +1091,12 @@ static int fnic_send_frame(struct fnic *fnic, struct fc_frame *fp)
>  
>  	pa = pci_map_single(fnic->pdev, eth_hdr, tot_len, PCI_DMA_TODEVICE);
[..]

Otherwise:

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                           Storage
jthumshirn@suse.de                                 +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600  D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2015-08-12 13:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-12 13:26 [PATCH V2] fnic: check pci_map_single() return value Maurizio Lombardi
2015-08-12 13:33 ` Johannes Thumshirn [this message]
2015-08-12 15:00   ` Maurizio Lombardi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mqdmvxwk4wl.fsf@c203.arch.suse.de \
    --to=jthumshirn@suse.de \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mlombard@redhat.com \
    --cc=sramars@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.