Skip to content

Commit

Permalink
Fnic: Memcopy only mimumum of data or trace buffer
Browse files Browse the repository at this point in the history
In case of receive path, we do not have eth header or fcoe header available
when we take a trace so we fill the fc trace buffer with 0xff for both
values. We copy only mimimum of received data or trace buffer size -
fc header - eth and fcoe header

- Increment fnic version from 1.6.0.12 to 1.6.0.13

Signed-off-by: Hiral Shah <hishah@cisco.com>
Signed-off-by: Sesidhar Baddela <sebaddel@cisco.com>
Signed-off-by: Anil Chintalapati <achintal@cisco.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Hiral Shah authored and Christoph Hellwig committed Nov 20, 2014
1 parent a232bfb commit 042b356
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/scsi/fnic/fnic.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#define DRV_NAME "fnic"
#define DRV_DESCRIPTION "Cisco FCoE HBA Driver"
#define DRV_VERSION "1.6.0.12"
#define DRV_VERSION "1.6.0.13"
#define PFX DRV_NAME ": "
#define DFX DRV_NAME "%d: "

Expand Down
4 changes: 2 additions & 2 deletions drivers/scsi/fnic/fnic_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,12 +624,12 @@ int fnic_fc_trace_set_data(u32 host_no, u8 frame_type,
if (frame_type == FNIC_FC_RECV) {
eth_fcoe_hdr_len = sizeof(struct ethhdr) +
sizeof(struct fcoe_hdr);
fc_trc_frame_len = fc_trc_frame_len + eth_fcoe_hdr_len;
memset((char *)fc_trace, 0xff, eth_fcoe_hdr_len);
/* Copy the rest of data frame */
memcpy((char *)(fc_trace + eth_fcoe_hdr_len), (void *)frame,
min_t(u8, fc_trc_frame_len,
(u8)(FC_TRC_SIZE_BYTES - FC_TRC_HEADER_SIZE)));
(u8)(FC_TRC_SIZE_BYTES - FC_TRC_HEADER_SIZE
- eth_fcoe_hdr_len)));
} else {
memcpy((char *)fc_trace, (void *)frame,
min_t(u8, fc_trc_frame_len,
Expand Down

0 comments on commit 042b356

Please sign in to comment.