X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fionic%2Fionic_ethdev.c;h=5ec474dbf5390267e00f7a0ce554f191a2abe3d7;hb=21b1677d87a23a9695be0cbcbdf38607a2d58f84;hp=c9d8493f4971486cef25c24203060ca85deea2c8;hpb=561176361047ed180362343b8fb725390b387160;p=dpdk.git diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c index c9d8493f49..5ec474dbf5 100644 --- a/drivers/net/ionic/ionic_ethdev.c +++ b/drivers/net/ionic/ionic_ethdev.c @@ -74,8 +74,8 @@ static const struct rte_eth_desc_lim tx_desc_lim_v1 = { .nb_max = IONIC_MAX_RING_DESC, .nb_min = IONIC_MIN_RING_DESC, .nb_align = 1, - .nb_seg_max = IONIC_TX_MAX_SG_ELEMS_V1, - .nb_mtu_seg_max = IONIC_TX_MAX_SG_ELEMS_V1, + .nb_seg_max = IONIC_TX_MAX_SG_ELEMS_V1 + 1, + .nb_mtu_seg_max = IONIC_TX_MAX_SG_ELEMS_V1 + 1, }; static const struct eth_dev_ops ionic_eth_dev_ops = { @@ -215,15 +215,18 @@ ionic_dev_fw_version_get(struct rte_eth_dev *eth_dev, { struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev); struct ionic_adapter *adapter = lif->adapter; + int ret; - if (fw_version == NULL || fw_size <= 0) - return -EINVAL; - - snprintf(fw_version, fw_size, "%s", + ret = snprintf(fw_version, fw_size, "%s", adapter->fw_version); - fw_version[fw_size - 1] = '\0'; + if (ret < 0) + return -EINVAL; - return 0; + ret += 1; /* add the size of '\0' */ + if (fw_size < (size_t)ret) + return ret; + else + return 0; } /*