Date: Wed, 9 Oct 2013 17:41:47 +0000 (UTC) From: Mark Murray <markm@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r256202 - in projects/random_number_generator: . gnu/usr.bin gnu/usr.bin/rcs share/doc/psd share/doc/psd/13.rcs share/man/man5 share/mk sys/arm/s3c2xx0 sys/cam sys/cam/ctl sys/contrib/i... Message-ID: <201310091741.r99Hfllf020817@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markm Date: Wed Oct 9 17:41:47 2013 New Revision: 256202 URL: http://svnweb.freebsd.org/changeset/base/256202 Log: MFC - tracking commit Added: projects/random_number_generator/gnu/usr.bin/rcs/ - copied from r256201, head/gnu/usr.bin/rcs/ projects/random_number_generator/share/doc/psd/13.rcs/ - copied from r256201, head/share/doc/psd/13.rcs/ projects/random_number_generator/tools/build/options/WITHOUT_RCS - copied unchanged from r256201, head/tools/build/options/WITHOUT_RCS Modified: projects/random_number_generator/ObsoleteFiles.inc projects/random_number_generator/UPDATING projects/random_number_generator/gnu/usr.bin/Makefile projects/random_number_generator/share/doc/psd/Makefile projects/random_number_generator/share/man/man5/src.conf.5 projects/random_number_generator/share/mk/bsd.own.mk projects/random_number_generator/sys/arm/s3c2xx0/uart_bus_s3c2410.c projects/random_number_generator/sys/arm/s3c2xx0/uart_cpu_s3c2410.c projects/random_number_generator/sys/cam/cam_xpt.c projects/random_number_generator/sys/cam/ctl/ctl_frontend_iscsi.c projects/random_number_generator/sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c projects/random_number_generator/sys/dev/e1000/e1000_80003es2lan.c projects/random_number_generator/sys/dev/e1000/e1000_80003es2lan.h projects/random_number_generator/sys/dev/e1000/e1000_82571.c projects/random_number_generator/sys/dev/e1000/e1000_82575.c projects/random_number_generator/sys/dev/e1000/e1000_82575.h projects/random_number_generator/sys/dev/e1000/e1000_api.c projects/random_number_generator/sys/dev/e1000/e1000_defines.h projects/random_number_generator/sys/dev/e1000/e1000_hw.h projects/random_number_generator/sys/dev/e1000/e1000_i210.c projects/random_number_generator/sys/dev/e1000/e1000_i210.h projects/random_number_generator/sys/dev/e1000/e1000_ich8lan.c projects/random_number_generator/sys/dev/e1000/e1000_ich8lan.h projects/random_number_generator/sys/dev/e1000/e1000_mac.c projects/random_number_generator/sys/dev/e1000/e1000_osdep.h projects/random_number_generator/sys/dev/e1000/e1000_phy.c projects/random_number_generator/sys/dev/e1000/e1000_phy.h projects/random_number_generator/sys/dev/e1000/e1000_regs.h projects/random_number_generator/sys/dev/e1000/e1000_vf.h projects/random_number_generator/sys/dev/e1000/if_igb.c projects/random_number_generator/sys/dev/e1000/if_igb.h projects/random_number_generator/sys/dev/iscsi/iscsi.c projects/random_number_generator/sys/dev/netmap/if_igb_netmap.h projects/random_number_generator/sys/kern/uipc_sockbuf.c projects/random_number_generator/sys/netinet/tcp_input.c projects/random_number_generator/sys/sys/sockbuf.h projects/random_number_generator/tools/build/mk/OptionalObsoleteFiles.inc projects/random_number_generator/usr.sbin/bsdconfig/bsdconfig projects/random_number_generator/usr.sbin/bsdconfig/console/ttys projects/random_number_generator/usr.sbin/bsdconfig/mouse/enable projects/random_number_generator/usr.sbin/bsdconfig/networking/devices projects/random_number_generator/usr.sbin/bsdconfig/networking/share/device.subr projects/random_number_generator/usr.sbin/bsdconfig/networking/share/hostname.subr projects/random_number_generator/usr.sbin/bsdconfig/networking/share/ipaddr.subr projects/random_number_generator/usr.sbin/bsdconfig/networking/share/media.subr projects/random_number_generator/usr.sbin/bsdconfig/networking/share/netmask.subr projects/random_number_generator/usr.sbin/bsdconfig/networking/share/resolv.subr projects/random_number_generator/usr.sbin/bsdconfig/networking/share/routing.subr projects/random_number_generator/usr.sbin/bsdconfig/password/share/password.subr projects/random_number_generator/usr.sbin/bsdconfig/security/kern_securelevel projects/random_number_generator/usr.sbin/bsdconfig/security/security projects/random_number_generator/usr.sbin/bsdconfig/share/common.subr projects/random_number_generator/usr.sbin/bsdconfig/share/device.subr projects/random_number_generator/usr.sbin/bsdconfig/share/dialog.subr projects/random_number_generator/usr.sbin/bsdconfig/share/media/any.subr projects/random_number_generator/usr.sbin/bsdconfig/share/media/cdrom.subr projects/random_number_generator/usr.sbin/bsdconfig/share/media/common.subr projects/random_number_generator/usr.sbin/bsdconfig/share/media/dos.subr projects/random_number_generator/usr.sbin/bsdconfig/share/media/floppy.subr projects/random_number_generator/usr.sbin/bsdconfig/share/media/ftp.subr projects/random_number_generator/usr.sbin/bsdconfig/share/media/http.subr projects/random_number_generator/usr.sbin/bsdconfig/share/media/nfs.subr projects/random_number_generator/usr.sbin/bsdconfig/share/media/options.subr projects/random_number_generator/usr.sbin/bsdconfig/share/media/tcpip.subr projects/random_number_generator/usr.sbin/bsdconfig/share/media/ufs.subr projects/random_number_generator/usr.sbin/bsdconfig/share/media/usb.subr projects/random_number_generator/usr.sbin/bsdconfig/share/mustberoot.subr projects/random_number_generator/usr.sbin/bsdconfig/share/packages/packages.subr projects/random_number_generator/usr.sbin/bsdconfig/startup/misc projects/random_number_generator/usr.sbin/bsdconfig/startup/rcconf projects/random_number_generator/usr.sbin/bsdconfig/startup/rcdelete projects/random_number_generator/usr.sbin/bsdconfig/startup/rcvar projects/random_number_generator/usr.sbin/bsdconfig/startup/share/rcconf.subr projects/random_number_generator/usr.sbin/bsdconfig/startup/share/rcedit.subr projects/random_number_generator/usr.sbin/bsdconfig/timezone/timezone projects/random_number_generator/usr.sbin/bsdconfig/usermgmt/groupdel projects/random_number_generator/usr.sbin/bsdconfig/usermgmt/groupedit projects/random_number_generator/usr.sbin/bsdconfig/usermgmt/groupinput projects/random_number_generator/usr.sbin/bsdconfig/usermgmt/share/group_input.subr projects/random_number_generator/usr.sbin/bsdconfig/usermgmt/share/user_input.subr projects/random_number_generator/usr.sbin/bsdconfig/usermgmt/userdel projects/random_number_generator/usr.sbin/bsdconfig/usermgmt/useredit projects/random_number_generator/usr.sbin/bsdconfig/usermgmt/userinput projects/random_number_generator/usr.sbin/bsdconfig/usermgmt/usermgmt projects/random_number_generator/usr.sbin/ctladm/ctladm.c projects/random_number_generator/usr.sbin/ctld/kernel.c projects/random_number_generator/usr.sbin/ctld/login.c projects/random_number_generator/usr.sbin/iscsid/discovery.c Directory Properties: projects/random_number_generator/ (props changed) projects/random_number_generator/sys/ (props changed) projects/random_number_generator/sys/contrib/ipfilter/ (props changed) Modified: projects/random_number_generator/ObsoleteFiles.inc ============================================================================== --- projects/random_number_generator/ObsoleteFiles.inc Wed Oct 9 17:34:45 2013 (r256201) +++ projects/random_number_generator/ObsoleteFiles.inc Wed Oct 9 17:41:47 2013 (r256202) @@ -38,29 +38,6 @@ # xargs -n1 | sort | uniq -d; # done -# 20131015: removal of RCS from base -OLD_FILES+=usr/bin/ci -OLD_FILES+=usr/bin/co -OLD_FILES+=usr/bin/ident -OLD_FILES+=usr/bin/merge -OLD_FILES+=usr/bin/rcs -OLD_FILES+=usr/bin/rcsclean -OLD_FILES+=usr/bin/rcsdiff -OLD_FILES+=usr/bin/rcsfreeze -OLD_FILES+=usr/bin/rcsmerge -OLD_FILES+=usr/bin/rlog -OLD_FILES+=usr/share/man/man1/ci.1.gz -OLD_FILES+=usr/share/man/man1/co.1.gz -OLD_FILES+=usr/share/man/man1/ident.1.gz -OLD_FILES+=usr/share/man/man1/merge.1.gz -OLD_FILES+=usr/share/man/man1/rcs.1.gz -OLD_FILES+=usr/share/man/man1/rcsclean.1.gz -OLD_FILES+=usr/share/man/man1/rcsdiff.1.gz -OLD_FILES+=usr/share/man/man1/rcsfreeze.1.gz -OLD_FILES+=usr/share/man/man1/rcsintro.1.gz -OLD_FILES+=usr/share/man/man1/rcsmerge.1.gz -OLD_FILES+=usr/share/man/man1/rlog.1.gz -OLD_FILES+=usr/share/man/man5/rcsfile.5.gz # 20131001: ar and ranlib from binutils not used OLD_FILES+=usr/bin/gnu-ar OLD_FILES+=usr/bin/gnu-ranlib Modified: projects/random_number_generator/UPDATING ============================================================================== --- projects/random_number_generator/UPDATING Wed Oct 9 17:34:45 2013 (r256201) +++ projects/random_number_generator/UPDATING Wed Oct 9 17:41:47 2013 (r256202) @@ -31,10 +31,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) -20131006: - RCS has been removed from the base system. If you need RCS - install either devel/rcs or devel/rcs57. - 20130930: BIND has been removed from the base system. If all you need is a local resolver, simply enable and start the local_unbound Modified: projects/random_number_generator/gnu/usr.bin/Makefile ============================================================================== --- projects/random_number_generator/gnu/usr.bin/Makefile Wed Oct 9 17:34:45 2013 (r256201) +++ projects/random_number_generator/gnu/usr.bin/Makefile Wed Oct 9 17:41:47 2013 (r256202) @@ -12,6 +12,7 @@ SUBDIR= ${_binutils} \ ${_gperf} \ grep \ ${_groff} \ + ${_rcs} \ sdiff \ send-pr \ ${_texinfo} @@ -31,6 +32,10 @@ _dtc= dtc _texinfo= texinfo .endif +.if ${MK_RCS} != "no" +_rcs= rcs +.endif + .if ${MK_BINUTILS} != "no" _binutils= binutils .endif Modified: projects/random_number_generator/share/doc/psd/Makefile ============================================================================== --- projects/random_number_generator/share/doc/psd/Makefile Wed Oct 9 17:34:45 2013 (r256201) +++ projects/random_number_generator/share/doc/psd/Makefile Wed Oct 9 17:41:47 2013 (r256202) @@ -20,6 +20,7 @@ SUBDIR= title \ 05.sysman \ 06.Clang \ 12.make \ + 13.rcs \ 15.yacc \ 16.lex \ 17.m4 \ Modified: projects/random_number_generator/share/man/man5/src.conf.5 ============================================================================== --- projects/random_number_generator/share/man/man5/src.conf.5 Wed Oct 9 17:34:45 2013 (r256201) +++ projects/random_number_generator/share/man/man5/src.conf.5 Wed Oct 9 17:41:47 2013 (r256202) @@ -909,6 +909,11 @@ This includes .Xr rlogin 1 , .Xr rsh 1 , etc. +.It Va WITHOUT_RCS +.\" from FreeBSD: head/tools/build/options/WITHOUT_RCS 156932 2006-03-21 07:50:50Z ru +Set to not build +.Xr rcs 1 +and related utilities. .It Va WITHOUT_RESCUE .\" from FreeBSD: head/tools/build/options/WITHOUT_RESCUE 156932 2006-03-21 07:50:50Z ru Set to not build Modified: projects/random_number_generator/share/mk/bsd.own.mk ============================================================================== --- projects/random_number_generator/share/mk/bsd.own.mk Wed Oct 9 17:34:45 2013 (r256201) +++ projects/random_number_generator/share/mk/bsd.own.mk Wed Oct 9 17:41:47 2013 (r256202) @@ -334,6 +334,7 @@ __DEFAULT_YES_OPTIONS = \ PROFILE \ QUOTAS \ RCMDS \ + RCS \ RESCUE \ ROUTED \ SENDMAIL \ Modified: projects/random_number_generator/sys/arm/s3c2xx0/uart_bus_s3c2410.c ============================================================================== --- projects/random_number_generator/sys/arm/s3c2xx0/uart_bus_s3c2410.c Wed Oct 9 17:34:45 2013 (r256201) +++ projects/random_number_generator/sys/arm/s3c2xx0/uart_bus_s3c2410.c Wed Oct 9 17:41:47 2013 (r256202) @@ -35,7 +35,6 @@ static driver_t uart_s3c2410_driver = { sizeof(struct uart_softc), }; -extern struct uart_class uart_s3c2410_class; extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; static int uart_s3c2410_probe(device_t dev) Modified: projects/random_number_generator/sys/arm/s3c2xx0/uart_cpu_s3c2410.c ============================================================================== --- projects/random_number_generator/sys/arm/s3c2xx0/uart_cpu_s3c2410.c Wed Oct 9 17:34:45 2013 (r256201) +++ projects/random_number_generator/sys/arm/s3c2xx0/uart_cpu_s3c2410.c Wed Oct 9 17:41:47 2013 (r256202) @@ -47,8 +47,6 @@ extern struct uart_ops uart_s3c2410_ops; vm_offset_t s3c2410_uart_vaddr; unsigned int s3c2410_pclk; -extern struct uart_class uart_s3c2410_class; - int uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) { Modified: projects/random_number_generator/sys/cam/cam_xpt.c ============================================================================== --- projects/random_number_generator/sys/cam/cam_xpt.c Wed Oct 9 17:34:45 2013 (r256201) +++ projects/random_number_generator/sys/cam/cam_xpt.c Wed Oct 9 17:41:47 2013 (r256202) @@ -2415,7 +2415,7 @@ xptsetasyncbusfunc(struct cam_eb *bus, v struct ccb_setasync *csa = (struct ccb_setasync *)arg; xpt_compile_path(&path, /*periph*/NULL, - bus->sim->path_id, + bus->path_id, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); xpt_setup_ccb(&cpi.ccb_h, &path, CAM_PRIORITY_NORMAL); @@ -3840,13 +3840,8 @@ xpt_bus_register(struct cam_sim *sim, de /* Couldn't satisfy request */ return (CAM_RESRC_UNAVAIL); } - if (strcmp(sim->sim_name, "xpt") != 0) { - sim->path_id = - xptpathid(sim->sim_name, sim->unit_number, sim->bus_id); - } TAILQ_INIT(&new_bus->et_entries); - new_bus->path_id = sim->path_id; cam_sim_hold(sim); new_bus->sim = sim; timevalclear(&new_bus->last_reset); @@ -3855,6 +3850,8 @@ xpt_bus_register(struct cam_sim *sim, de new_bus->generation = 0; xpt_lock_buses(); + sim->path_id = new_bus->path_id = + xptpathid(sim->sim_name, sim->unit_number, sim->bus_id); old_bus = TAILQ_FIRST(&xsoftc.xpt_busses); while (old_bus != NULL && old_bus->path_id < new_bus->path_id) @@ -3958,8 +3955,8 @@ xptnextfreepathid(void) path_id_t pathid; const char *strval; + mtx_assert(&xsoftc.xpt_topo_lock, MA_OWNED); pathid = 0; - xpt_lock_buses(); bus = TAILQ_FIRST(&xsoftc.xpt_busses); retry: /* Find an unoccupied pathid */ @@ -3968,7 +3965,6 @@ retry: pathid++; bus = TAILQ_NEXT(bus, links); } - xpt_unlock_buses(); /* * Ensure that this pathid is not reserved for @@ -3977,7 +3973,6 @@ retry: if (resource_string_value("scbus", pathid, "at", &strval) == 0) { ++pathid; /* Start the search over */ - xpt_lock_buses(); goto retry; } return (pathid); @@ -3993,6 +3988,8 @@ xptpathid(const char *sim_name, int sim_ pathid = CAM_XPT_PATH_ID; snprintf(buf, sizeof(buf), "%s%d", sim_name, sim_unit); + if (strcmp(buf, "xpt0") == 0 && sim_bus == 0) + return (pathid); i = 0; while ((resource_find_match(&i, &dname, &dunit, "at", buf)) == 0) { if (strcmp(dname, "scbus")) { Modified: projects/random_number_generator/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- projects/random_number_generator/sys/cam/ctl/ctl_frontend_iscsi.c Wed Oct 9 17:34:45 2013 (r256201) +++ projects/random_number_generator/sys/cam/ctl/ctl_frontend_iscsi.c Wed Oct 9 17:41:47 2013 (r256202) @@ -229,8 +229,6 @@ cfiscsi_pdu_update_cmdsn(const struct ic /* * The target MUST silently ignore any non-immediate command outside * of this range. - * - * XXX: ... or non-immediate duplicates within the range. */ if (cmdsn < cs->cs_cmdsn || cmdsn > cs->cs_cmdsn + maxcmdsn_delta) { CFISCSI_SESSION_UNLOCK(cs); @@ -288,8 +286,8 @@ cfiscsi_pdu_handle(struct icl_pdu *reque CFISCSI_SESSION_WARN(cs, "received PDU with unsupported " "opcode 0x%x; dropping connection", request->ip_bhs->bhs_opcode); - cfiscsi_session_terminate(cs); icl_pdu_free(request); + cfiscsi_session_terminate(cs); } } @@ -455,6 +453,9 @@ cfiscsi_pdu_handle_nop_out(struct icl_pd struct iscsi_bhs_nop_out *bhsno; struct iscsi_bhs_nop_in *bhsni; struct icl_pdu *response; + void *data = NULL; + size_t datasize; + int error; cs = PDU_SESSION(request); bhsno = (struct iscsi_bhs_nop_out *)request->ip_bhs; @@ -468,9 +469,26 @@ cfiscsi_pdu_handle_nop_out(struct icl_pd return; } + datasize = icl_pdu_data_segment_length(request); + if (datasize > 0) { + data = malloc(datasize, M_CFISCSI, M_NOWAIT | M_ZERO); + if (data == NULL) { + CFISCSI_SESSION_WARN(cs, "failed to allocate memory; " + "dropping connection"); + icl_pdu_free(request); + cfiscsi_session_terminate(cs); + return; + } + icl_pdu_get_data(request, 0, data, datasize); + } + response = cfiscsi_pdu_new_response(request, M_NOWAIT); if (response == NULL) { + CFISCSI_SESSION_WARN(cs, "failed to allocate memory; " + "droppping connection"); + free(data, M_CFISCSI); icl_pdu_free(request); + cfiscsi_session_terminate(cs); return; } bhsni = (struct iscsi_bhs_nop_in *)response->ip_bhs; @@ -478,14 +496,19 @@ cfiscsi_pdu_handle_nop_out(struct icl_pd bhsni->bhsni_flags = 0x80; bhsni->bhsni_initiator_task_tag = bhsno->bhsno_initiator_task_tag; bhsni->bhsni_target_transfer_tag = 0xffffffff; - -#if 0 - /* XXX */ - response->ip_data_len = request->ip_data_len; - response->ip_data_mbuf = request->ip_data_mbuf; - request->ip_data_len = 0; - request->ip_data_mbuf = NULL; -#endif + if (datasize > 0) { + error = icl_pdu_append_data(response, data, datasize, M_NOWAIT); + if (error != 0) { + CFISCSI_SESSION_WARN(cs, "failed to allocate memory; " + "dropping connection"); + free(data, M_CFISCSI); + icl_pdu_free(request); + icl_pdu_free(response); + cfiscsi_session_terminate(cs); + return; + } + free(data, M_CFISCSI); + } icl_pdu_free(request); cfiscsi_pdu_queue(response); @@ -507,14 +530,16 @@ cfiscsi_pdu_handle_scsi_command(struct i if (request->ip_data_len > 0 && cs->cs_immediate_data == false) { CFISCSI_SESSION_WARN(cs, "unsolicited data with " "ImmediateData=No; dropping connection"); - cfiscsi_session_terminate(cs); icl_pdu_free(request); + cfiscsi_session_terminate(cs); return; } io = ctl_alloc_io(cs->cs_target->ct_softc->fe.ctl_pool_ref); if (io == NULL) { - CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io"); + CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io; " + "dropping connection"); icl_pdu_free(request); + cfiscsi_session_terminate(cs); return; } ctl_zero_io(io); @@ -554,10 +579,12 @@ cfiscsi_pdu_handle_scsi_command(struct i refcount_acquire(&cs->cs_outstanding_ctl_pdus); error = ctl_queue(io); if (error != CTL_RETVAL_COMPLETE) { - CFISCSI_SESSION_WARN(cs, "ctl_queue() failed; error %d", error); + CFISCSI_SESSION_WARN(cs, "ctl_queue() failed; error %d; " + "dropping connection", error); ctl_free_io(io); refcount_release(&cs->cs_outstanding_ctl_pdus); icl_pdu_free(request); + cfiscsi_session_terminate(cs); } } @@ -575,8 +602,10 @@ cfiscsi_pdu_handle_task_request(struct i bhstmr = (struct iscsi_bhs_task_management_request *)request->ip_bhs; io = ctl_alloc_io(cs->cs_target->ct_softc->fe.ctl_pool_ref); if (io == NULL) { - CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io"); + CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io;" + "dropping connection"); icl_pdu_free(request); + cfiscsi_session_terminate(cs); return; } ctl_zero_io(io); @@ -617,7 +646,10 @@ cfiscsi_pdu_handle_task_request(struct i response = cfiscsi_pdu_new_response(request, M_NOWAIT); if (response == NULL) { + CFISCSI_SESSION_WARN(cs, "failed to allocate memory; " + "dropping connection"); icl_pdu_free(request); + cfiscsi_session_terminate(cs); return; } bhstmr2 = (struct iscsi_bhs_task_management_response *) @@ -636,10 +668,12 @@ cfiscsi_pdu_handle_task_request(struct i refcount_acquire(&cs->cs_outstanding_ctl_pdus); error = ctl_queue(io); if (error != CTL_RETVAL_COMPLETE) { - CFISCSI_SESSION_WARN(cs, "ctl_queue() failed; error %d", error); + CFISCSI_SESSION_WARN(cs, "ctl_queue() failed; error %d; " + "dropping connection", error); ctl_free_io(io); refcount_release(&cs->cs_outstanding_ctl_pdus); icl_pdu_free(request); + cfiscsi_session_terminate(cs); } } @@ -649,7 +683,7 @@ cfiscsi_handle_data_segment(struct icl_p struct iscsi_bhs_data_out *bhsdo; struct cfiscsi_session *cs; struct ctl_sg_entry ctl_sg_entry, *ctl_sglist; - size_t copy_len, off, buffer_offset; + size_t copy_len, len, off, buffer_offset; int ctl_sg_count; union ctl_io *io; @@ -684,10 +718,6 @@ cfiscsi_handle_data_segment(struct icl_p ctl_sglist->len = io->scsiio.kern_data_len; ctl_sg_count = 1; } -#if 0 - if (ctl_sg_count > 1) - CFISCSI_SESSION_DEBUG(cs, "ctl_sg_count = %d", ctl_sg_count); -#endif if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) == ISCSI_BHS_OPCODE_SCSI_DATA_OUT) @@ -707,7 +737,20 @@ cfiscsi_handle_data_segment(struct icl_p return (true); } + /* + * This is the offset within the PDU data segment, as opposed + * to buffer_offset, which is the offset within the task (SCSI + * command). + */ off = 0; + len = icl_pdu_data_segment_length(request); + + /* + * Iterate over the scatter/gather segments, filling them with data + * from the PDU data segment. Note that this can get called multiple + * times for one SCSI command; the cdw structure holds state for the + * scatter/gather list. + */ for (;;) { KASSERT(cdw->cdw_sg_index < ctl_sg_count, ("cdw->cdw_sg_index >= ctl_sg_count")); @@ -715,7 +758,8 @@ cfiscsi_handle_data_segment(struct icl_p cdw->cdw_sg_addr = ctl_sglist[cdw->cdw_sg_index].addr; cdw->cdw_sg_len = ctl_sglist[cdw->cdw_sg_index].len; } - copy_len = icl_pdu_data_segment_length(request) - off; + KASSERT(off <= len, ("len > off")); + copy_len = len - off; if (copy_len > cdw->cdw_sg_len) copy_len = cdw->cdw_sg_len; @@ -726,15 +770,27 @@ cfiscsi_handle_data_segment(struct icl_p io->scsiio.ext_data_filled += copy_len; if (cdw->cdw_sg_len == 0) { - if (cdw->cdw_sg_index == ctl_sg_count - 1) + /* + * End of current segment. + */ + if (cdw->cdw_sg_index == ctl_sg_count - 1) { + /* + * Last segment in scatter/gather list. + */ break; + } cdw->cdw_sg_index++; } - if (off == icl_pdu_data_segment_length(request)) + + if (off == len) { + /* + * End of PDU payload. + */ break; + } } - if (off < icl_pdu_data_segment_length(request)) { + if (len > off) { CFISCSI_SESSION_WARN(cs, "received too much data: got %zd bytes, " "expected %zd", icl_pdu_data_segment_length(request), off); cfiscsi_session_terminate(cs); @@ -808,8 +864,8 @@ cfiscsi_pdu_handle_data_out(struct icl_p CFISCSI_SESSION_UNLOCK(cs); if (cdw == NULL) { CFISCSI_SESSION_WARN(cs, "data transfer tag 0x%x, initiator task tag " - "0x%x, not found", bhsdo->bhsdo_target_transfer_tag, - bhsdo->bhsdo_initiator_task_tag); + "0x%x, not found; dropping connection", + bhsdo->bhsdo_target_transfer_tag, bhsdo->bhsdo_initiator_task_tag); icl_pdu_free(request); cfiscsi_session_terminate(cs); return; @@ -846,6 +902,7 @@ cfiscsi_pdu_handle_logout_request(struct case BHSLR_REASON_CLOSE_CONNECTION: response = cfiscsi_pdu_new_response(request, M_NOWAIT); if (response == NULL) { + CFISCSI_SESSION_DEBUG(cs, "failed to allocate memory"); icl_pdu_free(request); cfiscsi_session_terminate(cs); return; @@ -863,6 +920,8 @@ cfiscsi_pdu_handle_logout_request(struct case BHSLR_REASON_REMOVE_FOR_RECOVERY: response = cfiscsi_pdu_new_response(request, M_NOWAIT); if (response == NULL) { + CFISCSI_SESSION_WARN(cs, + "failed to allocate memory; dropping connection"); icl_pdu_free(request); cfiscsi_session_terminate(cs); return; @@ -934,7 +993,7 @@ cfiscsi_callout(void *context) cp = icl_pdu_new_bhs(cs->cs_conn, M_NOWAIT); if (cp == NULL) { - CFISCSI_SESSION_WARN(cs, "failed to allocate PDU"); + CFISCSI_SESSION_WARN(cs, "failed to allocate memory"); return; } bhsni = (struct iscsi_bhs_nop_in *)cp->ip_bhs; @@ -2275,11 +2334,6 @@ cfiscsi_datamove_in(union ctl_io *io) */ PDU_TOTAL_TRANSFER_LEN(request) = io->scsiio.kern_total_len; -#if 0 - if (ctl_sg_count > 1) - CFISCSI_SESSION_DEBUG(cs, "ctl_sg_count = %d", ctl_sg_count); -#endif - /* * This is the offset within the current SCSI command; * i.e. for the first call of datamove(), it will be 0, @@ -2287,8 +2341,6 @@ cfiscsi_datamove_in(union ctl_io *io) * of previous ones. */ off = htonl(io->scsiio.kern_rel_offset); - if (off > 1) - CFISCSI_SESSION_DEBUG(cs, "off = %zd", off); i = 0; addr = NULL; @@ -2361,7 +2413,7 @@ cfiscsi_datamove_in(union ctl_io *io) /* * Can't stuff more data into the current PDU; * queue it. Note that's not enough to check - * for kern_data_resid == 0 instead; there + * for kern_data_resid == 0 instead; there * may be several Data-In PDUs for the final * call to cfiscsi_datamove(), and we want * to set the F flag only on the last of them. @@ -2380,10 +2432,12 @@ cfiscsi_datamove_in(union ctl_io *io) if (response != NULL) { if (off == io->scsiio.kern_total_len) { bhsdi->bhsdi_flags |= BHSDI_FLAGS_F; +#if 0 } else { CFISCSI_SESSION_DEBUG(cs, "not setting the F flag; " "have %zd, need %zd", off, (size_t)io->scsiio.kern_total_len); +#endif } KASSERT(response->ip_data_len > 0, ("sending empty Data-In")); cfiscsi_pdu_queue(response); Modified: projects/random_number_generator/sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c ============================================================================== --- projects/random_number_generator/sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c Wed Oct 9 17:34:45 2013 (r256201) +++ projects/random_number_generator/sys/contrib/ipfilter/netinet/ip_rcmd_pxy.c Wed Oct 9 17:41:47 2013 (r256202) @@ -159,7 +159,7 @@ ipf_p_rcmd_portmsg(fin, aps, nat) ip6_t *ip6; #endif int tcpsz; - int slen; + int slen = 0; /* silence gcc */ ip_t *ip; mb_t *m; Modified: projects/random_number_generator/sys/dev/e1000/e1000_80003es2lan.c ============================================================================== --- projects/random_number_generator/sys/dev/e1000/e1000_80003es2lan.c Wed Oct 9 17:34:45 2013 (r256201) +++ projects/random_number_generator/sys/dev/e1000/e1000_80003es2lan.c Wed Oct 9 17:41:47 2013 (r256202) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2013, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -32,16 +32,12 @@ ******************************************************************************/ /*$FreeBSD$*/ -/* - * 80003ES2LAN Gigabit Ethernet Controller (Copper) +/* 80003ES2LAN Gigabit Ethernet Controller (Copper) * 80003ES2LAN Gigabit Ethernet Controller (Serdes) */ #include "e1000_api.h" -static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw); -static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw); -static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw); static s32 e1000_acquire_phy_80003es2lan(struct e1000_hw *hw); static void e1000_release_phy_80003es2lan(struct e1000_hw *hw); static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw); @@ -71,14 +67,12 @@ static s32 e1000_read_kmrn_reg_80003es2 u16 *data); static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, u16 data); -static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw); static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw); static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask); static s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw); static void e1000_power_down_phy_copper_80003es2lan(struct e1000_hw *hw); -/* - * A table for the GG82563 cable length where the range is defined +/* A table for the GG82563 cable length where the range is defined * with a lower bound at "index" and the upper bound at * "index + 5". */ @@ -95,13 +89,13 @@ static const u16 e1000_gg82563_cable_len static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; DEBUGFUNC("e1000_init_phy_params_80003es2lan"); if (hw->phy.media_type != e1000_media_type_copper) { phy->type = e1000_phy_none; - goto out; + return E1000_SUCCESS; } else { phy->ops.power_up = e1000_power_up_phy_copper; phy->ops.power_down = e1000_power_down_phy_copper_80003es2lan; @@ -133,12 +127,9 @@ static s32 e1000_init_phy_params_80003es ret_val = e1000_get_phy_id(hw); /* Verify phy id */ - if (phy->id != GG82563_E_PHY_ID) { - ret_val = -E1000_ERR_PHY; - goto out; - } + if (phy->id != GG82563_E_PHY_ID) + return -E1000_ERR_PHY; -out: return ret_val; } @@ -176,8 +167,7 @@ static s32 e1000_init_nvm_params_80003es size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> E1000_EECD_SIZE_EX_SHIFT); - /* - * Added to a constant, "size" becomes the left-shift value + /* Added to a constant, "size" becomes the left-shift value * for setting word_size. */ size += NVM_WORD_SIZE_BASE_SHIFT; @@ -234,8 +224,8 @@ static s32 e1000_init_mac_params_80003es /* FWSM register */ mac->has_fwsm = TRUE; /* ARC supported; valid only if manageability features are enabled. */ - mac->arc_subsystem_valid = (E1000_READ_REG(hw, E1000_FWSM) & - E1000_FWSM_MODE_MASK) ? TRUE : FALSE; + mac->arc_subsystem_valid = !!(E1000_READ_REG(hw, E1000_FWSM) & + E1000_FWSM_MODE_MASK); /* Adaptive IFS not supported */ mac->adaptive_ifs = FALSE; @@ -377,14 +367,13 @@ static s32 e1000_acquire_nvm_80003es2lan ret_val = e1000_acquire_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM); if (ret_val) - goto out; + return ret_val; ret_val = e1000_acquire_nvm_generic(hw); if (ret_val) e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM); -out: return ret_val; } @@ -415,23 +404,20 @@ static s32 e1000_acquire_swfw_sync_80003 u32 swfw_sync; u32 swmask = mask; u32 fwmask = mask << 16; - s32 ret_val = E1000_SUCCESS; - s32 i = 0, timeout = 50; + s32 i = 0; + s32 timeout = 50; DEBUGFUNC("e1000_acquire_swfw_sync_80003es2lan"); while (i < timeout) { - if (e1000_get_hw_semaphore_generic(hw)) { - ret_val = -E1000_ERR_SWFW_SYNC; - goto out; - } + if (e1000_get_hw_semaphore_generic(hw)) + return -E1000_ERR_SWFW_SYNC; swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC); if (!(swfw_sync & (fwmask | swmask))) break; - /* - * Firmware currently using resource (fwmask) + /* Firmware currently using resource (fwmask) * or other software thread using resource (swmask) */ e1000_put_hw_semaphore_generic(hw); @@ -441,8 +427,7 @@ static s32 e1000_acquire_swfw_sync_80003 if (i == timeout) { DEBUGOUT("Driver can't access resource, SW_FW_SYNC timeout.\n"); - ret_val = -E1000_ERR_SWFW_SYNC; - goto out; + return -E1000_ERR_SWFW_SYNC; } swfw_sync |= swmask; @@ -450,8 +435,7 @@ static s32 e1000_acquire_swfw_sync_80003 e1000_put_hw_semaphore_generic(hw); -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -497,14 +481,13 @@ static s32 e1000_read_phy_reg_gg82563_80 ret_val = e1000_acquire_phy_80003es2lan(hw); if (ret_val) - goto out; + return ret_val; /* Select Configuration Page */ if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) { page_select = GG82563_PHY_PAGE_SELECT; } else { - /* - * Use Alternative Page Select register to access + /* Use Alternative Page Select register to access * registers 30 and 31 */ page_select = GG82563_PHY_PAGE_SELECT_ALT; @@ -514,12 +497,11 @@ static s32 e1000_read_phy_reg_gg82563_80 ret_val = e1000_write_phy_reg_mdic(hw, page_select, temp); if (ret_val) { e1000_release_phy_80003es2lan(hw); - goto out; + return ret_val; } - if (hw->dev_spec._80003es2lan.mdic_wa_enable == TRUE) { - /* - * The "ready" bit in the MDIC register may be incorrectly set + if (hw->dev_spec._80003es2lan.mdic_wa_enable) { + /* The "ready" bit in the MDIC register may be incorrectly set * before the device has completed the "Page Select" MDI * transaction. So we wait 200us after each MDI command... */ @@ -529,9 +511,8 @@ static s32 e1000_read_phy_reg_gg82563_80 ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp); if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) { - ret_val = -E1000_ERR_PHY; e1000_release_phy_80003es2lan(hw); - goto out; + return -E1000_ERR_PHY; } usec_delay(200); @@ -549,7 +530,6 @@ static s32 e1000_read_phy_reg_gg82563_80 e1000_release_phy_80003es2lan(hw); -out: return ret_val; } @@ -572,14 +552,13 @@ static s32 e1000_write_phy_reg_gg82563_8 ret_val = e1000_acquire_phy_80003es2lan(hw); if (ret_val) - goto out; + return ret_val; /* Select Configuration Page */ if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) { page_select = GG82563_PHY_PAGE_SELECT; } else { - /* - * Use Alternative Page Select register to access + /* Use Alternative Page Select register to access * registers 30 and 31 */ page_select = GG82563_PHY_PAGE_SELECT_ALT; @@ -589,12 +568,11 @@ static s32 e1000_write_phy_reg_gg82563_8 ret_val = e1000_write_phy_reg_mdic(hw, page_select, temp); if (ret_val) { e1000_release_phy_80003es2lan(hw); - goto out; + return ret_val; } - if (hw->dev_spec._80003es2lan.mdic_wa_enable == TRUE) { - /* - * The "ready" bit in the MDIC register may be incorrectly set + if (hw->dev_spec._80003es2lan.mdic_wa_enable) { + /* The "ready" bit in the MDIC register may be incorrectly set * before the device has completed the "Page Select" MDI * transaction. So we wait 200us after each MDI command... */ @@ -604,9 +582,8 @@ static s32 e1000_write_phy_reg_gg82563_8 ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp); if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) { - ret_val = -E1000_ERR_PHY; e1000_release_phy_80003es2lan(hw); - goto out; + return -E1000_ERR_PHY; } usec_delay(200); @@ -624,7 +601,6 @@ static s32 e1000_write_phy_reg_gg82563_8 e1000_release_phy_80003es2lan(hw); -out: return ret_val; } @@ -655,7 +631,6 @@ static s32 e1000_write_nvm_80003es2lan(s static s32 e1000_get_cfg_done_80003es2lan(struct e1000_hw *hw) { s32 timeout = PHY_CFG_TIMEOUT; - s32 ret_val = E1000_SUCCESS; u32 mask = E1000_NVM_CFG_DONE_PORT_0; DEBUGFUNC("e1000_get_cfg_done_80003es2lan"); @@ -671,12 +646,10 @@ static s32 e1000_get_cfg_done_80003es2la } if (!timeout) { DEBUGOUT("MNG configuration cycle has not completed.\n"); - ret_val = -E1000_ERR_RESET; - goto out; + return -E1000_ERR_RESET; } -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -688,33 +661,32 @@ out: **/ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw) { - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 phy_data; bool link; DEBUGFUNC("e1000_phy_force_speed_duplex_80003es2lan"); if (!(hw->phy.ops.read_reg)) - goto out; + return E1000_SUCCESS; - /* - * Clear Auto-Crossover to force MDI manually. M88E1000 requires MDI + /* Clear Auto-Crossover to force MDI manually. M88E1000 requires MDI * forced whenever speed and duplex are forced. */ ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); if (ret_val) - goto out; + return ret_val; phy_data &= ~GG82563_PSCR_CROSSOVER_MODE_AUTO; ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_SPEC_CTRL, phy_data); if (ret_val) - goto out; + return ret_val; DEBUGOUT1("GG82563 PSCR: %X\n", phy_data); ret_val = hw->phy.ops.read_reg(hw, PHY_CONTROL, &phy_data); if (ret_val) - goto out; + return ret_val; e1000_phy_force_speed_duplex_setup(hw, &phy_data); @@ -723,7 +695,7 @@ static s32 e1000_phy_force_speed_duplex_ ret_val = hw->phy.ops.write_reg(hw, PHY_CONTROL, phy_data); if (ret_val) - goto out; + return ret_val; usec_delay(1); @@ -733,32 +705,30 @@ static s32 e1000_phy_force_speed_duplex_ ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT, 100000, &link); if (ret_val) - goto out; + return ret_val; if (!link) { - /* - * We didn't get link. + /* We didn't get link. * Reset the DSP and cross our fingers. */ ret_val = e1000_phy_reset_dsp_generic(hw); if (ret_val) - goto out; + return ret_val; } /* Try once more */ ret_val = e1000_phy_has_link_generic(hw, PHY_FORCE_LIMIT, 100000, &link); if (ret_val) - goto out; + return ret_val; } ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, &phy_data); if (ret_val) - goto out; + return ret_val; - /* - * Resetting the phy means we need to verify the TX_CLK corresponds + /* Resetting the phy means we need to verify the TX_CLK corresponds * to the link speed. 10Mbps -> 2.5MHz, else 25MHz. */ phy_data &= ~GG82563_MSCR_TX_CLK_MASK; @@ -767,15 +737,13 @@ static s32 e1000_phy_force_speed_duplex_ else phy_data |= GG82563_MSCR_TX_CLK_100MBPS_25; - /* - * In addition, we must re-enable CRS on Tx for both half and full + /* In addition, we must re-enable CRS on Tx for both half and full * duplex. */ phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX; ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, phy_data); -out: return ret_val; } @@ -789,32 +757,29 @@ out: static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; - s32 ret_val = E1000_SUCCESS; + s32 ret_val; u16 phy_data, index; DEBUGFUNC("e1000_get_cable_length_80003es2lan"); if (!(hw->phy.ops.read_reg)) - goto out; + return E1000_SUCCESS; ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_DSP_DISTANCE, &phy_data); if (ret_val) - goto out; + return ret_val; index = phy_data & GG82563_DSPD_CABLE_LENGTH; - if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE - 5) { - ret_val = -E1000_ERR_PHY; - goto out; - } + if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE - 5) + return -E1000_ERR_PHY; phy->min_cable_length = e1000_gg82563_cable_length_table[index]; phy->max_cable_length = e1000_gg82563_cable_length_table[index + 5]; phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2; -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -855,11 +820,11 @@ static s32 e1000_reset_hw_80003es2lan(st { u32 ctrl; s32 ret_val; + u16 kum_reg_data; DEBUGFUNC("e1000_reset_hw_80003es2lan"); - /* - * Prevent the PCI-E bus from sticking if there is no TLP connection + /* Prevent the PCI-E bus from sticking if there is no TLP connection * on the last TLP read/write transaction when MAC is reset. */ ret_val = e1000_disable_pcie_master_generic(hw); @@ -878,23 +843,30 @@ static s32 e1000_reset_hw_80003es2lan(st ctrl = E1000_READ_REG(hw, E1000_CTRL); ret_val = e1000_acquire_phy_80003es2lan(hw); + if (ret_val) + return ret_val; + DEBUGOUT("Issuing a global reset to MAC\n"); E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_RST); e1000_release_phy_80003es2lan(hw); + /* Disable IBIST slave mode (far-end loopback) */ + e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, + &kum_reg_data); + kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; + e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, + kum_reg_data); + ret_val = e1000_get_auto_rd_done_generic(hw); if (ret_val) /* We don't want to continue accessing MAC registers. */ - goto out; + return ret_val; /* Clear any pending interrupt events. */ E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); E1000_READ_REG(hw, E1000_ICR); - ret_val = e1000_check_alt_mac_addr_generic(hw); - -out: - return ret_val; + return e1000_check_alt_mac_addr_generic(hw); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310091741.r99Hfllf020817>