Re: [PATCH v2 7/9] qedi: add module param to set ping packet size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/21/18 1:25 AM, Nilesh Javali wrote:
> Default packet size is 0x400.
> For jumbo packets set to 0x2400.
> 
> Signed-off-by: Nilesh Javali <nilesh.javali@xxxxxxxxxx>
> ---
>  drivers/scsi/qedi/qedi.h      |  1 -
>  drivers/scsi/qedi/qedi_main.c | 13 +++++++++----
>  2 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/scsi/qedi/qedi.h b/drivers/scsi/qedi/qedi.h
> index 6fa02c5..a26bb506 100644
> --- a/drivers/scsi/qedi/qedi.h
> +++ b/drivers/scsi/qedi/qedi.h
> @@ -63,7 +63,6 @@
>  #define QEDI_LOCAL_PORT_INVALID	0xffff
>  #define TX_RX_RING		16
>  #define RX_RING			(TX_RX_RING - 1)
> -#define LL2_SINGLE_BUF_SIZE	0x400
>  #define QEDI_PAGE_ALIGN(addr)	ALIGN(addr, QEDI_PAGE_SIZE)
>  #define QEDI_PAGE_MASK		(~((QEDI_PAGE_SIZE) - 1))
>  
> diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c
> index 2621dee..8942f62 100644
> --- a/drivers/scsi/qedi/qedi_main.c
> +++ b/drivers/scsi/qedi/qedi_main.c
> @@ -44,6 +44,11 @@
>  MODULE_PARM_DESC(qedi_io_tracing,
>  		 " Enable logging of SCSI requests/completions into trace buffer. (default off).");
>  
> +uint qedi_ll2_buf_size = 0x400;
> +module_param(qedi_ll2_buf_size, uint, 0644);
> +MODULE_PARM_DESC(qedi_ll2_buf_size,
> +		 "parameter to set ping packet size, default - 0x400, Jumbo packets - 0x2400.");
> +
>  const struct qed_iscsi_ops *qedi_ops;
>  static struct scsi_transport_template *qedi_scsi_transport;
>  static struct pci_driver qedi_pci_driver;
> @@ -228,7 +233,7 @@ static int __qedi_alloc_uio_rings(struct qedi_uio_dev *udev)
>  	}
>  
>  	/* Allocating memory for Tx/Rx pkt buffer */
> -	udev->ll2_buf_size = TX_RX_RING * LL2_SINGLE_BUF_SIZE;
> +	udev->ll2_buf_size = TX_RX_RING * qedi_ll2_buf_size;
>  	udev->ll2_buf_size = QEDI_PAGE_ALIGN(udev->ll2_buf_size);
>  	udev->ll2_buf = (void *)__get_free_pages(GFP_KERNEL | __GFP_COMP |
>  						 __GFP_ZERO, 2);
> @@ -283,7 +288,7 @@ static int qedi_alloc_uio_rings(struct qedi_ctx *qedi)
>  	qedi->udev = udev;
>  
>  	udev->tx_pkt = udev->ll2_buf;
> -	udev->rx_pkt = udev->ll2_buf + LL2_SINGLE_BUF_SIZE;
> +	udev->rx_pkt = udev->ll2_buf + qedi_ll2_buf_size;
>  	return 0;
>  
>   err_uctrl:
> @@ -752,8 +757,8 @@ static int qedi_ll2_process_skb(struct qedi_ctx *qedi, struct sk_buff *skb,
>  
>  	udev = qedi->udev;
>  	uctrl = udev->uctrl;
> -	pkt = udev->rx_pkt + (uctrl->hw_rx_prod * LL2_SINGLE_BUF_SIZE);
> -	len = min_t(u32, skb->len, (u32)LL2_SINGLE_BUF_SIZE);
> +	pkt = udev->rx_pkt + (uctrl->hw_rx_prod * qedi_ll2_buf_size);
> +	len = min_t(u32, skb->len, (u32)qedi_ll2_buf_size);
>  	memcpy(pkt, skb->data, len);
>  
>  	memset(&rxbd, 0, sizeof(rxbd));
> 


Reviewed-by: Lee Duncan <lduncan@xxxxxxxx>



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux