summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
diff options
context:
space:
mode:
authorRahul Lakkireddy2018-01-17 08:23:46 +0100
committerDavid S. Miller2018-01-19 20:56:32 +0100
commit56cf2635ce30febd448dc78ff5361e4d9ad2fc0e (patch)
tree763696362a1631aa9602c62149274414d035f071 /drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
parentnet/dim: Fix fixpoint divide exception in net_dim_stats_compare (diff)
downloadkernel-qcow2-linux-56cf2635ce30febd448dc78ff5361e4d9ad2fc0e.tar.gz
kernel-qcow2-linux-56cf2635ce30febd448dc78ff5361e4d9ad2fc0e.tar.xz
kernel-qcow2-linux-56cf2635ce30febd448dc78ff5361e4d9ad2fc0e.zip
cxgb4: update dump collection logic to use compression
Update firmware dump collection logic to use compression when available. Let collection logic attempt to do compression, instead of returning out of memory early. Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: Vishal Kulkarni <vishal@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
index a2d6c8a69c52..bf1732da8c6d 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c
@@ -341,22 +341,14 @@ static void cxgb4_cudbg_collect_entity(struct cudbg_init *pdbg_init,
const struct cxgb4_collect_entity *e_arr,
u32 arr_size, void *buf, u32 *tot_size)
{
- struct adapter *adap = pdbg_init->adap;
struct cudbg_error cudbg_err = { 0 };
struct cudbg_entity_hdr *entity_hdr;
- u32 entity_size, i;
- u32 total_size = 0;
+ u32 i, total_size = 0;
int ret;
for (i = 0; i < arr_size; i++) {
const struct cxgb4_collect_entity *e = &e_arr[i];
- /* Skip entities that won't fit in output buffer */
- entity_size = cxgb4_get_entity_length(adap, e->entity);
- if (entity_size >
- pdbg_init->outbuf_size - *tot_size - total_size)
- continue;
-
entity_hdr = cudbg_get_entity_hdr(buf, e->entity);
entity_hdr->entity_type = e->entity;
entity_hdr->start_offset = dbg_buff->offset;
@@ -408,7 +400,8 @@ int cxgb4_cudbg_collect(struct adapter *adap, void *buf, u32 *buf_size,
cudbg_hdr->max_entities = CUDBG_MAX_ENTITY;
cudbg_hdr->chip_ver = adap->params.chip;
cudbg_hdr->dump_type = CUDBG_DUMP_TYPE_MINI;
- cudbg_hdr->compress_type = CUDBG_COMPRESSION_NONE;
+ cudbg_init.compress_type = CUDBG_COMPRESSION_NONE;
+ cudbg_hdr->compress_type = cudbg_init.compress_type;
min_size = sizeof(struct cudbg_hdr) +
sizeof(struct cudbg_entity_hdr) *