Deleted Added
full compact
cq.c (278886) cq.c (297124)
1/*
2 * Copyright (c) 2009-2013 Chelsio, Inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 16 unchanged lines hidden (view full) ---

25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2009-2013 Chelsio, Inc. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:

--- 16 unchanged lines hidden (view full) ---

25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/dev/cxgbe/iw_cxgbe/cq.c 278886 2015-02-17 08:40:27Z hselasky $");
33__FBSDID("$FreeBSD: head/sys/dev/cxgbe/iw_cxgbe/cq.c 297124 2016-03-21 00:29:45Z np $");
34
35#include "opt_inet.h"
36
37#ifdef TCP_OFFLOAD
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/kernel.h>
41#include <sys/ktr.h>

--- 677 unchanged lines hidden (view full) ---

719 wc->status = IB_WC_FATAL_ERR;
720 break;
721 case T4_ERR_SWFLUSH:
722 wc->status = IB_WC_WR_FLUSH_ERR;
723 break;
724 default:
725 printf("Unexpected cqe_status 0x%x for QPID = 0x%0x\n",
726 CQE_STATUS(&cqe), CQE_QPID(&cqe));
34
35#include "opt_inet.h"
36
37#ifdef TCP_OFFLOAD
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/kernel.h>
41#include <sys/ktr.h>

--- 677 unchanged lines hidden (view full) ---

719 wc->status = IB_WC_FATAL_ERR;
720 break;
721 case T4_ERR_SWFLUSH:
722 wc->status = IB_WC_WR_FLUSH_ERR;
723 break;
724 default:
725 printf("Unexpected cqe_status 0x%x for QPID = 0x%0x\n",
726 CQE_STATUS(&cqe), CQE_QPID(&cqe));
727 ret = -EINVAL;
727 wc->status = IB_WC_FATAL_ERR;
728 }
729 }
730out:
731 if (wq)
732 spin_unlock(&qhp->lock);
733 return ret;
734}
735

--- 120 unchanged lines hidden (view full) ---

856 if (ucontext) {
857 mm = kmalloc(sizeof *mm, GFP_KERNEL);
858 if (!mm)
859 goto err3;
860 mm2 = kmalloc(sizeof *mm2, GFP_KERNEL);
861 if (!mm2)
862 goto err4;
863
728 }
729 }
730out:
731 if (wq)
732 spin_unlock(&qhp->lock);
733 return ret;
734}
735

--- 120 unchanged lines hidden (view full) ---

856 if (ucontext) {
857 mm = kmalloc(sizeof *mm, GFP_KERNEL);
858 if (!mm)
859 goto err3;
860 mm2 = kmalloc(sizeof *mm2, GFP_KERNEL);
861 if (!mm2)
862 goto err4;
863
864 memset(&uresp, 0, sizeof(uresp));
864 uresp.qid_mask = rhp->rdev.cqmask;
865 uresp.cqid = chp->cq.cqid;
866 uresp.size = chp->cq.size;
867 uresp.memsize = chp->cq.memsize;
868 spin_lock(&ucontext->mmap_lock);
869 uresp.key = ucontext->key;
870 ucontext->key += PAGE_SIZE;
871 uresp.gts_key = ucontext->key;
872 ucontext->key += PAGE_SIZE;
873 spin_unlock(&ucontext->mmap_lock);
865 uresp.qid_mask = rhp->rdev.cqmask;
866 uresp.cqid = chp->cq.cqid;
867 uresp.size = chp->cq.size;
868 uresp.memsize = chp->cq.memsize;
869 spin_lock(&ucontext->mmap_lock);
870 uresp.key = ucontext->key;
871 ucontext->key += PAGE_SIZE;
872 uresp.gts_key = ucontext->key;
873 ucontext->key += PAGE_SIZE;
874 spin_unlock(&ucontext->mmap_lock);
874 ret = ib_copy_to_udata(udata, &uresp, sizeof uresp);
875 ret = ib_copy_to_udata(udata, &uresp,
876 sizeof(uresp) - sizeof(uresp.reserved));
875 if (ret)
876 goto err5;
877
878 mm->key = uresp.key;
879 mm->addr = vtophys(chp->cq.queue);
880 mm->len = chp->cq.memsize;
881 insert_mmap(ucontext, mm);
882

--- 45 unchanged lines hidden ---
877 if (ret)
878 goto err5;
879
880 mm->key = uresp.key;
881 mm->addr = vtophys(chp->cq.queue);
882 mm->len = chp->cq.memsize;
883 insert_mmap(ucontext, mm);
884

--- 45 unchanged lines hidden ---