Re: svn commit: r344479 - head/sys/mips/conf
On Sat, 23 Feb 2019, Maxim Sobolev wrote: Log: o Get rid of silly comment which seems to have got life of its own via copy-and-paste process; It is perhaps better than no comment on a misformatted options line. o Return geom_uzip(4) usage back to how manual page prescribes it to be used while I am here. Section 4 man pages unfortunately don't usually have examples of comments on options line, and never have correct formatting. Modified: head/sys/mips/conf/AP94 == --- head/sys/mips/conf/AP94 Fri Feb 22 23:15:32 2019(r344478) +++ head/sys/mips/conf/AP94 Sat Feb 23 00:00:49 2019(r344479) @@ -21,7 +21,6 @@ hints "AP94.hints" # GEOM modules device geom_redboot# to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! options GEOM_UZIP options ROOTDEVNAME=\"ufs:md0.uzip\" Now there is no comment on the remaining GEOM_UZIP line. "device foo" is sometimes abused to access an unsupported option (an option that is not listed in conf/options*). "foo" is then not available as a macro, but it is available as a keyword for selecting files from conf/files. Also, if DEV_FOO is listed in conf/options, then this is a syntax error if "foo" is _not_ used as a keyword in conf/files, but if "foo" is so used then DEV_FOO is not a syntax error and a #define of it is generated. Everything seems to be case-sensitive, except there is no way to prevent the conversion of "foo" to "FOO" in DEV_FOO. "device loop" is an example of use of this. This just selects the file if_loop.c, and there are no messy ifdefs, so DEV_LOOP is not needed and is not an option and not generated. "device bpf" is a messier example which needs ifdefs on DEV_BPF, so DEV_BPF must be an option. "device gzip" is an example of abuse of this. gzip is very far from being a device. Modified: head/sys/mips/conf/DIR-825B1 Modified: head/sys/mips/conf/ROUTERSTATION_MFS Modified: head/sys/mips/conf/RSPRO_MFS Modified: head/sys/mips/conf/WZR-300HP 4 more removals leaving no comment. == --- head/sys/mips/conf/WZR-300HPFri Feb 22 23:15:32 2019 (r344478) +++ head/sys/mips/conf/WZR-300HPSat Feb 23 00:00:49 2019 (r344479) @@ -26,7 +26,7 @@ options BOOTVERBOSE # GEOM modules device geom_map# to get access to the SPI flash partitions -device geom_uzip # compressed in-memory filesystem hackery! +optionsGEOM_UZIP options ROOTDEVNAME=\"ufs:/dev/map/rootfs.uzip\" This is an addition with a misformatted options line and no comment. conf/NOTES provides an example with correct formatting. It even provides a comment suitable for copying. conf/NOTES has many misformatted options lines (27 with the keyword followed by 2 tabs and 1 with it followed by 1 tab), but all GEOM_FOO lines are formatted normally. */NOTES has too many lines not suitable for copying since they have no comment. NOTES tends to have more verbose comments written in separate paragraphs and lists. The lists are better made up of options lines with short comments. Modified: head/sys/mips/conf/WZR-HPAG300H Another addition with a misformatted options line and no comment. Normal formatting of options lines lines things up nicely, but wastes 8 or 16 columns which would be better used for comments. Many options names are too long. GENERIC is more consistent than NOTES in wasting an extra 8 columns for short option names so as to line up the comments. device names are better, and not wasting an extra 8 columns to line up the comments for device directives gives another set of inconsistencies. Bruce ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r344480 - head/sys/cam/ctl
Author: mav Date: Sat Feb 23 04:24:44 2019 New Revision: 344480 URL: https://svnweb.freebsd.org/changeset/base/344480 Log: Remove disabled CTL_LEGACY_STATS support. It was not only disabled for quite a while, but also appeared to be broken at r325517, when maximum number of ports was made configurable. MFC after:1 week Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_ioctl.h head/sys/cam/ctl/ctl_private.h Modified: head/sys/cam/ctl/ctl.c == --- head/sys/cam/ctl/ctl.c Sat Feb 23 00:00:49 2019(r344479) +++ head/sys/cam/ctl/ctl.c Sat Feb 23 04:24:44 2019(r344480) @@ -2743,39 +2743,6 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, #endif /* CTL_IO_DELAY */ break; } -#ifdef CTL_LEGACY_STATS - case CTL_GETSTATS: { - struct ctl_stats *stats = (struct ctl_stats *)addr; - int i; - - /* -* XXX KDM no locking here. If the LUN list changes, -* things can blow up. -*/ - i = 0; - stats->status = CTL_SS_OK; - stats->fill_len = 0; - STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (stats->fill_len + sizeof(lun->legacy_stats) > - stats->alloc_len) { - stats->status = CTL_SS_NEED_MORE_SPACE; - break; - } - retval = copyout(&lun->legacy_stats, &stats->lun_stats[i++], -sizeof(lun->legacy_stats)); - if (retval != 0) - break; - stats->fill_len += sizeof(lun->legacy_stats); - } - stats->num_luns = softc->num_luns; - stats->flags = CTL_STATS_FLAG_NONE; -#ifdef CTL_TIME_IO - stats->flags |= CTL_STATS_FLAG_TIME_VALID; -#endif - getnanouptime(&stats->timestamp); - break; - } -#endif /* CTL_LEGACY_STATS */ case CTL_ERROR_INJECT: { struct ctl_error_desc *err_desc, *new_err_desc; @@ -4758,17 +4725,6 @@ fail: ctl_init_log_page_index(lun); /* Setup statistics gathering */ -#ifdef CTL_LEGACY_STATS - lun->legacy_stats.device_type = be_lun->lun_type; - lun->legacy_stats.lun_number = lun_number; - lun->legacy_stats.blocksize = be_lun->blocksize; - if (be_lun->blocksize == 0) - lun->legacy_stats.flags = CTL_LUN_STATS_NO_BLOCKSIZE; - lun->legacy_stats.ports = malloc(sizeof(struct ctl_lun_io_port_stats) * - ctl_max_ports, M_DEVBUF, M_WAITOK | M_ZERO); - for (len = 0; len < ctl_max_ports; len++) - lun->legacy_stats.ports[len].targ_port = len; -#endif /* CTL_LEGACY_STATS */ lun->stats.item = lun_number; /* @@ -13078,21 +13034,6 @@ ctl_process_done(union ctl_io *io) type = CTL_STATS_WRITE; else type = CTL_STATS_NO_IO; - -#ifdef CTL_LEGACY_STATS - uint32_t targ_port = port->targ_port; - lun->legacy_stats.ports[targ_port].bytes[type] += - io->scsiio.kern_total_len; - lun->legacy_stats.ports[targ_port].operations[type] ++; - lun->legacy_stats.ports[targ_port].num_dmas[type] += - io->io_hdr.num_dmas; -#ifdef CTL_TIME_IO - bintime_add(&lun->legacy_stats.ports[targ_port].dma_time[type], - &io->io_hdr.dma_bt); - bintime_add(&lun->legacy_stats.ports[targ_port].time[type], - &bt); -#endif -#endif /* CTL_LEGACY_STATS */ lun->stats.bytes[type] += io->scsiio.kern_total_len; lun->stats.operations[type] ++; Modified: head/sys/cam/ctl/ctl_ioctl.h == --- head/sys/cam/ctl/ctl_ioctl.hSat Feb 23 00:00:49 2019 (r344479) +++ head/sys/cam/ctl/ctl_ioctl.hSat Feb 23 04:24:44 2019 (r344480) @@ -69,9 +69,6 @@ /* Hopefully this won't conflict with new misc devices that pop up */ #defineCTL_MINOR 225 -/* Legacy statistics accumulated for every port for every LU. */ -//#define CTL_LEGACY_STATS 1 - typedef enum { CTL_DELAY_TYPE_NONE, CTL_DELAY_TYPE_CONT, @@ -119,39 +116,6 @@ typedef enum { CTL_STATS_FLAG_TIME_VALID = 0x01 } ctl_stats_flags; -#ifdef CTL_LEGACY_STATS -typedef enum { - CTL_LUN_STATS_NO_BLOCKSIZE = 0x01 -} ctl_lun_stats_flags; - -struct ctl_lun_io_port_stats { - uint32_ttarg_port; - uint64_tbytes[CTL_STATS_NUM_TYPES]; - uint64_toperations[CTL_STATS_NUM_
svn commit: r344481 - in head: share/man/man4 sys/netinet
Author: glebius Date: Sat Feb 23 06:03:18 2019 New Revision: 344481 URL: https://svnweb.freebsd.org/changeset/base/344481 Log: Support struct ip_mreqn as argument for IP_ADD_MEMBERSHIP. Legacy support for struct ip_mreq remains in place. The struct ip_mreqn is Linux extension to classic BSD multicast API. It has extra field allowing to specify the interface index explicitly. In Linux it used as argument for IP_MULTICAST_IF and IP_ADD_MEMBERSHIP. FreeBSD kernel also declares this structure and supports it as argument to IP_MULTICAST_IF since r170613. So, we have structure declared but not fully supported, this confused third party application configure scripts. Code handling IP_ADD_MEMBERSHIP was mixed together with code for IP_ADD_SOURCE_MEMBERSHIP. Bringing legacy and new structure support into the mess would made the "argument switcharoo" intolerable, so code was separated into its own switch case clause. MFC after:3 months Differential Revision:https://reviews.freebsd.org/D19276 Modified: head/share/man/man4/ip.4 head/sys/netinet/in_mcast.c Modified: head/share/man/man4/ip.4 == --- head/share/man/man4/ip.4Sat Feb 23 04:24:44 2019(r344480) +++ head/share/man/man4/ip.4Sat Feb 23 06:03:18 2019(r344481) @@ -28,7 +28,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd August 19, 2018 +.Dd February 22, 2019 .Dt IP 4 .Os .Sh NAME @@ -571,32 +571,55 @@ To join a multicast group, use the .Dv IP_ADD_MEMBERSHIP option: .Bd -literal -struct ip_mreq mreq; -setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); +struct ip_mreqn mreqn; +setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreqn, sizeof(mreqn)); .Ed .Pp where -.Fa mreq +.Fa mreqn is the following structure: .Bd -literal -struct ip_mreq { +struct ip_mreqn { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_interface; /* local IP address of interface */ +intimr_ifindex; /* interface index */ } .Ed .Pp -.Va imr_interface -should be set to the -.Tn IP -address of a particular multicast-capable interface if +.Va imr_ifindex +should be set to the index of a particular multicast-capable interface if the host is multihomed. -It may be set to -.Dv INADDR_ANY -to choose the default interface, although this is not recommended; -this is considered to be the first interface corresponding -to the default route. -Otherwise, the first multicast-capable interface -configured in the system will be used. +If +.Va imr_ifindex +is non-zero, value of +.Va imr_interface +is ignored. +Otherwise, if +.Va imr_ifindex +is 0, kernel will use IP address from +.Va imr_interface +to lookup the interface. +Value of +.Va imr_interface +may be set to +.Va INADDR_ANY +to choose the default interface, although this is not recommended; this is +considered to be the first interface corresponding to the default route. +Otherwise, the first multicast-capable interface configured in the system +will be used. +.Pp +Legacy +.Vt "struct ip_mreq" , +that lacks +.Va imr_ifindex +field is also supported by +.Dv IP_ADD_MEMBERSHIP +setsockopt. +In this case kernel would behave as if +.Va imr_ifindex +was set to zero: +.Va imr_interface +will be used to lookup interface. .Pp Prior to .Fx 7.0 , Modified: head/sys/netinet/in_mcast.c == --- head/sys/netinet/in_mcast.c Sat Feb 23 04:24:44 2019(r344480) +++ head/sys/netinet/in_mcast.c Sat Feb 23 06:03:18 2019(r344481) @@ -2049,40 +2049,49 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt ssa->ss.ss_family = AF_UNSPEC; switch (sopt->sopt_name) { - case IP_ADD_MEMBERSHIP: - case IP_ADD_SOURCE_MEMBERSHIP: { - struct ip_mreq_sourcemreqs; + case IP_ADD_MEMBERSHIP: { + struct ip_mreqn mreqn; - if (sopt->sopt_name == IP_ADD_MEMBERSHIP) { - error = sooptcopyin(sopt, &mreqs, - sizeof(struct ip_mreq), - sizeof(struct ip_mreq)); - /* -* Do argument switcharoo from ip_mreq into -* ip_mreq_source to avoid using two instances. -*/ - mreqs.imr_interface = mreqs.imr_sourceaddr; - mreqs.imr_sourceaddr.s_addr = INADDR_ANY; - } else if (sopt->sopt_name == IP_ADD_SOURCE_MEMBERSHIP) { - error = sooptcopyin(sopt, &mreqs, - sizeof(struct ip_mreq_source), - sizeof(struct ip_mreq_source)); - } + if (sopt->sopt_valsize == sizeof(struct ip_mreqn)) + error = sooptcopyin(sopt, &mreqn, +
svn commit: r344482 - head/share/man/man4
Author: brueffer Date: Sat Feb 23 09:34:57 2019 New Revision: 344482 URL: https://svnweb.freebsd.org/changeset/base/344482 Log: Fix a slew of mdoc errors and warnings. MFC after:1 week Modified: head/share/man/man4/cc_newreno.4 head/share/man/man4/ctl.4 head/share/man/man4/ehci.4 head/share/man/man4/em.4 head/share/man/man4/ena.4 head/share/man/man4/ips.4 head/share/man/man4/liquidio.4 head/share/man/man4/nda.4 head/share/man/man4/ng_nat.4 head/share/man/man4/ohci.4 head/share/man/man4/pci.4 head/share/man/man4/sctp.4 head/share/man/man4/ses.4 head/share/man/man4/siftr.4 head/share/man/man4/smartpqi.4 head/share/man/man4/sysmouse.4 head/share/man/man4/tcp.4 head/share/man/man4/uath.4 head/share/man/man4/ucom.4 head/share/man/man4/ugen.4 head/share/man/man4/uhci.4 head/share/man/man4/uhid.4 head/share/man/man4/ukbd.4 head/share/man/man4/umoscom.4 head/share/man/man4/ums.4 head/share/man/man4/uplcom.4 head/share/man/man4/usb.4 head/share/man/man4/uvscom.4 head/share/man/man4/vale.4 head/share/man/man4/vmci.4 head/share/man/man4/vmm.4 head/share/man/man4/wi.4 head/share/man/man4/xe.4 head/share/man/man4/xhci.4 Modified: head/share/man/man4/cc_newreno.4 == --- head/share/man/man4/cc_newreno.4Sat Feb 23 06:03:18 2019 (r344481) +++ head/share/man/man4/cc_newreno.4Sat Feb 23 09:34:57 2019 (r344482) @@ -75,6 +75,7 @@ the congestion window in response to an ECN congestion .Va net.inet.tcp.cc.abe=1 per: cwnd = (cwnd * CC_NEWRENO_BETA_ECN) / 100. Default is 80. +.El .Sh MIB Variables The algorithm exposes these variables in the .Va net.inet.tcp.cc.newreno @@ -93,6 +94,7 @@ the congestion window in response to an ECN congestion .Va net.inet.tcp.cc.abe=1 per: cwnd = (cwnd * beta_ecn) / 100. Default is 80. +.El .Sh SEE ALSO .Xr cc_chd 4 , .Xr cc_cubic 4 , Modified: head/share/man/man4/ctl.4 == --- head/share/man/man4/ctl.4 Sat Feb 23 06:03:18 2019(r344481) +++ head/share/man/man4/ctl.4 Sat Feb 23 09:34:57 2019(r344482) @@ -202,6 +202,7 @@ The default value is 1024. .It Va kern.cam.ctl.max_ports Specifies the maximum number of ports we support, must be a power of 2. The default value is 256. +.El .Sh SEE ALSO .Xr cfiscsi 4 , .Xr cfumass 4 , Modified: head/share/man/man4/ehci.4 == --- head/share/man/man4/ehci.4 Sat Feb 23 06:03:18 2019(r344481) +++ head/share/man/man4/ehci.4 Sat Feb 23 09:34:57 2019(r344482) @@ -88,6 +88,7 @@ The default value is 0 (off). .It Va hw.usb.ehci.no_hs This tunable disables USB devices to attach like HIGH-speed ones and will force all attached devices to attach to the FULL- or LOW-speed companion controller. The default value is 0 (off). +.El .Sh SYSCTL VARIABLES The following variables are available as both .Xr sysctl 8 Modified: head/share/man/man4/em.4 == --- head/share/man/man4/em.4Sat Feb 23 06:03:18 2019(r344481) +++ head/share/man/man4/em.4Sat Feb 23 09:34:57 2019(r344482) @@ -264,6 +264,7 @@ If .Va hw.em.tx_int_delay is non-zero, this tunable limits the maximum delay in which a transmit interrupt is generated. +.El .Sh FILES .Bl -tag -width /dev/led/em* .It Pa /dev/led/em* Modified: head/share/man/man4/ena.4 == --- head/share/man/man4/ena.4 Sat Feb 23 06:03:18 2019(r344481) +++ head/share/man/man4/ena.4 Sat Feb 23 09:34:57 2019(r344482) @@ -239,6 +239,7 @@ for more details. .Pp Packet with unsupported number of segments was queued for sending to the device; packet will be dropped. +.El .Sh SUPPORT If an issue is identified with the released source code with a supported adapter email the specific information related to the issue to Modified: head/share/man/man4/ips.4 == --- head/share/man/man4/ips.4 Sat Feb 23 06:03:18 2019(r344481) +++ head/share/man/man4/ips.4 Sat Feb 23 09:34:57 2019(r344482) @@ -114,7 +114,7 @@ Unable to obtain adapter or drive configuration. A buffer input/output error has occurred. .Bq Er ENXIO .El -.Ss General adapter errors: +.Ss General adapter errors : .Bl -diag .It Attaching bus failed .Pp @@ -146,7 +146,7 @@ The adapter is disabled. .Pp The driver was unable to allocate resources for the device. .El -.Ss Error messages due to DMA: +.Ss Error messages due to DMA : .Bl -diag .It can't alloc command dma tag .It can't alloc SG dma tag @@ -155,7 +155,7 @@ The driver was unable to allocate resources for the de .Pp Failure to map or allocate DMA resources.
Re: svn commit: r344479 - head/sys/mips/conf
On Sat, Feb 23, 2019 at 12:00:50AM +, Maxim Sobolev wrote: > Author: sobomax > Date: Sat Feb 23 00:00:49 2019 > New Revision: 344479 > URL: https://svnweb.freebsd.org/changeset/base/344479 > > Log: > o Get rid of silly comment which seems to have got life of its own via > copy-and-paste process; > > o Return geom_uzip(4) usage back to how manual page prescribes it to be > used while I am here. > > Modified: > head/sys/mips/conf/AP94 > head/sys/mips/conf/DIR-825B1 > head/sys/mips/conf/ROUTERSTATION_MFS > head/sys/mips/conf/RSPRO_MFS > head/sys/mips/conf/WZR-300HP > head/sys/mips/conf/WZR-HPAG300H To put this commit into some perspective: - removal of 'device geom_uzip' is the part of the still discussed https://reviews.freebsd.org/D19266; - of course the removal there conflicts with the uncommitted patch, requiring me to spend time handling the conflict; - as a happy coincidence the patch is incomplete leaving a lot more 'device geom_uzip' in sys/mips/conf files - I have to explain all of that to some people outside the svn-src@ (see the tag line in the review) and try to smooth out the naturally uprising attitude. I am curious, do you think that the rush to remove the comment worth the outcome ? ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r344484 - head/sys/compat/linuxkpi/common/include/linux
Author: mmacy Date: Sat Feb 23 20:45:45 2019 New Revision: 344484 URL: https://svnweb.freebsd.org/changeset/base/344484 Log: linux/fs: simplify interop and correct definition of loff_t - offsets can be negative, loff_t needs to be signed, it also simplifies interop with the rest of the code base to use off_t than the actual linux definition "long long" - don't rely on the defining "file" to "linux_file" in interface definitions as that causes heartache with includes Reviewed by: hps@ MFC after:1 week Sponsored by: iX Systems Differential Revision:https://reviews.freebsd.org/D19274 Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h head/sys/compat/linuxkpi/common/include/linux/types.h Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h == --- head/sys/compat/linuxkpi/common/include/linux/fs.h Sat Feb 23 14:27:09 2019(r344483) +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Sat Feb 23 20:45:45 2019(r344484) @@ -129,25 +129,25 @@ do { \ pgsigio(*(queue), (sig), 0);\ } while (0) -typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); +typedef int (*filldir_t)(void *, const char *, int, off_t, u64, unsigned); struct file_operations { struct module *owner; - ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); - ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *); - unsigned int (*poll) (struct file *, struct poll_table_struct *); - long (*unlocked_ioctl)(struct file *, unsigned int, unsigned long); - long (*compat_ioctl)(struct file *, unsigned int, unsigned long); - int (*mmap)(struct file *, struct vm_area_struct *); + ssize_t (*read)(struct linux_file *, char __user *, size_t, off_t *); + ssize_t (*write)(struct linux_file *, const char __user *, size_t, off_t *); + unsigned int (*poll) (struct linux_file *, struct poll_table_struct *); + long (*unlocked_ioctl)(struct linux_file *, unsigned int, unsigned long); + long (*compat_ioctl)(struct linux_file *, unsigned int, unsigned long); + int (*mmap)(struct linux_file *, struct vm_area_struct *); int (*open)(struct inode *, struct file *); - int (*release)(struct inode *, struct file *); - int (*fasync)(int, struct file *, int); + int (*release)(struct inode *, struct linux_file *); + int (*fasync)(int, struct linux_file *, int); /* Although not supported in FreeBSD, to align with Linux code * we are adding llseek() only when it is mapped to no_llseek which returns * an illegal seek error */ - loff_t (*llseek)(struct file *, loff_t, int); + off_t (*llseek)(struct linux_file *, off_t, int); #if 0 /* We do not support these methods. Don't permit them to compile. */ loff_t (*llseek)(struct file *, loff_t, int); Modified: head/sys/compat/linuxkpi/common/include/linux/types.h == --- head/sys/compat/linuxkpi/common/include/linux/types.h Sat Feb 23 14:27:09 2019(r344483) +++ head/sys/compat/linuxkpi/common/include/linux/types.h Sat Feb 23 20:45:45 2019(r344484) @@ -55,7 +55,7 @@ typedef uint64_t __be64; typedef unsigned intuint; typedef unsigned gfp_t; -typedef uint64_t loff_t; +typedef off_t loff_t; typedef vm_paddr_t resource_size_t; typedef uint16_t __bitwise__ __sum16; typedef unsigned long pgoff_t; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r344485 - in head/sys/compat: lindebugfs linuxkpi/common/include/linux linuxkpi/common/src
Author: mmacy Date: Sat Feb 23 20:56:41 2019 New Revision: 344485 URL: https://svnweb.freebsd.org/changeset/base/344485 Log: import linux debugfs support Reviewed by: hps@ MFC after:1 week Sponsored by: iX Systems Differential Revision:https://reviews.freebsd.org/D19258 Added: head/sys/compat/lindebugfs/ head/sys/compat/lindebugfs/lindebugfs.c (contents, props changed) head/sys/compat/linuxkpi/common/include/linux/debugfs.h (contents, props changed) head/sys/compat/linuxkpi/common/include/linux/seq_file.h (contents, props changed) head/sys/compat/linuxkpi/common/src/linux_seq_file.c (contents, props changed) Added: head/sys/compat/lindebugfs/lindebugfs.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/lindebugfs/lindebugfs.c Sat Feb 23 20:56:41 2019 (r344485) @@ -0,0 +1,309 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2016-2018, Matthew Macy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include + +MALLOC_DEFINE(M_DFSINT, "debugfsint", "Linux debugfs internal"); + +static struct pfs_node *debugfs_root; + +#define DM_SYMLINK 0x1 +#define DM_DIR 0x2 +#define DM_FILE 0x3 + +struct dentry_meta { + struct dentry dm_dnode; + const struct file_operations *dm_fops; + void *dm_data; + umode_t dm_mode; + int dm_type; +}; + +static int +debugfs_attr(PFS_ATTR_ARGS) +{ + struct dentry_meta *dm; + + dm = pn->pn_data; + + vap->va_mode = dm->dm_mode; + return (0); +} + +static int +debugfs_destroy(PFS_DESTROY_ARGS) +{ + struct dentry_meta *dm; + + dm = pn->pn_data; + if (dm->dm_type == DM_SYMLINK) + free(dm->dm_data, M_DFSINT); + + free(dm, M_DFSINT); + return (0); +} + +static int +debugfs_fill(PFS_FILL_ARGS) +{ + struct dentry_meta *d; + struct linux_file lf; + struct seq_file *sf; + struct vnode vn; + void *buf; + int rc; + size_t len; + off_t off; + + d = pn->pn_data; + + if ((rc = linux_set_current_flags(curthread, M_NOWAIT))) + return (rc); + vn.v_data = d->dm_data; + buf = uio->uio_iov[0].iov_base; + len = min(uio->uio_iov[0].iov_len, uio->uio_resid); + off = 0; + lf.private_data = NULL; + rc = d->dm_fops->open(&vn, &lf); + if (rc < 0) { +#ifdef INVARIANTS + printf("%s:%d open failed with %d\n", __FUNCTION__, __LINE__, rc); +#endif + return (-rc); + } + sf = lf.private_data; + sf->buf = sb; + if (uio->uio_rw == UIO_READ) + rc = d->dm_fops->read(&lf, NULL, len, &off); + else + rc = d->dm_fops->write(&lf, buf, len, &off); + if (d->dm_fops->release) + d->dm_fops->release(&vn, &lf); + else + single_release(&vn, &lf); + + if (rc < 0) { +#ifdef INVARIANTS + printf("%s:%d read/write failed with %d\n", __FUNCTION__, __LINE__, rc); +#endif + return (-rc); + } + return (0); +} + +static int +debugfs_fill_data(PFS_FILL_ARGS) +{ + struct de
svn commit: r344486 - in head/sys: kern sys
Author: mmacy Date: Sat Feb 23 21:04:48 2019 New Revision: 344486 URL: https://svnweb.freebsd.org/changeset/base/344486 Log: Change seq_read to seq_load to avoid namespace conflicts with lkpi MFC after:1 week Sponsored by: iX Systems Modified: head/sys/kern/kern_descrip.c head/sys/sys/seq.h Modified: head/sys/kern/kern_descrip.c == --- head/sys/kern/kern_descrip.cSat Feb 23 20:56:41 2019 (r344485) +++ head/sys/kern/kern_descrip.cSat Feb 23 21:04:48 2019 (r344486) @@ -2629,7 +2629,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights */ for (;;) { #ifdef CAPABILITIES - seq = seq_read(fd_seq(fdt, fd)); + seq = seq_load(fd_seq(fdt, fd)); fde = &fdt->fdt_ofiles[fd]; haverights = *cap_rights_fde_inline(fde); fp = fde->fde_file; Modified: head/sys/sys/seq.h == --- head/sys/sys/seq.h Sat Feb 23 20:56:41 2019(r344485) +++ head/sys/sys/seq.h Sat Feb 23 21:04:48 2019(r344486) @@ -121,7 +121,7 @@ seq_write_end(seq_t *seqp) } static __inline seq_t -seq_read(const seq_t *seqp) +seq_load(const seq_t *seqp) { seq_t ret; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r344487 - in head/sys: conf gnu/gcov
Author: mmacy Date: Sat Feb 23 21:14:00 2019 New Revision: 344487 URL: https://svnweb.freebsd.org/changeset/base/344487 Log: gcov support add gcov support and export results as files in debugfs Reviewed by: hps@ MFC after:1 week Sponsored by: iX Systems Differential Revision:https://reviews.freebsd.org/D19260 Added: head/sys/gnu/gcov/ head/sys/gnu/gcov/gcc_4_7.c (contents, props changed) head/sys/gnu/gcov/gcov.h (contents, props changed) head/sys/gnu/gcov/gcov_fs.c (contents, props changed) head/sys/gnu/gcov/gcov_subr.c (contents, props changed) Modified: head/sys/conf/files head/sys/conf/kern.mk head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk head/sys/conf/options Modified: head/sys/conf/files == --- head/sys/conf/files Sat Feb 23 21:04:48 2019(r344486) +++ head/sys/conf/files Sat Feb 23 21:14:00 2019(r344487) @@ -3726,6 +3726,11 @@ fs/cd9660/cd9660_util.c optional cd9660 fs/cd9660/cd9660_vfsops.c optional cd9660 fs/cd9660/cd9660_vnops.c optional cd9660 fs/cd9660/cd9660_iconv.c optional cd9660_iconv +gnu/gcov/gcc_4_7.c optional gcov +gnu/gcov/gcov_fs.c optional gcov lindebugfs \ + compile-with "${LINUXKPI_C}" +gnu/gcov/gcov_subr.c optional gcov + kern/bus_if.m standard kern/clock_if.mstandard kern/cpufreq_if.m standard @@ -4473,6 +4478,12 @@ compat/linuxkpi/common/src/linux_slab.c optional comp compat/linuxkpi/common/src/linux_usb.c optional compat_linuxkpi usb \ compile-with "${LINUXKPI_C}" compat/linuxkpi/common/src/linux_work.coptional compat_linuxkpi \ + compile-with "${LINUXKPI_C}" + +compat/linuxkpi/common/src/linux_seq_file.coptional compat_linuxkpi | lindebugfs \ + compile-with "${LINUXKPI_C}" + +compat/lindebugfs/lindebugfs.c optional lindebugfs \ compile-with "${LINUXKPI_C}" # OpenFabrics Enterprise Distribution (Infiniband) Modified: head/sys/conf/kern.mk == --- head/sys/conf/kern.mk Sat Feb 23 21:04:48 2019(r344486) +++ head/sys/conf/kern.mk Sat Feb 23 21:14:00 2019(r344487) @@ -56,7 +56,7 @@ CWARNEXTRA?= -Wno-error=address \ -Wno-error=maybe-uninitialized \ -Wno-error=overflow \ -Wno-error=sequence-point \ - -Wno-error=unused-but-set-variable + -Wno-unused-but-set-variable .if ${COMPILER_VERSION} >= 60100 CWARNEXTRA+= -Wno-error=misleading-indentation \ -Wno-error=nonnull-compare \ Modified: head/sys/conf/kern.post.mk == --- head/sys/conf/kern.post.mk Sat Feb 23 21:04:48 2019(r344486) +++ head/sys/conf/kern.post.mk Sat Feb 23 21:14:00 2019(r344487) @@ -32,6 +32,10 @@ MKMODULESENV+= WITH_EXTRA_TCP_STACKS="${WITH_EXTRA_TCP MKMODULESENV+= SAN_CFLAGS="${SAN_CFLAGS}" .endif +.if defined(GCOV_CFLAGS) +MKMODULESENV+= GCOV_CFLAGS="${GCOV_CFLAGS}" +.endif + # Allow overriding the kernel debug directory, so kernel and user debug may be # installed in different directories. Setting it to "" restores the historical # behavior of installing debug files in the kernel directory. Modified: head/sys/conf/kern.pre.mk == --- head/sys/conf/kern.pre.mk Sat Feb 23 21:04:48 2019(r344486) +++ head/sys/conf/kern.pre.mk Sat Feb 23 21:14:00 2019(r344487) @@ -130,6 +130,15 @@ SAN_CFLAGS+= -fsanitize-coverage=trace-pc CFLAGS+= ${SAN_CFLAGS} +GCOV_ENABLED!= grep GCOV opt_global.h || true ; echo +.if !empty(GCOV_ENABLED) +.if ${COMPILER_TYPE} == "gcc" +GCOV_CFLAGS+= -fprofile-arcs -ftest-coverage +.endif +.endif + +CFLAGS+= ${GCOV_CFLAGS} + # Put configuration-specific C flags last (except for ${PROF}) so that they # can override the others. CFLAGS+= ${CONF_CFLAGS} Modified: head/sys/conf/kmod.mk == --- head/sys/conf/kmod.mk Sat Feb 23 21:04:48 2019(r344486) +++ head/sys/conf/kmod.mk Sat Feb 23 21:14:00 2019(r344487) @@ -380,6 +380,9 @@ ${_src}: # Add the sanitizer C flags CFLAGS+= ${SAN_CFLAGS} +# Add the gcov flags +CFLAGS+= ${GCOV_CFLAGS} + # Respect configuration-specific C flags. CFLAGS+= ${ARCH_FLAGS} ${CONF_CFLAGS} Modified: head/sys/conf/options == --- head/
Re: svn commit: r344487 - in head/sys: conf gnu/gcov
> Author: mmacy > Date: Sat Feb 23 21:14:00 2019 > New Revision: 344487 > URL: https://svnweb.freebsd.org/changeset/base/344487 > > Log: > gcov support > > add gcov support and export results as files in debugfs > > Reviewed by:hps@ > MFC after: 1 week > Sponsored by: iX Systems > Differential Revision: https://reviews.freebsd.org/D19260 > > Added: > head/sys/gnu/gcov/ > head/sys/gnu/gcov/gcc_4_7.c (contents, props changed) > head/sys/gnu/gcov/gcov.h (contents, props changed) > head/sys/gnu/gcov/gcov_fs.c (contents, props changed) > head/sys/gnu/gcov/gcov_subr.c (contents, props changed) > Modified: > head/sys/conf/files > head/sys/conf/kern.mk > head/sys/conf/kern.post.mk > head/sys/conf/kern.pre.mk > head/sys/conf/kmod.mk > head/sys/conf/options > > Modified: head/sys/conf/files > == > --- head/sys/conf/files Sat Feb 23 21:04:48 2019(r344486) > +++ head/sys/conf/files Sat Feb 23 21:14:00 2019(r344487) > @@ -3726,6 +3726,11 @@ fs/cd9660/cd9660_util.coptional cd9660 > fs/cd9660/cd9660_vfsops.coptional cd9660 > fs/cd9660/cd9660_vnops.c optional cd9660 > fs/cd9660/cd9660_iconv.c optional cd9660_iconv > +gnu/gcov/gcc_4_7.c optional gcov > +gnu/gcov/gcov_fs.c optional gcov lindebugfs \ > + compile-with "${LINUXKPI_C}" > +gnu/gcov/gcov_subr.c optional gcov > + > kern/bus_if.mstandard > kern/clock_if.m standard > kern/cpufreq_if.mstandard > @@ -4473,6 +4478,12 @@ compat/linuxkpi/common/src/linux_slab.c > optional comp > compat/linuxkpi/common/src/linux_usb.c optional > compat_linuxkpi usb \ > compile-with "${LINUXKPI_C}" > compat/linuxkpi/common/src/linux_work.c optional > compat_linuxkpi \ > + compile-with "${LINUXKPI_C}" > + > +compat/linuxkpi/common/src/linux_seq_file.c optional > compat_linuxkpi | lindebugfs \ > + compile-with "${LINUXKPI_C}" > + > +compat/lindebugfs/lindebugfs.c optional lindebugfs \ > compile-with "${LINUXKPI_C}" > > # OpenFabrics Enterprise Distribution (Infiniband) > > Modified: head/sys/conf/kern.mk > == > --- head/sys/conf/kern.mk Sat Feb 23 21:04:48 2019(r344486) > +++ head/sys/conf/kern.mk Sat Feb 23 21:14:00 2019(r344487) > @@ -56,7 +56,7 @@ CWARNEXTRA?=-Wno-error=address > \ > -Wno-error=maybe-uninitialized \ > -Wno-error=overflow \ > -Wno-error=sequence-point \ > - -Wno-error=unused-but-set-variable > + -Wno-unused-but-set-variable > .if ${COMPILER_VERSION} >= 60100 > CWARNEXTRA+= -Wno-error=misleading-indentation \ > -Wno-error=nonnull-compare \ > > Modified: head/sys/conf/kern.post.mk > == > --- head/sys/conf/kern.post.mkSat Feb 23 21:04:48 2019 > (r344486) > +++ head/sys/conf/kern.post.mkSat Feb 23 21:14:00 2019 > (r344487) > @@ -32,6 +32,10 @@ MKMODULESENV+= WITH_EXTRA_TCP_STACKS="${WITH_EXTRA_TCP > MKMODULESENV+= SAN_CFLAGS="${SAN_CFLAGS}" > .endif > > +.if defined(GCOV_CFLAGS) > +MKMODULESENV+= GCOV_CFLAGS="${GCOV_CFLAGS}" > +.endif > + > # Allow overriding the kernel debug directory, so kernel and user debug may > be > # installed in different directories. Setting it to "" restores the > historical > # behavior of installing debug files in the kernel directory. > > Modified: head/sys/conf/kern.pre.mk > == > --- head/sys/conf/kern.pre.mk Sat Feb 23 21:04:48 2019(r344486) > +++ head/sys/conf/kern.pre.mk Sat Feb 23 21:14:00 2019(r344487) > @@ -130,6 +130,15 @@ SAN_CFLAGS+= -fsanitize-coverage=trace-pc > > CFLAGS+= ${SAN_CFLAGS} > > +GCOV_ENABLED!= grep GCOV opt_global.h || true ; echo > +.if !empty(GCOV_ENABLED) > +.if ${COMPILER_TYPE} == "gcc" > +GCOV_CFLAGS+= -fprofile-arcs -ftest-coverage > +.endif > +.endif > + > +CFLAGS+= ${GCOV_CFLAGS} > + > # Put configuration-specific C flags last (except for ${PROF}) so that they > # can override the others. > CFLAGS+= ${CONF_CFLAGS} > > Modified: head/sys/conf/kmod.mk > == > --- head/sys/conf/kmod.mk Sat Feb 23 21:04:48 2019(r344486) > +++ head/sys/conf/kmod.mk Sat Feb 23 21:14:00 2019(r344487) > @@ -380,6 +380,9 @@ ${_src}: > # Add the sanitizer C flags > CFLAGS+= $
Re: svn commit: r344487 - in head/sys: conf gnu/gcov
> > Author: mmacy > > Date: Sat Feb 23 21:14:00 2019 > > New Revision: 344487 > > URL: https://svnweb.freebsd.org/changeset/base/344487 > > > > Log: > > gcov support > > > > add gcov support and export results as files in debugfs > > > > Reviewed by: hps@ > > MFC after:1 week > > Sponsored by: iX Systems > > Differential Revision:https://reviews.freebsd.org/D19260 And an additional nit, we can never becomre GPL free if we continue to add GPL code to the system. > > > > Added: > > head/sys/gnu/gcov/ > > head/sys/gnu/gcov/gcc_4_7.c (contents, props changed) > > head/sys/gnu/gcov/gcov.h (contents, props changed) > > head/sys/gnu/gcov/gcov_fs.c (contents, props changed) > > head/sys/gnu/gcov/gcov_subr.c (contents, props changed) > > Modified: > > head/sys/conf/files > > head/sys/conf/kern.mk > > head/sys/conf/kern.post.mk > > head/sys/conf/kern.pre.mk > > head/sys/conf/kmod.mk > > head/sys/conf/options > > > > Modified: head/sys/conf/files > > == > > --- head/sys/conf/files Sat Feb 23 21:04:48 2019(r344486) > > +++ head/sys/conf/files Sat Feb 23 21:14:00 2019(r344487) > > @@ -3726,6 +3726,11 @@ fs/cd9660/cd9660_util.c optional cd9660 > > fs/cd9660/cd9660_vfsops.c optional cd9660 > > fs/cd9660/cd9660_vnops.c optional cd9660 > > fs/cd9660/cd9660_iconv.c optional cd9660_iconv > > +gnu/gcov/gcc_4_7.c optional gcov > > +gnu/gcov/gcov_fs.c optional gcov lindebugfs \ > > + compile-with "${LINUXKPI_C}" > > +gnu/gcov/gcov_subr.c optional gcov > > + > > kern/bus_if.m standard > > kern/clock_if.mstandard > > kern/cpufreq_if.m standard > > @@ -4473,6 +4478,12 @@ compat/linuxkpi/common/src/linux_slab.c > > optional comp > > compat/linuxkpi/common/src/linux_usb.c optional > > compat_linuxkpi usb \ > > compile-with "${LINUXKPI_C}" > > compat/linuxkpi/common/src/linux_work.coptional > > compat_linuxkpi \ > > + compile-with "${LINUXKPI_C}" > > + > > +compat/linuxkpi/common/src/linux_seq_file.coptional > > compat_linuxkpi | lindebugfs \ > > + compile-with "${LINUXKPI_C}" > > + > > +compat/lindebugfs/lindebugfs.c optional lindebugfs \ > > compile-with "${LINUXKPI_C}" > > > > # OpenFabrics Enterprise Distribution (Infiniband) > > > > Modified: head/sys/conf/kern.mk > > == > > --- head/sys/conf/kern.mk Sat Feb 23 21:04:48 2019(r344486) > > +++ head/sys/conf/kern.mk Sat Feb 23 21:14:00 2019(r344487) > > @@ -56,7 +56,7 @@ CWARNEXTRA?= -Wno-error=address > > \ > > -Wno-error=maybe-uninitialized \ > > -Wno-error=overflow \ > > -Wno-error=sequence-point \ > > - -Wno-error=unused-but-set-variable > > + -Wno-unused-but-set-variable > > .if ${COMPILER_VERSION} >= 60100 > > CWARNEXTRA+= -Wno-error=misleading-indentation \ > > -Wno-error=nonnull-compare \ > > > > Modified: head/sys/conf/kern.post.mk > > == > > --- head/sys/conf/kern.post.mk Sat Feb 23 21:04:48 2019 > > (r344486) > > +++ head/sys/conf/kern.post.mk Sat Feb 23 21:14:00 2019 > > (r344487) > > @@ -32,6 +32,10 @@ MKMODULESENV+= WITH_EXTRA_TCP_STACKS="${WITH_EXTRA_TCP > > MKMODULESENV+= SAN_CFLAGS="${SAN_CFLAGS}" > > .endif > > > > +.if defined(GCOV_CFLAGS) > > +MKMODULESENV+= GCOV_CFLAGS="${GCOV_CFLAGS}" > > +.endif > > + > > # Allow overriding the kernel debug directory, so kernel and user debug > > may be > > # installed in different directories. Setting it to "" restores the > > historical > > # behavior of installing debug files in the kernel directory. > > > > Modified: head/sys/conf/kern.pre.mk > > == > > --- head/sys/conf/kern.pre.mk Sat Feb 23 21:04:48 2019 > > (r344486) > > +++ head/sys/conf/kern.pre.mk Sat Feb 23 21:14:00 2019 > > (r344487) > > @@ -130,6 +130,15 @@ SAN_CFLAGS+= -fsanitize-coverage=trace-pc > > > > CFLAGS+= ${SAN_CFLAGS} > > > > +GCOV_ENABLED!= grep GCOV opt_global.h || true ; echo > > +.if !empty(GCOV_ENABLED) > > +.if ${COMPILER_TYPE} == "gcc" > > +GCOV_CFLAGS+= -fprofile-arcs -ftest-coverage > > +.endif > > +.endif > > + > > +CFLAGS+= ${GCOV_CFLAGS} > > + > > # Put configuration-specific C flags last (except for ${PROF}) so that they > > # can override the others. > > CFLAGS+= ${CONF_CFLAGS} > > > > Modified: head/sys/conf/kmod.mk > > ==
Re: svn commit: r344487 - in head/sys: conf gnu/gcov
In message <201902232152.x1nlqjkg032...@pdx.rh.cn85.dnsmgr.net>, "Rodney W. Gri mes" writes: > > > Author: mmacy > > > Date: Sat Feb 23 21:14:00 2019 > > > New Revision: 344487 > > > URL: https://svnweb.freebsd.org/changeset/base/344487 > > > > > > Log: > > > gcov support > > > > > > add gcov support and export results as files in debugfs > > > > > > Reviewed by:hps@ > > > MFC after: 1 week > > > Sponsored by: iX Systems > > > Differential Revision: https://reviews.freebsd.org/D19260 > > And an additional nit, we can never becomre GPL free > if we continue to add GPL code to the system. +1 on adding GPL code to the system. The thing that comes to mind with this commit is that we generally try to commit to the vendor branch externally obtained code and merge. That this was committed directly suggests that we will be the maintainers of this code, also suggesting that this GPL code is here to stay. Or, are there plans to replace this with BSD licensed code. As this is external, obtained from should have been documented in the commit message. Ccould this not be put into ports? Those wishing to use this feature could install it as desired. Not to heap it on, just a bunch of questions coming to mind as I write this: What about DTrace, can't we do the same with it? Which once again argues against GPL in base, especially the kernel. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r344488 - head/sbin/dhclient
Author: sobomax Date: Sat Feb 23 23:31:13 2019 New Revision: 344488 URL: https://svnweb.freebsd.org/changeset/base/344488 Log: Further refine r336195: do not even attempt to verify/update interface's MTU if we've set it once and there were no changes on the DHCP server side since the last refresh. This is consistent I believe with how dhclient handles other settings like IP address, mask etc. Approved by: cem, eugen Differential Revision:https://reviews.freebsd.org/D18546 Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c == --- head/sbin/dhclient/dhclient.c Sat Feb 23 21:14:00 2019 (r344487) +++ head/sbin/dhclient/dhclient.c Sat Feb 23 23:31:13 2019 (r344488) @@ -863,6 +863,7 @@ bind_lease(struct interface_info *ip) opt = &ip->client->new->options[DHO_INTERFACE_MTU]; if (opt->len == sizeof(u_int16_t)) { u_int16_t mtu = 0; + u_int16_t old_mtu = 0; bool supersede = (ip->client->config->default_actions[DHO_INTERFACE_MTU] == ACTION_SUPERSEDE); @@ -871,12 +872,19 @@ bind_lease(struct interface_info *ip) else mtu = be16dec(opt->data); + if (ip->client->active) { + opt = &ip->client->active->options[DHO_INTERFACE_MTU]; + if (opt->len == sizeof(u_int16_t)) { + old_mtu = be16dec(opt->data); + } + } + if (mtu < MIN_MTU) { /* Treat 0 like a user intentionally doesn't want to change MTU and, * therefore, warning is not needed */ if (!supersede || mtu != 0) warning("mtu size %u < %d: ignored", (unsigned)mtu, MIN_MTU); - } else { + } else if (ip->client->state != S_RENEWING || mtu != old_mtu) { interface_set_mtu_unpriv(privfd, mtu); } } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r344489 - head/sys/cam/ctl
Author: mav Date: Sat Feb 23 23:35:52 2019 New Revision: 344489 URL: https://svnweb.freebsd.org/changeset/base/344489 Log: Free some space in struct ctl_io_hdr for better use. - Collapse original_sc and serializing_sc fields into one, since they are never used simultanously, we have only one local I/O and one remote. - Move remote_sglist and local_sglist fields into CTL_PRIV_BACKEND, since they are used only on Originating SC in XFER mode, where requests don't ever reach backends, so we can reuse backend's private storage. MFC after:2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_io.h Modified: head/sys/cam/ctl/ctl.c == --- head/sys/cam/ctl/ctl.c Sat Feb 23 23:31:13 2019(r344488) +++ head/sys/cam/ctl/ctl.c Sat Feb 23 23:35:52 2019(r344489) @@ -651,7 +651,7 @@ ctl_ha_datamove(union ctl_io *io) memset(&msg.dt, 0, sizeof(msg.dt)); msg.hdr.msg_type = CTL_MSG_DATAMOVE; - msg.hdr.original_sc = io->io_hdr.original_sc; + msg.hdr.original_sc = io->io_hdr.remote_io; msg.hdr.serializing_sc = io; msg.hdr.nexus = io->io_hdr.nexus; msg.hdr.status = io->io_hdr.status; @@ -766,7 +766,7 @@ ctl_ha_done(union ctl_io *io) if (io->io_hdr.io_type == CTL_IO_SCSI) { memset(&msg, 0, sizeof(msg)); msg.hdr.msg_type = CTL_MSG_FINISH_IO; - msg.hdr.original_sc = io->io_hdr.original_sc; + msg.hdr.original_sc = io->io_hdr.remote_io; msg.hdr.nexus = io->io_hdr.nexus; msg.hdr.status = io->io_hdr.status; msg.scsi.scsi_status = io->scsiio.scsi_status; @@ -1439,7 +1439,7 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e // populate ctsio from msg io->io_hdr.io_type = CTL_IO_SCSI; io->io_hdr.msg_type = CTL_MSG_SERIALIZE; - io->io_hdr.original_sc = msg->hdr.original_sc; + io->io_hdr.remote_io = msg->hdr.original_sc; io->io_hdr.flags |= CTL_FLAG_FROM_OTHER_SC | CTL_FLAG_IO_ACTIVE; /* @@ -1495,7 +1495,7 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e * Keep track of this, we need to send it back over * when the datamove is complete. */ - io->io_hdr.serializing_sc = msg->hdr.serializing_sc; + io->io_hdr.remote_io = msg->hdr.serializing_sc; if (msg->hdr.status == CTL_SUCCESS) io->io_hdr.status = msg->hdr.status; @@ -1508,9 +1508,8 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e CTL_HA_DATAMOVE_SEGMENT + 1; sgl = malloc(sizeof(*sgl) * i, M_CTL, M_WAITOK | M_ZERO); - io->io_hdr.remote_sglist = sgl; - io->io_hdr.local_sglist = - &sgl[msg->dt.kern_sg_entries]; + CTL_RSGL(io) = sgl; + CTL_LSGL(io) = &sgl[msg->dt.kern_sg_entries]; io->scsiio.kern_data_ptr = (uint8_t *)sgl; @@ -1597,7 +1596,7 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e } io->io_hdr.flags |= CTL_FLAG_IO_ACTIVE; io->io_hdr.msg_type = CTL_MSG_R2R; - io->io_hdr.serializing_sc = msg->hdr.serializing_sc; + io->io_hdr.remote_io = msg->hdr.serializing_sc; ctl_enqueue_isc(io); break; @@ -2369,7 +2368,7 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) mtx_unlock(&lun->lun_lock); /* send msg back to other side */ - msg_info.hdr.original_sc = ctsio->io_hdr.original_sc; + msg_info.hdr.original_sc = ctsio->io_hdr.remote_io; msg_info.hdr.serializing_sc = (union ctl_io *)ctsio; msg_info.hdr.msg_type = CTL_MSG_R2R; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, @@ -2395,7 +2394,7 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) /*retry_count*/ 0); badjuju: ctl_copy_sense_data_back((union ctl_io *)ctsio, &msg_info); - msg_info.hdr.original_sc = ctsio->io_hdr.original_sc; + msg_info.hdr.original_sc = ctsio->io_hdr.remote_io; msg_info.hdr.serializing_sc = NULL; msg_info.hdr.msg_type = CTL_MSG_BAD_JUJU;