Commit b33006eb authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

eth: bnxt: plug bnxt_validate_qcfg() into qops

Plug bnxt_validate_qcfg() back into qops, where it was in my old RFC.

Link: https://patch.msgid.link/20260122005113.2476634-7-kuba@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 8e3245cb
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -15983,8 +15983,12 @@ static void bnxt_queue_default_qcfg(struct net_device *dev,
	qcfg->rx_page_size = BNXT_RX_PAGE_SIZE;
}

static int bnxt_validate_qcfg(struct bnxt *bp, struct netdev_queue_config *qcfg)
static int bnxt_validate_qcfg(struct net_device *dev,
			      struct netdev_queue_config *qcfg,
			      struct netlink_ext_ack *extack)
{
	struct bnxt *bp = netdev_priv(dev);

	/* Older chips need MSS calc so rx_page_size is not supported */
	if (!(bp->flags & BNXT_FLAG_CHIP_P5_PLUS) &&
	    qcfg->rx_page_size != BNXT_RX_PAGE_SIZE)
@@ -16012,10 +16016,6 @@ static int bnxt_queue_mem_alloc(struct net_device *dev,
	if (!bp->rx_ring)
		return -ENETDOWN;

	rc = bnxt_validate_qcfg(bp, qcfg);
	if (rc < 0)
		return rc;

	rxr = &bp->rx_ring[idx];
	clone = qmem;
	memcpy(clone, rxr, sizeof(*rxr));
@@ -16311,6 +16311,7 @@ static const struct netdev_queue_mgmt_ops bnxt_queue_mgmt_ops = {
	.ndo_queue_start	= bnxt_queue_start,
	.ndo_queue_stop		= bnxt_queue_stop,
	.ndo_default_qcfg	= bnxt_queue_default_qcfg,
	.ndo_validate_qcfg	= bnxt_validate_qcfg,
	.supported_params	= QCFG_RX_PAGE_SIZE,
};