Thread (32 messages) 32 messages, 2 authors, 2021-12-23

Re: [PATCH v1 16/25] net/spnic: add device configure/version/info

From: Yanling Song <hidden>
Date: 2021-12-22 00:56:54

On Mon, 20 Dec 2021 08:23:56 +0800
Stephen Hemminger [off-list ref] wrote:
On Sat, 18 Dec 2021 10:51:43 +0800
Yanling Song [off-list ref] wrote:
quoted
+static int spnic_dev_configure(struct rte_eth_dev *dev)
+{
+	struct spnic_nic_dev *nic_dev =
SPNIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev); +
+	nic_dev->num_sqs =  dev->data->nb_tx_queues;
+	nic_dev->num_rqs = dev->data->nb_rx_queues;
+
+	if (nic_dev->num_sqs > nic_dev->max_sqs ||
+	    nic_dev->num_rqs > nic_dev->max_rqs) {
+		PMD_DRV_LOG(ERR, "num_sqs: %d or num_rqs: %d
larger than max_sqs: %d or max_rqs: %d",
+			    nic_dev->num_sqs, nic_dev->num_rqs,
+			    nic_dev->max_sqs, nic_dev->max_rqs);
+		return -EINVAL;
+	}
+  
This should already be covered by checks in ethedev:dev_configure.
OK. The check will be removed in the next version.
quoted
+	/* The range of mtu is 384~9600 */
+	if (SPNIC_MTU_TO_PKTLEN(dev->data->dev_conf.rxmode.mtu) <
+	    SPNIC_MIN_FRAME_SIZE ||
+	    SPNIC_MTU_TO_PKTLEN(dev->data->dev_conf.rxmode.mtu) >
+	    SPNIC_MAX_JUMBO_FRAME_SIZE) {
+		PMD_DRV_LOG(ERR, "Max rx pkt len out of range,
mtu: %d, expect between %d and %d",
+			    dev->data->dev_conf.rxmode.mtu,
+			    SPNIC_MIN_FRAME_SIZE,
SPNIC_MAX_JUMBO_FRAME_SIZE);
+		return -EINVAL;
+	}  
Already covered by eth_dev_validate_mtu called from ethdev
dev_configure.
OK. The check will be removed in the next version.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help