Re: [PATCH 14/16] NTB: ntb_transport: Enable direct-DMA queues
Koichiro Den <[email protected]>
| Newsgroups | dev.linux.lists.ntb,org.kernel.vger.linux-kernel,org.kernel.vger.netdev |
|---|---|
| Message-ID | <2xmt6d5bvo55odqgyatzxjft7fmqa2koq4cojekzjmubbktd5j@b2fprbbrsxwt> |
On Tue, Aug 11, 2026 at 01:51:33AM +0900, Koichiro Den wrote: > Advertise direct RX when a DMA mapping device is available, and direct > TX only when every QP has a suitable channel. Negotiation can then > enable either direction independently. > > Signed-off-by: Koichiro Den <[email protected]> > --- > drivers/ntb/ntb_transport.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c > index f2fa145994b9..9f5d6a407be7 100644 > --- a/drivers/ntb/ntb_transport.c > +++ b/drivers/ntb/ntb_transport.c > @@ -554,7 +554,7 @@ static bool ntb_direct_tx_mode(struct ntb_transport_qp *qp) > > static bool ntb_direct_link_capable(struct ntb_transport_qp *qp) > { > - return ntb_direct_rx_mode(qp) || ntb_direct_tx_mode(qp); > + return ntb_direct_layout(qp->transport); > } Sorry, I got distracted while rearranging and polishing the series at the last minute, leaving this meaningless intermediate diff here. :( I'll properly fold it into the earlier commit in the next revision, so please disregard this hunk for now. Sorry for the noise. Best regards, Koichiro > > static void ntb_transport_notify_peer(struct ntb_transport_qp *qp) > @@ -2058,6 +2058,11 @@ static int ntb_transport_probe(struct ntb_client *self, struct ntb_dev *ndev) > else if (use_direct_dma) > dev_info(&ndev->dev, > "not enough scratchpads for direct DMA negotiation\n"); > + if (nt->direct_dma_dev) { > + nt->direct_features = NTB_DIRECT_FEAT_RX; > + if (nt->qp_count && nt->qp_vec[0].direct_dma_chan) > + nt->direct_features |= NTB_DIRECT_FEAT_TX; > + } > > mutex_init(&nt->link_event_lock); > INIT_DELAYED_WORK(&nt->link_work, ntb_transport_link_work); > -- > 2.51.0 >