Mercurial > illumos > illumos-gate
changeset 12642:3d43062bca80
6959875 vnet and vsw should setup data cookies correctly in RxDringData mode
author | WENTAO YANG <Wentao.Yang@Sun.COM> |
---|---|
date | Thu, 17 Jun 2010 16:29:23 -0700 |
parents | 0d09c6ce3fde |
children | 044ff822d212 |
files | usr/src/uts/sun4v/io/vnet_rxdring.c usr/src/uts/sun4v/io/vsw_rxdring.c |
diffstat | 2 files changed, 26 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/sun4v/io/vnet_rxdring.c Thu Jun 17 16:08:46 2010 -0400 +++ b/usr/src/uts/sun4v/io/vnet_rxdring.c Thu Jun 17 16:29:23 2010 -0700 @@ -20,9 +20,9 @@ */ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. */ + #include <sys/types.h> #include <sys/errno.h> #include <sys/sysmacros.h> @@ -113,7 +113,7 @@ int vgen_create_rx_dring(vgen_ldc_t *ldcp) { - int i; + int i, j; int rv; uint32_t ncookies; ldc_mem_info_t minfo; @@ -207,6 +207,16 @@ } ldcp->rx_data_ncookies = ncookies; + for (j = 1; j < ncookies; j++) { + rv = ldc_mem_nextcookie(ldcp->rx_data_handle, + &(ldcp->rx_data_cookie[j])); + if (rv != 0) { + DERR(vgenp, ldcp, "ldc_mem_nextcookie " + "failed rv (%d)", rv); + goto fail; + } + } + /* * Successful in binding the handle to rx data area. Now setup mblks * around each data buffer and setup the descriptors to point to these
--- a/usr/src/uts/sun4v/io/vsw_rxdring.c Thu Jun 17 16:08:46 2010 -0400 +++ b/usr/src/uts/sun4v/io/vsw_rxdring.c Thu Jun 17 16:29:23 2010 -0700 @@ -20,9 +20,9 @@ */ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. */ + #include <sys/types.h> #include <sys/errno.h> #include <sys/sysmacros.h> @@ -247,7 +247,7 @@ static int vsw_setup_rx_dring(vsw_ldc_t *ldcp, dring_info_t *dp) { - int i; + int i, j; int rv; size_t data_sz; vio_mblk_t *vmp; @@ -315,6 +315,16 @@ } dp->data_ncookies = ncookies; + for (j = 1; j < ncookies; j++) { + rv = ldc_mem_nextcookie(dp->data_handle, + &(dp->data_cookie[j])); + if (rv != 0) { + DERR(vswp, "%s: ldc_mem_nextcookie " + "failed rv (%d)", name, rv); + goto fail; + } + } + /* * Successful in binding the handle to rx data area. Now setup mblks * around each data buffer and setup the descriptors to point to these