git: 02a57b183020 - stable/13 - thunderx: fix potential sign extension issue

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Mon, 06 Mar 2023 00:31:31 UTC
The branch stable/13 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=02a57b183020d6c889f794f876a0c000597e01b4

commit 02a57b183020d6c889f794f876a0c000597e01b4
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-02-28 19:17:30 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-03-06 00:30:57 +0000

    thunderx: fix potential sign extension issue
    
    Coverity reported a sign extension issue on rq->caching << 26 in the
    Linux ThunderX driver.  (It appears Coverity Scan doesn't build arm64
    objects in FreeBSD.)
    
    As done in Linux, add a cast.
    
    Fixes: 3c0086b81391 ("Raw import of ThunderX VNIC networking driver...")
    Sponsored by: The FreeBSD Foundation
    
    (cherry picked from commit 5e95f5f5315083baa7d98d3286f6c0a82621a68e)
---
 sys/dev/vnic/nicvf_queues.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/vnic/nicvf_queues.c b/sys/dev/vnic/nicvf_queues.c
index bb3eacb75fad..84e1d132da5a 100644
--- a/sys/dev/vnic/nicvf_queues.c
+++ b/sys/dev/vnic/nicvf_queues.c
@@ -1337,7 +1337,7 @@ nicvf_rcv_queue_config(struct nicvf *nic, struct queue_set *qs,
 	mbx.rq.msg = NIC_MBOX_MSG_RQ_CFG;
 	mbx.rq.qs_num = qs->vnic_id;
 	mbx.rq.rq_num = qidx;
-	mbx.rq.cfg = (rq->caching << 26) | (rq->cq_qs << 19) |
+	mbx.rq.cfg = ((uint64_t)rq->caching << 26) | (rq->cq_qs << 19) |
 	    (rq->cq_idx << 16) | (rq->cont_rbdr_qs << 9) |
 	    (rq->cont_qs_rbdr_idx << 8) | (rq->start_rbdr_qs << 1) |
 	    (rq->start_qs_rbdr_idx);