From: Srujana Challa <[email protected]>

If requested LFs are not available, return -ENOSPC instead of -EINVAL
from ATTACH_RESOURCES mailbox, So that user can distinguish
the error case.

Change-Id: I26465f187236d9a79db066c363c5306c466f3134
Signed-off-by: Srujana Challa <[email protected]>
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/42516
Tested-by: sa_ip-sw-jenkins <[email protected]>
Reviewed-by: Sunil Kovvuri Goutham <[email protected]>
Signed-off-by: Ruiqiang Hao <[email protected]>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c 
b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
index 34aadaac59fa..e49da93b829f 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
@@ -1571,11 +1571,13 @@ static int rvu_check_rsrc_availability(struct rvu *rvu,
        int free_lfs, mappedlfs, blkaddr;
        struct rvu_hwinfo *hw = rvu->hw;
        struct rvu_block *block;
+       int ret;
 
-       if (rvu_check_rsrc_policy(rvu, req, pcifunc)) {
+       ret = rvu_check_rsrc_policy(rvu, req, pcifunc);
+       if (ret) {
                dev_err(rvu->dev, "Func 0x%x: Resource policy check failed\n",
                        pcifunc);
-               return -EINVAL;
+               return ret;
        }
 
        /* Only one NPA LF can be attached */
-- 
2.14.5

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9402): 
https://lists.yoctoproject.org/g/linux-yocto/message/9402
Mute This Topic: https://lists.yoctoproject.org/mt/79974875/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to